:root {
    --bg-color: #f3f6f9;
    --sidebar-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --danger-color: #ef4444;
    --danger-hover: #dc2828;
    --border-color: #e2e8f0;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --border-radius: 16px;
    --transition: all 0.25s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.sidebar-header {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    color: var(--primary-color);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    gap: 8px;
}

.sidebar-index-progress {
    margin-top: auto;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
}
.sidebar-index-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.sidebar-index-label strong {
    margin-left: auto;
    color: var(--text-main);
    font-size: 0.95rem;
}
.sidebar-progress-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.sidebar-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 99px;
    transition: width 0.4s ease;
}
.sidebar-index-detail {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 12px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

.nav-item.active {
    background-color: #eff6ff;
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.header-title p {
    color: var(--text-muted);
}

/* Buttons */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: #f8fafc;
}

.btn-danger-icon {
    background-color: #fee2e2;
    color: var(--danger-color);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-danger-icon:hover {
    background-color: var(--danger-color);
    color: white;
}

.btn-edit-icon {
    background-color: #dbeafe;
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit-icon:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Card */
.table-card {
    background: var(--sidebar-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 8px 16px;
    gap: 8px;
    width: 300px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    background: white;
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
}

/* Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    background-color: #f8fafc;
}

.data-table td {
    font-size: 14px;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-blue {
    background-color: #eff6ff;
    color: var(--primary-color);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: var(--border-radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.btn-close {
    background: transparent;
    font-size: 20px;
    color: var(--text-muted);
}

.btn-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid var(--primary-color);
}

.toast.show {
    transform: translateX(0);
}

.toast.success { border-left-color: #10b981; }
.toast.success i { color: #10b981; }
.toast.error { border-left-color: var(--danger-color); }
.toast.error i { color: var(--danger-color); }

.text-center { text-align: center; }
.loading-state { color: var(--text-muted); padding: 40px !important; }
