/* =====================================================
   HR ERP SYSTEM — MAIN STYLESHEET
   Theme: Ocean Blue + Green + Complementary Palette
   ===================================================== */

:root {
    --primary:        #0077B6;
    --primary-dark:   #005F8E;
    --primary-light:  #00B4D8;
    --primary-xlight: #CAF0F8;
    --secondary:      #2DC653;
    --secondary-dark: #1FA83D;
    --accent:         #0096C7;
    --warning:        #F4A261;
    --danger:         #E63946;
    --info:           #48CAE4;
    --dark:           #1A1A2E;
    --text:           #2D3748;
    --text-muted:     #718096;
    --border:         #E2E8F0;
    --bg:             #F0F4F8;
    --bg-card:        #FFFFFF;
    --sidebar-bg:     #0A3D62;
    --sidebar-text:   #BEE3F8;
    --sidebar-hover:  #1A6EA8;
    --sidebar-active: #0096C7;
    --topbar-height:  64px;
    --sidebar-width:  260px;
    --radius:         8px;
    --radius-lg:      12px;
    --shadow:         0 2px 8px rgba(0,119,182,0.10);
    --shadow-lg:      0 8px 24px rgba(0,119,182,0.15);
    --transition:     all 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ─── LAYOUT ─── */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo img { width: 36px; height: 36px; border-radius: 8px; }

.sidebar-logo .app-name {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-logo .app-sub {
    color: var(--sidebar-text);
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-section-title {
    padding: 12px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(190,227,248,0.45);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border-left-color: var(--primary-light);
}

.nav-item.active {
    background: rgba(0,150,199,0.2);
    color: #fff;
    border-left-color: var(--sidebar-active);
}

.nav-item .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-user .avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user .user-info .name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.sidebar-user .user-info .role {
    color: var(--sidebar-text);
    font-size: 11px;
    opacity: 0.7;
}

/* ─── MAIN CONTENT ─── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── TOPBAR ─── */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 500;
    box-shadow: var(--shadow);
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    flex: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    text-decoration: none;
}

.topbar-btn:hover { background: var(--primary-xlight); color: var(--primary); }

.topbar-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
}

.topbar-user:hover { background: var(--bg); }

.topbar-user .avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    overflow: hidden;
}

.topbar-user .avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar-user .user-name { font-size: 13px; font-weight: 600; }
.topbar-user .user-role { font-size: 11px; color: var(--text-muted); }

/* ─── PAGE CONTENT ─── */
.page-content { padding: 24px; flex: 1; }

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header-left .page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
}

.page-header-left .page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--border); }

/* ─── CARDS ─── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary-xlight);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 15px;
}

.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg); }

/* ─── STAT CARDS ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: var(--transition);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.blue   { background: var(--primary-xlight); color: var(--primary); }
.stat-icon.green  { background: #D4EDDA; color: var(--secondary-dark); }
.stat-icon.orange { background: #FFF3E0; color: #E65100; }
.stat-icon.red    { background: #FDECEA; color: var(--danger); }
.stat-icon.teal   { background: #E0F7FA; color: #00796B; }
.stat-icon.purple { background: #F3E5F5; color: #7B1FA2; }

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 11px; margin-top: 6px; }
.stat-change.up   { color: var(--secondary-dark); }
.stat-change.down { color: var(--danger); }

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-lg  { padding: 11px 22px; font-size: 15px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }
.btn-icon.btn-sm { width: 28px; height: 28px; padding: 4px; }

.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-dark); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0303a; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-info      { background: var(--info); color: var(--dark); }
.btn-light     { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-light:hover { background: var(--border); }
.btn-outline   { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-xlight); }
.btn-outline-danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-outline-danger:hover { background: #FDECEA; }

/* ─── TABLES ─── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead tr {
    background: var(--primary);
    color: #fff;
}

.data-table thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.data-table tbody tr:hover { background: var(--primary-xlight); }
.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody td {
    padding: 11px 14px;
    color: var(--text);
    vertical-align: middle;
}

.data-table tfoot tr {
    background: var(--bg);
    font-weight: 700;
}

.data-table tfoot td {
    padding: 11px 14px;
    border-top: 2px solid var(--primary);
}

/* ─── BADGES / STATUS ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary   { background: var(--primary-xlight); color: var(--primary); }
.badge-success   { background: #D4EDDA; color: #155724; }
.badge-warning   { background: #FFF3CD; color: #856404; }
.badge-danger    { background: #FDECEA; color: #721C24; }
.badge-info      { background: #D1ECF1; color: #0C5460; }
.badge-secondary { background: #E2E8F0; color: var(--text-muted); }
.badge-dark      { background: var(--dark); color: #fff; }

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green  { background: var(--secondary); }
.status-dot.yellow { background: #F6AD55; }
.status-dot.red    { background: var(--danger); }
.status-dot.blue   { background: var(--primary-light); }
.status-dot.grey   { background: var(--text-muted); }

/* ─── FORMS ─── */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control, .form-select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    background: var(--bg-card);
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,119,182,0.12);
}

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-valid   { border-color: var(--secondary); }

textarea.form-control { resize: vertical; min-height: 80px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .input-addon {
    padding: 9px 12px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* ─── MODALS ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,61,98,0.55);
    backdrop-filter: blur(2px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: translateY(-16px) scale(0.98);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 780px; }
.modal-xl { max-width: 1000px; }
.modal-sm { max-width: 400px; }

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title .icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--primary-xlight);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 14px;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    transition: var(--transition);
    flex-shrink: 0;
}

.modal-close:hover { background: var(--bg); color: var(--danger); }

.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* ─── ALERTS ─── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.alert-success { background: #D4EDDA; color: #155724; border: 1px solid #C3E6CB; }
.alert-danger  { background: #FDECEA; color: #721C24; border: 1px solid #F5C6CB; }
.alert-warning { background: #FFF3CD; color: #856404; border: 1px solid #FFE69C; }
.alert-info    { background: #D1ECF1; color: #0C5460; border: 1px solid #BEE5EB; }

.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-content .alert-title { font-weight: 700; margin-bottom: 2px; }

/* ─── TABLE TOOLBAR ─── */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.table-search {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
    position: relative;
}

.table-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: var(--bg-card);
    transition: var(--transition);
    outline: none;
}

.table-search input:focus { border-color: var(--primary); }

.table-search .search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.table-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-select {
    padding: 7px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 12.5px;
    background: var(--bg-card);
    color: var(--text);
    outline: none;
    cursor: pointer;
}

.filter-select:focus { border-color: var(--primary); }

/* ─── PAGINATION ─── */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    transition: var(--transition);
    text-decoration: none;
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── TABS ─── */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    gap: 0;
    overflow-x: auto;
}

.tab-btn {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── PROGRESS ─── */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.6s ease;
}

.progress-fill.green { background: linear-gradient(90deg, var(--secondary-dark), var(--secondary)); }
.progress-fill.orange { background: linear-gradient(90deg, #E65100, var(--warning)); }
.progress-fill.red { background: linear-gradient(90deg, #c0303a, var(--danger)); }

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 6px;
}

.empty-state p { font-size: 13px; }

/* ─── DROPDOWN ─── */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.dropdown-menu.open { display: block; }

.dropdown-item {
    padding: 10px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text);
    transition: var(--transition);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover { background: var(--primary-xlight); color: var(--primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #FDECEA; }
.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

/* ─── NOTIFICATION DROPDOWN ─── */
.notif-dropdown {
    min-width: 320px;
    max-height: 420px;
    display: flex;
    flex-direction: column;
}

.notif-header {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-list { overflow-y: auto; flex: 1; }

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-xlight); }

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 5px;
    flex-shrink: 0;
}

.notif-item .notif-title { font-size: 12.5px; font-weight: 600; color: var(--dark); }
.notif-item .notif-msg   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-item .notif-time  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.notif-footer {
    padding: 10px 16px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.notif-footer a {
    font-size: 12.5px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ─── TIMELINE ─── */
.timeline { padding: 8px 0; }
.timeline-item {
    display: flex;
    gap: 14px;
    padding-bottom: 20px;
    position: relative;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 28px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-xlight);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 13px;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-content .tl-title { font-size: 13px; font-weight: 600; color: var(--dark); }
.timeline-content .tl-time  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.timeline-content .tl-body  { font-size: 12.5px; color: var(--text); margin-top: 4px; }

/* ─── CHARTS ─── */
.chart-container { position: relative; }

/* ─── LOADING ─── */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 20px; height: 20px; border-width: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 50;
}

/* ─── AVATAR ─── */
.avatar-stack { display: flex; }
.avatar-stack .av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    margin-left: -8px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-stack .av:first-child { margin-left: 0; }

/* ─── LANDING PAGE ─── */
.landing-hero {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary) 60%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
}

.landing-nav {
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-nav .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

.landing-nav .logo .logo-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    backdrop-filter: blur(4px);
}

.landing-nav .logo .logo-text { font-size: 20px; font-weight: 800; }
.landing-nav .logo .logo-sub  { font-size: 11px; opacity: 0.7; }

.landing-hero-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.landing-hero-content { max-width: 640px; }

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
}

.landing-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 16px;
}

.landing-title span { color: var(--primary-xlight); }

.landing-subtitle {
    font-size: 17px;
    color: rgba(255,255,255,0.80);
    line-height: 1.7;
    margin-bottom: 36px;
}

.landing-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn-white {
    background: #fff;
    color: var(--primary-dark);
    border: none;
}

.btn-white:hover { background: var(--primary-xlight); }

.btn-ghost {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.35);
    backdrop-filter: blur(4px);
}

.btn-ghost:hover { background: rgba(255,255,255,0.20); }

.landing-features {
    padding: 80px 40px;
    background: var(--bg-card);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.feature-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--primary-xlight);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
}

.feature-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.feature-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ─── LOGIN PAGE ─── */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--sidebar-bg), var(--primary));
    padding: 32px 32px 28px;
    text-align: center;
    color: #fff;
}

.auth-logo {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 14px;
    backdrop-filter: blur(4px);
}

.auth-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.auth-sub   { font-size: 13px; opacity: 0.75; }

.auth-body { padding: 28px 32px 32px; }

.auth-body .form-control { padding: 11px 14px; font-size: 14px; }
.auth-body .btn { padding: 12px; font-size: 14px; width: 100%; justify-content: center; }

.auth-footer {
    text-align: center;
    padding: 0 32px 24px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 600; }

/* ─── DASHBOARD WIDGETS ─── */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text);
    min-width: 90px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 600;
}

.quick-btn:hover {
    border-color: var(--primary);
    background: var(--primary-xlight);
    color: var(--primary);
    transform: translateY(-2px);
}

.quick-btn .qb-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-xlight);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
}

.quick-btn:hover .qb-icon { background: var(--primary); color: #fff; }

/* ─── ALERT ITEMS ─── */
.alert-list { list-style: none; }
.alert-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.alert-list li:last-child { border-bottom: none; }
.alert-list .al-icon { font-size: 16px; flex-shrink: 0; }
.alert-list .al-info  { flex: 1; }
.alert-list .al-name  { font-weight: 600; color: var(--dark); }
.alert-list .al-meta  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ─── MODULE DASHBOARD TILES ─── */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.module-tile {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.module-tile:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.module-tile .tile-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.module-tile .tile-title { font-size: 14px; font-weight: 700; color: var(--dark); }
.module-tile .tile-desc  { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.module-tile .tile-count { font-size: 20px; font-weight: 800; color: var(--primary); }

/* ─── RESPONSIVE ─── */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .sidebar-toggle { display: flex; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 16px; }
}


@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 16px; }
    .landing-nav { padding: 16px 20px; }
    .landing-hero-body { padding: 24px 20px; }
    .auth-card { max-width: 100%; }
    .auth-body { padding: 24px 20px 28px; }
}

/* ─── PRINT ─── */
@media print {
    .sidebar, .topbar, .btn, .modal-overlay { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ─── UTILITIES ─── */
.text-primary { color: var(--primary); }
.text-success { color: var(--secondary-dark); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.text-dark    { color: var(--dark); }
.text-white   { color: #fff; }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.fw-bold      { font-weight: 700; }
.fw-semi      { font-weight: 600; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.p-0    { padding: 0; }
.w-full { width: 100%; }
.hidden { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
/* ===== Module Index Card Grid ===== */
.module-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 8px;
}
.module-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 18px 16px;
    text-decoration: none;
    color: var(--text-primary, #111);
    transition: box-shadow .15s, transform .15s;
    cursor: pointer;
}
.module-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); transform: translateY(-2px); }
.mc-icon {
    position: relative;
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}
.mc-badge {
    position: absolute;
    top: -5px; right: -5px;
    background: #DC3545;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px; height: 17px;
    line-height: 17px;
    text-align: center;
    padding: 0 3px;
}
.mc-body { flex: 1; }
.mc-title { font-weight: 700; font-size: 14px; }
.mc-desc  { font-size: 12px; color: var(--text-muted, #6b7280); margin-top: 2px; }
.mc-arrow { color: var(--text-muted, #9ca3af); font-size: 13px; }