:root {
    --primary: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #0dcaf0;
    --light: #f8f9fa;
    --dark: #212529;
    --white: #ffffff;
    --border: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --radius: 8px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--dark);
    background: var(--light);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); color: var(--white); }
.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-secondary:hover { background: #5a6268; color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #157347; color: var(--white); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #bb2d3b; color: var(--white); }
.btn-warning { background: var(--warning); color: var(--dark); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}
.form-group small { display: block; margin-top: 4px; color: var(--secondary); font-size: 12px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--light); font-weight: 600; font-size: 13px; }
.table tr:hover { background: #f0f4ff; }

/* Cards */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-header { padding: 12px 20px; background: var(--light); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; font-weight: 600; }

/* Badges */
.badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; color: var(--white); }
.badge-success { background: var(--success); }
.badge-danger { background: var(--danger); }
.badge-warning { background: var(--warning); color: var(--dark); }
.badge-info { background: var(--info); }
.badge-secondary { background: var(--secondary); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.alert-success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.alert-danger { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }
.alert-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }

/* Messages */
.error-msg { color: var(--danger); background: #f8d7da; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.success-msg { color: var(--success); background: #d1e7dd; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.page-header h1 { font-size: 24px; }

/* Nav */
.navbar { background: var(--white); box-shadow: var(--shadow); padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 56px; position: sticky; top: 0; z-index: 100; }
.navbar-brand { font-size: 18px; font-weight: 700; color: var(--primary); }
.navbar-nav { display: flex; gap: 4px; list-style: none; align-items: center; }
.navbar-nav a { padding: 8px 12px; border-radius: var(--radius); color: var(--dark); }
.navbar-nav a:hover { background: var(--light); text-decoration: none; }
.navbar-nav a.active { background: var(--primary); color: var(--white); }

/* Sidebar Layout */
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 240px; background: var(--white); border-right: 1px solid var(--border); padding: 16px 0; flex-shrink: 0; }
.sidebar-nav { list-style: none; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--dark); }
.sidebar-nav a:hover { background: var(--light); text-decoration: none; }
.sidebar-nav a.active { background: #e7f1ff; color: var(--primary); border-right: 3px solid var(--primary); }
.main-content { flex: 1; padding: 24px; }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.pagination a:hover { background: var(--light); text-decoration: none; }
.pagination .active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* Install Page */
.install-body { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.install-container { background: var(--white); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); width: 100%; max-width: 600px; overflow: hidden; }
.install-header { background: var(--primary); color: var(--white); padding: 24px; text-align: center; }
.install-header h1 { font-size: 24px; margin-bottom: 4px; }
.install-header p { opacity: 0.8; }
.install-progress { display: flex; align-items: center; justify-content: center; padding: 20px; gap: 0; }
.progress-step { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--light); color: var(--secondary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.progress-step.active .step-num { background: var(--primary); color: var(--white); }
.progress-step.completed .step-num { background: var(--success); color: var(--white); }
.step-label { font-size: 12px; color: var(--secondary); }
.progress-step.active .step-label { color: var(--primary); font-weight: 600; }
.progress-line { width: 40px; height: 2px; background: var(--border); margin: 0 4px; margin-bottom: 20px; }
.progress-line.active { background: var(--primary); }
.install-content { padding: 24px; }
.install-content h2 { margin-bottom: 8px; }
.install-desc { color: var(--secondary); margin-bottom: 20px; }
.install-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Check List */
.check-list { margin-bottom: 16px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 6px; }
.check-item.passed { background: #d1e7dd; }
.check-item.failed { background: #f8d7da; }
.check-icon { font-size: 18px; font-weight: bold; }
.check-item.passed .check-icon { color: var(--success); }
.check-item.failed .check-icon { color: var(--danger); }
.check-label { flex: 1; font-weight: 500; }
.check-detail { font-size: 12px; color: var(--secondary); }

/* Success Box */
.success-box { background: #d1e7dd; border: 1px solid #badbcc; border-radius: var(--radius); padding: 20px; text-align: center; margin-bottom: 20px; }
.success-box p { margin-bottom: 8px; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: var(--white); border-radius: var(--radius); width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* Timeline */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.timeline-item .time { font-size: 12px; color: var(--secondary); margin-bottom: 4px; }
.timeline-item .content { font-size: 14px; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .sidebar.show { display: block; position: fixed; top: 56px; left: 0; bottom: 0; z-index: 99; }
    .main-content { padding: 16px; }
    .navbar { padding: 0 12px; }
    .page-header { flex-direction: column; gap: 10px; align-items: flex-start; }
    .table { display: block; overflow-x: auto; }
    .install-container { max-width: 100%; }
    .install-progress { flex-wrap: wrap; }
    .progress-line { display: none; }
}

/* Menu Toggle */
.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }
@media (max-width: 768px) {
    .menu-toggle { display: block; }
}

/* Notification Badge */
.notification-badge { position: relative; }
.notification-badge .badge-count { position: absolute; top: -4px; right: -4px; background: var(--danger); color: var(--white); font-size: 10px; padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center; }

/* Filter Panel */
.filter-panel { background: var(--white); padding: 16px; border-radius: var(--radius); margin-bottom: 16px; box-shadow: var(--shadow); }
.filter-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filter-row .form-group { margin-bottom: 0; flex: 1; min-width: 150px; }
.filter-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.filter-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #e7f1ff; color: var(--primary); border-radius: 20px; font-size: 12px; }
.filter-tag .remove { cursor: pointer; font-weight: bold; }
