/* === Light Mode Theme (Potensi Field-Ready Palette) === */
[data-theme="light"] {
    --bg-surface-1: #f8fafc;
    --bg-surface-2: #ffffff;
    --bg-surface-3: #f1f5f9;
    --bg-muted: #e2e8f0;
    --bg-color: var(--bg-surface-1);
    --bg-card: var(--bg-surface-2);
    --card-bg: var(--bg-card);
    --bg-surface: var(--bg-surface-2);
    --text-color: var(--text-primary);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --brand-color: #0d3b66;
    --brand-hover: #082f49;
    --brand-color-dark: #082f49;
    --brand-color-rgb: 13, 59, 102;
    --brand-fg: #0d3b66;
    --brand-bg: var(--brand-color);
    --safety-color: #e85d04;
    --safety-hover: #c2410c;
    --safety-color-rgb: 232, 93, 4;
    --safety-fg: #c2410c;
    --safety-bg: var(--safety-color);

    --border-color: #cbd5e1;
    --bg-cer-color: #e2e8f0;
    --bg-input: #ffffff;

    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);

    --bg-hover: rgba(0, 0, 0, 0.04);
    --bg-secondary: #e2e8f0;
    --text-on-brand: #ffffff;

    /* Status colors - high contrast for field use */
    --success-color: #2d6a4f;
    --error-color: #b91c1c;
    --warning-color: #b45309;
    --purple-color: #7c3aed;
    --success-text: #166534;
    --success-bg: #dcfce7;
    --success-solid: #15803d;
    --warning-text: #854d0e;
    --warning-bg: #fef3c7;
    --warning-solid: #a16207;
    --error-text: #991b1b;
    --error-bg: #fee2e2;
    --error-solid: #b91c1c;
    --info-text: #1d4ed8;
    --info-bg: #dbeafe;
    --info-solid: #2563eb;

    /* Warning/Alert colors for light mode */
    --warn-bg: #fff7ed;
    --warn-text: #b45309;

    /* Sidebar - light/white theme in light mode (Poital.flow style) */
    --sidebar-bg: #ffffff;
    --sidebar-text: #475569;
    --sidebar-text-active: #0f172a;
    --sidebar-accent: #e85d04;
    --sidebar-accent-rgb: 232, 93, 4;
    --sidebar-hover-bg: rgba(0, 0, 0, 0.04);
    --sidebar-section-label: #64748b;
    --sidebar-border: #cbd5e1;
}

/* === Dark Mode Theme (Default now) === */
@media (prefers-color-scheme: light) {
    /* Optional: Invert for light mode if needed, but user requested dark mode default */
}

/* === Reset & Base Styles === */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Text selection: orange accent for visibility in both modes */
::selection {
    background-color: rgba(232, 93, 4, 0.28);
    color: inherit;
}
::-moz-selection {
    background-color: rgba(232, 93, 4, 0.28);
    color: inherit;
}

/* === Mobile-First Utility Classes === */

/* Visibility utilities based on breakpoints */
.show-mobile-only {
    display: none !important;
}
.hide-mobile {
    display: block;
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .show-mobile-only {
        display: block !important;
    }
    .hide-mobile {
        display: none !important;
    }
    .show-mobile-flex {
        display: flex !important;
    }
    .show-mobile-grid {
        display: grid !important;
    }
}

/* Touch Target Utility - Enforces 48x48px minimum tap area */
.touch-target {
    min-width: var(--touch-target-size);
    min-height: var(--touch-target-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

/* Large touch target for primary actions (56x56px) */
.touch-target-lg {
    min-width: 56px;
    min-height: 56px;
    padding: 14px;
}

/* Extra large touch target for hero actions (64x64px) */
.touch-target-xl {
    min-width: 64px;
    min-height: 64px;
    padding: 16px;
}

/* Text size utilities for mobile */
.text-body {
    font-size: var(--font-min-body) !important; /* 16px minimum */
}
.text-secondary {
    font-size: var(--font-min-secondary) !important; /* 14px minimum */
}
.text-touch {
    font-size: var(--font-size-touch) !important; /* 18px for touch interfaces */
}

/* Prevent horizontal scroll on mobile */
.no-overflow-x {
    overflow-x: hidden;
    max-width: 100%;
}

/* === Dashboard Layout (Grid System) === */
.dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: 64px 1fr; /* Header + Content (Sub-nav in header) */
    height: 100vh; /* Fill viewport */
    height: 100dvh;
    padding-top: var(--safe-top, var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));
    overflow: hidden; /* Prevent container scroll */
    background-color: var(--bg-color);
}

/* ===== LEFT SIDEBAR ===== */
.app-sidebar {
    grid-column: 1;
    grid-row: 1 / -1; /* Span all rows */
    display: flex !important;
    flex-direction: column;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    height: 100%;
    max-height: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    min-width: 260px;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-hover-bg) transparent;
}

.app-sidebar::-webkit-scrollbar {
    width: 4px;
}
.app-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.app-sidebar::-webkit-scrollbar-thumb {
    background: var(--sidebar-hover-bg);
    border-radius: 4px;
}

.sidebar-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--sidebar-border);
}

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

/* App logo (always visible, never changes) */
.sidebar-app-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-app-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-brand-info h2 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--sidebar-text-active);
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

/* Sidebar Group & Section Labels */
.sidebar-group {
    margin-bottom: 4px;
}

.sidebar-section-label {
    padding: 16px 16px 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sidebar-section-label);
    user-select: none;
}

/* High specificity to override global button styles */
.app-sidebar button.sidebar-nav-item {
    display: flex !important;
    align-items: center;
}

/* Allow inline style="display:none" to hide the button (overrides !important above) */
.app-sidebar button.sidebar-nav-item[style*="display: none"],
.app-sidebar button.sidebar-nav-item[style*="display:none"] {
    display: none !important;
}

.app-sidebar button.sidebar-nav-item {
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    padding: 9px 16px;
    margin: 0;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 8px;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    min-height: unset !important;
    min-width: unset !important;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    position: relative;
}

.sidebar-nav-item i {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-nav-item span {
    flex: 1;
    text-align: left;
}

.app-sidebar button.sidebar-nav-item:hover {
    background: var(--sidebar-hover-bg) !important;
    background-color: var(--sidebar-hover-bg) !important;
    color: var(--sidebar-text-active);
}

.sidebar-nav-item:hover i {
    opacity: 1;
}

.app-sidebar button.sidebar-nav-item.active {
    background: rgba(var(--sidebar-accent-rgb), 0.15) !important;
    background-color: rgba(var(--sidebar-accent-rgb), 0.15) !important;
    color: var(--sidebar-accent);
    font-weight: 600;
}

.sidebar-nav-item.active i {
    opacity: 1;
    color: var(--sidebar-accent);
}

/* Sidebar Company Brand (below app brand, shown when user has company) */
.sidebar-company-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    min-height: 0;
}

.sidebar-company-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--sidebar-hover-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-company-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.sidebar-company-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--sidebar-text);
    line-height: 1.35;
    word-break: break-word;
    flex: 1;
    min-width: 0;
}

/* Sidebar Help Link */
.sidebar-help {
    padding: 8px 12px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-help-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 16px;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.sidebar-help-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
}

.sidebar-help-btn i {
    font-size: 1.2rem;
    opacity: 0.8;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.sidebar-user-info:hover,
.sidebar-user-info:active {
    background: var(--sidebar-hover-bg);
}

.sidebar-user-chevron {
    font-size: 14px;
    color: var(--sidebar-text);
    margin-left: auto;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.sidebar-user-chevron.expanded {
    transform: rotate(180deg);
}

.sidebar-user-avatar {
    font-size: 26px;
    color: var(--sidebar-accent);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--sidebar-accent-rgb), 0.15);
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sidebar-text-active);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar user quick-action menu */
.sidebar-user-menu {
    display: none;
    padding: 4px 16px 8px;
}

.sidebar-user-menu.open {
    display: block;
}

.sidebar-user-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    margin-top: 4px;
    background: transparent;
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    color: var(--sidebar-text-active) !important;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    min-height: 48px;
}

.sidebar-user-menu-item span {
    color: var(--sidebar-text-active) !important;
}

.sidebar-user-menu-item:hover,
.sidebar-user-menu-item:active {
    background: var(--sidebar-hover-bg);
}

.sidebar-user-menu-item i {
    font-size: 18px;
    color: var(--brand-fg, var(--brand-color));
}

.sidebar-user-menu-danger {
    color: var(--error-text, var(--danger-color)) !important;
    border-color: rgba(239, 68, 68, 0.25);
}

.sidebar-user-menu-danger i,
.sidebar-user-menu-danger span {
    color: var(--error-text, var(--danger-color)) !important;
}

@keyframes slideMenuUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sidebar-actions {
    display: flex;
    gap: 4px;
}

.sidebar-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 1rem;
}

.sidebar-action-btn:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-active);
    border-color: var(--sidebar-border);
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== SUB-NAV CONTAINER ===== */
.sub-nav-container {
    /* Reset for header flex layout */
    grid-column: auto;
    grid-row: auto;
    background: transparent;
    border-bottom: none;
    z-index: auto;

    /* Layout */
    display: flex;
    flex: 1;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 0 0 20px;
    height: 100%;
    gap: 2px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.sub-nav-container::-webkit-scrollbar {
    display: none;
}

.sub-nav {
    display: contents;
    align-items: center;
    height: 100%;
}

.sub-nav-btn {
    height: 100%;
    padding: 0 12px;
    border-radius: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
    letter-spacing: 0.01em;
    scroll-snap-align: start;
}

.sub-nav-btn i {
    font-size: 1rem;
}

.sub-nav-btn:hover {
    color: var(--text-primary);
    background: transparent;
}

.sub-nav-btn.active {
    color: var(--brand-fg, var(--brand-color));
    border-bottom-color: var(--brand-color);
    font-weight: 600;
    background: transparent;
}

/* Secondary sub-navigation (nested within sections) */
.sub-nav-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    margin-bottom: var(--section-gap-sm, 10px);
    background: var(--bg-surface-2, #f5f5f5);
    border-radius: 8px;
    overflow-x: auto;
}

.sub-nav-btn-secondary {
    padding: 6px 14px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted, #666);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sub-nav-btn-secondary i {
    font-size: 0.875rem;
}

.sub-nav-btn-secondary:hover {
    color: var(--text-primary, #333);
    background: var(--bg-hover, rgba(15, 23, 42, 0.06));
    border-color: rgba(var(--sidebar-accent-rgb, 232, 93, 4), 0.45);
}

.sub-nav-btn-secondary.active {
    color: var(--sidebar-accent, var(--brand-color, #4f46e5));
    background: rgba(var(--sidebar-accent-rgb, 232, 93, 4), 0.16);
    border-color: rgba(var(--sidebar-accent-rgb, 232, 93, 4), 0.5);
    font-weight: 600;
}

.sub-nav-btn-secondary.active:hover {
    color: var(--sidebar-accent, var(--brand-color, #4f46e5));
    background: rgba(var(--sidebar-accent-rgb, 232, 93, 4), 0.22);
}

/* Mobile: Push to new row/area */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .sub-nav-container {
        display: none !important; /* Hide sub-nav on mobile per user request */
        width: 100%;
        margin: 0;
        order: 3; /* Push below left/right sections */
        border-top: 1px solid var(--border-color);
        overflow-x: auto;
        justify-content: flex-start;
        height: 48px;
        background: var(--bg-surface-2); /* Distinct background for separation */
    }

    .sub-nav-btn {
        flex-shrink: 0;
        border-bottom-width: 2px;
    }
}

/* ===== CONTENT AREA ===== */
.app-container {
    grid-column: 2;
    grid-row: 2; /* After header */
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* ===== SUPPORT MODE BANNER ===== */
.support-mode-banner {
    grid-column: 2;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(90deg, #ff6b35, #f7c948);
    color: #1a1a2e;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* Hidden banner should not take grid space */
.support-mode-banner[style*="display: none"] {
    display: none !important;
}

.support-mode-banner i {
    font-size: 1.1rem;
}

/* ===== HEADER (Tiimi-Inspired Clean Header) ===== */
.app-header {
    grid-column: 2;
    grid-row: 1; /* Always first row */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 60px;
    background: var(--bg-surface-2);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    position: sticky;
    top: 0;
}

/* Header Company Selector — hidden, company name shown in sidebar only */
.header-company-selector { display: none !important; }

/* Header Icon Buttons (Search, etc.) */
.header-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1.25rem;
}

.header-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Header User Avatar */
.header-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-color), var(--brand-hover));
    color: var(--text-on-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    overflow: hidden;
}

.header-user-avatar > img,
.sidebar-user-avatar > img,
.desktop-profile-avatar > img,
#edit-profile-avatar > img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile-only elements hidden by default */
.mobile-only {
    display: none !important;
}

/* Desktop-only elements shown by default */
.desktop-only {
    display: flex;
}

.desktop-page-title {
    display: none;
    min-width: 0;
}

.desktop-page-title h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.35rem;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: 0;
}

/* Mobile menu button hidden on desktop */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    background: var(--bg-hover);
}

/* Note: .header-brand h2 styles are in COMPANY BRANDING section below */

.version-badge {
    background: rgba(var(--sidebar-accent-rgb), 0.15);
    color: var(--sidebar-accent);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(var(--sidebar-accent-rgb), 0.25);
}

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

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

/* Notification Bell (task-021) */
.notification-bell-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-bell-btn {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.notification-bell-btn i {
    font-size: 22px;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.notification-bell-btn:hover {
    background: var(--bg-hover);
}

.notification-bell-btn:hover i {
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.75rem; /* 12px - acceptable for badge counters */
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-width: calc(100vw - 24px);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    max-height: 500px;
    overflow: hidden;
}

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

.notification-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.mark-all-read-btn {
    background: transparent;
    border: none;
    color: var(--brand-fg, var(--brand-color));
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.mark-all-read-btn:hover {
    background: var(--bg-hover);
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: var(--bg-hover);
}

.notification-item.unread {
    background: rgba(52, 152, 219, 0.05);
    border-left: 3px solid var(--brand-color);
}

.notification-item.unread:hover {
    background: rgba(52, 152, 219, 0.1);
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.notification-message {
    font-size: 0.875rem; /* 14px - increased from 0.85rem for readability */
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.notification-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notification-type-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem; /* 12px - acceptable for type badges */
    font-weight: 500;
    border-radius: 12px;
    text-transform: uppercase;
}

.notification-type-assessment {
    background: rgba(52, 152, 219, 0.15);
    color: var(--brand-fg, var(--brand-color));
}

.notification-type-resign {
    background: rgba(231, 76, 60, 0.15);
    color: var(--error-text, var(--danger-color));
}

.notification-type-comment {
    background: rgba(155, 89, 182, 0.15);
    color: #9b59b6;
}

.notification-type-task_assign {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success-text, var(--success-color));
}

.notification-type-job_app {
    background: rgba(241, 196, 15, 0.15);
    color: var(--warning-text, var(--warning-color));
}

.notification-type-project_assign {
    background: rgba(52, 73, 94, 0.25);
    color: #5d7a94; /* WCAG AA: Lightened from #34495e for better contrast */
}

.notification-type-mention {
    background: rgba(99, 102, 241, 0.2);
    color: #8183f4; /* Primary color variant for mention */
}

.notification-type-general {
    background: rgba(149, 165, 166, 0.2);
    color: #a8b2b3; /* WCAG AA: Improved from #95a5a6 for 4.5:1 */
}

.notification-type-wfa_activity {
    background: rgba(26, 188, 156, 0.15);
    color: #1abc9c;
}

.notification-type-position_change {
    background: rgba(142, 68, 173, 0.15);
    color: #8e44ad;
}

.notification-type-work_output {
    background: rgba(230, 126, 34, 0.15);
    color: #e67e22;
}

.notification-type-compliance {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}

.notification-type-employee_joined {
    background: rgba(46, 204, 113, 0.15);
    color: #27ae60;
}

.notification-type-project_completed {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

.notification-type-leave_request {
    background: rgba(241, 196, 15, 0.15);
    color: #f39c12;
}

.notification-type-attendance_late {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
}

.notification-type-overtime_approval {
    background: rgba(52, 152, 219, 0.12);
    color: #2980b9;
}

.notification-type-job_recommendation {
    background: rgba(52, 152, 219, 0.15);
    color: #2980b9;
}

.notification-time {
    font-size: 0.875rem;  /* Increased from 0.75rem (14px) */
    color: var(--text-secondary);
}

.notification-list-hint {
    padding: 8px 16px 0;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.notification-empty i {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 12px;
}

/* Profile Dropdown */
.profile-dropdown-wrapper {
    position: relative;
}

.profile-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.profile-dropdown-trigger:hover {
    background: var(--bg-hover);
    border-color: var(--brand-color);
}

.profile-dropdown-icon {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.profile-dropdown-wrapper.open .profile-dropdown-icon {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    max-width: calc(100vw - 24px);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.profile-dropdown-wrapper.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-content {
    padding: 16px;
}

.profile-dropdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-dropdown-item:last-of-type {
    border-bottom: none;
}

.profile-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.profile-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown-edit {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    padding: 8px 12px;
}

.profile-dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 40px;
}

.toggle-password-btn {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.toggle-password-btn:hover {
    opacity: 1;
    color: var(--brand-fg, var(--brand-color));
}

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

.success {
    color: var(--success-text, var(--success-color, #22c55e));
    background: rgba(34, 197, 94, 0.1);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 1.1em;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--brand-fg, var(--brand-color));
    border-color: var(--brand-color);
}

.app-footer {
    margin-top: calc(var(--spacing-unit) * 4);
    padding-top: calc(var(--spacing-unit) * 2);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9em;
}

.app-footer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.pro-cta-btn {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--primary-color);
    color: var(--text-on-brand);
    font-weight: 700;
    cursor: pointer;
    transform: scale(1);
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.pro-cta-btn:hover {
    transform: scale(1.04);
    background: var(--primary-hover);
    color: var(--text-on-brand);
}

/* Tab Content Panels */
.tab-content {
    display: none; /* Hidden by default */
    padding: 0;
}

/* Mobile: Remove tab content padding for full-width */
@media (max-width: 480px) and (hover: none) and (pointer: coarse) {
    .tab-content {
        padding: 0;
    }
}

@media (max-width: 320px) and (hover: none) and (pointer: coarse) {
    .tab-content {
        padding: 0;
    }
}

.tab-content.active {
    display: block !important; /* Show when active */
}

/* Hide h3 titles completely - replaced by sub-nav */
.tab-content > h3 {
    display: none !important;
}

/* Hide context-bar that was before sub-nav */
.tab-content > .context-bar {
    display: none !important;
}

.context-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.context-bar label {
    margin: 0;
    font-weight: 600;
    font-size: var(--font-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

.context-bar select {
    max-width: 300px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-1);
    color: var(--text-primary);
    font-size: var(--font-sm);
    transition: all 0.2s ease;
}

/* Light mode context-bar select */
[data-theme="light"] .context-bar select {
    background-color: #ffffff;
    color: #1a1a1a;
}
.manager-project-selector-wrapper select option {
    background-color: var(--bg-surface-1);
    color: var(--text-primary);
}
[data-theme="light"] .manager-project-selector-wrapper select option {
    background-color: #ffffff;
    color: #1a1a1a;
}

.context-bar select option {
    background-color: var(--bg-surface-1);
    color: var(--text-primary);
}

[data-theme="light"] .context-bar select option {
    background-color: #ffffff;
    color: #1a1a1a;
}

.context-bar select:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 2px var(--brand-tint-20, rgba(var(--brand-color-rgb), 0.2));
    outline: none;
}

.context-hint {
    color: var(--text-secondary); /* Use proper secondary color instead of opacity */
    font-size: 14px;
}

.tab-content > h3 + p {
    margin-top: calc(var(--spacing-unit) * -1);
}
h2, h3, h4 {
    text-align: center;
    color: var(--brand-fg, var(--primary-color));
    margin-top: 0;
}
p {
    margin-bottom: calc(var(--spacing-unit) * 2);
}
section {
    margin-bottom: calc(var(--spacing-unit) * 4);
    padding-top: var(--spacing-unit);
    border-top: 1px solid var(--border-color);
}

/* === Utilitas Aksesibilitas === */
.visually-hidden,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip links — visible on keyboard focus only */
.skip-link {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: calc(var(--z-toast, 1200) + 10);
    padding: 10px 16px;
    border-radius: var(--border-radius-sm, 6px);
    background: var(--brand-color);
    color: var(--text-on-brand, #fff);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.15s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid var(--accent-color, var(--safety-color));
    outline-offset: 2px;
}

/* Reduce motion for vestibular / battery / preference (WCAG 2.2) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* === Keyboard Navigation Focus === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--bg-card), 0 0 0 6px var(--accent-color);
}

/* === Tab Navigation (Mobile-First) === */
.tab-nav {
    display: flex;
    justify-content: center; /* Center tabs in header */
    flex-grow: 1;
    margin: 0 var(--spacing-unit);
    border-bottom: none;
    overflow-x: auto; /* Memungkinkan scroll horizontal di mobile */
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* Scroll mulus di iOS */
    /* ARIA tablist styling */
    padding-bottom: 0;
    height: 100%;
    align-items: center;
    gap: 8px;
}

/* === Bottom Navigation Bar (Mobile Only - Modernized Feb 2026) === */
.bottom-nav {
    display: none; /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 72px;
    background: var(--bg-surface-2, #ffffff);
    border-top: 1px solid var(--border-color, #cbd5e1);
    z-index: 1000;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
    /* Safe area for iPhone notch/home indicator */
    padding-bottom: var(--safe-bottom, env(safe-area-inset-bottom, 0px));
}

/* Capacitor keyboard inset (set by src/shared/capacitor.js) */
html.keyboard-open .bottom-nav {
    padding-bottom: calc(var(--safe-bottom, 0px) + var(--keyboard-inset, 0px));
    height: calc(72px + var(--safe-bottom, 0px) + var(--keyboard-inset, 0px));
}

html.keyboard-open #main-content,
html.keyboard-open .dashboard-container,
html.keyboard-open .user-section.active {
    scroll-padding-bottom: calc(88px + var(--keyboard-inset, 0px));
}

html.keyboard-open .apk-update-banner {
    bottom: calc(80px + var(--safe-bottom, 0px) + var(--keyboard-inset, 0px));
}

body.device-mobile.window-medium .apk-update-banner,
body.device-mobile.window-expanded .apk-update-banner {
    left: calc(var(--nav-rail-width, 72px) + 12px);
    bottom: calc(12px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + var(--keyboard-inset, 0px));
}

body.device-desktop .bottom-nav,
body.device-desktop #absen-cuti-switcher,
body.device-desktop #user-attendance-nav-btn {
    display: none !important;
}

/* Own-absensi status/history is allowed on desktop; Absen Masuk/Pulang stays mobile-only. */
body.device-desktop #user-attendance-checkin-btn,
body.device-desktop #user-attendance-checkout-btn {
    display: none !important;
}

/* iOS Safari PWA support */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        min-height: calc(72px + var(--safe-bottom, env(safe-area-inset-bottom)));
    }
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 72px;
    padding: 0 12px;
    max-width: 560px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 56px;
    min-height: 52px;
    max-width: 96px;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    color: var(--text-primary, #0f172a);
    transition: all 0.2s ease;
    padding: 8px 4px;
    position: relative;
    margin: 0 2px;
    gap: 4px;
}

.bottom-nav-item i,
.bottom-nav-item .p-icon {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: currentColor;
    transition: transform 0.2s ease, color 0.2s ease;
}

.bottom-nav-item span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.1px;
    white-space: nowrap;
    color: currentColor;
    transition: color 0.2s ease;
}

/* Active state — pill highlight */
.bottom-nav-item.active {
    color: var(--brand-fg, var(--brand-color));
    background: rgba(var(--brand-color-rgb), 0.1);
}

.bottom-nav-item.active i {
    transform: none;
}

/* Tap feedback */
.bottom-nav-item:active {
    transform: scale(0.93);
    background: rgba(var(--brand-color-rgb), 0.06);
}

/* Hover state for desktop testing */
.bottom-nav-item:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Notification badge on bottom nav item */
.bottom-nav-item .nav-badge {
    position: absolute;
    top: 4px;
    right: 50%;
    transform: translateX(14px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--error-color);
    color: white;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bottom-nav-item .nav-badge:empty {
    display: none;
}

/* Pulse animation for new notifications */
.bottom-nav-item .nav-badge.pulse {
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: translateX(14px) scale(1); }
    50% { transform: translateX(14px) scale(1.15); }
}

/* ===== MOBILE RESPONSIVE (< 768px) ===== */
/* Note: hover/pointer conditions removed for PWA compatibility —
   some PWA standalone environments do not correctly report hover:none/pointer:coarse */
@media (max-width: 768px) {
    /* Switch to single column layout */
    .dashboard-container {
        grid-template-columns: 1fr;
        padding-bottom: calc(76px + var(--safe-bottom));
    }

    /* Reset grid positions for mobile */
    .support-mode-banner,
    .app-header,
    .app-container {
        grid-column: 1;
    }

    /* Hide sidebar on mobile (off-canvas from left) */
    .app-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1001;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        grid-column: unset;
        grid-row: unset;
    }

    .app-sidebar.active {
        left: 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    }

    /* Show mobile elements */
    .mobile-only {
        display: flex !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-menu-btn {
        display: flex;
    }

    body.mobile-drawer-account-only #app-sidebar .sidebar-user-menu {
        display: block !important;
        padding: 8px 16px 4px;
    }

    body.mobile-drawer-account-only #app-sidebar .sidebar-user-menu-item {
        min-height: 46px;
        margin-top: 8px;
        background: rgba(var(--sidebar-accent-rgb), 0.08);
    }

    body.mobile-drawer-account-only #app-sidebar .sidebar-user-chevron {
        display: none;
    }

    /* Show bottom nav on mobile */
    .bottom-nav {
        display: block;
    }

    /* Header adjustments for mobile */
    .app-header {
        padding: 0 16px;
    }

    .header-brand {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .header-brand h2 {
        font-size: 1.1rem;
    }
}

/* Extra mobile adjustments for smaller screens */
@media (max-width: 480px) {
    .app-header {
        padding: 0 0 0 8px;
        height: 56px;
    }

    .header-brand h2 {
        font-size: 1rem;
    }
}

@media (max-width: 320px) {
    .app-header {
        padding: 0 0 0 4px;
        height: 52px;
    }

    .header-brand h2 {
        font-size: 0.95rem;
    }

    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }
}

/* Hide scrollbar for cleaner look */
.tab-nav::-webkit-scrollbar {
    display: none;
}
.tab-nav {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge legacy */
}

.tab-btn {
    padding: 0 16px;
    height: 100%;
    min-height: 48px;  /* Ensure minimum tap target */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;  /* Increased from 0.9rem for readability */
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--brand-fg, var(--brand-color));
    border-bottom-color: var(--brand-color);
    background: transparent;
}

/* Ensure icons in tabs are aligned */
.tab-btn i {
    margin-right: 8px;
    font-size: 1.1em;
    vertical-align: text-bottom;
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Module Tier Badges === */
.module-tier-badge {
    display: inline-block;
    font-size: 0.75em;  /* Increased from 0.7em for readability */
    padding: 3px 8px;  /* Increased padding */
    border-radius: 4px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 22px;  /* Ensure visibility */
    display: inline-flex;
    align-items: center;
}

.module-tier-badge.tier-0 {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success-text, #166534);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.module-tier-badge.tier-1 {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.module-tier-badge.tier-2 {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.module-tier-badge.tier-3 {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.module-tier-badge.core {
    background: rgba(34, 197, 94, 0.25);
    color: var(--success-text, #166534);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.module-tier-badge.optional {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* In tab buttons */
.tab-btn .module-tier-badge {
    font-size: 0.65em;  /* Increased from 0.6em */
    padding: 2px 6px;  /* Increased padding */
    margin-left: 4px;
    min-height: 18px;
}

/* In module lists */
.module-list-item .module-tier-badge {
    margin-left: auto;
}

/* === Forms (Mobile-First & Aksesibel) === */
form {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1.5);
    max-width: 500px;
    margin: 0 auto;
    padding: var(--spacing-unit);
}
label {
    margin-bottom: 0;
    font-weight: bold;
    font-size: var(--font-size-touch);
    color: var(--text-color);
}
input, select, textarea {
    padding: 10px 14px;
    margin-bottom: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-sm);
    min-height: 40px;
    width: 100%;
    background-color: var(--bg-input);
    color: var(--text-color);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(var(--brand-color-rgb), 0.12);
}

/* Light mode: Override select dropdown colors */
[data-theme="light"] select {
    background-color: #ffffff;
    color: #1a1a1a;
}

/* Searchable dropdown (Choices.js) - themed with existing tokens */
.choices {
    width: 100%;
}
.choices__inner {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    min-height: unset;
    padding: 0;
}
.choices__list--single {
    padding: var(--touch-padding);
}
.choices__input {
    background-color: var(--bg-card);
    color: var(--text-color);
    caret-color: var(--text-color);
    margin: 0;
    padding: var(--touch-padding);
    border: none;
    border-radius: var(--border-radius);
}
.choices__input--cloned {
    background-color: var(--bg-card) !important;
    color: var(--text-color) !important;
    caret-color: var(--text-color) !important;
    opacity: 1 !important;
}
.choices__input--cloned::placeholder {
    color: var(--text-color) !important;
    opacity: 0.6;
}
.choices__list--dropdown,
.choices__list[aria-expanded] {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    z-index: 50;
}
.choices__item,
.choices__list--dropdown .choices__item--selectable,
.choices__list[aria-expanded] .choices__item--selectable {
    color: var(--text-color) !important;
    background-color: transparent;
}
.choices__placeholder {
    color: var(--text-color);
    opacity: 0.7;
}
/* Ensure hovered/keyboard-highlighted option remains readable */
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted,
.choices__list--dropdown .choices__item--selectable:hover,
.choices__list[aria-expanded] .choices__item--selectable:hover {
    background-color: rgba(var(--safety-color-rgb, 232, 93, 4), 0.16) !important;
    color: var(--text-primary) !important;
}

.choices__list--dropdown .choices__item--selectable.is-selected {
    background-color: rgba(var(--safety-color-rgb, 232, 93, 4), 0.1);
    color: var(--safety-fg, var(--safety-color)) !important;
    font-weight: 600;
}

/* Choices.js Multiple Select */
.choices__list--multiple .choices__item {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    color: white;
}
.choices__list--multiple .choices__item.is-highlighted {
    background-color: var(--primary-hover);
    border: 1px solid var(--primary-hover);
}
.choices[data-type*="select-multiple"] .choices__button,
.choices__list--multiple .choices__item .choices__button {
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    filter: invert(1);
}

/* Choices.js Arrow & General */
.choices[data-type*="select-one"]::after {
    border-color: var(--text-secondary) transparent transparent transparent;
}
.choices[data-type*="select-one"].is-open::after {
    border-color: transparent transparent var(--text-secondary) transparent;
}
.choices__list--dropdown .choices__placeholder {
    display: none;
}

/* Missing Form Classes */
.form-select, .form-control {
    padding: 12px 14px;
    min-height: var(--touch-target-size); /* 48px minimum tap target */
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base); /* 16px minimum */
    background-color: var(--bg-card);
    color: var(--text-color);
    width: 100%;
    transition: border-color 0.2s ease;
}

.form-select:focus, .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Small variant - still maintains 44px min height for accessibility */
.form-select-sm {
    padding: 8px 12px;
    min-height: 44px; /* Slightly smaller but still accessible */
    font-size: var(--font-min-secondary); /* 14px minimum */
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card);
    color: var(--text-color);
}

input[type="file"] {
    padding: 12px;
}
/* ===== App-wide compact checkbox baseline (replaces scale(1.5) bloat) ===== */
input[type="checkbox"]:not(.module-switch),
input[type="radio"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    transform: none;
    flex-shrink: 0;
    accent-color: var(--brand-color, var(--primary-color));
    cursor: pointer;
    vertical-align: middle;
}

/* Hidden toggle switches — custom slider UI, not native checkbox box */
input.module-switch[type="checkbox"],
.bc-toggle-switch input[type="checkbox"],
.module-item.module-toggleable input.module-switch {
    position: absolute;
    opacity: 0;
    width: 0 !important;
    height: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    transform: none !important;
}

/* Labels wrapping checkbox + text (modals, forms, face config, leave, tax, etc.) */
label:has(> input[type="checkbox"]:first-child):not(.position-permission-option),
label:has(> input[type="radio"]:first-child):not(.position-permission-option),
label.checkbox-label,
label.column-toggle-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: 100%;
    margin-bottom: 0;
    font-weight: 500;
    cursor: pointer;
}

.form-group > label:has(> input[type="checkbox"]),
.form-group > label:has(> input[type="radio"]) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Table / matrix / bulk selection checkboxes */
th input[type="checkbox"],
td input[type="checkbox"],
.module-checkbox,
.matrix-checkbox,
.batch-checkbox,
.applicant-checkbox,
.shift-assign-cb,
.ot-assign-cb,
.ot-project-cb,
.module-row-select,
.project-req-cat-cb {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    transform: none;
}

.module-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
}
/* State untuk input tidak valid (dikelola oleh JS) */
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
    border-color: var(--error-color);
    box-shadow: 0 0 0 2px var(--error-color);
}

button, .button {
    padding: 12px 20px; /* Horizontal padding lebih besar */
    min-height: var(--touch-target-size); /* 48px minimum untuk touch */
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: var(--font-size-touch);
    font-weight: 600;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space antara icon dan text */
}
button:hover, .button:hover {
    background-color: var(--primary-hover);
    color: var(--text-on-brand);
}
button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    color: var(--text-secondary);
}

/* Inline loading spinner (for buttons) */
.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}

/* Button loading state */
button.loading, .btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}
button.loading::after, .btn.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    animation: spinner-rotate 0.8s linear infinite;
    vertical-align: middle;
}

/* Input validation states */
input.input-error, select.input-error, textarea.input-error {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 2px rgba(224, 108, 117, 0.2);
}
input.input-success, select.input-success, textarea.input-success {
    border-color: var(--success-color) !important;
    box-shadow: 0 0 0 2px rgba(152, 195, 121, 0.2);
}
.field-error {
    color: var(--error-text, var(--error-color));
    font-size: var(--font-sm);
    margin-top: 4px;
    display: block;
}
.field-hint {
    color: var(--text-secondary);
    font-size: var(--font-xs);
    margin-top: 2px;
}

/* Module toggles fieldset */
.module-toggles {
    background: var(--bg-surface-1);
}

.module-toggles legend {
    color: var(--text-primary);
}

.module-toggles .toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    cursor: pointer;
}

.module-toggles .toggle-item:last-child {
    border-bottom: none;
}

.module-toggles .toggle-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.module-toggles .toggle-item span {
    color: var(--text-primary);
    font-size: var(--font-sm);
}

.module-toggles .toggle-item:hover {
    background: var(--bg-surface-2);
    margin: 0 -12px;
    padding: 8px 12px;
    border-radius: 4px;
}

/* Small badge (uses existing design tokens) */
.pill-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--warning-color);
    color: #121212;
    line-height: 1.2;
}

/* Mobile: clamp long job/recommendation text */
@media (max-width: 480px) and (hover: none) and (pointer: coarse) {
    .recommend-text {
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
.login-link, .register-link {
    text-align: center;
    margin-top: calc(var(--spacing-unit) * 2);
}
.login-link button, .register-link button {
    background: none;
    color: var(--brand-fg, var(--primary-color));
    padding: 5px;
    font-size: var(--font-size-base);
    text-decoration: underline;
}

/* === Tables (Responsif) === */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
}
th, td {
    border: 1px solid var(--border-color);
    padding: var(--table-cell-pad-y, 10px) var(--table-cell-pad-x, 12px);
    text-align: left;
    vertical-align: top;
    white-space: nowrap; /* Mencegah wrap aneh di mobile */
}
th {
    background-color: var(--bg-color);
    font-weight: 600;
}
.actions button {
    margin-right: var(--spacing-unit);
    padding: 8px 12px;
    font-size: 14px;
}

/* === Pesan Error & Success (Aksesibel) === */
.error, p.error {
    color: var(--error-text, var(--error-color));
    text-align: center;
    font-weight: bold;
    padding: 10px;
    border: 1px solid var(--error-color);
    border-radius: var(--border-radius);
    background: rgba(224, 108, 117, 0.1);
}
.success {
    color: var(--success-text, var(--success-color));
    text-align: center;
    font-weight: bold;
    padding: 10px;
    border: 1px solid var(--success-color);
    border-radius: var(--border-radius);
    background: rgba(152, 195, 121, 0.1);
}

/* === User Dashboard Toggles === */
.toggle-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: var(--touch-padding);
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: var(--font-size-touch);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-unit);
    position: relative;
}
.toggle-btn::after {
    content: '+'; /* Indikator expand */
    position: absolute;
    right: 20px;
    font-weight: bold;
    font-size: 24px;
}
.toggle-btn.active::after {
    content: '−'; /* Indikator collapse */
}
.toggle-btn:hover {
    background-color: var(--primary-hover);
    color: var(--text-on-brand);
}
.section-content {
    display: none;
    padding: 0;
    margin-bottom: 0;
    background-color: var(--bg-color);
    border: none;
    border-radius: 0;
}

/* Mobile: reduce section padding for more content space */
@media (max-width: 480px) and (hover: none) and (pointer: coarse) {
    .section-content {
        padding: 0;
        margin-bottom: 0;
        border-radius: 0;
    }
}

@media (max-width: 320px) and (hover: none) and (pointer: coarse) {
    .section-content {
        padding: 0;
        margin-bottom: 0;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
}

.section-content.active {
    display: block;
    animation: fadeIn 0.4s;
}

/* User Section (sub-sections within user-tab) */
.user-section {
    display: none;
}
.user-section.active {
    display: block;
}

.empty-state,
.muted {
    color: var(--text-secondary); /* WCAG: Use text-secondary (#a0a0a0) instead of opacity */
}

/*
 * Canonical empty-state + skeleton contract (Phase A UX)
 * - Loading unknown data → .skeleton-card / .skeleton-line (loading-skeleton.css)
 * - Known empty result   → .empty-state (+ optional .empty-state-compact)
 * - Inline busy spinner  → .loading-spinner
 *
 * Markup:
 * <div class="empty-state empty-state-compact">
 *   <i class="ph ph-…" aria-hidden="true"></i>
 *   <p class="empty-state-title">…</p>
 *   <p class="empty-state-desc">…</p>
 * </div>
 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    padding: 28px 16px;
    color: var(--text-secondary);
}

.empty-state > i.ph,
.empty-state > .p-icon {
    font-size: 2rem;
    line-height: 1;
    color: var(--brand-fg, var(--brand-color));
    opacity: 0.9;
}

.empty-state-title {
    margin: 0;
    font-size: var(--font-base, 0.9375rem);
    font-weight: 700;
    color: var(--text-primary);
}

.empty-state-desc {
    margin: 0;
    max-width: 36ch;
    font-size: var(--font-sm, 0.875rem);
    line-height: 1.5;
    color: var(--text-secondary);
}

.empty-state-compact {
    padding: 20px 12px;
}

.empty-state-compact > i.ph {
    font-size: 1.75rem;
}

.empty-state[hidden],
.empty-state-compact[hidden] {
    display: none !important;
}

.table-message {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary); /* WCAG: Use text-secondary instead of opacity */
}

.grid-message {
    grid-column: 1 / -1;
    padding: 10px;
}
ul {
    list-style-type: none;
    padding: 0;
}
li {
    margin-bottom: 10px;
    padding: 10px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
}

/* === Mobile-First Media Queries === */

/* Extra Small Phones (up to 320px) - iPhone SE, older Androids */
@media (max-width: 320px) and (hover: none) and (pointer: coarse) {
    :root {
        --spacing-unit: 4px;
        --touch-target-size: 48px; /* Maintain 48px even on small screens */
        --font-size-base: 16px;
        --font-size-touch: 17px;
    }

    body {
        font-size: 16px;
        padding: 0;
    }

    .container, .app-container {
        padding: 0;
    }

    /* Prevent horizontal scroll - CRITICAL */
    *, *::before, *::after {
        max-width: 100%;
        box-sizing: border-box;
    }

    img, video, iframe {
        max-width: 100%;
        height: auto;
    }

    /* Stack buttons vertically */
    .btn-group, .button-group, .modal-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-group > *, .button-group > *, .modal-actions > * {
        width: 100%;
    }

    /* Reduce card padding */
    .card, .info-card, .stat-card, .user-dashboard-card {
        padding: 12px;
    }

    /* Smaller headings */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
    h4 { font-size: 1rem; }

    /* Full width inputs */
    input, select, textarea {
        width: 100%;
    }

    /* Hide non-essential text on smallest screens */
    .hide-xs {
        display: none !important;
    }
}

/* Small Phones (321px - 374px) */
@media (min-width: 321px) and (max-width: 374px) and (hover: none) and (pointer: coarse) {
    :root {
        --spacing-unit: 6px;
        --touch-target-size: 48px;
        --font-size-base: 16px;
        --font-size-touch: 18px;
    }

    body {
        font-size: 16px;
        padding: 0;
    }

    .container {
        padding: 0;
    }

    /* Ensure no horizontal scroll */
    * {
        max-width: 100%;
    }

    img {
        max-width: 100%;
        height: auto;
    }
}

/* Medium Phones (375px - 479px) */
@media (min-width: 375px) and (max-width: 479px) and (hover: none) and (pointer: coarse) {
    body {
        font-size: 16px;
        padding: 0;
    }

    .container {
        padding: 0;
    }
}

/* === Desktop & Tablet === */
@media (min-width: 768px) {
    body {
        padding: 0;
    }
    .app-container {
        margin-top: 0;
        margin-bottom: 0;
    }
    /* Layout form 2 kolom di desktop */
    form.grid-form {
        display: grid;
        grid-template-columns: 150px 1fr; /* Label dan Input */
        align-items: center;
        gap: var(--section-gap, 12px);
        width: 100%;
        max-width: min(100%, var(--form-max-width, 960px));
    }
    form.grid-form label {
        text-align: right;
        margin-bottom: 0;
    }
    form.grid-form button[type="submit"] {
        grid-column: 1 / -1; /* Tombol span penuh */
        margin-top: 10px;
    }
}

/* Tambahan untuk Accordion Forms */
.accordion-btn {
    background-color: var(--primary-color);
    color: white;
    padding: var(--touch-padding);
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: var(--font-size-touch);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-unit);
    position: relative;
}
.accordion-btn::after {
    content: '+';
    position: absolute;
    right: 20px;
    font-weight: bold;
}
.accordion-btn.active::after {
    content: '−';
}
.accordion-content {
    display: block;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 calc(var(--spacing-unit) * 2);
    border-bottom: 0 solid transparent;
    transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out, padding 0.5s ease, border-bottom 0.5s ease;
    visibility: hidden;
}
.accordion-content.active,
.accordion-content.open {
    opacity: 1;
    padding-top: calc(var(--spacing-unit) * 2);
    padding-bottom: calc(var(--spacing-unit) * 2);
    border-bottom: 2px solid var(--border-color);
    visibility: visible;
}

/* CSS untuk Struktur Organisasi */
#org-tree, #user-org-tree {
    width: 100%;
    height: 600px;
    overflow: auto;
    background: var(--bg-surface-1);
    border-radius: var(--border-radius);
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    #org-tree, #user-org-tree {
        height: 400px;
    }
}

/* Visual Chart is view-only: hierarchy editing happens in Table Editor */
/* REMOVED: old org-panel display:none rule (replaced by drawer system) */

@media (min-width: 980px) {
    /* Chart takes full width - no side panel */
}

/* org-chart styles (L2598-L3352) → styles/modules/org-chart.css */

/* assessment styles (L2600-L2829) → styles/modules/assessment.css */

/* modal-dialog (L2602-L3459) → styles/components/modal-dialog.css */

/* user-tab-forms (L3460-L3649) → styles/modules/user-tab-forms.css */

/* responsive-card-tables (L3650-L3840) → styles/modules/responsive-card-tables.css */



/* Agenda styles (L13202-L15611) → styles/modules/agenda.css */

/* settings-branding styles (L6797-L7410) → styles/modules/settings-branding.css */

/* hc-workspace styles (L7411-L8094) → styles/modules/hc-workspace.css */

/* employment-history styles (L8095-L8798) → styles/modules/employment-history.css */

/* shell-mobile (L5647-L5841) → styles/modules/shell-mobile.css */

/* pending-assessments (L3853-L4051) → styles/modules/pending-assessments.css */

/* =====================================================
   ASSESSMENT DETAIL MODAL
   ===================================================== */

.assessment-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.user-info-text h5 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.assessment-stats {
    display: flex;
    gap: 24px;
}

.assessment-stats .stat-item {
    text-align: center;
}

.assessment-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-fg, var(--primary-color));
}

.assessment-stats .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.assessment-detail-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group-inline label {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin: 0;
}

.filter-group-inline select {
    min-width: 150px;
}

/* Score badges */
.score-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 32px;
    text-align: center;
}

.score-badge.score-high {
    background: #d4edda;
    color: #155724;
}

.score-badge.score-medium {
    background: #fff3cd;
    color: #856404;
}

.score-badge.score-low {
    background: #f8d7da;
    color: #721c24;
}

/* Modal footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary, #f8f9fa);
}

/* Sticky table header */
#assessment-detail-table thead.sticky-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

#assessment-detail-table th {
    background: var(--bg-secondary, #f8f9fa);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

#assessment-detail-table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Mobile adjustments for modal */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .assessment-detail-header {
        flex-direction: column;
        text-align: center;
    }

    .user-info-card {
        flex-direction: column;
        text-align: center;
    }

    .assessment-stats {
        width: 100%;
        justify-content: space-around;
    }

    .assessment-detail-filters {
        flex-direction: column;
    }

    .filter-group-inline {
        width: 100%;
    }

    .filter-group-inline select {
        flex: 1;
    }

    dialog.modal-dialog.modal-lg {
        max-width: 95%;
        margin: 10px auto;
    }
}

/* =====================================================
   COMPANY ASSESSMENT SUMMARY (HC/Director)
   ===================================================== */

.stat-card-mini {
    background: var(--bg-secondary, #f8f9fa);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    text-align: center;
    min-width: 100px;
    flex: 1;
    max-width: 150px;
}

.stat-card-mini .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-fg, var(--primary-color));
}

.stat-card-mini .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.company-assessment-filters {
    background: var(--bg-secondary, #f8f9fa);
    padding: 12px;
    border-radius: var(--border-radius);
}

.company-assessment-filters .filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.company-assessment-filters .filter-item label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

.company-assessment-filters .filter-item input,
.company-assessment-filters .filter-item select {
    padding: 6px 10px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-card);
    color: var(--text-color);
}

#company-assessment-table {
    font-size: 0.875rem;
}

#company-assessment-table thead.sticky-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

#company-assessment-table th {
    background: var(--bg-secondary, #f8f9fa);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

#company-assessment-table th:hover {
    background: var(--border-color);
}

#company-assessment-table td {
    vertical-align: middle;
}

.user-name-cell {
    line-height: 1.3;
}

.user-name-cell strong {
    color: var(--text-color);
}

.user-name-cell small {
    font-size: 0.75rem;
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .company-assessment-filters {
        flex-direction: column;
    }

    .company-assessment-filters .filter-item {
        width: 100%;
    }

    .stat-card-mini {
        max-width: none;
    }
}

/* Small button group for table actions */
.btn-group-sm {
    display: flex;
    gap: 4px;
}

.btn-group-sm .btn {
    padding: 4px 8px;
    font-size: 0.875rem;
}

.btn-group-sm .btn i {
    font-size: 1rem;
}

/* blue-collar styles (L12763-L16275) → styles/modules/blue-collar.css */

/* superadmin-license styles (L9497-L9794) → styles/modules/superadmin-license.css */

/* ==========================================================================
   DESKTOP COMPACT MODE (100% Zoom Optimization)
   Fixes "content looks too large/cramped" issue on standard desktops
   ========================================================================== */
@media (min-width: 1024px) {
    :root {
        /* Reduce base font scale slightly */
        --font-base: 0.9375rem; /* 15px instead of 16px */

        /* Reduce header hierarchy sizes */
        --font-xl: 1.25rem;    /* 20px */
        --font-2xl: 1.75rem;   /* 28px */
        --font-lg: 1rem;       /* 16px */

        /* Tighter spacing */
        --touch-target-size: 36px; /* Mouse pointers allow smaller targets */
        --border-radius: 6px;      /* Sharper, more professional look */

        /* Custom Variables for Desktop */
        --desktop-header-height: 56px;
        --desktop-card-padding: 16px;
    }

    /* 1. Header & Layout Compactness */
    .app-header {
        height: 56px;
        padding: 0 20px;
    }

    .dashboard-container {
        /* Adjust row height to match new header */
        grid-template-rows: 56px 1fr;
    }

    .header-brand h2 {
        font-size: 1.15rem;
    }

    /* 2. Sidebar Compactness */
    .app-sidebar {
        min-width: 240px; /* Reduced from 260px */
        grid-template-columns: 240px 1fr;
    }

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

    .sidebar-nav {
        padding: 12px 0px;
    }

    .sidebar-nav-item {
        padding: 8px 16px;
        font-size: 0.9rem;
        gap: 10px;
    }

    .sidebar-nav-item i {
        font-size: 1.1rem;
        width: 20px;
    }

    /* 3. Card Compactness */
    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
    }

    .stat-value {
        font-size: 1.6rem; /* Reduced from 2rem+ */
    }

    .stat-label {
        font-size: 0.8rem;
    }

    /* 4. Quick Actions Compactness */
    .quick-actions {
        padding: 16px;
        padding-bottom: 20px;
    }

    .quick-actions h4 {
        margin-bottom: 12px;
        font-size: 0.95rem;
    }

    .action-buttons {
        gap: 10px;
    }

    .action-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        min-height: 38px;
    }

    /* 5. Sub Navigation (Tabs) Compactness */
    .sub-nav {
        padding: 8px 0;
        margin-bottom: 16px;
    }

    .sub-nav-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    /* 6. Table/List Compactness */
    td, th {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    /* 7. General Content Padding */
    .tab-content {
        padding: 20px 24px;
    }

    /* 8. Human Capital Dashboard Specifics */
    .stats-grid {
        gap: 16px;
        margin-bottom: 24px;
    }
}

/* ============================================
   HC MODULE - White-collar notice banner
   ============================================ */

.hc-wc-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.22);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-muted, #666);
    line-height: 1.5;
}

.hc-wc-notice i {
    font-size: 1rem;
    color: #3b82f6;
    flex-shrink: 0;
    margin-top: 1px;
}

.hc-wc-notice strong {
    color: var(--text-primary, #333);
}

/* ============================================
   SHIFT MANAGEMENT - Shift Info Banner & WFA
   ============================================ */

.bc-shift-info-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.bc-shift-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-light, #EBF5FF);
    border: 2px solid var(--primary, #3B82F6);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary, #3B82F6);
}

.bc-shift-times {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.bc-shift-separator {
    color: var(--text-tertiary);
}

.bc-shift-times i {
    font-size: 1rem;
    vertical-align: middle;
}

.bc-wfa-activity-form {
    text-align: left;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    border: 1px dashed var(--border-color);
}

.bc-wfa-activity-form textarea {
    resize: vertical;
    min-height: 60px;
}

.bc-wfa-activity-form .helper-text {
    margin-top: 4px;
    font-size: 0.8rem;
}

/* Overtime summary stat */
.bc-summary-lembur .bc-summary-value {
    color: var(--warning, #F59E0B);
}

/* Shift sub-section navigation */
.hc-shift-subsection {
    min-height: 200px;
}

/* Penugasan Shift — assignment page */
.hc-shift-assign-page .hc-shift-assign-intro {
    font-size: 0.9em;
    padding: 0 1rem;
    margin-bottom: 0.75rem;
}

.hc-shift-assign-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.hc-shift-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-secondary, #6b7280);
}

.hc-shift-stat-pill strong {
    color: var(--text-primary, #111827);
    font-weight: 600;
}

.hc-shift-stat-assigned {
    background: color-mix(in srgb, var(--success, #10b981) 12%, transparent);
}

.hc-shift-stat-unassigned {
    background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
}

.hc-shift-assign-alert {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 1rem 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--warning, #f59e0b) 12%, var(--bg-secondary, #fff));
    font-size: 0.88rem;
}

.hc-shift-assign-toolbar {
    padding: 0 1rem 1rem;
    gap: 0.75rem;
}

.hc-shift-assign-toolbar .form-group {
    flex: 1;
    min-width: 140px;
}

.hc-shift-search-group {
    flex: 1.4;
    min-width: 180px;
}

.hc-shift-bulk-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 1rem 1rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary, #3b82f6) 10%, var(--bg-secondary, #f9fafb));
    border: 1px solid color-mix(in srgb, var(--primary, #3b82f6) 25%, transparent);
    position: sticky;
    top: 0;
    z-index: 2;
}

.hc-shift-bulk-count {
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: auto;
}

.hc-shift-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: color-mix(in srgb, var(--shift-color, #3b82f6) 18%, transparent);
    border-left: 3px solid var(--shift-color, #3b82f6);
    color: var(--text-primary, #1f2937);
}

.hc-shift-modal-preview {
    min-height: 1.25rem;
    margin-top: 0.25rem;
}

@media (max-width: 640px) {
    .hc-shift-assign-toolbar .form-group {
        min-width: 100%;
        flex: 1 1 100%;
    }

    .hc-shift-bulk-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .hc-shift-bulk-count {
        margin-right: 0;
    }
}

/* Attendance mode badges */
.badge-info {
    background: var(--primary-light, #EBF5FF);
    color: var(--primary, #3B82F6);
    border: 1px solid var(--primary, #3B82F6);
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* attendance-face styles (L10169-L10454) → styles/modules/attendance-face.css */

/* settings-branding styles (L10455-L10704) → styles/modules/settings-branding.css */

/* ============================================================
   IN-APP USER GUIDE (Panduan Pengguna)
   ============================================================ */

/* Guide modal — larger than modal-lg */
dialog.modal-dialog.modal-guide {
    max-width: 1100px;
    width: 95vw;
    height: 85vh;
    max-height: 85vh;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
}

.guide-modal-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Header */
.guide-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    flex-shrink: 0;
    background: var(--bg-card, #fff);
    gap: 12px;
}

.guide-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.guide-modal-title i {
    font-size: 1.5rem;
    color: var(--brand-fg, var(--primary-color, #2563eb));
}

.guide-modal-title h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color, #1e293b);
}

.guide-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guide-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.guide-search-wrap i {
    position: absolute;
    left: 10px;
    font-size: 1rem;
    color: var(--text-secondary, #94a3b8);
    pointer-events: none;
}

.guide-search-wrap input {
    padding: 7px 12px 7px 32px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-color, #1e293b);
    width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.guide-search-wrap input:focus {
    outline: none;
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Two-pane layout */
.guide-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Left: Table of Contents */
.guide-toc {
    width: 250px;
    min-width: 250px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    padding: 12px 0;
    flex-shrink: 0;
}

.guide-toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary, #64748b);
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    text-decoration: none;
    user-select: none;
}

.guide-toc-item:hover {
    background: var(--bg-hover, rgba(0,0,0,0.04));
    color: var(--text-color, #1e293b);
}

.guide-toc-item.active {
    background: var(--primary-bg, rgba(37, 99, 235, 0.08));
    color: var(--brand-fg, var(--primary-color, #2563eb));
    border-left-color: var(--primary-color, #2563eb);
    font-weight: 600;
}

.guide-toc-item i {
    font-size: 1.15rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.guide-toc-item.active i {
    opacity: 1;
}

.guide-toc-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Right: Content pane */
.guide-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-width: 0;
}

.guide-content-inner {
    padding: 28px 36px 40px;
    max-width: 780px;
}

/* Typography inside guide */
.guide-content-inner h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-color, #1e293b);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color, #2563eb);
}

.guide-content-inner h2 i {
    font-size: 1.4rem;
    color: var(--brand-fg, var(--primary-color, #2563eb));
}

.guide-content-inner h3 {
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--text-color, #1e293b);
    margin: 24px 0 10px;
}

.guide-content-inner h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color, #334155);
    margin: 18px 0 8px;
}

.guide-content-inner p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-color, #475569);
    margin: 0 0 12px;
}

.guide-content-inner ul,
.guide-content-inner ol {
    margin: 0 0 14px;
    padding-left: 22px;
}

.guide-content-inner li {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color, #475569);
    margin-bottom: 4px;
}

.guide-content-inner li ul,
.guide-content-inner li ol {
    margin-top: 4px;
    margin-bottom: 4px;
}

/* Guide audience badge */
.guide-audience {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-bg, rgba(37, 99, 235, 0.08));
    color: var(--brand-fg, var(--primary-color, #2563eb));
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 16px !important;
}

/* Guide tables */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 18px;
    font-size: 0.85rem;
}

.guide-table thead th {
    background: var(--bg-secondary, #f1f5f9);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-color, #334155);
    border-bottom: 2px solid var(--border-color, #e2e8f0);
}

.guide-table tbody td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-color, #475569);
    vertical-align: top;
}

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

.guide-table tbody tr:hover {
    background: rgba(0,0,0,0.02);
}

/* Tip & Warning callouts */
.guide-tip,
.guide-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.55;
    margin: 12px 0 16px;
}

.guide-tip {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid #3b82f6;
    color: var(--text-color, #334155);
}

.guide-tip i {
    color: #3b82f6;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.guide-warning {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #f59e0b;
    color: var(--text-color, #334155);
}

.guide-warning i {
    color: #f59e0b;
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Badges inside guide */
.guide-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.5;
}

.guide-badge-yellow { background: #fef3c7; color: #92400e; }
.guide-badge-blue   { background: #dbeafe; color: #1e40af; }
.guide-badge-green  { background: #dcfce7; color: #166534; }
.guide-badge-orange { background: #ffedd5; color: #9a3412; }
.guide-badge-red    { background: #fee2e2; color: #991b1b; }

/* FAQ items */
.guide-faq-item {
    padding: 14px 16px;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 10px;
    margin-bottom: 10px;
}

.guide-faq-item h4 {
    margin: 0 0 6px !important;
    font-size: 0.9rem;
    color: var(--text-color, #1e293b);
}

.guide-faq-item p {
    margin: 0;
    color: var(--text-secondary, #64748b);
}

/* Search highlight */
.guide-search-highlight {
    background: rgba(245, 158, 11, 0.3);
    border-radius: 2px;
    padding: 0 1px;
}

/* No results message */
.guide-no-results {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary, #94a3b8);
}

.guide-no-results i {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* ── Mobile responsive ── */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    dialog.modal-dialog.modal-guide {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .guide-modal-header {
        padding: 12px 16px;
        flex-wrap: wrap;
    }

    .guide-search-wrap input {
        width: 140px;
    }

    .guide-layout {
        flex-direction: column;
    }

    .guide-toc {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e2e8f0);
        padding: 8px 8px;
        overflow-x: auto;
        overflow-y: hidden;
        display: flex;
        flex-direction: row;
        gap: 4px;
        max-height: 52px;
        flex-shrink: 0;
    }

    .guide-toc-item {
        padding: 6px 12px;
        border-left: none;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.8rem;
        gap: 6px;
    }

    .guide-toc-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--primary-color, #2563eb);
    }

    .guide-toc-label {
        display: none;
    }

    .guide-content-inner {
        padding: 20px 18px 32px;
    }

    .guide-content-inner h2 {
        font-size: 1.15rem;
    }
}

/* Dark mode support for guide */
@media (prefers-color-scheme: dark) {
    .guide-badge-yellow { background: rgba(254, 243, 199, 0.2); color: #fbbf24; }
    .guide-badge-blue   { background: rgba(219, 234, 254, 0.15); color: #60a5fa; }
    .guide-badge-green  { background: rgba(220, 252, 231, 0.15); color: #4ade80; }
    .guide-badge-orange { background: rgba(255, 237, 213, 0.15); color: #fb923c; }
    .guide-badge-red    { background: rgba(254, 226, 226, 0.15); color: #f87171; }
}

[data-theme="dark"] .guide-badge-yellow { background: rgba(254, 243, 199, 0.15); color: #fbbf24; }
[data-theme="dark"] .guide-badge-blue   { background: rgba(219, 234, 254, 0.1); color: #60a5fa; }
[data-theme="dark"] .guide-badge-green  { background: rgba(220, 252, 231, 0.1); color: #4ade80; }
[data-theme="dark"] .guide-badge-orange { background: rgba(255, 237, 213, 0.1); color: #fb923c; }
[data-theme="dark"] .guide-badge-red    { background: rgba(254, 226, 226, 0.1); color: #f87171; }

[data-theme="dark"] .guide-faq-item {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .guide-table thead th {
    background: rgba(255, 255, 255, 0.06);
}

/* approvals styles (L11156-L11466) → styles/modules/approvals.css */

/* ===========================================
   Team Summary (Ringkasan Tim) - April 2026
   =========================================== */
.team-summary-stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--surface-2, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #dee2e6);
}
.team-summary-stats-bar .ts-stat {
    text-align: center;
    padding: 8px 4px;
}
.team-summary-stats-bar .ts-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.team-summary-stats-bar .ts-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.team-summary-table .ts-cell-name { min-width: 180px; }
.team-summary-table .ts-name-line { font-size: 0.95rem; }
.team-summary-table .ts-position-line { font-size: 0.8rem; }
.team-summary-table .ts-meta-line { font-size: 0.75rem; margin-top: 2px; }
.team-summary-table .ts-cell-avg { width: 100px; text-align: center; vertical-align: middle; }
.team-summary-table .ts-avg-badge {
    display: inline-block;
    min-width: 44px;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
}
.team-summary-table .ts-avg-good { background: #d1fae5; color: #065f46; }
.team-summary-table .ts-avg-mid  { background: #fef3c7; color: #92400e; }
.team-summary-table .ts-avg-low  { background: #fee2e2; color: #991b1b; }
.team-summary-table .ts-avg-none { background: #f3f4f6; color: #6b7280; }

.team-summary-table .skill-chip {
    display: inline-block;
    padding: 3px 8px;
    margin: 2px 3px 2px 0;
    background: var(--surface-2, #f3f4f6);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: nowrap;
}
.team-summary-table .skill-chip strong {
    margin-left: 4px;
    color: var(--text-primary);
}
.team-summary-table .ts-cell-best .skill-chip { border-color: #86efac; background: #f0fdf4; }
.team-summary-table .ts-cell-weak .skill-chip { border-color: #fca5a5; background: #fef2f2; }

.team-summary-table .team-summary-row-empty {
    background: rgba(251, 191, 36, 0.08);
}

/* Mobile: convert table rows to cards */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .team-summary-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    .team-summary-table thead { display: none; }
    .team-summary-table, .team-summary-table tbody, .team-summary-table tr, .team-summary-table td {
        display: block;
        width: 100%;
    }
    .team-summary-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--border-color, #dee2e6);
        border-radius: 10px;
        padding: 12px;
        background: var(--surface, #fff);
    }
    .team-summary-table td {
        padding: 6px 0;
        border: none;
        text-align: left;
    }
    .team-summary-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.7rem;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 2px;
        letter-spacing: 0.5px;
    }
    .team-summary-table .ts-cell-name { min-width: 0; padding-bottom: 8px; border-bottom: 1px solid var(--border-color, #eee); margin-bottom: 6px; }
    .team-summary-table .ts-cell-avg { display: inline-block; width: auto; text-align: left; }
    .team-summary-table .ts-cell-actions { padding-top: 10px; }
    .team-summary-table .btn-group-sm .btn { flex: 1; }
}

/* assessment styles (L18802-L19410) → styles/modules/assessment.css */

/* ==========================================================================
   LEGACY: Desktop dashboard mockup alignment (theme/chrome only)
   Spacing, padding, section-header shape, and table borders are overridden by
   "Layout density v1" at end of file. Do not add new shell spacing rules here.
   ========================================================================== */
@media (min-width: 769px) {
    #main-app.dashboard-container {
        --bg-surface-1: #f5f7fb;
        --bg-surface-2: #ffffff;
        --bg-surface-3: #f8fafc;
        --bg-muted: #eef4fb;
        --bg-card: #ffffff;
        --bg-input: #ffffff;
        --bg-secondary: #f8fafc;
        --text-primary: #172033;
        --text-secondary: #65748b;
        --text-muted: #65748b;
        --brand-color: #0d3b66;
        --brand-hover: #082f49;
        --brand-color-rgb: 13, 59, 102;
        --primary-color: #0d3b66;
        --primary-hover: #082f49;
        --border-color: #d7dfeb;
        --success-color: #2d6a4f;
        --warning-color: #b45309;
        --error-color: #b91c1c;
        --danger-color: #b91c1c;
        --purple-color: #6656c7;
        --sidebar-bg: #121b2d;
        --sidebar-text: #c4d1e6;
        --sidebar-text-active: #ffffff;
        --sidebar-accent: #e85d04;
        --sidebar-accent-rgb: 232, 93, 4;
        --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
        --sidebar-section-label: #7f91af;
        --sidebar-border: #24314d;
        --border-radius: 8px;
        --border-radius-lg: 8px;
        --shadow: 0 16px 36px rgba(23, 32, 51, 0.08);
        grid-template-columns: 264px minmax(0, 1fr) !important;
        grid-template-rows: 72px minmax(0, 1fr) !important;
        background: #f5f7fb;
    }

    #main-app .app-sidebar {
        min-width: 264px !important;
        padding: 16px 12px;
        gap: 14px;
        background: #121b2d;
        border-right: 1px solid #1e2a42;
        color: #dce7f7;
    }

    #main-app .sidebar-header {
        padding: 4px 8px 14px;
        border-bottom: 1px solid #24314d;
    }

    #main-app .sidebar-brand-info h2 {
        color: #ffffff;
        font-size: 19px;
        line-height: 1;
        letter-spacing: 0;
        font-weight: 900;
    }

    #main-app .version-badge {
        display: block;
        width: fit-content;
        margin-top: 4px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #93a5c2;
        font-size: 11px;
        font-weight: 800;
    }

    #main-app .sidebar-app-logo {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: #1763c6;
        padding: 7px;
    }

    #main-app .sidebar-company-brand {
        margin: 0;
        padding: 12px;
        border: 1px solid #263554;
        border-radius: 8px;
        background: #17233a;
        gap: 10px;
    }

    #main-app .sidebar-company-logo {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: #223352;
    }

    #main-app .sidebar-company-text {
        min-width: 0;
        display: grid;
        gap: 2px;
    }

    #main-app .sidebar-company-name {
        color: #ffffff;
        font-size: 13px;
        font-weight: 800;
    }

    #main-app .sidebar-company-text small {
        color: #93a5c2;
        font-size: 11px;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #main-app .sidebar-nav {
        padding: 0;
        gap: 0;
    }

    #main-app .sidebar-group {
        margin: 0;
    }

    #main-app .sidebar-section-label {
        margin: 10px 10px 4px;
        padding: 0;
        color: #7f91af;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 0.08em;
    }

    #main-app .app-sidebar button.sidebar-nav-item {
        min-height: 42px !important;
        padding: 0 12px;
        border-radius: 8px;
        color: #c4d1e6;
        font-size: 14px;
        font-weight: 700;
        gap: 10px;
        justify-content: flex-start;
    }

    #main-app .app-sidebar button.sidebar-nav-item:hover {
        background: rgba(255, 255, 255, 0.06) !important;
        color: #ffffff;
    }

    #main-app .app-sidebar button.sidebar-nav-item.active {
        background: rgba(84, 150, 255, 0.16) !important;
        color: #ffffff;
        font-weight: 800;
    }

    #main-app .sidebar-nav-item.active i,
    #main-app .sidebar-nav-item i {
        color: inherit;
        opacity: 1;
        font-size: 18px;
        width: 22px;
    }

    #main-app .sidebar-help {
        margin-top: auto;
        padding: 12px 0 0;
        border-top: 1px solid #24314d;
    }

    #main-app .sidebar-help-btn {
        min-height: 42px;
        padding: 0 12px;
        border-radius: 8px;
        font-weight: 700;
    }

    #main-app .sidebar-footer {
        padding: 0;
        border-top: 0;
        display: grid;
        gap: 8px;
    }

    #main-app .sidebar-user-info {
        min-height: 50px;
        padding: 8px;
        border-radius: 8px;
        background: #17233a;
    }

    #main-app .sidebar-user-avatar {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        background: #e8f1ff;
        color: #124d9a;
    }

    #main-app .sidebar-actions {
        justify-content: flex-end;
    }

    #main-app .app-header {
        height: 60px !important;
        padding: 0 24px;
        gap: 16px;
        background: #ffffff;
        border-bottom: 1px solid #d7dfeb;
        color: #172033;
    }

    #main-app .header-left {
        flex: 0 0 auto;
        min-width: 0;
        gap: 0;
    }

    #main-app .desktop-page-title {
        display: block;
        min-width: 0;
        max-width: 100%;
    }

    #main-app .desktop-page-title h1 {
        margin: 0;
        color: #172033;
        font-size: 21px;
        line-height: 1.05;
        font-weight: 800;
        letter-spacing: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: left;
    }

    #main-app .desktop-page-title p {
        margin: 5px 0 0;
        color: #65748b;
        font-size: 13px;
        line-height: 1.35;
    }

    #main-app .sub-nav-container {
        flex: 1;
        align-self: stretch;
        height: 100%;
        min-width: 0;
        margin: 0;
        padding-left: 6px;
        border-left: 0;
        justify-content: flex-start;
    }

    #main-app .sub-nav:not([style*="display: none"]) {
        display: inline-flex !important;
    }

    #main-app .sub-nav {
        align-items: center;
        gap: 6px;
        height: 100%;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        overflow-x: auto;
        scrollbar-width: none;
    }

    #main-app .sub-nav::-webkit-scrollbar {
        display: none;
    }

    #main-app .sub-nav-btn {
        position: relative;
        min-height: 0;
        height: 36px;
        max-width: 260px;
        padding: 0 11px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #52627a;
        font-size: 13px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #main-app .sub-nav-btn[style*="display: none"] {
        display: none !important;
    }

    #main-app .sub-nav-btn:hover {
        background: #f2f6fb;
        color: #124d9a;
    }

    #main-app .sub-nav-btn::after {
        content: "";
        position: absolute;
        right: 0;
        bottom: 4px;
        left: 0;
        height: 2px;
        border-radius: 999px 999px 0 0;
        background: transparent;
    }

    #main-app .sub-nav-btn.active,
    #main-app .sub-nav-btn[aria-selected="true"] {
        background: rgba(232, 93, 4, 0.1);
        color: #e85d04;
        border: 0;
        box-shadow: none;
        font-weight: 750;
    }

    #main-app .sub-nav-btn.active::after,
    #main-app .sub-nav-btn[aria-selected="true"]::after {
        background: #e85d04;
    }

    #main-app .sub-nav-btn span:not(.sub-nav-count-badge) {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1;
    }

    #main-app .sub-nav-btn i {
        flex: 0 0 auto;
        color: inherit;
        font-size: 15px;
        line-height: 1;
        opacity: 0.85;
    }

    #main-app .sub-nav-btn.active i,
    #main-app .sub-nav-btn[aria-selected="true"] i {
        opacity: 1;
    }

    #main-app .header-user,
    #main-app .top-actions {
        gap: 8px;
    }

    #main-app .header-icon-btn,
    #main-app .notification-bell-btn,
    #main-app .profile-dropdown-trigger,
    #main-app .sidebar-action-btn {
        border: 1px solid #d7dfeb;
        border-radius: 8px;
        background: #ffffff;
        color: #172033;
    }

    #main-app .app-container {
        /* Padding: see Layout density v1 §5 at EOF */
        background: #f5f7fb;
    }

    #main-app .tab-content.active {
        display: block !important;
    }

    #main-app h1,
    #main-app h2,
    #main-app h3,
    #main-app h4 {
        color: #172033;
        letter-spacing: 0;
        text-align: left;
    }

    #main-app p,
    #main-app small,
    #main-app .helper-text,
    #main-app .text-muted {
        color: var(--text-muted) !important;
    }

    #main-app .card,
    #main-app .user-dashboard-card,
    #main-app .stat-card,
    #main-app .company-cockpit-panel,
    #main-app .onboarding-card,
    #main-app .quick-actions,
    #main-app .approval-card,
    #main-app .panel {
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-card);
        box-shadow: var(--shadow);
    }

    #main-app .section-header {
        margin-bottom: var(--section-gap, 12px);
        padding: 0 0 var(--stack-gap, 8px);
        border: 0;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        align-items: center;
    }

    #main-app .section-header h2 {
        margin: 0;
        font-size: 1.2rem;
        line-height: 1.2;
        font-weight: 800;
    }

    #main-app .section-subheader {
        margin-bottom: var(--section-gap, 12px);
        padding: 0 2px;
    }

    #main-app .section-subheader h3 {
        margin: 0;
        font-size: 1.05rem;
        line-height: 1.25;
        font-weight: 750;
    }

    #main-app .stats-grid {
        gap: var(--section-gap, 12px);
        margin-bottom: var(--section-gap, 12px);
    }

    #main-app .stat-card {
        min-height: 92px;
        padding: var(--card-pad, 12px);
        align-items: center;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: var(--shadow);
    }

    #main-app .stat-card:hover {
        transform: translateY(-1px);
        border-color: rgba(var(--brand-color-rgb), 0.45);
        box-shadow: var(--shadow-hover);
    }

    #main-app .stat-icon {
        width: 42px;
        height: 42px;
        border-radius: 8px;
    }

    #main-app .stat-value {
        color: var(--text-primary);
        font-size: 30px;
        font-weight: 900;
        letter-spacing: 0;
    }

    #main-app .stat-label {
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 800;
    }

    #main-app .company-cockpit-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--section-gap, 12px);
        margin: var(--section-gap, 12px) 0;
    }

    #main-app .company-cockpit-panel {
        padding: 0;
        overflow: hidden;
        box-shadow: var(--shadow-hover);
    }

    #main-app .company-cockpit-head {
        min-height: 58px;
        margin: 0;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-color);
    }

    #main-app .company-cockpit-head h4 {
        font-size: 18px;
        font-weight: 900;
    }

    #main-app .company-cockpit-list {
        padding: 16px;
        gap: 10px;
    }

    #main-app .company-cockpit-row,
    #main-app .company-cockpit-action {
        min-height: 58px;
        padding: 12px;
        border-radius: 8px;
        background: var(--bg-surface-2);
        border-color: var(--border-color);
    }

    #main-app .company-cockpit-row i,
    #main-app .company-cockpit-action i {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: rgba(var(--brand-color-rgb), 0.12);
        color: var(--brand-fg, var(--brand-color));
        font-size: 19px;
    }

    #main-app .director-cockpit {
        display: grid;
        gap: var(--section-gap, 12px);
        margin-bottom: var(--section-gap, 12px);
    }

    #main-app .director-section-head {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 16px;
    }

    #main-app .director-section-head .eyebrow {
        color: #124d9a;
        font-size: 12px;
        font-weight: 900;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    #main-app .director-section-head h2 {
        margin: 5px 0 0;
        font-size: 30px;
        line-height: 1.14;
        font-weight: 900;
    }

    #main-app .director-section-head p {
        max-width: 100%;
        margin: 6px 0 0;
        color: #65748b;
    }

    #main-app .director-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }

    #main-app .director-risk-strip {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    #main-app .director-risk-card {
        min-height: 132px;
        padding: 14px;
        border: 1px solid #d7dfeb;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 8px 18px rgba(23, 32, 51, 0.04);
    }

    #main-app .director-risk-card strong {
        display: block;
        margin-top: 10px;
        color: #172033;
        font-size: 15px;
        font-weight: 900;
    }

    #main-app .director-risk-card p {
        margin: 6px 0 0;
        color: #65748b;
        font-size: 13px;
        line-height: 1.45;
    }

    #main-app .director-cockpit-layout {
        display: grid;
        grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
        gap: 16px;
        align-items: start;
    }

    #main-app .director-panel {
        min-width: 0;
        overflow: hidden;
        border: 1px solid #d7dfeb;
        border-radius: 8px;
        background: #ffffff;
        box-shadow: 0 16px 36px rgba(23, 32, 51, 0.08);
    }

    #main-app .director-panel-head {
        min-height: 58px;
        padding: 14px 16px;
        border-bottom: 1px solid #d7dfeb;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
    }

    #main-app .director-panel-head h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 900;
    }

    #main-app .director-panel-head .badge {
        max-width: 100%;
        white-space: nowrap;
    }

    #main-app .director-panel-body {
        padding: 16px;
    }

    #main-app .director-priority-list {
        display: grid;
        gap: 10px;
    }

    #main-app .director-row {
        width: 100%;
        min-height: 62px;
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 12px;
        border: 1px solid #d7dfeb;
        border-radius: 8px;
        background: #ffffff;
    }

    #main-app .director-row > i {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        display: grid;
        place-items: center;
        background: #eef4fb;
        color: #124d9a;
        font-size: 19px;
    }

    #main-app .director-row strong,
    #main-app .director-row small {
        display: block;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    #main-app .director-row strong {
        color: #172033;
        font-size: 14px;
        font-weight: 900;
    }

    #main-app .director-row small {
        margin-top: 3px;
        color: #65748b;
        font-size: 12px;
        line-height: 1.35;
    }

    /* Legacy fake chart removed — health panel uses .director-assessment-health stats/empty-state */

    #main-app .badge,
    #main-app .sidebar-approval-badge {
        min-height: 24px;
        border-radius: 999px;
        font-size: 12px;
        font-weight: 900;
    }

    #main-app .btn-primary,
    #main-app button.btn-primary,
    #main-app .btn-secondary,
    #main-app button.btn-secondary,
    #main-app .quick-action-btn {
        min-height: 38px;
        border-radius: 8px;
        font-weight: 900;
    }

    @media (max-width: 860px) {
        #main-app .director-risk-strip {
            grid-template-columns: 1fr;
        }

        #main-app .director-cockpit-layout {
            grid-template-columns: 1fr;
        }
    }
}

/* shell-density (L8032-L9900) → styles/modules/shell-density.css */

