:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 64px;
    --topbar-height: 64px;
    --primary: #1e3a5f;
    --primary-light: #2a4d7a;
    --primary-dark: #152c4a;
    --accent: #4f8fea;
    --accent-hover: #3d7dd8;
    --surface: #f8f9fc;
    --surface-card: #ffffff;
    --border: #e2e8f0;
    --text-primary: #1a202c;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    --transition: 0.2s ease;
}

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

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== App Layout ===== */
.app-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== Sidebar Group (collapsible) ===== */
.sidebar-group {
    list-style: none;
    margin-bottom: 2px;
}

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 6px 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    gap: 6px;
    transition: color var(--transition);
}

.sidebar-group-toggle:hover {
    color: rgba(255, 255, 255, 0.55);
}

.sidebar-group-chevron {
    margin-left: auto;
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.sidebar-group.collapsed .sidebar-group-chevron {
    transform: rotate(-90deg);
}

.sidebar-group-items {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 600px;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    opacity: 1;
}

.sidebar-group.collapsed .sidebar-group-items {
    max-height: 0;
    opacity: 0;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    transition: transform var(--transition), width 0.22s ease;
    overflow: hidden;
}

.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.sidebar-brand-icon {
    font-size: 1.5rem;
    color: var(--accent);
}

.sidebar-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-brand-sub {
    display: block;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
    padding-left: 36px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    margin-bottom: 2px;
}

.sidebar-section-label {
    list-style: none;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.3);
    padding: 16px 14px 6px;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
}

.sidebar-menu-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-menu-item.active .sidebar-menu-link {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 2px 8px rgba(79, 143, 234, 0.3);
}

.sidebar-menu-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 6px 0 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
    transition: color var(--transition);
}

.sidebar-collapse-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8125rem;
    font-weight: 500;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-role {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.7rem;
    display: block;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    transition: margin-left 0.22s ease;
}

/* ===== Sidebar Collapsed (desktop) ===== */
.app-wrapper.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.app-wrapper.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.app-wrapper.sidebar-collapsed .sidebar-brand-text,
.app-wrapper.sidebar-collapsed .sidebar-brand-sub,
.app-wrapper.sidebar-collapsed .sidebar-user-info {
    display: none;
}

.app-wrapper.sidebar-collapsed .sidebar-group-toggle span,
.app-wrapper.sidebar-collapsed .sidebar-group-chevron {
    display: none;
}

.app-wrapper.sidebar-collapsed .sidebar-menu-link span {
    display: none;
}

.app-wrapper.sidebar-collapsed .sidebar-menu-link {
    justify-content: center;
    padding: 9px 0;
}

.app-wrapper.sidebar-collapsed .sidebar-menu-link i {
    width: auto;
    font-size: 1.15rem;
}

.app-wrapper.sidebar-collapsed .sidebar-group-toggle {
    justify-content: center;
    padding: 6px 0;
}

.app-wrapper.sidebar-collapsed .sidebar-group-toggle i.bi-chevron-down {
    display: none;
}

.app-wrapper.sidebar-collapsed .sidebar-group-items {
    max-height: 600px !important;
    opacity: 1 !important;
}

.app-wrapper.sidebar-collapsed .sidebar-collapse-btn {
    padding: 6px 0 10px;
}

.app-wrapper.sidebar-collapsed .sidebar-brand-link {
    justify-content: center;
}

.app-wrapper.sidebar-collapsed .sidebar-brand {
    padding: 24px 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-wrapper.sidebar-collapsed .sidebar-user {
    justify-content: center;
}

.app-wrapper.sidebar-collapsed .sidebar-nav {
    padding: 12px 8px;
}

.app-wrapper.sidebar-collapsed .sidebar-footer {
    padding: 16px 8px;
}

/* ===== Topbar ===== */
.topbar {
    height: var(--topbar-height);
    background: var(--surface-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    flex-shrink: 0;
}

.topbar-title {
    flex: 1;
}

.topbar-title h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-ghost {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-ghost:hover {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.sidebar-toggle {
    color: var(--text-secondary);
    padding: 4px;
    text-decoration: none;
}

/* ===== Topbar User ===== */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    user-select: none;
}

.topbar-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Initials avatar in sidebar footer */
.sidebar-user-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    user-select: none;
}

/* ===== Content Area ===== */
.content-area {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
}

/* ===== Auth Wrapper ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
    padding: 20px;
}

.auth-card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.auth-brand-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.auth-brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-brand p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== Cards ===== */
.card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.card-body {
    padding: 0;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title svg,
.card-title i {
    color: var(--accent);
    flex-shrink: 0;
}

/* ===== Stat Cards ===== */
.stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.stat-card-icon.blue  { background: rgba(79, 143, 234, 0.1); color: var(--accent); }
.stat-card-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-card-icon.amber { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-card-icon.red   { background: rgba(239, 68, 68, 0.1);  color: var(--danger); }

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Tables ===== */
.table-container {
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-container .table {
    margin-bottom: 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead th {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    white-space: nowrap;
    text-align: left;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text-primary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-hover tbody tr:hover {
    background: rgba(79, 143, 234, 0.03);
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    font-weight: 500;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.badge-success, .badge-approved, .badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-warning, .badge-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge-info, .badge-onleave {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
}

.badge-secondary, .badge-cancelled {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.badge-danger, .badge-rejected, .badge-terminated {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ===== Buttons ===== */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.8125rem;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--surface-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    border: 1px solid var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.75rem;
}

/* ===== Forms ===== */
.form-label, .form-group label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.form-control, .form-select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 14px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all var(--transition);
    color: var(--text-primary);
    background: var(--surface-card);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 143, 234, 0.12);
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 4px;
}

.field-error {
    color: var(--danger);
    font-size: 0.75rem;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ===== Page Layout Helpers ===== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h1, .page-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.back-link:hover {
    color: var(--accent-hover);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.8125rem;
}

.page-link {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 6px 12px;
    text-decoration: none;
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== Detail List ===== */
.detail-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.4rem 1rem;
    font-size: 0.875rem;
    margin: 0 0 1.5rem;
}

.detail-list dt {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-list dd {
    margin: 0;
    color: var(--text-primary);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.detail-grid dt {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    padding: 14px 0 4px;
}

.detail-grid dd {
    font-size: 0.9rem;
    color: var(--text-primary);
    padding-bottom: 14px;
    margin: 0;
    border-bottom: 1px solid var(--border);
}

.detail-grid dd:last-of-type {
    border-bottom: none;
}

/* ===== Profile ===== */
.profile-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-header h2 {
    margin: 0 0 0.25rem;
}

.profile-note {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 1rem;
}

/* ===== Alerts ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* ===== Modal ===== */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 16px 24px;
}

/* ===== Utilities ===== */
.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-style: italic;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
    display: block;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.15rem 0;
}

.link {
    color: var(--accent);
    text-decoration: none;
}

.link:hover {
    color: var(--accent-hover);
}

.link-danger {
    color: var(--danger);
    text-decoration: none;
    margin-left: 0.5rem;
}

.request-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.request-item {
    display: flex;
    gap: 1rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.request-item:last-child {
    border-bottom: none;
}

/* ===== Login ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    width: 360px;
}

.login-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ===== Content Width Constraint ===== */
.content-narrow {
    max-width: 680px;
}

/* ===== MFA Status ===== */
.mfa-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.mfa-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
}

.mfa-badge.enabled {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.mfa-badge.disabled {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.mfa-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ===== MFA Setup Steps ===== */
.step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-body {
    flex: 1;
}

.step-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}

.step-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.qr-container {
    text-align: center;
    margin: 0.75rem 0;
}

.manual-key {
    font-family: monospace;
    font-size: 0.875rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    word-break: break-all;
    color: var(--text-primary);
    margin-top: 0.5rem;
    display: block;
}

/* ===== Recovery Codes ===== */
.recovery-box {
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.recovery-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.recovery-sub {
    font-size: 0.8rem;
    color: #b45309;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.recovery-codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.recovery-codes code {
    font-family: monospace;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 5px;
    padding: 0.3rem 0.6rem;
    color: #78350f;
}

/* ===== Alert Info ===== */
.alert-info {
    background: rgba(6, 182, 212, 0.08);
    color: #0891b2;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ===== Request Status Indicators ===== */
.status-pending   { border-left: 3px solid var(--warning);    padding-left: 8px; }
.status-approved  { border-left: 3px solid var(--success);    padding-left: 8px; }
.status-rejected  { border-left: 3px solid var(--danger);     padding-left: 8px; }
.status-cancelled { border-left: 3px solid var(--text-muted); padding-left: 8px; }

/* ===== Dashboard ===== */
.dashboard h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ===== Payslip Viewer ===== */
.payslip-viewer {
    padding: 0;
    overflow: hidden;
}

/* ===== Code / Monospace ===== */
.text-mono {
    font-family: monospace;
    font-size: 0.875rem;
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-bar label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.filter-bar select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 10px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--surface-card);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 143, 234, 0.12);
}

/* ===== Table Actions Cell ===== */
.table-actions {
    text-align: right;
    white-space: nowrap;
}

/* ===== Text Utilities ===== */
.text-muted {
    color: var(--text-secondary);
}

/* ===== Detail Card ===== */
.detail-card {
    /* visual modifier for .card on detail/read-only pages — no extra styles needed */
}

/* ===== Header Actions ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== Competency Feedback Row ===== */
.competency-feedback-row {
    margin-bottom: 1.5rem;
}

/* ===== Notifications ===== */
.notification-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.notification-item:first-child {
    padding-top: 0;
}

.notification-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.notification-unread {
    background: rgba(79, 143, 234, 0.03);
}

.notification-unread .notification-title {
    color: var(--primary);
}

.notification-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.notification-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: auto;
}

.notification-body {
    margin-bottom: 0.5rem;
}

.notification-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ===== Sidebar Overlay ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1039;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
}

/* ===== Responsive — tablet and below ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 20px 16px;
    }

    .topbar {
        padding: 0 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== Responsive — mobile ===== */
@media (max-width: 575.98px) {
    .content-area {
        padding: 16px 12px;
    }

    .topbar-title h1 {
        font-size: 1rem;
    }

    .page-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .page-header h1,
    .page-header h2 {
        font-size: 1.125rem;
        width: 100%;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .detail-list {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .detail-list dt {
        color: var(--text-muted);
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        padding-top: 10px;
        font-weight: 600;
    }

    .detail-list dd {
        padding-bottom: 4px;
    }

    .form-actions {
        flex-wrap: wrap;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .card-body {
        padding: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .auth-card {
        padding: 28px 20px;
    }
}

@media (min-width: 768px) {
    html {
        font-size: 14px;
    }
}

/* ===== Help Page ===== */
.help-page {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.help-nav-panel {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    max-height: calc(100vh - var(--topbar-height) - 56px);
    overflow-y: auto;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.help-nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 8px 8px;
    margin: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.help-nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    background: none;
    border: none;
    border-radius: var(--radius);
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color var(--transition);
}

.help-nav-group-toggle:hover {
    background-color: var(--surface);
}

.help-nav-group-toggle i:first-child {
    color: var(--accent);
    font-size: 0.875rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.help-chevron {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.help-nav-group.expanded .help-chevron {
    transform: rotate(90deg);
}

.help-nav-articles {
    display: none;
    flex-direction: column;
    margin-bottom: 2px;
}

.help-nav-articles.show {
    display: flex;
}

.help-nav-article {
    display: block;
    padding: 5px 8px 5px 34px;
    font-size: 0.7875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background-color var(--transition), color var(--transition);
}

.help-nav-article:hover {
    background-color: var(--surface);
    color: var(--text-primary);
    text-decoration: none;
}

.help-nav-article.active {
    background-color: rgba(79, 143, 234, 0.1);
    color: var(--accent);
    font-weight: 500;
}

.help-article-panel {
    flex: 1;
    min-width: 0;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
}

/* Markdown article typography */
.help-article h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border);
}

.help-article h2 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.625rem;
}

.help-article h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.help-article p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.help-article table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

.help-article th,
.help-article td {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.help-article th {
    background-color: var(--surface);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.help-article tr:nth-child(even) td {
    background-color: rgba(248, 249, 252, 0.6);
}

.help-article code {
    background-color: var(--surface);
    border: 1px solid var(--border);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.8125em;
    color: var(--accent);
}

.help-article pre {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.help-article pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 0.8125rem;
}

.help-article blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.625rem 1rem;
    margin: 1rem 0;
    background-color: rgba(79, 143, 234, 0.07);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.help-article blockquote p {
    margin-bottom: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.help-article ol,
.help-article ul {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.help-article li {
    margin-bottom: 0.35rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.help-article strong {
    font-weight: 600;
}

.help-article hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .help-page {
        flex-direction: column;
    }

    .help-nav-panel {
        width: 100%;
        position: static;
        max-height: none;
    }

    .help-article-panel {
        padding: 20px;
    }
}

/* ===== Error Pages ===== */
.ep-error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 3rem 1.5rem;
    text-align: center;
}

.ep-error-illustration {
    width: 120px;
    height: 120px;
    margin-bottom: 1.75rem;
    opacity: 0.9;
    animation: ep-float 4s ease-in-out infinite;
}

@keyframes ep-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.ep-error-code {
    font-size: clamp(4.5rem, 16vw, 8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.875rem;
    user-select: none;
}

.ep-error-code-500 {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.ep-error-code-other {
    background: linear-gradient(135deg, var(--text-secondary) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.ep-error-title {
    font-size: clamp(1.25rem, 4vw, 1.625rem);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.ep-error-body {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    max-width: 38rem;
    line-height: 1.65;
    margin: 0 0 0.5rem;
}

.ep-error-ref {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 2rem;
}

.ep-error-ref code {
    font-size: 0.8125rem;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    color: var(--text-secondary);
}

.ep-error-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.75rem;
}
