/* ============================================
   GHAZAWY MORTABAT - Clean Operations Dashboard
   Mobile-First Optimized Version
   ============================================ */

/* ---- Design Tokens ---- */
:root {
    --font-ui: "IBM Plex Sans Arabic", "SF Arabic", "SF Pro Arabic", "Segoe UI", Tahoma, sans-serif;
    --font-admin-ui: var(--font-ui);
    --font-size-body: 16px;
    --font-size-heading: 22px;

    /* ---- Light Mode (Default) ---- */
    --brand-red: #B91C1C;
    --brand-red-dark: #7F1D1D;
    --bg-page: #F6F7F9;
    --surface: #FFFFFF;

    --primary: var(--brand-red);
    --primary-light: #FFF1F2;
    --secondary: #F3F4F6;
    --bg-color: var(--bg-page);

    --text-main: #111827;
    --text-muted: #667085;
    --border: #E5E7EB;
    --danger: #DC2626;
    --success: #10B981;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 8px 18px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 16px 32px rgba(16, 24, 40, 0.10);
    --shadow-xl: 0 22px 44px rgba(16, 24, 40, 0.14);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);

    /* ---- Gradient Presets ---- */
    --grad-primary: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 100%);
    --grad-sidebar: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);

    /* ---- Additional Color Variables ---- */
    --color-focus-teal: #0F766E;
    --color-red-light: #FFF1F2;
    --color-red-dark: #991B1B;
    --color-table-border: #F3F4F6;

    /* ---- Custom theme-sensitive overrides ---- */
    --bg-accordion-header: rgba(248, 250, 252, 0.5);
    --bg-accordion-header-hover: rgba(248, 250, 252, 0.8);
    --bg-accordion-header-active: rgba(248, 250, 252, 0.9);
    --border-card: #E5E7EB;
    --bg-table-header: #F9FAFB;
    --bg-table-odd: #F9FAFB;
    --bg-table-even: #ffffff;
    --border-table: #F3F4F6;
    --text-table-th: #374151;
    --bg-minimal-kpi: var(--surface);
    --border-minimal-kpi: var(--border);
    --admin-btn-users-bg: #FFFFFF;
    --admin-btn-users-border: #3B82F6;
    --admin-btn-directory-bg: #FFFFFF;
    --admin-btn-directory-border: var(--brand-red);
    --admin-btn-upload-bg: #FFFFFF;
    --admin-btn-upload-border: #059669;
    --admin-btn-logs-bg: #FFFFFF;
    --admin-btn-logs-border: #475467;
    --admin-btn-payroll-bg: #FFFFFF;
    --admin-btn-payroll-border: #D97706;
    --admin-btn-upload-payroll-bg: #FFFFFF;
    --admin-btn-upload-payroll-border: #92400E;
    --admin-btn-insurance-bg: #FFFFFF;
    --admin-btn-insurance-border: #0284C7;
    --admin-btn-regularity-bg: #FFFFFF;
    --admin-btn-regularity-border: #22C55E;
    --wipe-button-bg: #EF4444;
    --wipe-button-hover-bg: #DC2626;
    --bg-textarea-file: var(--surface);
    --border-textarea-file: var(--border);
    --alert-info-bg: rgba(15, 118, 110, 0.05);
    --bg-footer: #FFFFFF;
    --border-footer: #E5E7EB;

    /* Safe area support (iPhone notch / home bar) */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    /* Secondary button gradients */
    --btn-secondary-bg: #FFFFFF;
    --btn-secondary-bg-hover: #F9FAFB;
    --btn-secondary-bg-active: #F3F4F6;

    /* Ticket row gradients */
    --bg-ticket-open: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 252, 254, 0.96));
    --bg-ticket-resolved: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.92));
}


/* ---- Base Reset & Typography ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html.app-booting,
html.app-booting *,
html.app-booting *::before,
html.app-booting *::after {
    transition: none !important;
}

html {
    /* Prevent font size inflation on iOS landscape */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    height: 100%;
    background: var(--bg-page);
}

body {
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
    background: var(--bg-page);
    color: var(--text-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    /* Prevent horizontal overflow on mobile */
    overflow-x: hidden;
    /* Respect safe areas */
    padding-bottom: var(--safe-bottom);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1 0 auto;
    width: 100%;
}

.hidden {
    display: none !important;
}

body[data-user-role="admin"] #admin-nav-menu-toggle {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

h2,
h3,
h4 {
    color: var(--text-main);
    font-weight: 700;
    font-size: var(--font-size-heading);
}

h2 {
    margin-bottom: 10px;
}

p {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: var(--font-size-body);
}

/* ---- Utilities ---- */
.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 15px;
}

.mt-4 {
    margin-top: 20px;
}

.pt-4 {
    padding-top: 20px;
}

.mb-3 {
    margin-bottom: 15px;
}

.mb-4 {
    margin-bottom: 20px;
}

.full-width {
    width: 100%;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */
nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    /* Respect top safe area (notch) */
    padding-top: calc(12px + var(--safe-top));
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    max-width: min(1880px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-area img {
    height: 36px;
    width: auto;
}

.logo {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
    letter-spacing: 0;
    white-space: nowrap;
}

.user-info {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 12px;
    min-width: 0;
    /* Allow shrinking */
    flex-shrink: 1;
}

.badge {
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    border: 1px solid rgba(155, 27, 48, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* ============================================
   CARDS & LAYOUTS (Soft Modern)
   ============================================ */
.section-container {
    max-width: 1560px;
    width: 96%;
    margin: 24px auto;
    padding: 0 20px;
}

.section-container-wide {
    max-width: none;
    width: 100%;
    padding-inline: clamp(12px, 1.5vw, 28px);
}

.card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-card);
    transition: var(--transition);
}

button[id^="btn-back-to-dashboard"] {
    background: #ECFDF5 !important;
    border: 1px solid rgba(5, 150, 105, 0.28) !important;
    color: #047857 !important;
    padding: 0 16px !important;
    min-height: 44px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.08) !important;
}

button[id^="btn-back-to-dashboard"] svg {
    color: currentColor !important;
    stroke: currentColor !important;
    flex: 0 0 auto;
}

button[id^="btn-back-to-dashboard"] span {
    color: currentColor !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    white-space: nowrap;
}

button[id^="btn-back-to-dashboard"]:hover {
    background: #D1FAE5 !important;
    border-color: rgba(4, 120, 87, 0.42) !important;
    color: #065F46 !important;
    transform: translateY(-1px);
}

/* Hover only on non-touch devices */
@media (hover: hover) {
    .card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-4px);
        border-color: rgba(0, 0, 0, 0.08);
    }

    .section-container > .card:hover:not(.login-card) {
        transform: none;
    }
}

/* ============================================
   LOGIN CARD (Premium Centered)
   ============================================ */
.login-card {
    max-width: 460px;
    margin: 12vh auto;
    text-align: center;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--grad-primary);
}

.login-logo {
    width: 140px;
    margin: 0 auto 20px;
    display: block;
}

.login-card h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
    color: var(--text-main);
}

.login-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ============================================
   FORMS & INPUTS (Soft UI)
   ============================================ */
.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

input,
textarea,
select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    /* font-size 1rem prevents iOS auto-zoom on focus */
    font-size: 1rem;
    font-family: var(--font-ui);
    transition: var(--transition-fast);
    background-color: var(--surface);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.02);
    outline: none;
    color: var(--text-main);
    /* Prevents double-tap zoom on iOS */
    touch-action: manipulation;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-focus-teal);
    background-color: var(--surface);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1), inset 0 2px 6px rgba(0, 0, 0, 0.02);
    transform: scale(1.01);
    outline: none;
}

/* ============================================
   BUTTONS (Pill Shaped & Clean)
   ============================================ */
button:not(.close-modal) {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-ui);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    /* Minimum 48px touch target (modern HIG) */
    min-height: 48px;
    letter-spacing: 0;
    /* Remove default tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(17, 17, 17, 0.2);
    outline: none;
}

.btn-primary:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

@media (hover: hover) {
    .btn-primary:hover {
        background: linear-gradient(135deg, #1a1a1a 0%, #404040 100%);
        transform: translateY(-3px);
        box-shadow: 0 8px 28px rgba(17, 17, 17, 0.35);
    }
}

.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(17, 17, 17, 0.2);
}

.btn-outline {
    background: var(--surface);
    border: 2px solid var(--border);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    outline: none;
}

.btn-outline:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

@media (hover: hover) {
    .btn-outline:hover {
        background: rgba(0, 0, 0, 0.02);
        border-color: var(--text-main);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    }
}

.btn-outline:active {
    background: rgba(0, 0, 0, 0.04);
    transform: translateY(0);
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-main);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    outline: none;
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

@media (hover: hover) {
    .btn-secondary:hover {
        background: var(--btn-secondary-bg-hover);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    }
}

.btn-secondary:active {
    background: var(--btn-secondary-bg-active);
    transform: translateY(0);
}

/* Google Login Button */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--surface);
    color: var(--text-main);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-sm);
    font-size: 1rem;
    padding: 14px 22px;
    border-radius: 12px;
    width: 100%;
    font-weight: 600;
    transition: var(--transition-fast);
    outline: none;
}

.google-btn:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

@media (hover: hover) {
    .google-btn:hover {
        background: rgba(0, 0, 0, 0.02);
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
        border-color: var(--text-main);
    }
}

.google-btn:active {
    background: rgba(0, 0, 0, 0.04);
    transform: translateY(-1px);
}

.google-btn:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.auth-browser-warning {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    padding: 14px;
    color: #7C2D12;
    background: #FFF7ED;
    border: 1px solid #FDBA74;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.7;
    text-align: right;
}

.auth-copy-link {
    align-self: stretch;
    padding: 9px 12px;
    color: #7C2D12;
    background: #FFFFFF;
    border: 1px solid #FB923C;
    border-radius: 9px;
    font-weight: 700;
}

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
}

.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

#dashboard-section .dashboard-sidebar {
    background: var(--grad-sidebar);
    backdrop-filter: blur(12px);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
    position: relative;
    transition: var(--transition);
}

#dashboard-section .dashboard-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--grad-primary);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

#dashboard-section .dashboard-sidebar h4 {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border);
}

.admin-review-mode .dashboard-grid {
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
}

/* Payroll explorer refinements */
#payroll-explorer-section,
#payroll-explorer-section input,
#payroll-explorer-section select,
#payroll-explorer-section button,
.payroll-detail-shell {
    font-family: var(--font-ui) !important;
}

#payroll-explorer-section .payroll-filter-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: #9CA3AF;
    pointer-events: none;
    z-index: 2;
}

#payroll-explorer-section .payroll-filter-field input,
#payroll-explorer-section .payroll-filter-field select {
    min-height: 46px;
    line-height: 1.4;
}

#full-payroll-table .payroll-sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: normal;
    transition: color 0.2s ease, background 0.2s ease;
}

#full-payroll-table .payroll-sortable-th:hover,
#full-payroll-table .payroll-sortable-th.is-active {
    color: var(--primary) !important;
    background: rgba(14, 165, 233, 0.08) !important;
}

#full-payroll-table .sort-indicator {
    display: inline-flex;
    min-width: 18px;
    margin-inline-start: 6px;
    color: var(--primary);
    font-weight: 900;
}

/* Removed the retired admin review hero and duplicate KPI skin. */
.tickets-workspace-card {
    border: none;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
    background: var(--surface);
    transition: var(--transition);
}

@media (hover: hover) {
    .tickets-workspace-card:hover {
        box-shadow: var(--shadow-md);
    }
}

.tickets-workspace-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.tickets-section-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    max-width: 720px;
}

.tickets-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tickets-container-shell {
    border-radius: var(--radius-lg);
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.tickets-review-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 12px;
}

.tickets-review-table thead tr {
    background: transparent !important;
    border-bottom: none !important;
}

.tickets-review-table th {
    padding: 8px 16px 12px !important;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.tickets-review-table th:nth-child(2),
.tickets-review-table td:nth-child(2) {
    width: 95px;
}

.tickets-review-table th:nth-child(6),
.tickets-review-table td:nth-child(6) {
    width: 18%;
}

.tickets-review-table th:nth-child(3),
.tickets-review-table td:nth-child(3),
.tickets-review-table th:nth-child(4),
.tickets-review-table td:nth-child(4) {
    width: 10%;
}

.tickets-review-table th:last-child,
.tickets-review-table td:last-child {
    width: 17%;
}

.ticket-review-row td {
    border: none;
    transition: var(--transition);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

@media (hover: hover) {
    .ticket-review-row:hover td {
        background: var(--primary-light) !important;
        box-shadow: var(--shadow-md);
    }
}

.ticket-review-row td:first-child {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}

.ticket-review-row td:last-child {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}

.ticket-review-row.is-open td {
    background: var(--bg-ticket-open);
}

.ticket-review-row.is-open td:first-child {
    box-shadow: inset -4px 0 0 rgba(217, 119, 6, 0.9);
}

.ticket-review-row.is-resolved td {
    background: var(--bg-ticket-resolved);
}

.ticket-queue-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.ticket-queue-pill-new {
    background: rgba(245, 158, 11, 0.12);
    color: #B45309;
}

.ticket-queue-pill-awaiting {
    background: rgba(14, 165, 233, 0.12);
    color: #0369A1;
}

.ticket-action-btn {
    border-radius: 999px;
    padding: 6px 14px !important;
    background: rgba(255, 255, 255, 0.94);
    min-height: 40px;
}

.ticket-action-btn-danger {
    background: var(--color-red-light);
    color: var(--color-red-dark);
    border-color: #FBCFE8;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.04));
    border-radius: var(--radius-md);
    border: 2px dashed var(--border);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

@media (hover: hover) {
    .empty-state:hover {
        border-color: var(--text-muted);
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.06));
    }
}

/* ============================================
   GLOBAL TABLES (Soft Design)
   ============================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    -webkit-overflow-scrolling: touch;
}

.app-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-data-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 8px;
    color: var(--text-main);
    text-align: right;
    font-size: clamp(0.76rem, 0.72vw, 0.92rem);
    line-height: 1.55;
}

.app-data-table th,
.app-data-table td {
    min-width: 0;
    max-width: none;
    padding: clamp(8px, 0.72vw, 14px) clamp(6px, 0.75vw, 16px);
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
    vertical-align: middle;
}

.app-data-table th {
    background: var(--bg-table-header);
    color: var(--text-table-th);
    font-size: clamp(0.72rem, 0.66vw, 0.86rem);
    font-weight: 800;
    line-height: 1.4;
}

.app-data-table tbody tr:nth-child(even) td {
    background: var(--bg-table-odd);
}

.app-data-table td button,
.app-data-table td .btn-primary,
.app-data-table td .btn-secondary,
.app-data-table td .btn-outline {
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    font-size: clamp(0.7rem, 0.62vw, 0.84rem);
}

.app-data-table td.table-actions-cell,
.app-data-table td[data-label="إجراءات"] {
    white-space: normal;
}

.app-data-table td.is-muted {
    font-weight: 800;
    color: var(--text-muted);
}

.app-data-table td.is-strong {
    font-weight: 700;
}

.app-data-table td.is-amount {
    font-weight: 800;
}

.app-data-table td.is-net {
    font-weight: 900;
    color: var(--primary);
}

.app-data-table .table-status-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.app-data-table .table-status-pill.is-ok {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
}

.app-data-table .table-status-pill.is-bad {
    background: rgba(239, 68, 68, 0.1);
    color: #B91C1C;
}

.app-data-table td.table-empty-cell {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
}

.app-table-caption,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.table-responsive table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 8px;
    margin-top: 10px;
}

.table-responsive thead tr,
.directory-table thead tr {
    background: transparent !important;
    border-bottom: none !important;
}

.table-responsive th,
.directory-table th {
    padding: 10px 16px !important;
    color: var(--text-muted) !important;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none !important;
    white-space: nowrap;
}

.table-responsive th:focus,
.directory-table th:focus {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

.table-responsive tbody tr td,
.directory-table tbody tr td {
    background: var(--surface);
    padding: 16px !important;
    border-top: none !important;
    border-bottom: none !important;
    border-right: none !important;
    border-left: none !important;
    vertical-align: middle;
    transition: var(--transition-fast);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.table-responsive tbody tr:focus-within td,
.directory-table tbody tr:focus-within td {
    background: rgba(0, 0, 0, 0.04);
    box-shadow: inset 0 0 0 2px var(--color-focus-teal);
}

@media (hover: hover) {
    .table-responsive tbody tr:hover td,
    .directory-table tbody tr:hover td {
        background: rgba(0, 0, 0, 0.02);
        box-shadow: inset 0 0 0 1px var(--border);
        transform: translateY(-2px);
    }
}

.table-responsive tbody tr td:first-child,
.directory-table tbody tr td:first-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.table-responsive tbody tr td:last-child,
.directory-table tbody tr td:last-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* ============================================
   LOADER & SPINNER
   ============================================ */
.loader-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.3s ease;
    padding: 16px;
    /* Respect safe areas inside modal overlay */
    padding-top: calc(16px + var(--safe-top));
    padding-bottom: calc(16px + var(--safe-bottom));
}

body.app-modal-open {
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    max-width: 95%;
    /* Increased from 580px */
    width: auto;
    min-width: 500px;
    border: none !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    background: var(--surface) !important;
    animation: dropIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    /* Scrollable modal on small screens */
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.nowrap {
    white-space: nowrap !important;
}

@keyframes dropIn {
    from {
        transform: translateY(-30px) scale(0.98);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.close-modal {
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: var(--transition-fast);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
    background: transparent;
    border: none;
    font-family: inherit;
    padding: 0;
    outline: none;
}

.close-modal:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

@media (hover: hover) {
    .close-modal:hover {
        color: var(--danger);
        background: rgba(239, 68, 68, 0.1);
        transform: rotate(90deg) scale(1.1);
    }
}

.close-modal:active {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
    transform: rotate(90deg) scale(1);
}

/* Ticket detail redesign */
.ticket-detail-modal-card {
    width: min(96vw, 920px) !important;
    max-width: min(96vw, 920px) !important;
    min-width: 0 !important;
    max-height: 92vh;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 18px !important;
    background: var(--surface) !important;
}

.ticket-detail-modal-header {
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.ticket-detail-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ticket-detail-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--primary-light);
    flex: 0 0 auto;
}

.ticket-detail-modal-title h3 {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 900;
    color: var(--text-main);
}

.ticket-detail-modal-title p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.5;
}

.ticket-detail-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--bg-table-odd);
    color: var(--text-muted);
    flex: 0 0 auto;
}

.ticket-detail-modal-body {
    padding: 22px;
    max-height: calc(92vh - 82px);
    overflow-y: auto;
    background: var(--bg-color);
}

/* Obsolete ticket-detail content skin removed; the active modal uses ticket-detail-modal-* classes. */
.ticket-detail-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.ticket-detail-actions h4 {
    margin: 0 0 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 900;
}

@media (max-width: 720px) {
    .ticket-detail-modal-header,
    .ticket-detail-modal-body {
        padding: 16px;
    }

    .ticket-detail-modal-title p {
        display: none;
    }

}

/* ============================================
   NOTIFICATION BELL
   ============================================ */
#notification-bell {
    position: relative;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    transition: var(--transition-fast);
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    background: transparent;
    border: none;
    outline: none;
}

#notification-bell:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

@media (hover: hover) {
    #notification-bell:hover {
        background: rgba(0, 0, 0, 0.04);
    }

    #notification-bell:hover svg {
        stroke: var(--primary);
        transform: scale(1.1);
    }
}

#notification-bell svg {
    transition: var(--transition-fast);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
    background-clip: padding-box;
}

/* ============================================
   ADMIN ACTION BUTTONS (NEW DESIGN)
   ============================================ */
.admin-action-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px;
    margin-top: 10px;
    margin-bottom: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    text-align: right;
    font-family: var(--font-ui);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-height: 48px;
    border: none;
    background: rgba(248, 250, 252, 0.5);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    outline: none;
}

.admin-action-btn:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

@media (hover: hover) {
    .admin-action-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        background: rgba(248, 250, 252, 0.8);
    }

    .admin-action-btn:hover svg {
        transform: scale(1.15) rotate(5deg);
    }
}

.admin-action-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.admin-action-btn svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.admin-btn-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.admin-btn-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
    color: inherit;
}

.admin-export-featured {
    background: var(--grad-primary);
    border: 2px solid rgba(51, 51, 51, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: white;
}

@media (hover: hover) {
    .admin-export-featured:hover {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
        border-color: rgba(51, 51, 51, 0.4);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
        transform: translateY(-4px);
    }
}

.admin-export-featured:active {
    background: linear-gradient(135deg, #0f0f0f 0%, #1f1f1f 100%);
    transform: translateY(-1px);
}

.admin-action-btn-compact {
    padding: 12px 14px;
    gap: 10px;
    min-height: 44px;
}

.admin-action-btn-compact .admin-btn-title {
    font-size: 14px;
    font-weight: 700;
}

/* ============================================
   MINIMALIST KPI CARDS
   ============================================ */
.minimal-kpi-card {
    background: var(--bg-minimal-kpi);
    border: 1px solid var(--border-minimal-kpi);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-fast);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

@media (hover: hover) {
    .minimal-kpi-card:hover {
        border-color: rgba(0, 0, 0, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        transform: translateY(-2px);
    }
}

.minimal-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.minimal-kpi-content {
    flex: 1;
    text-align: right;
    min-width: 0;
}

.minimal-kpi-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: 0;
}

.minimal-kpi-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.3;
}

/* ============================================
   TICKET MODAL ACTION BUTTONS
   ============================================ */
.ticket-action-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 10px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    min-height: 56px;
    min-width: 64px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    outline: none;
}

.ticket-action-button:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

@media (hover: hover) {
    .ticket-action-button:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    }

    .ticket-action-button:hover svg {
        transform: scale(1.15) rotate(8deg);
    }
}

.ticket-action-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.ticket-action-button svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.ticket-action-button span {
    font-size: 13px;
    line-height: 1;
}

.ticket-action-accept {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

@media (hover: hover) {
    .ticket-action-accept:hover {
        background: linear-gradient(135deg, #059669, #047857);
    }
}

.ticket-action-reject {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

@media (hover: hover) {
    .ticket-action-reject:hover {
        background: linear-gradient(135deg, #DC2626, #B91C1C);
    }
}

.ticket-action-delete {
    background: linear-gradient(135deg, #991B1B, #7F1D1D);
    color: white;
}

@media (hover: hover) {
    .ticket-action-delete:hover {
        background: linear-gradient(135deg, #7F1D1D, #6B1717);
    }
}

/* ============================================
   PAYROLL EXPLORER STYLES
   ============================================ */
.payroll-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    color: white;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    outline: none;
}

.payroll-action-btn:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

@media (hover: hover) {
    .payroll-action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    }

    .payroll-action-btn:hover svg {
        transform: scale(1.1);
    }
}

.payroll-action-btn:active {
    transform: translateY(1px);
}

.payroll-action-btn svg {
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.payroll-btn-purple {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
}

@media (hover: hover) {
    .payroll-btn-purple:hover {
        background: linear-gradient(135deg, #7C3AED, #6D28D9);
    }
}

.payroll-btn-green {
    background: linear-gradient(135deg, #10B981, #059669);
}

@media (hover: hover) {
    .payroll-btn-green:hover {
        background: linear-gradient(135deg, #059669, #047857);
    }
}

.payroll-table tbody tr {
    transition: var(--transition-fast);
    border-bottom: 1px solid var(--color-table-border);
}

@media (hover: hover) {
    .payroll-table tbody tr:hover {
        background: rgba(59, 130, 246, 0.15) !important;
        transform: scale(1.005);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
}

/* ============================================
   ACCORDION STYLES FOR ADMIN SIDEBAR
   ============================================ */
.admin-accordion {
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    transition: var(--transition-fast);
}

@media (hover: hover) {
    .admin-accordion:hover {
        box-shadow: var(--shadow-sm);
    }
}

.accordion-header {
    width: 100%;
    text-align: right;
    padding: 12px 14px;
    background: var(--bg-accordion-header);
    border: 1px solid var(--border);
    border-bottom: none;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
    font-family: var(--font-ui);
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    outline: none;
}

.accordion-header:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: -2px;
}

@media (hover: hover) {
    .accordion-header:hover {
        background: var(--bg-accordion-header-hover);
    }
}

.accordion-header:active {
    background: var(--bg-accordion-header-active);
}

.accordion-header.active {
    border-bottom: 1px solid var(--border);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-fast) cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--surface);
}

.accordion-body.open {
    max-height: 1200px;
    transition: max-height var(--transition) cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-body .admin-action-btn {
    margin: 8px auto;
    width: 94%;
}

/* ============================================
   RESPONSIVE — TABLET (≤ 900px)
   ============================================ */
@media (max-width: 900px) {

    .tickets-workspace-head {
        flex-direction: column;
    }

    .tickets-toolbar {
        width: 100%;
    }

    .tickets-toolbar .input-control,
    .tickets-toolbar select {
        width: 100% !important;
    }
}

/* ============================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================ */
@media (max-width: 768px) {

    /* --- Layout --- */
    .section-container {
        padding: 0 12px;
        margin: 16px auto;
        width: 100%;
    }

    button[id^="btn-back-to-dashboard"] {
        width: 100% !important;
    }

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

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

    /* Sidebar goes below content on mobile */
    #dashboard-section .dashboard-sidebar {
        padding: 16px;
        border-radius: var(--radius-md);
        order: 2;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        height: auto;
        background: var(--grad-sidebar);
    }
    
    #dashboard-section .dashboard-sidebar h4 {
        grid-column: 1 / -1;
        margin-bottom: 4px;
        padding-bottom: 6px;
        font-size: 0.9rem;
        border-bottom: 1px dashed var(--border);
    }
    
    #dashboard-section .dashboard-sidebar button {
        width: 100% !important;
        font-size: 0.85rem;
        margin: 0 !important;
    }

    /* --- Navigation --- */
    .nav-container {
        padding: 0 16px;
        flex-wrap: nowrap;
    }

    .logo {
        font-size: 0.95rem;
    }

    .badge {
        max-width: 100px;
        font-size: 0.72rem;
        padding: 3px 8px;
    }

    /* --- Login --- */
    .login-card {
        margin: 4vh 16px;
        padding: 32px 20px;
        border-radius: var(--radius-md);
    }

    .login-card h2 {
        font-size: 1.35rem;
    }

    .login-logo {
        width: 110px;
    }

    /* --- Cards --- */
    .card {
        padding: 18px 16px;
        border-radius: var(--radius-md);
    }

    /* --- Typography --- */
    h2 {
        font-size: 1.1rem;
    }

    h3 {
        font-size: 1rem;
    }

    .admin-kpi-card {
        padding: 16px 12px;
        border-radius: var(--radius-sm);
    }

    /* --- Minimal KPI --- */
    .minimal-kpi-card {
        padding: 14px 12px;
        gap: 12px;
    }

    .minimal-kpi-icon {
        width: 38px;
        height: 38px;
    }

    .minimal-kpi-number {
        font-size: 1.5rem;
    }

    .minimal-kpi-label {
        font-size: 0.78rem;
    }

    /* --- Ticket Action Buttons --- */
    .ticket-action-button {
        padding: 10px 8px;
        gap: 5px;
        min-height: 52px;
    }

    .ticket-action-button svg {
        width: 18px;
        height: 18px;
    }

    .ticket-action-button span {
        font-size: 11px;
    }

    /* --- Admin Buttons --- */
    .admin-action-btn {
        padding: 16px 14px;
        gap: 12px;
    }

    .admin-btn-title {
        font-size: 16px;
    }

    .admin-action-btn svg {
        width: 24px;
        height: 24px;
    }

    /* --- Payroll --- */
    .payroll-action-btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    /* --- Modals --- */
    .modal {
        align-items: flex-end;
        padding: 0;
        padding-bottom: var(--safe-bottom);
    }

    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
        max-height: 92vh;
        padding: 20px 16px !important;
        animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    #ticket-detail-modal .modal-content > div:first-child {
        padding: 16px 20px !important;
    }

    #ticket-detail-modal .modal-content > div:nth-child(2) {
        padding: 16px 20px !important;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0.6;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* --- Admin accordion --- */
    .accordion-header {
        font-size: 0.95rem;
        padding: 12px 14px;
    }

    /* --- Inputs --- */
    input,
    textarea,
    select {
        padding: 13px 16px;
        border-radius: var(--radius-sm);
    }

    /* --- Tickets table wrapper --- */
    .tickets-container-shell {
        overflow-x: auto;
        border-radius: var(--radius-md);
        -webkit-overflow-scrolling: touch;
    }

    /* --- Empty state --- */
    .empty-state {
        padding: 40px 16px;
        font-size: 0.9rem;
    }
}

/* ============================================
   RESPONSIVE — SMALL PHONES (≤ 480px)
   ============================================ */
@media (max-width: 480px) {

    .section-container {
        padding: 0 10px;
        margin: 12px auto;
    }

    .card {
        padding: 14px 12px;
        border-radius: var(--radius-sm);
    }

    .login-card {
        margin: 3vh 10px;
        padding: 24px 16px;
    }

    .minimal-kpi-number {
        font-size: 1.35rem;
    }

    /* Stack toolbar on very small phones */
    .tickets-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .tickets-toolbar>* {
        width: 100%;
    }

    /* Nav logo text hidden on tiny screens if needed */
    .nav-container {
        padding: 0 10px;
        gap: 8px;
    }

    .badge {
        max-width: 80px;
        font-size: 0.68rem;
    }

    /* Payroll buttons full width on tiny screens */
    .payroll-action-btn {
        width: 100%;
        justify-content: center;
    }

    h2 {
        font-size: 1rem;
    }

    .admin-btn-title {
        font-size: 14px;
    }

    .admin-action-btn {
        padding: 13px 12px;
        gap: 10px;
    }

    /* Top Nav optimizations for tiny screens */
    .nav-username {
        display: none !important;
    }
    .logout-label {
        display: none !important;
    }
    #btn-logout {
        padding: 8px !important;
        gap: 0 !important;
        min-height: 40px !important;
    }
    .user-info {
        gap: 8px !important;
    }
    
    /* Ticket action buttons vertical layout */
    #ticket-actions-area div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
}

/* ============================================
   ADMIN BUTTON VARIANTS & INLINE STYLE REPLACEMENTS
   ============================================ */

/* Admin Button Style Variants */
.admin-btn-export {
    background: var(--grad-primary) !important;
    color: white !important;
    border: 2px solid rgba(51, 51, 51, 0.2) !important;
}

.admin-btn-users {
    background: var(--admin-btn-users-bg) !important;
    color: var(--admin-btn-users-border) !important;
    border: 2px solid var(--admin-btn-users-border) !important;
}

.admin-btn-directory {
    background: var(--admin-btn-directory-bg) !important;
    color: var(--admin-btn-directory-border) !important;
    border: 2px solid var(--admin-btn-directory-border) !important;
}

.admin-btn-upload {
    background: var(--admin-btn-upload-bg) !important;
    color: var(--admin-btn-upload-border) !important;
    border: 2px solid var(--admin-btn-upload-border) !important;
}

.admin-btn-logs {
    background: var(--admin-btn-logs-bg) !important;
    color: var(--admin-btn-logs-border) !important;
    border: 1.5px solid var(--admin-btn-logs-border) !important;
}

.admin-btn-payroll {
    background: var(--admin-btn-payroll-bg) !important;
    color: var(--admin-btn-payroll-border) !important;
    border: 2px solid var(--admin-btn-payroll-border) !important;
}

.admin-btn-upload-payroll {
    background: var(--admin-btn-upload-payroll-bg) !important;
    color: var(--admin-btn-upload-payroll-border) !important;
    border: 2px solid var(--admin-btn-upload-payroll-border) !important;
}

.admin-btn-insurance {
    background: var(--admin-btn-insurance-bg) !important;
    color: var(--admin-btn-insurance-border) !important;
    border: 1px solid var(--admin-btn-insurance-border) !important;
}

.admin-btn-regularity {
    background: var(--admin-btn-regularity-bg) !important;
    color: var(--admin-btn-regularity-border) !important;
    border: 1px solid var(--admin-btn-regularity-border) !important;
}

/* Flex & Layout Utilities */
.flex-center-gap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.no-margin-bottom {
    margin-bottom: 0 !important;
}

/* Ticket Reason Labels - Updated for Dark Mode */
.ticket-reason-lbl {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-fast);
    margin: 0;
}

.ticket-reason-lbl:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

.ticket-reason-lbl:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 1px;
}

.ticket-reason-lbl input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--color-focus-teal);
    flex-shrink: 0;
}

.ticket-reason-lbl span {
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 600;
}

/* Admin Navigation Links - Updated for Dark Mode */
.admin-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
    cursor: pointer;
    display: inline-block;
}

.admin-nav-link:hover {
    color: var(--text-main);
}

.admin-nav-link:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 2px;
}

/* Ticket Reasons Grid */
.ticket-reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
    background: transparent;
    padding: 0;
    border: none;
}

@media (max-width: 768px) {
    .ticket-reasons-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ticket-reasons-grid {
        grid-template-columns: 1fr;
        font-size: 0.85rem;
    }
}

/* ============================================
   MODAL & FORM UTILITIES
   ============================================ */

.wipe-button {
    background: var(--wipe-button-bg) !important;
    color: white !important;
    border: none !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    font-weight: bold !important;
    border-radius: var(--radius-md) !important;
    transition: var(--transition-fast) !important;
}

.wipe-button:hover {
    background: var(--wipe-button-hover-bg) !important;
    transform: translateY(-1px) !important;
}

.wipe-button:focus-visible {
    outline: 2px solid var(--color-focus-teal) !important;
    outline-offset: 2px !important;
}

.modal-header-flex {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-input-file {
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--border-textarea-file);
    border-radius: 6px;
    background: var(--bg-textarea-file);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-fast);
}

.form-input-file:hover {
    border-color: var(--color-focus-teal);
    background: rgba(15, 118, 110, 0.05);
}

.alert-info {
    font-size: 0.85rem;
    line-height: 1.6;
    background: var(--alert-info-bg);
    color: var(--text-main);
    border-left: 4px solid var(--color-focus-teal);
    padding: 12px;
    border-radius: var(--radius-md);
}

/* Adaptive Table Elements */
table thead tr,
table thead {
    background: var(--bg-table-header) !important;
}

table thead th {
    color: var(--text-table-th) !important;
}

table tbody tr:nth-child(odd) {
    background: var(--bg-table-odd);
}

table tbody tr:nth-child(even) {
    background: var(--bg-table-even);
}

/* Footer adaptive styling */
#global-footer {
    background: var(--bg-footer) !important;
    border-color: var(--border) !important;
}

/* Manager-facing UX pass: predictable type scale and quieter shared chrome. */
body[data-user-role="admin"] {
    --font-admin-ui: var(--font-ui);
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
    line-height: 1.6;
}

body[data-user-role="admin"] #top-nav .nav-container {
    min-height: 62px;
    padding-block: 8px;
    max-width: min(1600px, calc(100% - 32px));
}

body[data-user-role="admin"] #top-nav .logo-area img {
    max-height: 34px;
    object-fit: contain;
}

body[data-user-role="admin"] #top-nav .nav-user-chip {
    min-height: 40px;
}

body[data-user-role="admin"] .admin-operations-head h1,
body[data-user-role="admin"] .advance-admin-title-row h2,
body[data-user-role="admin"] .tickets-workspace-head h2,
body[data-user-role="admin"] .salary-report-header h1 {
    line-height: 1.35;
    letter-spacing: 0;
}

body[data-user-role="admin"] .tickets-review-table {
    min-width: 1120px;
}

body[data-user-role="admin"] .advance-table-wrap {
    overflow-x: auto;
}

body[data-user-role="admin"] .advance-requests-table {
    width: max-content;
    min-width: 1500px;
    table-layout: auto;
}

body[data-user-role="admin"] .advance-requests-table th,
body[data-user-role="admin"] .advance-requests-table td,
body[data-user-role="admin"] .tickets-review-table th,
body[data-user-role="admin"] .tickets-review-table td {
    font-size: 14px;
    line-height: 1.55;
}

body[data-user-role="admin"] .advance-requests-table th {
    position: sticky;
    top: 0;
    z-index: 3;
}

body[data-user-role="admin"] #global-footer .app-footer-status {
    display: none;
}

body[data-user-role="admin"] #global-footer .app-footer-inner {
    padding-block: 12px;
}

.admin-table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
}

.admin-table-pagination label,
.admin-table-pagination > div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-table-pagination select,
.admin-table-pagination button {
    min-height: 38px;
}

body[data-user-role="admin"] .admin-table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
}

body[data-user-role="admin"] .admin-table-pagination label,
body[data-user-role="admin"] .admin-table-pagination > div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

body[data-user-role="admin"] .admin-table-pagination select,
body[data-user-role="admin"] .admin-table-pagination button {
    min-height: 38px;
}

body[data-user-role="admin"] .admin-payroll-review-available {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(5, 150, 105, 0.22);
    border-radius: 10px;
    background: #ECFDF5;
    color: #065F46;
    font-size: 0.9rem;
    font-weight: 700;
}

body[data-user-role="admin"] .admin-payroll-review-available button {
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #059669;
    border-radius: 8px;
    background: #fff;
    color: #047857;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

body[data-user-role="admin"] .section-container-wide .input-control,
body[data-user-role="admin"] .section-container-wide select,
body[data-user-role="admin"] .section-container-wide input:not([type="checkbox"]):not([type="radio"]),
body[data-user-role="admin"] .section-container-wide button.btn-outline,
body[data-user-role="admin"] .section-container-wide button.btn-primary {
    min-height: 42px;
    font-family: var(--font-admin-ui);
    font-size: 0.92rem;
}

body[data-user-role="admin"] .section-container-wide .app-table-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    overflow-x: auto;
    scrollbar-color: #98A2B3 #F2F4F7;
}

body[data-user-role="admin"] .section-container-wide .app-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg-table-header);
    box-shadow: 0 1px 0 var(--border);
    font-size: 0.84rem;
    line-height: 1.45;
}

body[data-user-role="admin"] .section-container-wide .app-data-table tbody tr:hover > td {
    background-color: rgba(185, 28, 28, 0.035);
}

body[data-user-role="admin"] :is(.audit-logs-header, .advance-admin-header, .attendance-report-header, .salary-report-header) p {
    max-width: 72ch;
    line-height: 1.65;
}

/* Smooth transition when toggling */
html {
    transition: background-color 0.3s ease, color 0.3s ease;
}

body, .card, nav, .modal-content, .dashboard-sidebar, input, textarea, select, button {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Offline badge pulse animation */
@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

/* ============================================================
   MOBILE GESTURES & FEEDBACK STYLES
   ============================================================ */

/* Drag handle for mobile bottom sheet modals */
.modal-drag-handle {
    display: none;
}

@media (max-width: 768px) {
    .modal-drag-handle {
        display: block;
        width: 40px;
        height: 5px;
        background: #cbd5e1;
        border-radius: 3px;
        margin: -10px auto 15px auto;
        cursor: grab;
        opacity: 0.6;
        transition: background-color 0.2s, opacity 0.2s;
    }
    .modal-drag-handle:active {
        background: #94a3b8;
        opacity: 1;
        cursor: grabbing;
    }
    
    /* Touch Active states for native feel */
    button:active, 
    .btn:active, 
    .nav-item:active, 
    .close-modal:active,
    .admin-action-btn:active {
        transform: scale(0.96) !important;
        filter: brightness(0.9) !important;
        transition: transform 0.05s ease !important;
    }
    
}

/* Pull to Refresh Indicator */
#pull-to-refresh-indicator {
    position: fixed;
    top: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    pointer-events: none;
    opacity: 0;
    transition: none;
}

.ptr-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color, #e2e8f0);
    border-top-color: var(--primary, #0284c7);
    border-radius: 50%;
    animation: ptr-spin 0.8s linear infinite;
    background: var(--surface, #ffffff);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

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

/* ============================================================
   HOME DASHBOARD VISUAL REFRESH
   ============================================================ */

.users-management-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 18px;
}

.users-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.users-role-filter-btn {
    padding: 10px 16px !important;
    min-height: 44px;
    border-radius: 12px !important;
    background: var(--surface) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    cursor: pointer;
    font-size: 0.88rem !important;
    font-weight: 800 !important;
    box-shadow: var(--shadow-sm);
}

.users-role-filter-btn:hover,
.users-role-filter-btn.is-active {
    border-color: rgba(4, 120, 87, 0.24) !important;
    background: #ECFDF5 !important;
    color: #047857 !important;
}

.users-role-filter-btn.is-danger:hover,
.users-role-filter-btn.is-danger.is-active {
    border-color: rgba(185, 28, 28, 0.24) !important;
    background: #FEF2F2 !important;
    color: #B91C1C !important;
}

.users-role-filter-btn.is-warning:hover,
.users-role-filter-btn.is-warning.is-active {
    border-color: rgba(217, 119, 6, 0.28) !important;
    background: #FFFBEB !important;
    color: #92400E !important;
}

.users-migration-status {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

.users-migration-badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid rgba(217, 119, 6, 0.24);
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.users-migration-status small {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

#audit-logs-section {
    max-width: none;
    width: 100%;
    padding: 0 20px;
}

.audit-logs-shell {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-card);
    background: var(--surface);
}

.audit-logs-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
}

.audit-logs-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.audit-logs-title-row h2 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1.6rem;
    font-weight: 800;
}

.audit-logs-title-row p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.audit-logs-toolbar {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(220px, 320px);
    gap: 12px;
    align-items: center;
}

.audit-logs-toolbar .input-control {
    margin: 0;
    width: 100%;
    min-height: 44px;
}

.audit-logs-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    min-height: 420px;
    background: var(--surface);
}

.audit-logs-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    text-align: right;
}

.audit-logs-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.audit-logs-table thead tr {
    background: var(--bg-table-odd);
    border-bottom: 2px solid var(--border);
}

.audit-logs-table th {
    padding: 14px 24px;
    color: var(--text-table-th);
    font-size: 0.84rem;
    font-weight: 800;
    white-space: normal;
}

.audit-logs-table th:nth-child(1) {
    width: 160px;
}

.audit-logs-table th:nth-child(2) {
    width: auto;
}

.audit-logs-table th:nth-child(3) {
    width: 240px;
}

.audit-action-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 2px 8px;
    border-radius: 8px;
    background: #F3F4F6;
    color: #344054;
    font-size: 0.78rem;
    font-weight: 700;
}

.audit-action-badge.is-success {
    background: #F0FDF4;
    color: #166534;
}

.audit-action-badge.is-danger {
    background: #FEF2F2;
    color: #991B1B;
}

.audit-log-sentence {
    margin: 6px 0 0;
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 600;
}

.audit-details-toggle {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text-main);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.audit-detail-list {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.audit-detail-list[hidden] {
    display: none;
}

.audit-detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

.audit-detail-list span {
    color: var(--text-muted);
}

.audit-log-empty-details {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.audit-logs-table th,
.audit-logs-table td {
    letter-spacing: 0;
    vertical-align: top;
}

.audit-logs-table tbody tr.audit-log-row {
    border-bottom: 1px solid var(--border);
}

.audit-logs-table tbody tr.audit-log-row td {
    padding: 16px 24px !important;
    line-height: 1.55;
}

#import-logs-section {
    max-width: none;
    width: 100%;
    padding: 0 20px;
}

.import-logs-shell {
    min-height: min(760px, calc(100vh - 140px));
}

.import-logs-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 230px);
    min-height: 420px;
    padding: 18px 24px 24px;
    background: var(--surface);
    overscroll-behavior: contain;
}

.import-logs-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 10px;
    color: var(--text-main);
    text-align: right;
    white-space: normal;
}

.import-logs-table th {
    padding: 18px 20px;
    color: var(--text-table-th);
    background: var(--bg-table-header);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
}

.import-logs-table th:first-child {
    border-radius: 0 8px 8px 0;
}

.import-logs-table th:last-child {
    border-radius: 8px 0 0 8px;
}

.import-log-row {
    background: var(--bg-table-odd);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.import-log-row td {
    padding: 18px 20px;
    vertical-align: middle;
    letter-spacing: 0;
}

.import-log-row td:first-child {
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-weight: 700;
}

.import-log-row td:last-child {
    border-radius: 8px 0 0 8px;
}

.import-log-uploader {
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 800;
}

.import-log-summary-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.import-log-pill,
.import-log-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 8px;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.12);
}

.import-log-pill.is-success,
.import-log-status-badge.is-success {
    background: #16a34a;
}

.import-log-pill.is-info,
.import-log-status-badge.is-info {
    background: #0284c7;
}

.import-log-pill.is-warning,
.import-log-status-badge.is-warning {
    background: #ca8a04;
}

.import-log-pill.is-danger,
.import-log-status-badge.is-danger {
    background: #dc2626;
}

.import-log-pill.is-dark {
    background: #334155;
}

.import-log-status-badge.is-muted {
    background: #64748b;
}

.btn-view-log-detail {
    min-width: 130px;
    border: 0;
    border-radius: 8px;
    background: #3b82f6;
    color: #fff;
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.28);
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-view-log-detail:hover {
    background: #2563eb;
}

.btn-view-log-detail[aria-expanded="true"] {
    background: #475569;
}

.import-log-detail-row td {
    padding: 0 12px 18px;
    white-space: normal;
}

.import-log-detail-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.import-log-detail-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    color: var(--text-main);
}

.import-log-detail-heading strong {
    font-size: 1.05rem;
}

.import-log-detail-heading span {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.import-log-detail-table-wrap {
    max-height: min(520px, calc(100vh - 330px));
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.import-log-detail-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.import-log-detail-table th,
.import-log-detail-table td {
    padding: 12px 14px;
    letter-spacing: 0;
    text-align: right;
}

.import-log-detail-table th {
    background: var(--bg-table-header);
    color: var(--text-table-th);
    font-weight: 800;
}

.import-log-detail-table td {
    background: var(--bg-table-odd);
    color: var(--text-main);
    font-weight: 700;
}

.import-log-detail-table td:last-child {
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.6;
}

.text-center {
    text-align: center !important;
}

@media (max-width: 768px) {
    #import-logs-section {
        padding: 0 12px;
    }

    .import-logs-table-wrap {
        max-height: none;
        min-height: 0;
        padding: 14px;
    }

    .import-logs-table {
        min-width: 0;
        font-size: 0.88rem;
    }

    .import-logs-table th,
    .import-log-row td {
        padding: 12px 14px;
    }

    .import-log-uploader {
        font-size: 0.95rem;
    }

    .import-log-pill,
    .import-log-status-badge {
        min-height: 28px;
        padding: 5px 9px;
        font-size: 0.8rem;
    }

    .btn-view-log-detail {
        min-width: 112px;
        padding: 8px 12px;
        font-size: 0.84rem;
    }

    .import-log-detail-panel {
        padding: 14px;
    }

    .import-log-detail-table-wrap {
        max-height: 60vh;
    }

    .import-log-detail-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

.audit-log-date div {
    text-align: right;
}

.audit-log-date small,
.audit-log-actor small,
.audit-log-target small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.audit-log-actor,
.audit-log-target {
    font-weight: 700;
}

.audit-log-actor small {
    display: inline-block;
    direction: ltr;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-log-action span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.04);
}

.audit-log-details-cell {
    min-width: 360px;
    max-width: 620px;
}

.audit-log-details {
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.audit-log-details b {
    color: var(--text-table-th);
}

.audit-logs-loading {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    #audit-logs-section {
        padding: 0 12px;
    }

    .audit-logs-header,
    .audit-logs-toolbar {
        padding: 16px;
    }

    .audit-logs-title-row {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .audit-logs-title-row h2 {
        font-size: 1.15rem;
        line-height: 1.45;
    }

    .audit-logs-toolbar {
        grid-template-columns: 1fr;
    }

    .audit-logs-table-wrap {
        max-height: none;
        min-height: 0;
    }
}

.users-management-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    gap: 14px;
}

.users-management-stat-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.users-management-stat-card span,
.users-management-stat-card small {
    display: block;
    color: var(--text-muted);
    font-weight: 700;
}

.users-management-stat-card span {
    font-size: 0.84rem;
    margin-bottom: 10px;
}

.users-management-stat-card strong {
    display: block;
    color: var(--text-main);
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: 8px;
}

.users-management-stat-card small {
    font-size: 0.75rem;
}

.users-management-stat-card.is-payroll {
    border-color: rgba(16, 185, 129, 0.22);
    background: linear-gradient(180deg, rgba(236, 253, 245, 0.9), var(--surface));
}

.users-management-stat-card.is-directory {
    border-color: rgba(59, 130, 246, 0.22);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.9), var(--surface));
}

.users-management-stat-card.is-active-users {
    border-color: rgba(185, 28, 28, 0.22);
    background: linear-gradient(180deg, rgba(255, 241, 242, 0.95), var(--surface));
}

.users-management-search {
    display: flex;
    align-items: stretch;
}

.users-management-search input {
    width: 100%;
    min-height: 54px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-main);
    padding: 0 16px;
    font-family: inherit;
    font-weight: 700;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.users-management-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.users-management-table {
    border-spacing: 0;
}

.users-management-table thead tr {
    background: var(--bg-table-header) !important;
}

.users-management-table th {
    white-space: normal;
    font-size: 0.78rem;
}

.users-management-table tbody tr {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-main);
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.users-management-table tbody tr:hover {
    background: var(--bg-table-odd);
    box-shadow: inset 4px 0 0 var(--primary);
}

.users-management-table td {
    vertical-align: middle;
}

#users-explorer-section .btn-user-action,
#users-explorer-section .btn-edit-user,
#users-explorer-section .btn-delete-user,
#users-explorer-section .btn-link-user-directory {
    border: 1px solid transparent !important;
    border-radius: 10px !important;
    padding: 7px 11px !important;
    min-height: 34px;
    font-size: 0.76rem !important;
    font-weight: 800 !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

#users-explorer-section .btn-user-action:hover,
#users-explorer-section .btn-edit-user:hover,
#users-explorer-section .btn-delete-user:hover,
#users-explorer-section .btn-link-user-directory:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(16, 24, 40, 0.1);
}

#users-explorer-section .btn-user-action[data-action="supervisor"],
#users-explorer-section .btn-link-user-directory {
    background: #ECFDF5 !important;
    color: #047857 !important;
    border-color: rgba(4, 120, 87, 0.18) !important;
}

#users-explorer-section .btn-user-action[data-action="employee"] {
    background: #EFF6FF !important;
    color: #2563EB !important;
    border-color: rgba(37, 99, 235, 0.18) !important;
}

#users-explorer-section .btn-user-action[data-action="blocked"],
#users-explorer-section .btn-delete-user {
    background: #FEF2F2 !important;
    color: #B91C1C !important;
    border-color: rgba(185, 28, 28, 0.18) !important;
}

#users-explorer-section .btn-edit-user {
    background: #F8FAFC !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
}

body {
    background:
        linear-gradient(180deg, #F9FAFB 0%, var(--bg-page) 280px, var(--bg-page) 100%);
}

nav {
    border-bottom-color: #E4E7EC;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.btn-primary {
    background: var(--grad-primary);
    box-shadow: 0 8px 18px rgba(185, 28, 28, 0.18);
}

@media (hover: hover) {
    .btn-primary:hover {
        background: linear-gradient(135deg, #991B1B 0%, #6B1111 100%);
        box-shadow: 0 10px 22px rgba(185, 28, 28, 0.24);
    }
}

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

#dashboard-section {
    max-width: min(1880px, calc(100% - 32px));
    width: calc(100% - 32px);
    padding-left: 8px;
    padding-right: 8px;
}

#dashboard-section .card,
#dashboard-section .dashboard-sidebar,
#profile-header-container > div {
    border: 1px solid var(--border-card) !important;
    box-shadow: var(--shadow-sm) !important;
}

#dashboard-section .dashboard-content > .card {
    padding-left: 24px;
    padding-right: 24px;
}

@media (hover: hover) {
    #dashboard-section .card:hover,
    #profile-header-container > div:hover {
        transform: none;
        box-shadow: var(--shadow-md) !important;
    }
}

#dashboard-section .dashboard-sidebar {
    background: var(--surface);
    border-radius: 16px;
    padding: 18px;
}

#dashboard-section .dashboard-sidebar::before {
    width: 3px;
    background: var(--brand-red);
    opacity: 0.95;
}

.dashboard-sidebar > .btn-primary {
    background: var(--grad-primary) !important;
    color: white !important;
}

.dashboard-sidebar > .btn-secondary {
    background: var(--surface) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}

.dashboard-sidebar > .btn-secondary:active,
.dashboard-sidebar > .btn-secondary:focus-visible {
    border-color: var(--brand-red) !important;
}

#admin-controls {
    border-top-color: #EAECF0 !important;
}

#admin-controls > .admin-accordion {
    --group-accent: #98A2B3;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, #FFFFFF 0%, #F9FAFB 100%);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    overflow: hidden;
}

#admin-controls > .admin-accordion:nth-of-type(1) { --group-accent: #4F46E5; }
#admin-controls > .admin-accordion:nth-of-type(2) { --group-accent: #B91C1C; }
#admin-controls > .admin-accordion:nth-of-type(3) { --group-accent: #2563EB; }
#admin-controls > .admin-accordion:nth-of-type(4) { --group-accent: #D97706; }
#admin-controls > .admin-accordion:nth-of-type(5) { --group-accent: #0E7490; }
#admin-controls > .admin-accordion:nth-of-type(6) { --group-accent: #0284C7; }
#admin-controls > .admin-accordion:nth-of-type(7) { --group-accent: #475467; }

#admin-controls .accordion-header {
    background: transparent;
    border: 0;
    border-radius: 0;
    margin-top: 0;
    min-height: 46px;
    padding: 12px 14px;
    color: var(--text-main);
    box-shadow: inset -4px 0 0 var(--group-accent);
}

#admin-controls .accordion-header .icon-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

#admin-controls .accordion-header .arrow {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(148, 163, 184, 0.12);
    color: var(--group-accent);
    font-size: 0.72rem;
}

#admin-controls .accordion-header.active {
    background: rgba(248, 250, 252, 0.95);
    border-bottom: 1px solid var(--border);
}

#admin-controls .accordion-body {
    background: transparent;
}

.dashboard-sidebar .admin-action-btn {
    --admin-accent: #98A2B3;
    background: #FFFFFF !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
    box-shadow: inset -3px 0 0 var(--admin-accent), var(--shadow-sm) !important;
    border-radius: 12px;
}

.dashboard-sidebar .admin-action-btn.is-current {
    border-color: rgba(185, 28, 28, 0.28) !important;
    background: #FFF1F2 !important;
    box-shadow: inset -4px 0 0 var(--brand-red), 0 8px 18px rgba(185, 28, 28, 0.08) !important;
}

.admin-navigation-home.is-current {
    border-color: var(--brand-red);
    background: var(--primary-light);
    color: var(--brand-red-dark);
}

#admin-controls .accordion-header.has-current {
    border-color: rgba(185, 28, 28, 0.35);
    background: #FFF7F7;
}

.dashboard-sidebar .admin-action-btn svg {
    color: var(--admin-accent);
}

.dashboard-sidebar .admin-btn-title {
    font-size: 0.9rem !important;
}

.dashboard-sidebar .admin-btn-export {
    --admin-accent: var(--brand-red);
    background: var(--grad-primary) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: var(--shadow-md) !important;
}

.dashboard-sidebar .admin-btn-export svg {
    color: white;
}

.dashboard-sidebar .admin-btn-users {
    --admin-accent: #2563EB;
}

.dashboard-sidebar .admin-btn-directory {
    --admin-accent: var(--brand-red);
}

.dashboard-sidebar .admin-btn-upload {
    --admin-accent: #059669;
}

.dashboard-sidebar .admin-btn-logs {
    --admin-accent: #475467;
}

.dashboard-sidebar .admin-btn-payroll {
    --admin-accent: #D97706;
}

.dashboard-sidebar .admin-btn-upload-payroll {
    --admin-accent: #92400E;
}

.dashboard-sidebar .admin-btn-insurance {
    --admin-accent: #0284C7;
}

.dashboard-sidebar .admin-btn-regularity {
    --admin-accent: #16A34A;
}

.dashboard-sidebar .admin-btn-attendance {
    --admin-accent: #0E7490;
}

.sidebar-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: #EF4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    margin-inline-start: 8px;
}

/* Removed styling for the retired admin analytics container. */
.minimal-kpi-card {
    border-radius: 12px;
    box-shadow: none;
}

.minimal-kpi-icon {
    border-radius: 10px;
}

#employee-chart-container,
#payroll-details-container {
    border-color: var(--border) !important;
    border-radius: 12px !important;
}

#payroll-overview-section {
    border-right-color: var(--brand-red) !important;
    border-radius: 16px !important;
}

/* Retired admin command-center shell removed; attendance keeps the shared KPI card primitive below. */
.admin-kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 138px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: #111827;
}

.admin-kpi-card::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--kpi-accent, #38BDF8);
}

.admin-kpi-card.is-blue { --kpi-accent: #0EA5E9; }
.admin-kpi-card.is-green { --kpi-accent: #10B981; }
.admin-kpi-card.is-amber { --kpi-accent: #F59E0B; }
.admin-kpi-card.is-red { --kpi-accent: #EF4444; }

/* Removed command-center-only KPI internals. */
/* Attendance detail modal uses compact light KPIs, independent from the dark admin dashboard. */
.attendance-detail-kpi-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 18px;
    padding: 3px 2px 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

#attendance-employee-detail-modal .modal-content {
    width: 96%;
    max-width: 1520px;
}

#attendance-employee-detail-modal .admin-kpi-card {
    --detail-kpi-soft: #F0F9FF;
    flex: 1 0 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    min-height: 92px;
    padding: 10px 8px 11px;
    background: linear-gradient(145deg, #FFFFFF 12%, var(--detail-kpi-soft) 100%);
    border: 1px solid #E2E8F0;
    border-radius: 13px;
    box-shadow: 0 7px 20px rgba(15, 23, 42, 0.055);
}

#attendance-employee-detail-modal .admin-kpi-card::before {
    inset-inline-start: 0;
    inset-inline-end: 0;
    top: 0;
    width: auto;
    height: 4px;
    background: var(--kpi-accent, #0EA5E9);
}

#attendance-employee-detail-modal .admin-kpi-card.is-blue { --detail-kpi-soft: #F0F9FF; }
#attendance-employee-detail-modal .admin-kpi-card.is-green { --detail-kpi-soft: #F0FDF4; }
#attendance-employee-detail-modal .admin-kpi-card.is-amber { --detail-kpi-soft: #FFFBEB; }
#attendance-employee-detail-modal .admin-kpi-card.is-red { --detail-kpi-soft: #FEF2F2; }
#attendance-employee-detail-modal .admin-kpi-card.is-status {
    --kpi-accent: #0891B2;
    --detail-kpi-soft: #ECFEFF;
}

#attendance-employee-detail-modal .attendance-kpi-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 32px;
    margin: 0;
    padding: 4px 5px;
    color: #475569;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    font-size: 0.7rem;
    line-height: 1.25;
    font-weight: 800;
}

#attendance-employee-detail-modal .admin-kpi-card strong {
    display: block;
    margin-top: 8px;
    color: #0F172A;
    font-size: 1.25rem;
    line-height: 1.1;
    font-weight: 900;
}

#attendance-employee-detail-modal .admin-kpi-card.is-status strong {
    font-size: 0.78rem;
    line-height: 1.4;
}

@media (hover: hover) {
    #attendance-employee-detail-modal .admin-kpi-card:hover {
        transform: translateY(-2px);
        border-color: #CBD5E1;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    }
}

/* Removed the retired admin command-center layout and its light-theme override layer. */
.payroll-summary-shell {
    padding: 0 !important;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border-card);
}

.payroll-summary-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
}

.payroll-summary-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.payroll-summary-title-row h2 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1.6rem;
    font-weight: 900;
}

.payroll-summary-title-row p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.payroll-summary-back {
    width: auto !important;
    height: 44px;
    padding: 0 16px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-table-th);
}

.payroll-summary-back span {
    font-size: 0.9rem;
    font-weight: 800;
}

.payroll-summary-toolbar {
    padding: 18px 24px;
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.payroll-summary-toolbar select,
.payroll-summary-toolbar input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-main);
    padding: 10px 14px;
    font-family: var(--font-ui);
    font-weight: 700;
}

.payroll-summary-toolbar button {
    min-height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* Removed unused payroll summary KPI layout from the retired summary renderer. */
.payroll-summary-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 800;
}

.payroll-summary-employee-results {
    padding: 20px 24px 0;
    display: grid;
    gap: 14px;
}

.payroll-summary-employee-results.hidden {
    display: none;
}

/* The active employee lookup uses payroll-summary-choice cards. */
.payroll-summary-choice {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 12px 14px;
    text-align: right;
    cursor: pointer;
    display: grid;
    gap: 4px;
    color: var(--text-main);
    font-family: var(--font-ui);
}

.payroll-summary-choice strong {
    font-size: 0.95rem;
    font-weight: 900;
}

.payroll-summary-choice span,
.payroll-summary-choice small {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

@media (hover: hover) {
    .payroll-summary-choice:hover {
        border-color: rgba(185, 28, 28, 0.35);
        background: rgba(185, 28, 28, 0.035);
    }
}

.payroll-summary-list {
    padding: 22px 24px 28px;
    display: grid;
    gap: 14px;
}

.payroll-employee-summary-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.payroll-employee-summary-head {
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
}

.payroll-employee-summary-head span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    margin-bottom: 5px;
}

.payroll-employee-summary-head h3 {
    margin: 0 0 6px;
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 900;
}

.payroll-employee-summary-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.payroll-employee-summary-head > strong {
    color: var(--brand-red);
    font-size: 1rem;
    font-weight: 900;
    white-space: nowrap;
}

.payroll-summary-fixed-grid {
    padding: 18px 20px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
    gap: 16px;
    align-items: start;
}

.payroll-summary-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.payroll-summary-panel h4 {
    margin: 0;
    padding: 13px 16px;
    color: var(--text-main);
    font-size: 0.98rem;
    font-weight: 900;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
}

.payroll-summary-panel.is-deductions h4 {
    color: var(--brand-red);
}

.payroll-summary-panel.is-additions h4 {
    color: #047857;
}

.payroll-summary-value-row {
    min-height: 46px;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
}

.payroll-summary-value-row:last-child {
    border-bottom: 0;
}

.payroll-summary-value-row span {
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 900;
}

.payroll-summary-value-row strong {
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 900;
    white-space: nowrap;
}

.payroll-summary-value-row.is-zero strong {
    color: var(--text-muted);
}

.payroll-summary-value-row.has-value strong {
    color: var(--brand-red);
}

.payroll-summary-panel.is-additions .payroll-summary-value-row.has-value strong {
    color: #047857;
}

/* Removed the retired expandable payroll item/table renderer. */
.admin-btn-payroll-summary {
    --admin-accent: #8B5CF6;
}

.attendance-report-shell {
    padding: 0 !important;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border-card);
}

.attendance-report-header {
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-table-odd);
}

.attendance-title-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.attendance-title-wrap h2 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1.55rem;
    font-weight: 900;
}

.attendance-title-wrap p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.attendance-back-btn {
    width: auto !important;
    height: 44px !important;
    padding: 0 14px !important;
    border-radius: 8px !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-table-th) !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
}

.attendance-back-btn span {
    font-size: 0.88rem;
    font-weight: 800;
}

.attendance-upload-btn {
    min-height: 42px;
    border-radius: 8px;
}

.attendance-toolbar {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(170px, 220px) minmax(170px, 210px) minmax(170px, 210px) minmax(260px, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.attendance-toolbar .input-control,
.attendance-toolbar button {
    width: 100%;
    min-height: 42px;
    border-radius: 8px;
    font-weight: 800;
}

.attendance-toolbar button {
    white-space: nowrap;
    padding-inline: 14px;
}

.attendance-insights-panel {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
    display: grid;
    grid-template-columns: minmax(250px, 0.8fr) repeat(2, minmax(240px, 1fr));
    gap: 12px;
    align-items: stretch;
}

.attendance-insight-summary,
.attendance-insight-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 14px;
}

.attendance-insight-summary strong {
    display: block;
    color: #B45309;
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
}

.attendance-insight-summary > span {
    display: block;
    margin-top: 6px;
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 900;
}

.attendance-insight-summary em {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 800;
}

.attendance-insight-summary div {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.attendance-insight-summary div span {
    padding: 5px 8px;
    border-radius: 8px;
    background: rgba(14, 116, 144, 0.08);
    color: #0E7490;
    font-size: 0.74rem;
    font-weight: 900;
}

.attendance-insight-block h4 {
    margin: 0 0 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 900;
}

.attendance-insight-block ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.attendance-insight-block li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
}

.attendance-insight-block li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.attendance-insight-block b {
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 900;
}

.attendance-insight-block span {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-align: left;
}

.attendance-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 68vh;
    background: var(--surface);
}

.attendance-report-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    text-align: center;
}

.attendance-report-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 13px 10px;
    border-bottom: 2px solid var(--border);
    background: var(--bg-table-odd);
    color: var(--text-table-th);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: normal;
    text-align: center;
}

.attendance-report-table tbody td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.82rem;
    text-align: center;
    white-space: normal;
}

.attendance-report-table tbody td:nth-child(2),
.attendance-report-table thead th:nth-child(2) {
    width: 11%;
    text-align: start;
}

.attendance-report-table tbody td:nth-child(4),
.attendance-report-table tbody td:nth-child(5),
.attendance-report-table thead th:nth-child(4),
.attendance-report-table thead th:nth-child(5) {
    width: 8%;
    text-align: center;
}

.attendance-report-table tbody tr:nth-child(even) {
    background: var(--bg-table-odd);
}

@media (hover: hover) {
    .attendance-report-table tbody tr:hover {
        background: rgba(14, 116, 144, 0.06);
    }
}

.attendance-report-table .employee-cell,
.attendance-report-table .metric-strong {
    font-weight: 900;
}

.attendance-report-table .metric-warn {
    color: #B45309;
    font-weight: 900;
}

.attendance-report-table .metric-danger {
    color: #B91C1C;
    font-weight: 900;
}

.attendance-new-badge {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 7px;
    padding: 3px 8px;
    border: 1px solid rgba(4, 120, 87, 0.24);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    direction: rtl;
    font-size: 0.7rem;
    font-weight: 900;
    white-space: normal;
}

.attendance-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    max-width: 100%;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 8px;
    color: #fff;
    background: var(--status-color);
    font-size: 0.76rem;
    font-weight: 900;
}

.attendance-report-table .btn-attendance-detail {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 900;
}

@media (max-width: 768px) {
    .payroll-summary-toolbar {
        grid-template-columns: 1fr;
    }

    .payroll-summary-toolbar button {
        justify-content: center;
    }

    .payroll-summary-list,
    .payroll-summary-employee-results,
    .payroll-summary-header,
    .payroll-summary-toolbar {
        padding-inline: 14px;
    }

    .payroll-employee-summary-head,
    .payroll-summary-fixed-grid {
        grid-template-columns: 1fr;
    }

    .payroll-employee-summary-head {
        flex-direction: column;
    }

    .payroll-employee-summary-head > strong {
        white-space: normal;
    }

    .attendance-report-header,
    .attendance-title-wrap {
        align-items: flex-start;
        flex-direction: column;
    }

    .attendance-toolbar,
    .attendance-insights-panel {
        grid-template-columns: 1fr;
        padding-inline: 14px;
    }

    .attendance-report-header {
        padding-inline: 14px;
    }
}

.tickets-workspace-card {
    border: 1px solid var(--border-card);
}

.tickets-workspace-head {
    border-bottom: 1px solid #EAECF0;
    padding-bottom: 16px;
}

.tickets-toolbar .input-control {
    background: #FFFFFF;
    border-color: var(--border);
}

/* ============================================================
   RESPONSIVE POLISH PASS
   ============================================================ */

* {
    letter-spacing: 0 !important;
}

img,
svg,
canvas,
video {
    max-width: 100%;
}

button,
.badge,
.admin-btn-title,
.minimal-kpi-label,
.ticket-reason-lbl span {
    overflow-wrap: anywhere;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.gap-6 {
    gap: 24px;
}

.input-control {
    width: 100%;
    min-width: 0;
}

@media (min-width: 1024px) {
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .nav-container,
    .nav-container.nav-container-v2 {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
    }

    .nav-page-title {
        display: none;
    }

    .logo-area {
        min-width: 0;
    }

    .logo-area img {
        height: 32px;
        flex-shrink: 0;
    }

    .logo {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-info {
        min-width: 0;
        justify-content: flex-end;
        gap: 6px !important;
    }

    #notification-bell,
    #btn-logout {
        width: 42px;
        height: 42px;
        min-width: 42px !important;
        min-height: 42px !important;
        padding: 0 !important;
    }

    #user-role-badge,
    #offline-badge {
        max-width: 86px !important;
        padding-inline: 8px !important;
    }

    .dashboard-grid {
        align-items: start;
    }

    #dashboard-section .dashboard-sidebar {
        order: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        padding: 14px;
        gap: 10px;
    }

    #dashboard-section .dashboard-sidebar::before {
        display: none;
    }

    #dashboard-section .dashboard-sidebar button {
        min-width: 0;
        min-height: 50px;
        padding: 11px 10px !important;
        line-height: 1.45;
    }

    #btn-new-ticket {
        grid-column: 1 / -1;
    }

    .dashboard-content {
        order: 1;
    }

    #admin-controls {
        grid-column: 1 / -1;
        margin-top: 0 !important;
        padding-top: 8px !important;
    }

    .accordion-body.open {
        max-height: none;
    }

    .admin-action-btn {
        align-items: flex-start;
        min-width: 0;
    }

    .admin-btn-content {
        min-width: 0;
    }

    .tickets-workspace-head,
    .tickets-toolbar,
    .modal-header-flex {
        align-items: stretch;
    }

    .tickets-toolbar .input-control,
    .tickets-toolbar select,
    .tickets-toolbar button {
        width: 100% !important;
    }

    #new-ticket-modal .flex-between,
    #edit-ticket-modal .flex-between,
    #ticket-detail-modal .flex-between {
        align-items: flex-start;
        gap: 10px;
    }

    .ticket-reasons-grid {
        gap: 10px;
    }

    .ticket-reason-lbl {
        min-height: 46px;
        padding: 10px 12px;
        align-items: flex-start;
    }

    .ticket-reason-lbl input[type="checkbox"] {
        margin-top: 4px;
    }

    #input-ticket-desc,
    #edit-ticket-description {
        min-height: 140px;
        resize: vertical;
    }

    .users-management-toolbar,
    .users-management-stats {
        grid-template-columns: 1fr;
    }

    .users-management-search input {
        min-height: 50px;
    }

    body[data-user-role="employee"] .tickets-review-table,
    body[data-user-role="employee"] #full-payroll-table,
    body[data-user-role="employee"] #regularity-explorer-section table,
    body[data-user-role="employee"] #insurance-explorer-section table,
    body[data-user-role="employee"] #deleted-tickets-section table,
    body[data-user-role="employee"] #approved-tickets-section table,
    body[data-user-role="employee"] #users-explorer-section table {
        min-width: 0 !important;
        width: 100% !important;
        border-collapse: separate !important;
        border-spacing: 0 12px !important;
    }

    body[data-user-role="employee"] .tickets-review-table thead,
    body[data-user-role="employee"] #full-payroll-table thead,
    body[data-user-role="employee"] #regularity-explorer-section table thead,
    body[data-user-role="employee"] #insurance-explorer-section table thead,
    body[data-user-role="employee"] #deleted-tickets-section table thead,
    body[data-user-role="employee"] #approved-tickets-section table thead,
    body[data-user-role="employee"] #users-explorer-section table thead {
        display: none !important;
    }

    body[data-user-role="employee"] .tickets-review-table tbody,
    body[data-user-role="employee"] #full-payroll-table tbody,
    body[data-user-role="employee"] #regularity-explorer-section table tbody,
    body[data-user-role="employee"] #insurance-explorer-section table tbody,
    body[data-user-role="employee"] #deleted-tickets-section table tbody,
    body[data-user-role="employee"] #approved-tickets-section table tbody,
    body[data-user-role="employee"] #users-explorer-section table tbody {
        display: block !important;
    }

    body[data-user-role="employee"] .tickets-review-table tr,
    body[data-user-role="employee"] #full-payroll-table tr,
    body[data-user-role="employee"] #regularity-explorer-section table tr,
    body[data-user-role="employee"] #insurance-explorer-section table tr,
    body[data-user-role="employee"] #deleted-tickets-section table tr,
    body[data-user-role="employee"] #approved-tickets-section table tr,
    body[data-user-role="employee"] #users-explorer-section table tr {
        display: block !important;
        background: var(--surface) !important;
        border: 1px solid var(--border-card) !important;
        border-radius: 14px !important;
        box-shadow: var(--shadow-sm);
        margin-bottom: 12px;
        overflow: hidden;
    }

    body[data-user-role="employee"] .tickets-review-table td,
    body[data-user-role="employee"] #full-payroll-table td,
    body[data-user-role="employee"] #regularity-explorer-section table td,
    body[data-user-role="employee"] #insurance-explorer-section table td,
    body[data-user-role="employee"] #deleted-tickets-section table td,
    body[data-user-role="employee"] #approved-tickets-section table td,
    body[data-user-role="employee"] #users-explorer-section table td {
        display: grid !important;
        grid-template-columns: minmax(88px, 35%) minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        width: 100% !important;
        padding: 11px 14px !important;
        border-bottom: 1px solid var(--border) !important;
        text-align: right !important;
        white-space: normal !important;
        word-break: break-word;
        background: transparent !important;
    }

    body[data-user-role="employee"] .tickets-review-table td:last-child,
    body[data-user-role="employee"] #full-payroll-table td:last-child,
    body[data-user-role="employee"] #regularity-explorer-section table td:last-child,
    body[data-user-role="employee"] #insurance-explorer-section table td:last-child,
    body[data-user-role="employee"] #deleted-tickets-section table td:last-child,
    body[data-user-role="employee"] #approved-tickets-section table td:last-child,
    body[data-user-role="employee"] #users-explorer-section table td:last-child {
        border-bottom: none !important;
    }

    body[data-user-role="employee"] .tickets-review-table td::before,
    body[data-user-role="employee"] #full-payroll-table td::before,
    body[data-user-role="employee"] #regularity-explorer-section table td::before,
    body[data-user-role="employee"] #insurance-explorer-section table td::before,
    body[data-user-role="employee"] #deleted-tickets-section table td::before,
    body[data-user-role="employee"] #approved-tickets-section table td::before,
    body[data-user-role="employee"] #users-explorer-section table td::before {
        content: attr(data-label);
        color: var(--text-table-th);
        font-size: 0.76rem;
        font-weight: 900;
        line-height: 1.5;
    }

    body[data-user-role="employee"] .tickets-review-table td:not([data-label])::before,
    body[data-user-role="employee"] #full-payroll-table td:not([data-label])::before,
    body[data-user-role="employee"] #regularity-explorer-section table td:not([data-label])::before,
    body[data-user-role="employee"] #insurance-explorer-section table td:not([data-label])::before,
    body[data-user-role="employee"] #deleted-tickets-section table td:not([data-label])::before,
    body[data-user-role="employee"] #approved-tickets-section table td:not([data-label])::before,
    body[data-user-role="employee"] #users-explorer-section table td:not([data-label])::before {
        content: "";
    }

    body[data-user-role="employee"] .tickets-review-table td[data-label="تفاصيل"],
    body[data-user-role="employee"] .tickets-review-table td[data-label="إجراءات"],
    body[data-user-role="employee"] #full-payroll-table td[data-label="تفاصيل"],
    body[data-user-role="employee"] #deleted-tickets-section td[data-label="إجراءات"],
    body[data-user-role="employee"] #approved-tickets-section td[data-label="إجراءات"],
    body[data-user-role="employee"] #users-explorer-section td[data-label="إجراءات"] {
        grid-template-columns: 1fr !important;
    }

    body[data-user-role="employee"] .tickets-review-table td[data-label="تفاصيل"]::before,
    body[data-user-role="employee"] .tickets-review-table td[data-label="إجراءات"]::before,
    body[data-user-role="employee"] #full-payroll-table td[data-label="تفاصيل"]::before,
    body[data-user-role="employee"] #deleted-tickets-section td[data-label="إجراءات"]::before,
    body[data-user-role="employee"] #approved-tickets-section td[data-label="إجراءات"]::before,
    body[data-user-role="employee"] #users-explorer-section td[data-label="إجراءات"]::before {
        display: none;
    }

    .ticket-action-btn,
    #deleted-tickets-section td[data-label="إجراءات"] button,
    #approved-tickets-section td[data-label="إجراءات"] button,
    #users-explorer-section td[data-label="إجراءات"] button {
        width: 100%;
        justify-content: center;
        margin: 4px 0 !important;
    }

    #admin-analytics-section span[style*="color: white"] {
        color: var(--primary) !important;
    }

    #payroll-overview-section .flex-between {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #payroll-month-selector {
        width: 100% !important;
    }

    #dashboard-section .card,
    #insurance-explorer-section .card,
    #directory-explorer-section .card,
    #payroll-explorer-section .card,
    #regularity-explorer-section .card,
    #users-explorer-section .card {
        width: 100%;
        max-width: 100%;
    }

    #insurance-explorer-section .card > div:first-child,
    #directory-explorer-section .card > div:first-child,
    #payroll-explorer-section .card > div:first-child,
    #regularity-explorer-section .card > div:first-child,
    #users-explorer-section .card > div:first-child {
        padding: 16px !important;
    }

    #insurance-explorer-section .card > div:first-child > div,
    #directory-explorer-section .card > div:first-child > div,
    #payroll-explorer-section .card > div:first-child > div,
    #regularity-explorer-section .card > div:first-child > div,
    #users-explorer-section .card > div:first-child > div {
        width: 100%;
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px !important;
    }

    #insurance-explorer-section h2,
    #directory-explorer-section h2,
    #payroll-explorer-section h2,
    #regularity-explorer-section h2,
    #users-explorer-section h2 {
        font-size: 1.15rem !important;
        line-height: 1.45;
    }

    #btn-back-to-dashboard-insurance,
    #btn-back-to-dashboard-directory,
    #btn-back-to-dashboard-payroll,
    #btn-back-to-dashboard-regularity,
    #btn-back-to-dashboard-users {
        width: 100% !important;
        justify-content: center;
    }

    #insurance-explorer-section .card > div:nth-child(2) {
        padding: 16px !important;
    }

    #insurance-explorer-section .card > div:nth-child(2) > div {
        grid-template-columns: 1fr !important;
    }

    #insurance-explorer-section .card > div:nth-child(3),
    #directory-explorer-section .card > div:nth-child(2),
    #payroll-explorer-section .card > div:nth-child(2),
    #regularity-explorer-section .card > div:nth-child(2) {
        padding: 14px 16px !important;
        flex-direction: column;
        align-items: stretch !important;
    }

    #full-insurance-filter,
    #full-insurance-search,
    #explore-insurance-filter,
    #explore-insurance-search,
    #explore-payroll-month,
    #full-directory-search,
    #full-payroll-search,
    #regularity-explorer-month,
    #regularity-explorer-status-filter,
    #regularity-explorer-search {
        width: 100% !important;
        min-width: 0 !important;
    }

    #explore-insurance-modal .modal-content,
    #explore-payrolls-modal .modal-content,
    #manage-directory-modal .modal-content,
    #deleted-user-tickets-modal .modal-content,
    #regularity-list-modal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh !important;
    }

    #explore-insurance-modal .flex-between > div[style*="min-width:300px"] {
        min-width: 0 !important;
        width: 100% !important;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    body[data-user-role="employee"] #insurance-explorer-section .card > div:nth-child(4),
    body[data-user-role="employee"] #explore-insurance-modal div[style*="overflow-x:auto"] {
        overflow-x: auto !important;
        border: 0 !important;
    }

    body[data-user-role="employee"] #insurance-explorer-section table,
    body[data-user-role="employee"] #explore-insurance-modal table {
        min-width: 0 !important;
        width: 100% !important;
        display: block;
        border-collapse: separate !important;
    }

    body[data-user-role="employee"] #insurance-explorer-section thead,
    body[data-user-role="employee"] #explore-insurance-modal thead {
        display: none;
    }

    body[data-user-role="employee"] #full-insurance-body,
    body[data-user-role="employee"] #explore-insurance-body {
        display: grid;
        gap: 12px;
        padding: 12px;
    }

    body[data-user-role="employee"] #full-insurance-body tr,
    body[data-user-role="employee"] #explore-insurance-body tr {
        display: block;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface) !important;
        box-shadow: var(--shadow-sm);
    }

    body[data-user-role="employee"] #full-insurance-body td,
    body[data-user-role="employee"] #explore-insurance-body td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        width: 100%;
        padding: 9px 0 !important;
        border: 0 !important;
        color: var(--text-main) !important;
        text-align: left;
        white-space: normal;
    }

    body[data-user-role="employee"] #full-insurance-body td:not(:last-child),
    body[data-user-role="employee"] #explore-insurance-body td:not(:last-child) {
        border-bottom: 1px dashed var(--border) !important;
    }

    body[data-user-role="employee"] #full-insurance-body td::before,
    body[data-user-role="employee"] #explore-insurance-body td::before {
        color: var(--text-muted);
        content: attr(data-label);
        flex: 0 0 42%;
        font-weight: 800;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .section-container {
        width: 100%;
    }

    .modal-content {
        border-radius: 22px 22px 0 0 !important;
    }

    .close-modal {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    .minimal-kpi-card {
        padding: 12px;
    }

    .admin-action-btn svg {
        width: 22px;
        height: 22px;
    }

    #deleted-tickets-search,
    #deleted-tickets-type-filter,
    #deleted-tickets-deleted-by-filter,
    #deleted-tickets-from-date,
    #deleted-tickets-to-date,
    #approved-tickets-search,
    #btn-clear-deleted-tickets-filters,
    #btn-export-deleted-tickets {
        width: 100% !important;
    }

    #deleted-tickets-search {
        grid-column: 1 / -1;
    }

    #deleted-tickets-section [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        min-width: 100% !important;
    }

    #deleted-tickets-section [style*="grid-template-columns"] > div {
        flex-direction: column !important;
    }
}

@media (max-width: 360px) {
    #dashboard-section .dashboard-sidebar {
        grid-template-columns: 1fr !important;
    }
}
 

/* ========================================================================== 
   Directory Table Redesign
   ========================================================================== */
#directory-explorer-section {
    width: calc(100% - 24px);
    max-width: none;
    padding-inline: 0;
    margin: 12px auto 24px;
}

#directory-explorer-section .directory-employment-table {
    min-width: 0;
    table-layout: fixed;
    font-size: clamp(0.72rem, 0.68vw, 0.86rem);
}

#directory-explorer-section .directory-employment-table th,
#directory-explorer-section .directory-employment-table td {
    padding-inline: 12px;
}

#directory-explorer-section .ui-style-150 {
    padding-inline: 8px;
}

.directory-employment-status-filter {
    min-width: 190px;
    width: auto;
}

.directory-advanced-filters {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.directory-advanced-filters > summary {
    display: none;
}

.directory-advanced-filters-grid {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(410px, 2fr) minmax(190px, 1fr) minmax(190px, 1fr) auto;
    align-items: end;
    gap: 12px;
    padding: 14px 22px 18px;
}

.directory-filter-field {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.directory-filter-field > span,
.directory-filter-field > legend {
    display: block;
    margin-bottom: 6px;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.directory-filter-field > .input-control {
    width: 100%;
    min-height: 42px;
}

.directory-date-filter-field {
    display: grid;
    grid-template-columns: minmax(125px, 1fr) minmax(125px, 1fr) minmax(125px, 1fr);
    gap: 8px;
}

.directory-date-filter-field > legend {
    grid-column: 1 / -1;
}

.directory-clear-filters {
    min-height: 42px;
    white-space: nowrap;
}

.directory-operation-overlay {
    position: fixed;
    inset: 0;
    z-index: 4200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.62);
}

.directory-operation-dialog {
    width: min(780px, 96vw);
    max-height: 92vh;
    overflow: auto;
    padding: 24px;
    text-align: right;
}

.directory-operation-dialog.is-history {
    width: min(920px, 96vw);
}

.directory-operation-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 10px;
    margin-block: 18px;
}

.directory-operation-summary span {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-table-odd);
    color: var(--text-muted);
}

.directory-operation-summary b {
    display: block;
    margin-top: 5px;
    color: var(--text-main);
    font-size: 1.15rem;
}

.directory-operation-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.directory-operation-history-list {
    display: grid;
    gap: 10px;
    margin-block: 16px;
}

.directory-operation-history-list article {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(260px, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.directory-operation-history-list small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
}

.directory-operation-history-list article > div:last-child {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .directory-employment-status-filter {
        width: 100%;
    }

    .directory-advanced-filters > summary {
        display: block;
        padding: 14px;
        color: var(--text-main);
        font-weight: 800;
        cursor: pointer;
    }

    .directory-advanced-filters-grid {
        grid-template-columns: 1fr;
        padding-inline: 14px;
    }

    .directory-date-filter-field {
        grid-template-columns: 1fr;
    }

    .directory-date-filter-field > legend {
        grid-column: auto;
    }

    .directory-clear-filters {
        width: 100%;
    }

    .directory-operation-history-list article {
        grid-template-columns: 1fr;
    }
}

.directory-table th {
    padding: 16px 20px;
    font-weight: 700;
    color: var(--text-table-th);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.directory-table .dir-th-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.directory-table .dir-th-sortable:hover,
.directory-table .dir-th-sortable.active {
    color: var(--primary);
    background: rgba(155, 27, 48, 0.06);
}
.dir-sort-indicator {
    display: inline-flex;
    width: 14px;
    margin-right: 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
}
.dir-table-row {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}
.dir-table-row:hover {
    background-color: var(--bg-table-odd);
}
.dir-td-serial,
.dir-td-code {
    padding: 16px 20px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}
.dir-td-serial {
    color: var(--primary);
}
.dir-td-name {
    padding: 16px 20px;
    font-weight: 800;
    color: var(--text-main);
    min-width: 270px;
}
.dir-td-name strong,
.dir-td-name small {
    display: block;
}
.dir-td-name small {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: normal;
}
.dir-td-email {
    padding: 16px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.dir-td-job, .dir-td-dept,
.dir-td-project, .dir-td-employment-type,
.dir-td-start-date, .dir-td-manager {
    padding: 16px 20px;
    color: var(--text-main);
}
.dir-td-organization {
    min-width: 245px;
    padding: 12px 16px;
}
.dir-td-organization span {
    display: block;
    margin-block: 3px;
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.45;
    white-space: nowrap;
}
.dir-td-organization b {
    color: var(--text-main);
}
.dir-td-start-date {
    font-weight: 800;
    white-space: nowrap;
}
.dir-td-status {
    padding: 16px 20px;
}
.dir-td-insurance {
    padding: 16px 20px;
}
.dir-td-actions {
    padding: 12px 14px;
    text-align: center;
    min-width: 170px;
}
.dir-actions-wrapper {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}
#directory-explorer-section .dir-actions-wrapper .btn-outline {
    padding: 9px 12px;
}

/* Directory Badges */
.dir-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.dir-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}
.dir-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}
.dir-badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #B45309;
}
.dir-badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}
.dir-badge-muted {
    background: rgba(107, 114, 128, 0.12);
    color: #6B7280;
}

/* Action Button */
.dir-btn-edit,
.dir-btn-view {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.74rem;
    white-space: nowrap;
    transition: all 0.2s ease;
    line-height: 1.2;
}
.dir-btn-edit {
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.05);
}
.dir-btn-edit:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}
.dir-btn-view {
    color: #047857;
    border-color: rgba(4, 120, 87, 0.25);
    background: rgba(16, 185, 129, 0.08);
}
.dir-btn-view:hover {
    background: rgba(16, 185, 129, 0.16);
    border-color: #047857;
}

#btn-installment-advance.btn-installment-advance {
    background: #ECFDF5 !important;
    color: #047857 !important;
    border: 1px solid rgba(4, 120, 87, 0.25) !important;
    box-shadow: none !important;
}

@media (hover: hover) {
    #btn-installment-advance.btn-installment-advance:hover {
        background: #D1FAE5 !important;
        border-color: #047857 !important;
    }
}

.employee-advance-log-card {
    margin-top: 18px;
}

.employee-advance-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.employee-advance-log-head h2 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 900;
}

.employee-advance-log-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.employee-advance-log-list {
    display: grid;
    gap: 10px;
}

.employee-advance-log-item {
    display: grid;
    grid-template-columns: minmax(170px, 0.9fr) minmax(240px, 1.5fr);
    gap: 14px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-table-odd);
}

.employee-advance-main,
.employee-advance-meta {
    display: grid;
    gap: 5px;
}

.employee-advance-main strong {
    color: var(--text-main);
    font-size: 1.08rem;
}

.employee-advance-main small,
.employee-advance-meta span,
.employee-advance-log-note {
    color: var(--text-muted);
    font-size: 0.83rem;
    line-height: 1.6;
}

.employee-advance-log-note {
    color: var(--text-main);
}

@media (max-width: 720px) {
    .employee-advance-log-head,
    .employee-advance-log-item {
        grid-template-columns: 1fr;
    }

    .employee-advance-log-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* --- Installment Advance Requests --- */
.dashboard-sidebar .admin-btn-advance {
    --admin-accent: #D97706;
}

.installment-advance-card {
    max-width: 620px;
    width: 94%;
}

.advance-inline-warning,
.advance-calculation-preview,
.advance-history-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-table-odd);
}

.advance-inline-warning {
    padding: 12px 14px;
    margin-bottom: 14px;
    color: #92400E;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    font-weight: 800;
    line-height: 1.7;
}

.advance-calculation-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.advance-calculation-preview span,
.advance-history-item span,
.advance-history-item small,
.advance-decision-summary span,
.advance-decision-summary small {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.advance-calculation-preview strong {
    color: #B45309;
    font-size: 1.05rem;
}

.advance-history-box {
    margin-top: 18px;
    padding: 14px;
}

.advance-history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.advance-history-head h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.advance-history-list {
    display: grid;
    gap: 10px;
}

.advance-history-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.advance-history-item > div {
    display: grid;
    gap: 4px;
}

.advance-history-note {
    margin-top: 4px;
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.6;
}

.advance-admin-shell {
    width: 100%;
    padding: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border-card);
}

.advance-admin-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.advance-admin-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.advance-admin-title-row h2 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 1.55rem;
    font-weight: 900;
}

.advance-admin-title-row p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.advance-admin-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.advance-admin-stats span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.82rem;
}

.advance-admin-stats b {
    color: var(--text-main);
}

.advance-admin-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 220px auto;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.advance-admin-shell.is-supervisor-view .advance-admin-only {
    display: none !important;
}

.advance-admin-shell.is-supervisor-view .advance-admin-toolbar {
    grid-template-columns: minmax(260px, 1fr) 220px;
}

.advance-bulk-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

.advance-bulk-actions span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 900;
    white-space: nowrap;
}

.advance-bulk-actions .btn-outline {
    min-width: 118px;
    min-height: 42px;
    padding: 9px 14px;
    white-space: nowrap;
}

.btn-outline.is-danger,
.advance-bulk-actions .is-danger {
    color: #B91C1C;
    border-color: rgba(185, 28, 28, 0.25);
    background: #FEF2F2;
}

.advance-table-wrap {
    width: 100%;
    overflow-x: visible;
    background: transparent;
    -webkit-overflow-scrolling: touch;
}

.advance-requests-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: clamp(0.74rem, 0.7vw, 0.92rem);
    line-height: 1.7;
}

.advance-requests-table th,
.advance-requests-table td {
    padding: 14px 16px;
    vertical-align: top;
}

.advance-requests-table th {
    font-size: clamp(0.7rem, 0.65vw, 0.88rem);
    line-height: 1.45;
    white-space: normal;
}

.advance-requests-table td {
    font-size: 0.92rem;
}

.advance-requests-table td strong,
.advance-requests-table td small {
    display: block;
}

.advance-requests-table td strong {
    font-size: 0.96rem;
    line-height: 1.55;
}

.advance-requests-table td small {
    font-size: 0.8rem;
    line-height: 1.6;
}

.advance-requests-table th:nth-child(3),
.advance-requests-table td:nth-child(3) {
    width: 12%;
}

.advance-requests-table th:nth-child(8),
.advance-requests-table td:nth-child(8) {
    width: 11%;
}

.advance-requests-table th:nth-child(9),
.advance-requests-table td:nth-child(9),
.advance-requests-table th:nth-child(12),
.advance-requests-table td:nth-child(12) {
    width: 11%;
}

.advance-requests-table th:nth-child(13),
.advance-requests-table td:nth-child(13) {
    width: 9%;
}

.advance-requests-table th:last-child,
.advance-requests-table td:last-child {
    width: 10%;
    min-width: 0;
}

.advance-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.advance-status-pill.is-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #B45309;
}

.advance-status-pill.is-approved {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.advance-status-pill.is-executed {
    background: rgba(37, 99, 235, 0.12);
    color: #1D4ED8;
}

.advance-status-pill.is-rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #B91C1C;
}

.advance-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
}

.advance-admin-shell .btn-advance-decision,
.advance-admin-shell .btn-advance-opinion,
.advance-admin-shell .btn-advance-execute,
.advance-admin-shell .btn-advance-edit,
.advance-admin-shell .btn-advance-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 9px 7px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: clamp(0.68rem, 0.6vw, 0.84rem);
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    box-shadow: 0 2px 5px rgba(16, 24, 40, 0.1);
}

.advance-admin-shell .btn-advance-opinion {
    background: #D97706;
    color: #FFFFFF;
    border-color: #B45309;
}

.advance-admin-shell .btn-advance-execute {
    background: #2563EB;
    color: #FFFFFF;
    border-color: #1D4ED8;
}

.advance-admin-shell .btn-advance-decision.is-approve {
    background: #047857;
    color: #FFFFFF;
    border-color: #065F46;
}

.advance-admin-shell .btn-advance-decision.is-reject {
    background: #FFFFFF;
    color: #B91C1C;
    border-color: #FCA5A5;
}

.advance-admin-shell .btn-advance-edit {
    background: #334155;
    color: #FFFFFF;
    border-color: #1E293B;
}

.advance-admin-shell .btn-advance-delete {
    background: #FFFFFF;
    color: #B91C1C;
    border-color: #FCA5A5;
}

@media (hover: hover) {
    .advance-admin-shell .advance-actions button:hover,
    .advance-admin-shell .btn-advance-execute:hover {
        transform: translateY(-1px);
        filter: brightness(0.96);
        box-shadow: 0 5px 12px rgba(16, 24, 40, 0.16);
    }
}

.advance-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.advance-decision-summary {
    display: grid;
    gap: 4px;
}

.advance-workflow-summary {
    display: grid;
    gap: 5px;
    min-width: 180px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-table-odd);
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.6;
}

.advance-workflow-summary.is-warning {
    margin-bottom: 14px;
    color: #92400E;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    font-weight: 800;
}

.advance-workflow-summary strong,
.advance-workflow-summary span,
.advance-workflow-summary small {
    display: block;
}

.advance-workflow-summary span,
.advance-workflow-summary small {
    color: var(--text-muted);
}

.advance-loading {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
}

/* approved-th-sortable styling */
.approved-th-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.approved-th-sortable:hover,
.approved-th-sortable.active {
    color: var(--primary) !important;
    background: rgba(155, 27, 48, 0.06);
}


/* ============================================
   REDESIGN — NAVBAR (Option A) + QUICK ACTIONS
   Added: scoped to new classes only, does not
   remove or override unrelated existing rules.
   ============================================ */

/* ---- Navbar v2 ---- */
.nav-container-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.nav-start {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nav-home-btn {
    border: 0;
    background: transparent;
    padding: 0;
    min-width: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.nav-home-btn:focus-visible {
    outline: 2px solid var(--color-focus-teal);
    outline-offset: 3px;
    border-radius: 10px;
}

.nav-page-title {
    margin: 0;
    max-width: min(420px, 42vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
    font-size: 1.02rem;
    font-weight: 800;
    text-align: center;
}

.nav-user-menu {
    position: relative;
    flex-shrink: 0;
}

.nav-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 140;
    min-width: 188px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.nav-user-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    text-align: start;
}

.nav-user-logout:hover,
.nav-user-logout:focus-visible {
    background: var(--primary-light);
    color: var(--brand-red-dark);
}

.nav-icon-btn-v2 {
    width: 38px;
    height: 38px;
    min-height: 38px !important;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    padding: 0;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.nav-icon-btn-v2:hover {
    background: var(--bg-table-odd);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.nav-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.nav-user-chip-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-user-chip .nav-username {
    font-size: 0.85rem;
}

.nav-user-chip .badge {
    margin: 0;
}

#top-nav #btn-logout {
    flex-shrink: 0;
    overflow: visible;
}

@media (max-width: 768px) {
    .nav-user-chip .nav-username {
        display: none;
    }
}

/* ---- Quick Actions Grid (sidebar) ---- */
.qa-grid {
    display: contents;
}

.qa-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: right;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    margin-bottom: 10px;
    position: relative;
    min-height: auto;
    font-family: var(--font-ui);
    transition: var(--transition-fast);
}

@media (hover: hover) {
    .qa-btn:hover {
        background: var(--bg-table-odd);
        border-color: var(--text-muted);
        transform: translateY(-1px);
    }
}

.qa-btn:last-child {
    margin-bottom: 0;
}

.qa-btn.is-current {
    border-color: rgba(185, 28, 28, 0.28);
    background: #FFF1F2;
    box-shadow: inset -4px 0 0 var(--brand-red), 0 8px 18px rgba(185, 28, 28, 0.08);
}

.qa-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qa-icon-red {
    background: var(--primary-light);
    color: var(--primary);
}

.qa-icon-blue {
    background: rgba(79, 172, 254, 0.12);
    color: #0C447C;
}

.qa-icon-amber {
    background: rgba(245, 158, 11, 0.12);
    color: #92400E;
}

.qa-icon-green {
    background: rgba(16, 185, 129, 0.12);
    color: #065F46;
}

.qa-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qa-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

.qa-sub {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1.3;
}

.qa-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #EF4444;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
    flex-shrink: 0;
}

/* ---- Profile / Dashboard Hero (genProfileCardHTML output) ---- */
.profile-hero-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-card);
    padding: 22px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.profile-hero-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--grad-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-hero-greeting {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 2px;
}

.profile-hero-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
}

.profile-hero-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    margin-top: 6px;
}

.profile-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}

.profile-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .profile-hero-card {
        padding: 18px;
        gap: 14px;
    }

    .profile-hero-avatar {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .profile-hero-name {
        font-size: 1.1rem;
    }
}


/* ========================================================================== 
   Generated Classes from HTML Inline Styles Cleanup
   ========================================================================== */


.btn-back-to-dashboard {
    background: var(--surface); border: 1px solid var(--border); padding: 0 16px; height: 44px; border-radius: 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; transition: all 0.2s; width: auto;
}

.custom-label-height {
    margin: 0; min-height: 42px; font-size: 0.86rem;
}

.custom-table-td-sm {
    padding: 12px 14px; color: var(--text-table-th); font-size: 0.82rem;
}

.custom-table-th-sm {
    padding: 14px 12px; font-weight: 700; color: var(--text-table-th); font-size: 0.85rem;
}

.explorer-card-shell {
    padding: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--border-card);
}

.explorer-header-section {
    padding: 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; background: var(--bg-table-odd);
}

.explorer-subtitle {
    margin: 0; color: var(--text-muted); font-size: 0.9rem;
}

.explorer-title {
    margin: 0 0 4px; font-size: 1.6rem; color: var(--text-main); font-weight: 800;
}

.flex-center-gap-16 {
    display: flex; align-items: center; gap: 16px;
}

.m-0 {
    margin: 0;
}

.mt-1-muted-xs {
    margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem;
}

.my-custom-margin {
    margin-bottom: 0; margin-top: 10px;
}

.p-3 {
    padding: 12px;
}

.table-th-nowrap {
    padding: 10px 14px; font-weight: 700; white-space: normal;
}

.text-sm {
    font-size: 0.9rem;
}

.text-xs {
    font-size: 0.85rem;
}

.th-label-sm {
    font-weight: 700; color: var(--text-table-th); font-size: 0.9rem;
}

.th-padding-lg {
    padding: 16px 20px; font-weight: 700; color: var(--text-table-th);
}

.transition-rotate {
    transition: transform 0.3s ease;
}

.ui-style-1 {
    background: rgba(239, 68, 68, 0.1); color: #EF4444; border: 1px solid rgba(239, 68, 68, 0.2); display: none; align-items: center; gap: 6px; font-weight: 800; padding: 6px 12px; border-radius: 999px; font-size: 0.8rem; white-space: nowrap; flex-shrink: 0;
}

.ui-style-10 {
    margin-bottom: 0;
}

.ui-style-100 {
    display: flex; gap: 8px;
}

.ui-style-101 {
    padding: 0 12px; min-height: 42px; font-size: 0.82rem; white-space: nowrap;
}

.ui-style-102 {
    padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--bg-table-odd); display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

.ui-style-103 {
    color: var(--text-main);
}

.ui-style-104 {
    padding: 8px 12px; color: #B91C1C; border-color: rgba(185,28,28,0.35); background: rgba(239,68,68,0.06);
}

.ui-style-105 {
    overflow-x: auto; background: var(--surface);
}

.ui-style-106 {
    width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; text-align: right;
}

.ui-style-107 {
    background: var(--bg-table-header); border-bottom: 1px solid var(--border);
}

.ui-style-108 {
    padding: 12px 14px; color: var(--text-table-th); font-size: 0.82rem; width: 44px; text-align: center;
}

.ui-style-109 {
    margin: 0; min-height: 42px; font-size: 0.86rem; flex: 1; min-width: min(100%, 320px);
}

.ui-style-11 {
    width: auto; padding: 6px 12px;
}

.ui-style-110 {
    padding: 8px 12px; color: #0ea5e9; border-color: rgba(14,165,233,0.25); background: rgba(14,165,233,0.08);
}

.ui-style-111 {
    max-width: 800px; width: 90%;
}

.ui-style-112 {
    background: #EF4444; color: white; border: none; padding: 6px 12px; font-size: 0.85rem; font-weight: bold;
}

.ui-style-113 {
    font-size: 0.85rem; line-height: 1.6;
}

.ui-style-114 {
    width: 100%; padding: 12px; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface);
}

.ui-style-115 {
    display: block; margin-top: 8px; color: var(--text-muted);
}

.ui-style-116 {
    max-width: 760px; width: 90%;
}

.ui-style-117 {
    font-size: 0.85rem; line-height: 1.7;
}

.ui-style-118 {
    max-width: 1100px; width: 94%; max-height: 88vh; overflow: auto;
}

.ui-style-119 {
    background: var(--secondary); color: white; border: none; padding: 6px 12px; font-size: 0.85rem;
}

.ui-style-12 {
    overflow-x: visible;
}

.ui-style-120 {
    max-width: 600px; width: 90%;
}

.ui-style-122 {
    padding: 24px; background: var(--surface); border: 1px solid var(--border-card);
}

.ui-style-123 {
    gap: 12px; flex-wrap: wrap;
}

.ui-style-124 {
    margin: 0; color: var(--text-main);
}

.ui-style-125 {
    padding: 8px 12px;
}

.ui-style-126 {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px;
}

.ui-style-127 {
    padding: 12px; color: #B91C1C; border-color: rgba(185,28,28,0.35); background: rgba(239,68,68,0.06);
}

.ui-style-128 {
    margin-bottom: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-table-odd);
}

.ui-style-129 {
    margin: 0 0 12px; color: var(--text-main);
}

.ui-style-13 {
    margin-top: 20px;
}

.ui-style-130 {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 10px;
}

.ui-style-131 {
    position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto;
}

.ui-style-132 {
    margin-bottom: 10px;
}

.ui-style-133 {
    resize: vertical;
}

.ui-style-134 {
    font-size: 0.86rem; min-height: 22px; margin: 8px 0;
}

.ui-style-135 {
    padding: 10px 18px;
}

.ui-style-136 {
    margin-bottom: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}

.ui-style-137 {
    gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}

.ui-style-138 {
    margin: 4px 0 0; color: var(--text-muted); font-size: 0.86rem;
}

.ui-style-139 {
    display: grid; gap: 10px;
}

.ui-style-14 {
    padding: 20px 24px; border-bottom: 1px solid var(--border); background: var(--bg-table-odd); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}

.ui-style-140 {
    text-align: center; padding: 18px;
}

.ui-style-141 {
    margin-bottom: 18px; padding: 16px; border: 1px solid rgba(185,28,28,0.25); border-radius: 8px; background: rgba(239,68,68,0.04);
}

.ui-style-142 {
    margin: 0 0 8px; color: #B91C1C;
}

.ui-style-143 {
    margin: 0 0 12px; color: var(--text-muted); font-size: 0.9rem; line-height: 1.7;
}

.ui-style-144 {
    padding: 10px 14px; color: #B91C1C; border-color: rgba(185,28,28,0.35); background: rgba(239,68,68,0.06);
}

.ui-style-145 {
    font-size: 0.86rem; min-height: 22px; margin-top: 10px;
}

.ui-style-146 {
    text-align: center; padding: 24px;
}

.ui-style-147 {
    flex: 1; min-width: 280px; position: relative;
}

.ui-style-148 {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; color: #9CA3AF;
}

.ui-style-149 {
    width: 100%; padding: 12px 44px 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); font-size: 0.95rem; font-family: var(--font-ui); outline: none; transition: border-color 0.2s;
}

.ui-style-15 {
    display: flex; gap: 12px; flex-wrap: wrap; flex: 1; min-width: 300px;
}

.ui-style-150 {
    overflow-x: visible; background: var(--surface); padding: 0 24px 24px;
}

.ui-style-151 {
    width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; text-align: right; font-size: clamp(0.72rem, 0.68vw, 0.9rem); margin-top: 16px;
}

.ui-style-152 {
    width: 80px;
}

.ui-style-153 {
    width: 100px;
}

.ui-style-154 {
    font-size: 0.8rem; color: #9CA3AF;
}

.ui-style-155 {
    padding: 10px 16px; min-height: 42px; border-radius: 12px; color: #B91C1C; border-color: rgba(185,28,28,0.35); background: rgba(239,68,68,0.06); font-weight: 800; display: flex; align-items: center; gap: 8px; cursor: pointer;
}

.ui-style-156 {
    background: rgba(14, 165, 233, 0.1); padding: 16px; border-radius: 12px; border: 1px solid rgba(14, 165, 233, 0.2); display: flex; align-items: center; gap: 16px;
}

.ui-style-157 {
    width: 48px; height: 48px; background: #0EA5E9; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.ui-style-158 {
    font-size: 0.85rem; color: #0284C7; font-weight: 600; margin-bottom: 4px;
}

.ui-style-159 {
    font-size: 1.35rem; font-weight: 800; color: #0284C7; line-height: 1;
}

.ui-style-16 {
    flex: 1; min-width: 150px; position: relative;
}

.ui-style-160 {
    background: rgba(139, 92, 246, 0.1); padding: 16px; border-radius: 12px; border: 1px solid rgba(139, 92, 246, 0.2); display: flex; align-items: center; gap: 16px;
}

.ui-style-161 {
    width: 48px; height: 48px; background: #8B5CF6; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.ui-style-162 {
    font-size: 0.85rem; color: #7C3AED; font-weight: 600; margin-bottom: 4px;
}

.ui-style-163 {
    font-size: 1.35rem; font-weight: 800; color: #7C3AED; line-height: 1;
}

.ui-style-164 {
    padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--bg-table-odd); display: flex; gap: 16px; align-items: center;
}

.ui-style-165 {
    width: 180px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main);
}

.ui-style-166 {
    flex: 1; position: relative;
}

.ui-style-167 {
    width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); font-size: 0.95rem;
}

.ui-style-168 {
    width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; text-align: right;
}

.ui-style-169 {
    background: var(--bg-table-odd);
}

.ui-style-17 {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 1.1rem; color: #9CA3AF; pointer-events: none;
}

.ui-style-170 {
    padding: 12px 14px; font-weight: 700; color: var(--text-table-th); border-bottom: 2px solid var(--border); width: 60px; text-align: center;
}

.ui-style-171 {
    padding: 12px 24px; font-weight: 700; color: var(--text-table-th); border-bottom: 2px solid var(--border); width: 80px; text-align: center;
}

.ui-style-172 {
    padding: 12px 8px; font-weight: 700; color: var(--text-table-th); border-bottom: 2px solid var(--border);
}

.ui-style-173 {
    z-index: 1010;
}

.ui-style-174 {
    max-width: 98vw; width: 98%; max-height: 95vh; overflow-y: auto; padding: 24px;
}

.ui-style-175 {
    display: flex; gap: 10px; margin-bottom: 15px; align-items: center; flex-wrap: wrap;
}

.ui-style-176 {
    flex: 1; min-width: 200px; padding: 8px 12px;
}

.ui-style-177 {
    font-size: 0.85rem; color: var(--text-muted); white-space: nowrap;
}

.ui-style-178 {
    background: #10B981; border: none; padding: 6px 12px; font-size: 0.85rem; border-radius: 6px; cursor: pointer; font-weight: bold; color: white; display: none;
}

.ui-style-179 {
    overflow-x: visible;
}

.ui-style-18 {
    width: 100%; padding: 12px 46px 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-family: var(--font-ui); cursor: pointer;
}

.ui-style-180 {
    width: 100%; border-collapse: collapse; font-size: clamp(0.72rem, 0.68vw, 0.88rem); text-align: right; min-width: 0; table-layout: fixed;
}

.ui-style-181 {
    background: var(--bg-color); border-bottom: 2px solid var(--border);
}

.ui-style-182 {
    text-align: center; color: var(--text-muted);
}

.ui-style-183 {
    max-width: 480px;
}

.ui-style-184 {
    background: var(--bg-color); padding: 12px; border-radius: 8px; margin-bottom: 15px; font-size: 0.9rem;
}

.ui-style-185 {
    background: var(--primary-light); color: var(--primary); padding: 8px 12px; border-radius: 6px; font-size: 0.82rem; margin-bottom: 12px; border: 1px solid rgba(155,27,48,0.12);
}

.ui-style-186 {
    max-width: 98vw; width: 98%; max-height: 95vh; overflow-y: auto; padding: 28px;
}

.ui-style-187 {
    margin-bottom: 28px;
}

.ui-style-188 {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--primary-light); border-radius: 999px; margin-bottom: 12px; border: 1px solid var(--border-card);
}

.ui-style-189 {
    width: 6px; height: 6px; border-radius: 50%; background: #F59E0B;
}

.ui-style-19 {
    flex: 1; min-width: 170px; position: relative;
}

.ui-style-190 {
    color: var(--primary); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.5px;
}

.ui-style-191 {
    margin: 0 0 8px; font-size: 1.8rem; font-weight: 900; color: var(--text-main); letter-spacing: -0.02em;
}

.ui-style-192 {
    margin: 0; color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
}

.ui-style-193 {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px;
}

.ui-style-194 {
    background: #10B981;
}

.ui-style-195 {
    background: #3B82F6;
}

.ui-style-196 {
    background: #F59E0B;
}

.ui-style-197 {
    display: flex; gap: 12px; flex: 1; min-width: 300px;
}

.ui-style-198 {
    width: 160px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); padding: 10px 14px;
}

.ui-style-199 {
    flex: 1; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); padding: 10px 14px;
}

.ui-style-2 {
    width: 8px; height: 8px; background: #EF4444; border-radius: 50%; display: inline-block; animation: pulse 1.5s infinite;
}

.ui-style-20 {
    flex: 2; min-width: 250px; position: relative;
}

.ui-style-200 {
    overflow-x: visible; border-radius: 12px; border: 1px solid var(--border);
}

.ui-style-201 {
    width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; text-align: right; background: var(--surface); color: var(--text-main);
}

.ui-style-202 {
    background: var(--bg-table-header); border-bottom: 2px solid var(--border);
}

.ui-style-203 {
    padding: 14px 12px; font-weight: 700; color: var(--text-table-th); font-size: 0.85rem; text-align: center;
}

.ui-style-204 {
    padding: 14px 12px; font-weight: 800; color: var(--text-main); font-size: 0.85rem; background: var(--bg-table-odd);
}

.ui-style-205 {
    margin: 0 auto 10px;
}

.ui-style-206 {
    max-width: 1000px; width: 98%; max-height: 95vh; overflow-y: auto;
}

.ui-style-207 {
    width: 6px; height: 6px; border-radius: 50%; background: #22C55E;
}

.ui-style-208 {
    background: #EF4444;
}

.ui-style-209 {
    background: #0EA5E9;
}

.ui-style-21 {
    width: 100%; padding: 12px 46px 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; font-family: var(--font-ui);
}

.ui-style-210 {
    background: #8B5CF6;
}

.ui-style-211 {
    width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; text-align: right; background: var(--surface); color: var(--text-main);
}

.ui-style-213 {
    background: var(--bg-table-odd); border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}

.ui-style-214 {
    width: 100%; border-collapse: collapse; text-align: right;
}

.ui-style-215 {
    padding: 12px; color: var(--text-table-th);
}

.ui-style-216 {
    max-width: 900px; width: 95%; max-height: 95vh; overflow-y: auto;
}

.ui-style-217 {
    font-size: 0.9rem; color: var(--text-muted);
}

.ui-style-218 {
    display: inline-block; margin-left: 15px; font-weight: bold; color: var(--primary);
}

.ui-style-219 {
    color: #10B981;
}

.ui-style-22 {
    display: flex; gap: 10px;
}

.ui-style-220 {
    color: #F59E0B;
}

.ui-style-221 {
    display: inline-block; font-weight: bold; color: var(--text-muted);
}

.ui-style-222 {
    color: #EF4444;
}

.ui-style-223 {
    background: #0F766E; border: none; padding: 8px 16px;
}

.ui-style-224 {
    width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; text-align: right;
}

.ui-style-225 {
    font-size: 0.95rem; color: var(--text-main);
}

.ui-style-226 {
    border: 2px solid var(--border); border-radius: 12px; font-size: 1rem; background: var(--surface); color: var(--text-main);
}

.ui-style-227 {
    background: #10B981; color: white; font-weight: 700; padding: 14px; border-radius: 12px;
}

.ui-style-228 {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}

.ui-style-229 {
    max-width: 620px;
}

.ui-style-23 {
    padding: 10px 20px; font-size: 0.9rem; border-color: rgba(16, 185, 129, 0.2); color: #10B981; background: rgba(16, 185, 129, 0.1);
}

.ui-style-230 {
    max-width: 540px;
}

.ui-style-231 {
    max-width: 500px;
}

.ui-style-232 {
    max-width: 600px; padding: 0; display: flex; flex-direction: column; max-height: 85vh; overflow: hidden;
}

.ui-style-233 {
    padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface);
}

.ui-style-234 {
    margin: 0; color: var(--primary); font-size: 1.2rem;
}

.ui-style-235 {
    font-size: 0.85rem; color: var(--text-muted); margin-top: 4px;
}

.ui-style-236 {
    padding: 16px 20px; background: var(--bg-table-odd); border-bottom: 1px solid var(--border);
}

.ui-style-237 {
    font-weight: bold; color: var(--text-main); margin-bottom: 6px;
}

.ui-style-238 {
    color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap;
}

.ui-style-239 {
    flex: 1; padding: 16px 20px; overflow-y: auto; background: var(--bg-color); display: flex; flex-direction: column; gap: 12px;
}

.ui-style-24 {
    padding: 10px 20px; font-size: 0.9rem;
}

.ui-style-240 {
    padding: 16px 20px; background: var(--surface); border-top: 1px solid var(--border);
}

.ui-style-241 {
    flex: 1; resize: none;
}

.ui-style-242 {
    padding: 0 20px; display: flex; align-items: center; justify-content: center;
}

.ui-style-243 {
    margin-left: -5px;
}

.ui-style-244 {
    display: none; color: var(--danger); font-size: 0.9rem; text-align: center; padding: 10px 0; font-weight: bold;
}

.ui-style-245 {
    max-width: 560px;
}

.ui-style-25 {
    padding: 0; overflow-x: visible;
}

.ui-style-252 {
    font-size: 1.2rem; font-weight: bold; color: var(--primary); padding: 20px;
}

.ui-style-253 {
    background: var(--surface);
}

.ui-style-256 {
    background: #FFFFFF; color: var(--text-muted); padding: 0; margin-top: 0; border-top: 0;
}

.ui-style-257 {
    max-width: min(1880px, calc(100% - 32px)); margin: 0 auto;
}

.ui-style-258 {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px;
}

.ui-style-259 {
    display: flex; align-items: center; gap: 10px; margin-bottom: 15px;
}

.ui-style-26 {
    width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; text-align: right;
}

.ui-style-260 {
    height: 30px; filter: none;
}

.ui-style-261 {
    color: var(--text-main); font-weight: 800; font-size: 1.1rem;
}

.ui-style-262 {
    color: var(--text-main); margin-bottom: 20px; font-size: 1rem;
}

.ui-style-263 {
    display: flex; flex-direction: column; gap: 12px;
}

.ui-style-264 {
    font-size: 0.85rem; margin-bottom: 10px;
}

.ui-style-265 {
    font-size: 0.85rem; display: flex; align-items: center; gap: 8px; color: #10B981;
}

.ui-style-266 {
    width: 8px; height: 8px; background: #10B981; border-radius: 50%;
}

.ui-style-267 {
    border-top: 1px solid var(--border); padding-top: 25px; text-align: center; font-size: 0.8rem;
}

.ui-style-27 {
    background: var(--bg-table-odd); border-bottom: 2px solid var(--border);
}

.ui-style-28 {
    padding: 16px 24px; color: var(--text-table-th); font-weight: 700; font-size: 0.85rem; width: 60px; text-align: center;
}

.ui-style-29 {
    padding: 16px 8px; color: var(--text-table-th); font-weight: 700; font-size: 0.85rem;
}

.ui-style-3 {
    position: absolute; top: -5px; inset-inline-end: -5px; background: #EF4444; color: white; font-size: 0.6rem; font-weight: bold; border-radius: 50%; width: 16px; height: 16px; display: none; align-items: center; justify-content: center;
}

.ui-style-30 {
    padding: 16px 8px; color: var(--text-table-th); font-weight: 700; font-size: 0.85rem; width: 100px; text-align: center;
}

.ui-style-31 {
    padding: 16px 8px; color: var(--text-table-th); font-weight: 700; font-size: 0.85rem; width: 130px; text-align: center;
}

.ui-style-32 {
    padding: 16px 8px; color: var(--text-table-th); font-weight: 700; font-size: 0.85rem; width: 120px; text-align: center;
}

.ui-style-33 {
    padding: 16px 8px; color: var(--text-table-th); font-weight: 700; font-size: 0.85rem; width: 140px; text-align: center;
}

.ui-style-34 {
    padding: 16px 8px; color: var(--text-table-th); font-weight: 700; font-size: 0.85rem; min-width: 200px;
}

.ui-style-35 {
    text-align: center; padding: 40px; color: var(--text-muted);
}

.ui-style-36 {
    padding: 36px; text-align: center; color: var(--text-muted);
}

.ui-style-37 {
    padding: 24px; border-bottom: 1px solid var(--border); background: var(--surface);
}

.ui-style-38 {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
}

.ui-style-39 {
    background: var(--bg-table-odd); padding: 16px; border-radius: 12px; border: 1px solid var(--border); display: flex; align-items: center; gap: 16px;
}

.ui-style-4 {
    font-size: 0.85rem; padding: 8px 16px; display: flex; align-items: center; gap: 6px;
}

.ui-style-40 {
    width: 48px; height: 48px; background: #3B82F6; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.ui-style-41 {
    font-size: 0.85rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px;
}

.ui-style-42 {
    font-size: 1.5rem; font-weight: 800; color: var(--text-main); line-height: 1;
}

.ui-style-43 {
    background: rgba(16, 185, 129, 0.1); padding: 16px; border-radius: 12px; border: 1px solid rgba(16, 185, 129, 0.2); display: flex; align-items: center; gap: 16px;
}

.ui-style-44 {
    width: 48px; height: 48px; background: #10B981; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.ui-style-45 {
    font-size: 0.85rem; color: #10B981; font-weight: 600; margin-bottom: 4px;
}

.ui-style-46 {
    font-size: 1.5rem; font-weight: 800; color: #10B981; line-height: 1;
}

.ui-style-47 {
    background: rgba(245, 158, 11, 0.1); padding: 16px; border-radius: 12px; border: 1px solid rgba(245, 158, 11, 0.2); display: flex; align-items: center; gap: 16px;
}

.ui-style-48 {
    width: 48px; height: 48px; background: #EAB308; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.ui-style-49 {
    font-size: 0.85rem; color: #F59E0B; font-weight: 600; margin-bottom: 4px;
}

.ui-style-5 {
    flex-shrink: 0;
}

.ui-style-50 {
    font-size: 1.5rem; font-weight: 800; color: #F59E0B; line-height: 1;
}

.ui-style-51 {
    background: rgba(239, 68, 68, 0.1); padding: 16px; border-radius: 12px; border: 1px solid rgba(239, 68, 68, 0.2); display: flex; align-items: center; gap: 16px;
}

.ui-style-52 {
    width: 48px; height: 48px; background: #EF4444; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.ui-style-53 {
    font-size: 0.85rem; color: #EF4444; font-weight: 600; margin-bottom: 4px;
}

.ui-style-54 {
    font-size: 1.5rem; font-weight: 800; color: #EF4444; line-height: 1;
}

.ui-style-55 {
    width: 100%; padding: 12px 46px 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-family: var(--font-ui);
}

.ui-style-56 {
    display: flex; gap: 10px; flex-wrap: wrap;
}

.ui-style-57 {
    display: flex; align-items: center; gap: 8px;
}

.ui-style-58 {
    border-color: #EF4444; color: #EF4444; display: flex; align-items: center; gap: 8px;
}

.ui-style-59 {
    border-color: #10B981; color: #10B981; display: flex; align-items: center; gap: 8px;
}

.ui-style-6 {
    border-top: 1px solid var(--border);
}

.ui-style-60 {
    width: 100%; overflow-x: visible; background: var(--surface); padding: 0 24px 24px;
}

.ui-style-61 {
    width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; text-align: right; font-size: clamp(0.72rem, 0.68vw, 0.9rem); margin-top: 16px;
}

.ui-style-62 {
    position: sticky; top: 0; background: var(--bg-table-odd); z-index: 10; border-bottom: 2px solid var(--border);
}

.ui-style-63 {
    padding: 16px 20px; font-weight: 800; color: var(--text-main); background: var(--bg-table-odd);
}

.ui-style-64 {
    padding: 16px 20px; font-weight: 700; color: var(--text-table-th); text-align: center;
}

.ui-style-65 {
    padding: 40px; text-align: center;
}

.ui-style-66 {
    margin: 0 auto 15px;
}

.ui-style-67 {
    color: var(--text-muted); font-weight: 600; font-size: 1rem;
}

.ui-style-68 {
    padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-table-odd); display: flex; justify-content: space-between; align-items: center;
}

.ui-style-69 {
    font-size: 0.85rem; color: var(--text-muted);
}

.ui-style-7 {
    margin-bottom: 12px; color: var(--text-main); font-size: 0.95rem; font-weight: 800;
}

.ui-style-70 {
    font-weight: 700; color: var(--text-main);
}

.ui-style-71 {
    margin: 0 auto 12px;
}

.ui-style-72 {
    margin-bottom: 12px; padding: 12px; border-radius: 10px; background: rgba(16, 185, 129, 0.1); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.2); font-size: 0.9rem;
}

.ui-style-73 {
    color: var(--text-muted); font-weight: 600;
}

.ui-style-74 {
    min-height: 22px; font-size: 0.9rem;
}

.ui-style-75 {
    padding: 24px;
}

.ui-style-76 {
    margin-top: 0; border: 1px solid var(--border); border-radius: 12px; overflow-x: visible; background: var(--surface);
}

.ui-style-77 {
    width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse;
}

.ui-style-78 {
    padding: 16px 20px; font-weight: 700; color: var(--text-table-th); width: 70px;
}

.ui-style-79 {
    padding: 16px 20px; font-weight: 700; color: var(--text-table-th); text-align: start;
}

.ui-style-8 {
    position: relative;
}

.ui-style-80 {
    padding: 40px;
}

.ui-style-81 {
    max-width: 1040px; width: 95%; max-height: 90vh; overflow: hidden; padding: 0; background: var(--surface);
}

.ui-style-82 {
    margin: 0 0 6px; font-size: 1.35rem; color: var(--text-main); font-weight: 800;
}

.ui-style-83 {
    margin: 0; color: var(--text-table-th); font-size: 0.9rem;
}

.ui-style-84 {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
}

.ui-style-85 {
    padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
}

.ui-style-86 {
    display: inline-flex; align-items: center; gap: 10px; background: var(--bg-table-odd); color: #1D4ED8; border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 0.85rem;
}

.ui-style-87 {
    background: #1D4ED8; color: #fff; min-width: 24px; height: 24px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
}

.ui-style-88 {
    width: 100%; overflow-x: visible; overflow-y: auto; background: var(--surface); max-height: 50vh;
}

.ui-style-89 {
    width: 100%; border-collapse: collapse; min-width: 0; table-layout: fixed; text-align: right; font-size: 0.86rem; white-space: normal;
}

.ui-style-9 {
    display: none; position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #EF4444; color: white; font-size: 0.72rem; align-items: center; justify-content: center; font-weight: 900;
}

.ui-style-90 {
    position: sticky; top: 0; background: var(--bg-table-header); color: var(--text-table-th); z-index: 10; box-shadow: var(--shadow-sm);
}

.ui-style-91 {
    padding: 12px 16px; font-weight: 700; color: var(--text-table-th); border-bottom: 2px solid var(--border);
}

.ui-style-92 {
    padding: 12px 16px; font-weight: 700; color: var(--text-table-th); border-bottom: 2px solid var(--border); text-align: center;
}

.ui-style-93 {
    padding: 32px;
}

.ui-style-94 {
    margin: 0; color: var(--text-main); font-size: 1.35rem;
}

.ui-style-95 {
    padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border);
}

.ui-style-96 {
    background: var(--bg-table-odd); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; color: var(--text-main); font-size: 0.9rem;
}

.ui-style-97 {
    font-weight: 800; color: var(--primary);
}

.ui-style-98 {
    padding: 10px 16px; min-height: 42px; font-size: 0.86rem; white-space: nowrap;
}

.ui-style-99 {
    display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(140px, 1fr)); gap: 10px; flex: 1; min-width: min(100%, 760px);
}

.employee-self-service-actions {
    display: none;
}

.employee-detail-section {
    max-width: 920px;
}

.employee-detail-card {
    display: grid;
    gap: 20px;
}

.employee-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.employee-detail-eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 900;
}

.employee-detail-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--text-main);
    font-size: 1.35rem;
}

.employee-detail-header p {
    margin: 7px 0 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.employee-detail-back {
    flex: 0 0 auto;
}

/* ============================================
   TOP CENTERED OPERATIONS NAVIGATION
   Keeps the original button IDs and accordion logic intact.
   ============================================ */
#dashboard-section .grid-2,
#dashboard-section .dashboard-grid,
#dashboard-section.admin-review-mode .dashboard-grid,
.admin-review-mode #dashboard-section .dashboard-grid {
    grid-template-columns: 1fr !important;
}

#top-nav {
    padding-bottom: 0;
}

#top-nav .dashboard-sidebar {
    position: relative;
    z-index: 120;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: min(1600px, calc(100vw - 32px));
    margin: 10px auto 0;
    padding: 10px 24px 12px;
    overflow: visible;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    background: #FFFFFF;
    backdrop-filter: none;
    height: auto;
}

#top-nav .dashboard-sidebar::before,
#top-nav .dashboard-sidebar h4 {
    display: none !important;
}

#top-nav .dashboard-sidebar .qa-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 10px;
}

#top-nav .dashboard-sidebar .qa-btn {
    width: auto !important;
    min-width: 164px;
    min-height: 42px;
    margin: 0 !important;
    padding: 9px 12px !important;
    flex: 0 0 auto;
    border-radius: 10px;
    box-shadow: none;
}

#top-nav .dashboard-sidebar .qa-sub {
    display: none;
}

#top-nav #admin-controls:not(.hidden) {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: 0 !important;
    overflow: visible;
}

#admin-controls > .admin-accordion {
    position: relative;
    flex: 0 0 auto;
    overflow: visible;
    border-radius: 12px;
}

#admin-controls > .admin-action-btn {
    width: auto !important;
    min-width: 164px;
    min-height: 46px;
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 10px 14px !important;
    border-radius: 12px;
    justify-content: flex-start;
}

.system-backup-modal {
    width: min(94vw, 780px);
    max-height: 88vh;
    overflow: auto;
    padding: 22px;
    direction: rtl;
}

.system-backup-warning {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(202, 138, 4, 0.28);
    border-radius: 8px;
    background: #FFFBEB;
    color: #92400E;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.7;
}

.system-backup-toolbar,
.system-backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.system-backup-toolbar {
    margin-bottom: 12px;
}

.system-backup-actions {
    margin-top: 16px;
}

.system-backup-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.system-backup-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-table-odd);
    cursor: pointer;
}

.system-backup-option input {
    width: 17px;
    height: 17px;
    margin-top: 4px;
    flex: 0 0 auto;
}

.system-backup-option strong,
.system-backup-option small {
    display: block;
}

.system-backup-option strong {
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.5;
}

.system-backup-option small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.system-restore-file-input {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 800;
}

.system-restore-file-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #FFFFFF;
}

.system-restore-status {
    margin-bottom: 14px;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.7;
}

.system-restore-preview {
    display: grid;
    gap: 14px;
}

.system-restore-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.system-restore-meta {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-table-odd);
}

.system-restore-meta span,
.system-restore-meta strong {
    display: block;
    min-width: 0;
}

.system-restore-meta span {
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.system-restore-meta strong {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: var(--text-main);
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.5;
}

#admin-controls .accordion-header {
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: inset 0 -3px 0 var(--group-accent), var(--shadow-sm);
    white-space: nowrap;
}

#admin-controls .accordion-header.active {
    background: #FFF7F7;
    border-color: rgba(185, 28, 28, 0.22);
}

#admin-controls .accordion-body {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: min(300px, calc(100vw - 32px));
    max-height: none !important;
    padding: 6px 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #FFFFFF;
    box-shadow: 0 18px 42px rgba(16, 24, 40, 0.16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

/* Invisible bridge to cover the 10px gap between the button and the dropdown container */
#admin-controls .accordion-body::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
    background: transparent;
}

#admin-controls > .admin-accordion:nth-last-of-type(-n + 2) .accordion-body {
    right: auto;
    left: 0;
}

#admin-controls .accordion-body.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

#admin-controls .accordion-body .admin-action-btn {
    width: 100% !important;
    min-height: auto;
    margin: 0 !important;
    padding: 10px 16px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text-main) !important;
    justify-content: flex-start;
    gap: 0;
    transform: none !important;
}

#admin-controls .accordion-body .admin-action-btn:last-child {
    border-bottom: 0 !important;
}

@media (hover: hover) {
    #admin-controls .accordion-body .admin-action-btn:hover {
        background: var(--bg-table-odd) !important;
        box-shadow: none !important;
        transform: none !important;
    }
}

#admin-controls .accordion-body .admin-action-btn svg {
    display: none !important;
}

#admin-controls .accordion-body .admin-btn-content {
    display: block;
    flex: 1;
    min-width: 0;
}

#admin-controls .accordion-body .admin-btn-title {
    display: block;
    font-size: 0.9rem !important;
    font-weight: 800;
    line-height: 1.65;
    text-align: right;
    white-space: normal;
}

#admin-controls .accordion-body #btn-admin-messages-wipe .admin-btn-title {
    color: var(--danger);
}

#dashboard-section .dashboard-content {
    width: 100%;
}

@media (max-width: 1024px) {
    #top-nav .dashboard-sidebar {
        position: static;
        display: block;
        max-height: calc(100vh - 72px);
        margin-top: 8px;
        padding: 10px 16px;
        overflow-y: auto;
    }

    #top-nav .dashboard-sidebar .qa-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 10px;
    }

    #top-nav .dashboard-sidebar .qa-btn {
        width: 100% !important;
        min-width: 0;
        flex: initial;
    }

    #admin-controls:not(.hidden) {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    #admin-controls > .admin-accordion {
        overflow: hidden;
    }

    #admin-controls > .admin-action-btn {
        width: 100% !important;
        min-width: 0;
    }

    .system-backup-options-grid {
        grid-template-columns: 1fr;
    }

    .system-restore-summary-grid {
        grid-template-columns: 1fr;
    }

    #admin-controls .accordion-body {
        position: static;
        display: block;
        width: 100%;
        max-height: 0 !important;
        padding: 0 10px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        overflow: hidden;
    }

    #admin-controls .accordion-body.open {
        max-height: none !important;
        padding: 10px;
    }
}

@media (max-width: 640px) {
    #top-nav .dashboard-sidebar .qa-grid {
        grid-template-columns: 1fr;
    }

    #top-nav .dashboard-sidebar .qa-sub {
        display: inline;
    }
}

/* ============================================
   ADMIN OPERATIONS DASHBOARD
   ============================================ */
.admin-operations-dashboard {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.admin-operations-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.admin-operations-eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.admin-operations-head h1 {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 800;
}

.admin-operations-head p {
    max-width: 660px;
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

.admin-operations-controls {
    display: grid;
    gap: 7px;
    min-width: 290px;
}

.admin-operations-controls > label {
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 800;
}

.admin-operations-controls > small {
    min-height: 18px;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.admin-operations-control-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    gap: 8px;
}

.admin-operations-control-row .input-control,
.admin-operations-control-row .dashboard-refresh-btn {
    min-height: 42px;
}

.admin-operations-context {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.admin-operations-context strong {
    color: var(--text-main);
    font-weight: 800;
}

.admin-operations-context small {
    margin-inline-start: auto;
}

.admin-operations-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-primary-tasks {
    display: grid;
    gap: 12px;
}

.admin-primary-tasks-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-primary-tasks-heading h2,
.admin-operations-summary-title {
    margin: 0;
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 800;
}

.admin-primary-tasks-heading p {
    margin: 3px 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.admin-primary-tasks-heading > span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.admin-primary-task-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-primary-task {
    --task-accent: #B91C1C;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px 12px;
    min-width: 0;
    min-height: 142px;
    padding: 16px;
    border: 1px solid var(--border-card);
    border-inline-start: 3px solid var(--task-accent);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-main);
    text-align: start;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.admin-primary-task.is-advances { --task-accent: #B7791F; }
.admin-primary-task.is-payroll { --task-accent: #2563A6; }

.admin-primary-task:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--task-accent) 34%, var(--border-card));
    box-shadow: var(--shadow-md);
}

.admin-primary-task:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--task-accent) 28%, transparent);
    outline-offset: 2px;
}

.admin-primary-task-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--task-accent) 10%, white);
    color: var(--task-accent);
    font-size: 1rem;
    font-weight: 900;
}

.admin-primary-task-copy {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
}

.admin-primary-task-copy strong {
    font-size: 0.96rem;
    font-weight: 800;
}

.admin-primary-task-copy small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.65;
}

.admin-primary-task-link {
    grid-column: 2;
    align-self: end;
    color: var(--task-accent);
    font-size: 0.76rem;
    font-weight: 800;
}

.admin-operations-summary-title {
    margin-top: 4px;
}

.admin-operation-card {
    --operation-accent: #2563EB;
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    min-height: 170px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-main);
    text-align: start;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.admin-operation-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--operation-accent);
}

.admin-operation-card.is-complaints { --operation-accent: #B91C1C; }
.admin-operation-card.is-advances { --operation-accent: #D97706; }
.admin-operation-card.is-responses { --operation-accent: #2563EB; }

.admin-operation-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--operation-accent) 32%, var(--border-card));
    box-shadow: var(--shadow-md);
}

.admin-operation-card:focus-visible,
.admin-dashboard-response-item:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--operation-accent, #2563EB) 28%, transparent);
    outline-offset: 2px;
}

.admin-operation-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid color-mix(in srgb, var(--operation-accent) 24%, transparent);
    border-radius: 13px;
    background: color-mix(in srgb, var(--operation-accent) 10%, transparent);
    color: var(--operation-accent);
    font-size: 1rem;
    font-weight: 900;
}

.admin-operation-copy {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
}

.admin-operation-copy > span {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.admin-operation-copy > strong {
    color: var(--text-main);
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 800;
    line-height: 1;
}

.admin-operation-copy > small {
    color: var(--text-muted);
    font-size: 0.76rem;
    line-height: 1.6;
}

.admin-operation-link {
    grid-column: 1 / -1;
    align-self: end;
    color: var(--operation-accent);
    font-size: 0.78rem;
    font-weight: 800;
}

.admin-operations-panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.admin-operations-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-operations-panel-head h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.08rem;
    font-weight: 800;
}

.admin-operations-panel-head p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.admin-operations-panel-hint {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.admin-dashboard-responses-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-dashboard-response-item {
    --operation-accent: #2563EB;
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    background: var(--surface-soft, #F8FAFC);
    color: var(--text-main);
    text-align: start;
    cursor: pointer;
}

.admin-dashboard-response-item:hover {
    border-color: color-mix(in srgb, #2563EB 28%, var(--border-card));
}

.admin-dashboard-response-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-dashboard-response-top time,
.admin-dashboard-response-item > small {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.admin-dashboard-response-type {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

.admin-dashboard-response-type.is-complaint {
    background: rgba(185, 28, 28, 0.09);
    color: #991B1B;
}

.admin-dashboard-response-type.is-advance {
    background: rgba(217, 119, 6, 0.1);
    color: #92400E;
}

.admin-dashboard-response-item > strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-dashboard-response-item > p {
    display: -webkit-box;
    min-height: 44px;
    margin: 0;
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.78rem;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.admin-dashboard-leaderboards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-leaderboard-card {
    --leaderboard-color: #2563EB;
}

.admin-leaderboard-card.is-advances {
    --leaderboard-color: #D97706;
}

.admin-dashboard-leaderboard {
    display: grid;
    gap: 12px;
}

.admin-dashboard-leaderboard-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    min-width: 0;
}

.admin-dashboard-leaderboard-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.admin-dashboard-leaderboard-rank {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-card);
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.admin-dashboard-leaderboard-identity > div {
    display: grid;
    min-width: 0;
}

.admin-dashboard-leaderboard-identity strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-dashboard-leaderboard-identity small {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.admin-dashboard-leaderboard-value {
    align-self: center;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 800;
}

.admin-dashboard-leaderboard-track {
    grid-column: 1 / -1;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted, #E5E7EB);
}

.admin-dashboard-leaderboard-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--leaderboard-color);
}

.admin-dashboard-data-note {
    display: block;
    min-height: 18px;
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.6;
}

.admin-dashboard-empty {
    grid-column: 1 / -1;
    padding: 28px 16px;
    border: 1px dashed var(--border-card);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.admin-operations-dashboard[aria-busy="true"] .admin-operations-panel,
.admin-operations-dashboard[aria-busy="true"] .admin-operation-card {
    opacity: 0.72;
}

@media (max-width: 1100px) {
    .admin-operations-head {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-operations-controls {
        min-width: 0;
    }

    .admin-operations-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-operation-card.is-responses {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .admin-operations-context {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-operations-context small {
        margin-inline-start: 0;
    }

    .admin-operations-kpi-grid,
    .admin-dashboard-leaderboards,
    .admin-dashboard-responses-list {
        grid-template-columns: 1fr;
    }

    .admin-primary-task-grid {
        grid-template-columns: 1fr;
    }

    .admin-primary-task {
        min-height: 118px;
    }

    .admin-primary-tasks-heading > span {
        display: none;
    }

    .admin-operation-card.is-responses {
        grid-column: auto;
    }
}

@media (min-width: 769px) {
    #dashboard-section .dashboard-sidebar {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 10px 18px;
        overflow: visible;
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: var(--shadow-sm);
        background: #FFFFFF;
        height: auto;
    }

    #dashboard-section .dashboard-sidebar::before,
    #dashboard-section .dashboard-sidebar h4 {
        display: none !important;
    }

    #dashboard-section .dashboard-sidebar .qa-grid {
        display: flex !important;
        flex-wrap: nowrap;
        justify-content: center;
        gap: 10px;
        margin: 0;
    }

    #dashboard-section .dashboard-sidebar .qa-btn {
        width: auto !important;
        min-width: 164px;
        min-height: 42px;
        flex: 0 0 auto;
        margin: 0 !important;
        padding: 9px 12px !important;
        border-radius: 8px;
        box-shadow: none;
    }

    #dashboard-section .dashboard-sidebar .qa-sub {
        display: none !important;
    }

    #dashboard-section #admin-controls:not(.hidden) {
        display: flex !important;
        flex: 0 1 auto;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        overflow: visible;
    }

    #dashboard-section #admin-controls > .admin-accordion {
        flex: 0 0 auto;
        overflow: visible !important;
    }

    #dashboard-section #admin-controls .accordion-body {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        z-index: 1000;
        width: min(430px, calc(100vw - 32px));
        max-height: none !important;
        overflow: visible;
    }
}

/* ============================================
   DASHBOARD OVERVIEW + FOOTER REFRESH
   ============================================ */
.dashboard-overview {
    display: grid;
    gap: 12px;
    padding: 0;
}

.dashboard-overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.dashboard-overview-head h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
}

.dashboard-overview-head p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.dashboard-refresh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid rgba(185, 28, 28, 0.18);
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
}

.dashboard-refresh-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
}

.dashboard-kpi-tile {
    position: relative;
    display: grid;
    gap: 6px;
    min-height: 112px;
    padding: 15px;
    text-align: right;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
    color: var(--text-main);
    overflow: hidden;
}

button.dashboard-kpi-tile {
    cursor: pointer;
}

.dashboard-kpi-tile::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--tile-accent, var(--primary));
}

.dashboard-kpi-tile span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.dashboard-kpi-tile strong {
    color: var(--text-main);
    font-size: 2rem;
    line-height: 1;
    font-weight: 900;
}

.dashboard-kpi-tile small {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.dashboard-kpi-tile.is-red { --tile-accent: #B91C1C; }
.dashboard-kpi-tile.is-amber { --tile-accent: #D97706; }
.dashboard-kpi-tile.is-blue { --tile-accent: #2563EB; }
.dashboard-kpi-tile.is-green { --tile-accent: #059669; }

@media (hover: hover) {
    button.dashboard-kpi-tile:hover {
        border-color: rgba(185, 28, 28, 0.24);
        box-shadow: var(--shadow-md);
        transform: translateY(-1px);
    }
}

.dashboard-insight-strip {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.2fr);
    gap: 10px;
}

.dashboard-insight-strip > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.dashboard-insight-strip span {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.dashboard-insight-strip strong {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 800;
    text-align: left;
}

#global-footer.app-footer {
    margin-top: auto;
    flex-shrink: 0;
    padding: 0;
    background: #FFFFFF !important;
    color: var(--text-muted);
    border-top: 1px solid var(--border) !important;
}

.app-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    max-width: min(1880px, calc(100% - 32px));
    margin: 0 auto;
    padding: 12px 24px;
    font-size: 0.82rem;
    line-height: 1.5;
}

#global-footer .app-footer-status {
    display: none !important;
}

.app-footer-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 0.9fr) minmax(220px, 0.9fr);
    gap: 28px;
    margin-bottom: 22px;
}

.app-footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

#global-footer .ui-style-260 {
    height: 34px;
    filter: none;
}

#global-footer .ui-style-261,
#global-footer .ui-style-262 {
    color: var(--text-main);
}

#global-footer .ui-style-113,
#global-footer .ui-style-264 {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.7;
}

.app-footer-link-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.app-footer-link-list a,
.app-footer-link-list .admin-nav-link {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-table-odd);
    color: var(--text-main);
    font-weight: 800;
    font-size: 0.82rem;
    text-decoration: none;
    width: 100%;
    font-family: inherit;
    cursor: pointer;
    text-align: right;
}

.app-footer-link-list a:hover,
.app-footer-link-list .admin-nav-link:hover {
    border-color: rgba(185, 28, 28, 0.22);
    background: var(--primary-light);
    color: var(--primary);
}

.app-footer-status {
    width: fit-content;
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.08);
    color: #047857;
    font-weight: 800;
}

.app-footer-bottom {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .dashboard-kpi-grid,
    .app-footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .dashboard-overview-head {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-refresh-btn {
        width: 100%;
    }

    .dashboard-kpi-grid,
    .app-footer-grid,
    .app-footer-link-list {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-tile {
        min-height: 96px;
    }

    .dashboard-insight-strip > div {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ============================================================
   SALARY REPORTS
   ============================================================ */

.admin-btn-salary-reports {
    color: #6D28D9;
}

.salary-report-shell {
    padding: 0;
    overflow: hidden;
}

.salary-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(14, 165, 233, 0.05));
}

.salary-report-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.salary-report-title-row h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.55rem;
}

.salary-report-title-row p {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.salary-report-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.salary-report-formula {
    min-width: 310px;
    padding: 12px 15px;
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: 10px;
    background: var(--surface);
}

.salary-report-formula span,
.salary-report-formula strong {
    display: block;
}

.salary-report-formula span {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.salary-report-formula strong {
    color: #6D28D9;
    font-size: 0.86rem;
}

.salary-report-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 0.8fr)) minmax(220px, 1.2fr) auto;
    align-items: end;
    gap: 12px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.salary-report-filter {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.salary-report-filter > span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.salary-report-filter .input-control {
    min-height: 44px;
}

.salary-report-actions {
    display: flex;
    gap: 8px;
}

.salary-report-actions button {
    min-height: 44px;
    white-space: nowrap;
}

.salary-report-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    color: var(--text-muted);
    font-weight: 800;
}

.salary-report-loading.hidden {
    display: none;
}

.salary-report-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 22px 28px 10px;
}

.salary-report-kpi {
    position: relative;
    min-width: 0;
    padding: 16px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.salary-report-kpi::before {
    content: '';
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 4px;
    background: var(--salary-kpi-color, #64748B);
}

.salary-report-kpi span,
.salary-report-kpi strong {
    display: block;
}

.salary-report-kpi span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.salary-report-kpi strong {
    margin-top: 7px;
    color: var(--text-main);
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    font-weight: 900;
    white-space: nowrap;
}

.salary-report-kpi.is-employees { --salary-kpi-color: #64748B; }
.salary-report-kpi.is-basic { --salary-kpi-color: #0284C7; }
.salary-report-kpi.is-variable { --salary-kpi-color: #0F766E; }
.salary-report-kpi.is-commission { --salary-kpi-color: #D97706; }
.salary-report-kpi.is-total {
    --salary-kpi-color: #7C3AED;
    border-color: rgba(124, 58, 237, 0.22);
    background: rgba(124, 58, 237, 0.06);
}

.salary-report-kpi.is-total strong {
    color: #6D28D9;
}

.salary-report-panel {
    margin: 16px 28px 24px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    background: var(--surface);
}

.salary-report-workspace {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
    margin: 12px 28px 24px;
    min-height: min(64vh, 720px);
    height: min(72vh, 820px);
}

.salary-report-master {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    background: var(--surface);
}

.salary-report-master-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
}

.salary-report-master-head h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 0.95rem;
}

.salary-report-master-head p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.45;
}

.salary-report-master-search {
    display: block;
    padding: 10px 12px 8px;
}

.salary-report-master-search .input-control {
    min-height: 40px;
    width: 100%;
}

.salary-report-master-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
    overscroll-behavior: contain;
}

.salary-report-master-item {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    margin: 0 0 4px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: right;
    cursor: pointer;
}

.salary-report-master-item:hover {
    background: var(--bg-table-odd);
}

.salary-report-master-item.is-selected {
    border-color: rgba(124, 58, 237, 0.28);
    background: rgba(124, 58, 237, 0.08);
    box-shadow: inset -3px 0 0 #7C3AED;
}

.salary-report-master-name {
    color: var(--text-main);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.4;
}

.salary-report-master-item.is-selected .salary-report-master-name {
    color: #6D28D9;
}

.salary-report-master-meta {
    display: grid;
    justify-items: end;
    gap: 2px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.salary-report-master-meta strong {
    font-size: 0.78rem;
}

.salary-report-master-empty {
    padding: 28px 14px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.salary-report-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    margin: 0;
}

.salary-report-detail .salary-report-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
}

.salary-report-detail-head-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.salary-report-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(124, 58, 237, 0.22);
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    color: #6D28D9;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.salary-report-active-filter:hover {
    background: rgba(124, 58, 237, 0.14);
}

.salary-report-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table-odd);
}

.salary-report-panel-head h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
}

.salary-report-panel-head p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.salary-report-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    color: #6D28D9;
    font-size: 0.78rem;
    font-weight: 900;
}

.salary-report-table-wrap {
    width: 100%;
    max-height: min(72vh, 760px);
    overflow: auto;
    overscroll-behavior: contain;
}

.salary-report-table {
    min-width: 0;
    table-layout: fixed;
}

.salary-report-table th,
.salary-report-table td {
    padding: 12px 14px;
    text-align: center;
    white-space: normal;
}

.salary-report-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--bg-table-header) !important;
    box-shadow: 0 1px 0 var(--border);
}

.salary-report-table tbody td {
    padding-block: 12px !important;
}

.salary-report-table td.salary-report-name {
    min-width: 0;
    text-align: right;
    font-weight: 800;
    white-space: normal;
}

.salary-report-code {
    font-weight: 900;
    white-space: nowrap !important;
}

.salary-report-scope-cell strong,
.salary-report-scope-cell small {
    display: block;
}

.salary-report-scope-cell strong {
    color: var(--text-main);
}

.salary-report-scope-cell small {
    margin-top: 4px;
    color: var(--text-muted);
}

#salary-report-employee-table th:nth-child(1),
#salary-report-employee-table td:nth-child(1) { width: 4%; }
#salary-report-employee-table th:nth-child(2),
#salary-report-employee-table td:nth-child(2) { width: 8%; }
#salary-report-employee-table th:nth-child(3),
#salary-report-employee-table td:nth-child(3) { width: 20%; }
#salary-report-employee-table th:nth-child(4),
#salary-report-employee-table td:nth-child(4) { width: 18%; }
#salary-report-employee-table th:nth-child(n+5),
#salary-report-employee-table td:nth-child(n+5) {
    width: 12.5%;
    white-space: nowrap;
}

#salary-report-employee-table th:nth-child(n+5):not(:last-child),
#salary-report-employee-table td:nth-child(n+5):not(:last-child) {
    width: 10.5%;
}

#salary-report-employee-table th:last-child,
#salary-report-employee-table td:last-child {
    width: 8%;
    min-width: 116px;
}

.salary-report-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 62px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-table-odd);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 800;
}

.salary-report-pagination-actions,
.salary-report-pagination-actions label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.salary-report-pagination-actions .input-control {
    width: 76px;
    min-height: 36px;
    padding-block: 5px;
}

.salary-report-pagination-actions button {
    min-height: 36px;
    padding: 6px 13px;
}

.salary-report-pagination-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.salary-report-pagination-actions > strong {
    min-width: 58px;
    color: var(--text-main);
    text-align: center;
}

.salary-report-total-cell {
    color: #6D28D9;
    font-weight: 900;
    background: rgba(124, 58, 237, 0.04);
}

.salary-report-department-link {
    padding: 0;
    border: 0;
    background: transparent;
    color: #6D28D9;
    font: inherit;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

.salary-report-empty {
    padding: 34px !important;
    color: var(--text-muted);
    text-align: center !important;
}

.salary-report-empty.is-error,
.salary-report-master-empty.is-error {
    color: var(--danger);
}

@media (max-width: 1180px) {
    .salary-report-header {
        align-items: stretch;
        flex-direction: column;
    }

    .salary-report-formula {
        min-width: 0;
    }

    .salary-report-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .salary-report-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .salary-report-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .salary-report-workspace {
        grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
        margin-inline: 18px;
    }
}

@media (max-width: 680px) {
    .salary-report-header,
    .salary-report-toolbar {
        padding: 16px 14px;
    }

    .salary-report-title-row,
    .salary-report-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .salary-report-toolbar,
    .salary-report-kpis {
        grid-template-columns: 1fr;
    }

    .salary-report-actions {
        grid-column: auto;
    }

    .salary-report-actions button {
        flex: 1;
    }

    .salary-report-kpis {
        padding: 16px 14px 4px;
    }

    .salary-report-panel {
        margin: 14px;
    }

    .salary-report-workspace {
        grid-template-columns: 1fr;
        min-height: 0;
        margin: 14px;
    }

    .salary-report-master {
        max-height: 280px;
    }

    .salary-report-detail-head-meta {
        width: 100%;
        justify-content: space-between;
    }
}

.salary-report-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 28px 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.salary-report-tab {
    min-height: 42px;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: var(--bg-table-odd);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 900;
    cursor: pointer;
}

.salary-report-tab.is-active {
    position: relative;
    z-index: 1;
    margin-bottom: -1px;
    border-color: rgba(124, 58, 237, 0.3);
    background: var(--surface);
    color: #6D28D9;
    box-shadow: inset 0 3px 0 #7C3AED;
}

.salary-report-comparison-controls {
    display: grid;
    grid-template-columns: minmax(220px, 320px) auto minmax(280px, 1fr);
    align-items: end;
    gap: 18px;
    padding: 14px 28px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.16);
    background: rgba(124, 58, 237, 0.05);
}

.salary-report-comparison-controls.hidden {
    display: none;
}

/* Admin command center */
.admin-command-dashboard {
    gap: 14px;
    padding-bottom: 28px;
}

.admin-command-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 8% 10%, rgba(185, 28, 28, 0.08), transparent 28%),
        var(--surface);
    box-shadow: var(--shadow-sm);
}

.admin-command-intro {
    min-width: 0;
}

.admin-command-intro h1 {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(1.45rem, 2.2vw, 2.15rem);
    font-weight: 900;
    letter-spacing: -0.03em;
}

.admin-command-intro p {
    max-width: 760px;
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.75;
}

.admin-command-status {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 4px 8px;
    min-width: 190px;
    padding: 12px 14px;
    border: 1px solid rgba(22, 163, 74, 0.18);
    border-radius: 14px;
    background: rgba(22, 163, 74, 0.05);
    color: #166534;
    font-size: 0.76rem;
    font-weight: 800;
}

.admin-command-status small {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 600;
}

.admin-command-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16A34A;
    box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.1);
}

.admin-command-toolbar {
    display: grid;
    grid-template-columns: auto minmax(150px, 190px) minmax(150px, 1fr) minmax(150px, 1fr) auto;
    align-items: end;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.admin-command-period-switch {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 42px;
    padding: 4px;
    border: 1px solid var(--border-card);
    border-radius: 12px;
    background: var(--surface-soft, #F8FAFC);
}

.admin-command-period-switch button {
    min-height: 32px;
    padding: 6px 13px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
}

.admin-command-period-switch button.is-active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.09);
}

.admin-command-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.admin-command-field > span {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
}

.admin-command-field .input-control,
.admin-command-refresh {
    width: 100%;
    min-height: 42px;
}

.admin-command-refresh {
    align-self: end;
}

.admin-command-context {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.73rem;
}

.admin-command-context strong {
    color: var(--text-main);
}

.admin-command-context p {
    margin: 0;
    text-align: center;
}

.admin-command-period-stats {
    color: var(--text-main);
    font-weight: 800;
    white-space: nowrap;
}

.admin-command-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.admin-command-kpi {
    --command-accent: #2563EB;
    position: relative;
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
    min-height: 150px;
    padding: 17px;
    overflow: hidden;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text-main);
    text-align: start;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.admin-command-kpi::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--command-accent);
}

.admin-command-kpi:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--command-accent) 35%, var(--border-card));
    box-shadow: var(--shadow-md);
}

.admin-command-kpi:focus-visible,
.admin-command-period-switch button:focus-visible,
.admin-command-priority-row:focus-visible,
.admin-command-payroll-open:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--command-accent, #2563EB) 26%, transparent);
    outline-offset: 2px;
}

.admin-command-kpi.is-action { --command-accent: #7C3AED; }
.admin-command-kpi.is-overdue { --command-accent: #DC2626; }
.admin-command-kpi.is-complaints { --command-accent: #B91C1C; }
.admin-command-kpi.is-advances { --command-accent: #D97706; }
.admin-command-kpi.is-payroll { --command-accent: #2563EB; }

.admin-command-kpi-label {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.admin-command-kpi > strong {
    color: var(--text-main);
    font-size: clamp(1.8rem, 3vw, 2.45rem);
    font-weight: 900;
    line-height: 1;
}

.admin-command-kpi > small {
    color: var(--text-muted);
    font-size: 0.69rem;
    line-height: 1.55;
}

.admin-command-kpi-delta {
    align-self: end;
    min-height: 19px;
    margin-top: auto;
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 800;
}

.admin-command-kpi-delta.is-up { color: #B91C1C; }
.admin-command-kpi-delta.is-down { color: #15803D; }

.admin-command-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.admin-command-context > div:first-child p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-align: start;
}

.admin-command-context-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.admin-command-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 4px 12px;
    border: 1px solid var(--border-card);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 800;
}

.admin-command-chip strong {
    font-size: 1rem;
    font-weight: 900;
}

.admin-command-chip.is-action { border-color: color-mix(in srgb, #7C3AED 28%, var(--border-card)); }
.admin-command-chip.is-overdue { border-color: color-mix(in srgb, #DC2626 28%, var(--border-card)); color: #991B1B; }

.admin-command-lanes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.admin-command-lane {
    --lane-accent: #B91C1C;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border-card);
    border-top: 4px solid var(--lane-accent);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.admin-command-lane.is-complaints { --lane-accent: #B91C1C; }
.admin-command-lane.is-advances { --lane-accent: #D97706; }
.admin-command-lane.is-payroll { --lane-accent: #2563EB; }

.admin-command-lane-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.admin-command-lane-head h2 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
}

.admin-command-lane-num {
    color: var(--text-main);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 900;
    line-height: 1;
}

.admin-command-lane > small {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.55;
}

.admin-command-lane .admin-command-count.is-overdue {
    background: rgba(185, 28, 28, 0.1);
    color: #991B1B;
}

.admin-command-stage-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-command-stage-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--surface-soft, #F8FAFC);
    color: #374151;
    font-size: 0.68rem;
    font-weight: 800;
}

.admin-command-stage-chip.is-supervisor { background: rgba(217, 119, 6, 0.1); color: #92400E; }
.admin-command-stage-chip.is-admin { background: rgba(185, 28, 28, 0.09); color: #991B1B; }
.admin-command-stage-chip.is-answered { background: rgba(124, 58, 237, 0.1); color: #5B21B6; }
.admin-command-stage-chip.is-closed { background: rgba(22, 163, 74, 0.1); color: #166534; }

.admin-command-lane .admin-command-priority-list {
    flex: 1 1 auto;
}

.admin-command-lane-cta {
    width: 100%;
    min-height: 42px;
    margin-top: auto;
    border: 1px solid var(--border-card);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.admin-command-lane.is-complaints .admin-command-lane-cta {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
}

.admin-command-lane-cta:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--lane-accent) 26%, transparent);
    outline-offset: 2px;
}

.admin-command-analysis {
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.admin-command-analysis > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.admin-command-analysis > summary::-webkit-details-marker { display: none; }

.admin-command-analysis > summary .admin-command-panel-hint {
    white-space: normal;
}

.admin-command-analysis-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0 16px 16px;
}

.admin-command-analysis-grid > #admin-dashboard-responses-panel {
    grid-column: 1 / -1;
}

.admin-command-main-grid,
.admin-command-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.9fr);
    gap: 12px;
}

.admin-command-secondary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-command-panel {
    min-width: 0;
    padding: 19px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.admin-command-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 15px;
}

.admin-command-panel-head h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 900;
}

.admin-command-panel-head p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.7rem;
    line-height: 1.55;
}

.admin-command-panel-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 900;
}

.admin-command-count {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 30px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    color: #6D28D9;
    font-size: 0.74rem;
    font-weight: 900;
}

.admin-command-panel-hint {
    color: var(--text-muted);
    font-size: 0.65rem;
    white-space: nowrap;
}

.admin-command-priority-list {
    display: grid;
    gap: 8px;
}

.admin-command-priority-row {
    --priority-accent: #B91C1C;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--border-card);
    border-inline-start: 3px solid var(--priority-accent);
    border-radius: 12px;
    background: var(--surface-soft, #F8FAFC);
    color: var(--text-main);
    text-align: start;
    cursor: pointer;
}

.admin-command-priority-row.is-advance { --priority-accent: #D97706; }
.admin-command-priority-row.is-payroll { --priority-accent: #2563EB; }
.admin-command-priority-row.is-overdue { background: rgba(185, 28, 28, 0.035); }

.admin-command-priority-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--priority-accent) 10%, white);
    color: var(--priority-accent);
    font-size: 0.72rem;
    font-weight: 900;
}

.admin-command-priority-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.admin-command-priority-copy strong {
    overflow: hidden;
    font-size: 0.78rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-command-priority-copy span,
.admin-command-priority-copy small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-command-priority-age {
    display: grid;
    gap: 2px;
    color: var(--text-muted);
    font-size: 0.62rem;
    text-align: end;
    white-space: nowrap;
}

.admin-command-priority-age strong {
    color: var(--priority-accent);
    font-size: 0.7rem;
}

.admin-command-chart-legend {
    display: flex;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.63rem;
}

.admin-command-chart-legend span::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-inline-end: 5px;
    border-radius: 50%;
    background: #B91C1C;
}

.admin-command-chart-legend .is-closed::before { background: #2563EB; }

.admin-command-trend {
    display: grid;
    grid-template-columns: repeat(6, minmax(34px, 1fr));
    align-items: end;
    gap: 9px;
    min-height: 210px;
    padding-top: 12px;
}

.admin-command-trend-month {
    display: grid;
    grid-template-rows: 170px auto;
    gap: 7px;
    min-width: 0;
}

.admin-command-trend-bars {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 4px;
    min-height: 0;
    border-bottom: 1px solid var(--border-card);
}

.admin-command-trend-bar {
    position: relative;
    width: min(15px, 42%);
    min-height: 3px;
    border-radius: 7px 7px 2px 2px;
    background: #B91C1C;
}

.admin-command-trend-bar.is-closed { background: #2563EB; }

.admin-command-trend-bar span {
    position: absolute;
    inset: -17px 50% auto auto;
    transform: translateX(50%);
    color: var(--text-muted);
    font-size: 0.57rem;
    font-weight: 800;
}

.admin-command-trend-month > span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.62rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-command-stages,
.admin-command-hotspots,
.admin-command-health,
.admin-command-payroll {
    display: grid;
    gap: 11px;
}

.admin-command-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    align-items: center;
}

.admin-command-progress-row span,
.admin-command-progress-row strong {
    color: var(--text-main);
    font-size: 0.7rem;
}

.admin-command-progress-row strong { font-weight: 900; }

.admin-command-progress-track {
    grid-column: 1 / -1;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted, #E5E7EB);
}

.admin-command-progress-track i {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    background: var(--progress-color, #B91C1C);
}

.admin-command-payroll-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.admin-command-payroll-summary div {
    padding: 10px 7px;
    border-radius: 10px;
    background: var(--surface-soft, #F8FAFC);
    text-align: center;
}

.admin-command-payroll-summary strong {
    display: block;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 900;
}

.admin-command-payroll-summary span {
    color: var(--text-muted);
    font-size: 0.6rem;
}

.admin-command-payroll-meta {
    color: var(--text-muted);
    font-size: 0.68rem;
    line-height: 1.65;
}

.admin-command-payroll-open {
    min-height: 36px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.07);
    color: #1D4ED8;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 900;
    cursor: pointer;
}

.admin-command-health-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-card);
}

.admin-command-health-item:last-child { border-bottom: 0; }
.admin-command-health-item span { color: var(--text-muted); font-size: 0.69rem; }
.admin-command-health-item strong { color: var(--text-main); font-size: 0.8rem; font-weight: 900; }
.admin-command-health-item strong.is-good { color: #15803D; }
.admin-command-health-item strong.is-warning { color: #B45309; }
.admin-command-health-item strong.is-danger { color: #B91C1C; }

.admin-command-dashboard[aria-busy="true"] .admin-command-lanes,
.admin-command-dashboard[aria-busy="true"] .admin-command-analysis,
.admin-command-dashboard[aria-busy="true"] .admin-command-context-actions,
.admin-command-dashboard[aria-busy="true"] .admin-command-kpis,
.admin-command-dashboard[aria-busy="true"] .admin-command-main-grid,
.admin-command-dashboard[aria-busy="true"] .admin-command-secondary-grid,
.admin-command-dashboard[aria-busy="true"] .admin-command-bottom-grid {
    opacity: 0.68;
    pointer-events: none;
}

@media (max-width: 1240px) {
    .admin-command-toolbar {
        grid-template-columns: auto minmax(150px, 1fr) minmax(150px, 1fr) auto;
    }

    .admin-command-month-field {
        grid-column: 1 / -1;
    }

    .admin-command-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-command-lanes,
    .admin-command-analysis-grid,
    .admin-command-secondary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-command-lane.is-payroll,
    .admin-command-analysis-grid > #admin-dashboard-responses-panel,
    .admin-command-secondary-grid > :last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 920px) {
    .admin-command-head,
    .admin-command-lanes,
    .admin-command-analysis-grid,
    .admin-command-main-grid,
    .admin-command-bottom-grid {
        grid-template-columns: 1fr;
    }

    .admin-command-lane.is-payroll {
        grid-column: auto;
    }

    .admin-command-head {
        align-items: stretch;
        flex-direction: column;
        overflow: visible;
    }

    .admin-command-status {
        min-width: 0;
    }

    .admin-command-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-command-toolbar {
        grid-template-columns: 1fr;
    }

    .admin-command-period-switch,
    .admin-command-field,
    .admin-command-refresh {
        width: 100%;
    }

    .admin-command-context,
    .admin-command-context-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-command-context p,
    .admin-command-period-stats {
        text-align: start;
        white-space: normal;
    }
}

@media (max-width: 680px) {
    .admin-command-head,
    .admin-command-panel {
        padding: 16px;
    }

    .admin-command-toolbar,
    .admin-command-secondary-grid,
    .admin-command-kpis,
    .admin-command-lanes,
    .admin-command-analysis-grid {
        grid-template-columns: 1fr;
    }

    .admin-command-period-switch,
    .admin-command-month-field,
    .admin-command-secondary-grid > :last-child {
        grid-column: auto;
    }

    .admin-command-period-switch button {
        flex: 1;
    }

    .admin-command-kpi {
        min-height: 126px;
    }

    .admin-command-context {
        align-items: stretch;
    }

    .admin-command-chip {
        flex: 1 1 auto;
        justify-content: space-between;
    }

    .admin-command-period-stats {
        white-space: normal;
    }

    .admin-command-trend {
        gap: 5px;
        overflow-x: auto;
    }

    .admin-command-trend-month {
        min-width: 38px;
    }

    .admin-command-priority-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .admin-command-priority-age {
        grid-column: 2;
        text-align: start;
    }

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

.salary-report-month-picker {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.salary-report-month-picker legend {
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.salary-report-month-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.salary-report-month-picker-head > strong {
    color: var(--text-main);
    font-size: 0.82rem;
}

.salary-report-month-picker-head > span {
    display: flex;
    gap: 6px;
}

.salary-report-month-picker-head button {
    padding: 4px 8px;
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 999px;
    background: var(--surface);
    color: #6D28D9;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 900;
    cursor: pointer;
}

.salary-report-comparison-months {
    display: flex;
    gap: 7px;
    max-height: 104px;
    overflow: auto;
    flex-wrap: wrap;
    padding: 9px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
}

.salary-report-comparison-month-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
}

.salary-report-comparison-month-option:has(input:checked) {
    border-color: rgba(124, 58, 237, 0.4);
    background: rgba(124, 58, 237, 0.09);
    color: #6D28D9;
}

.salary-report-comparison-month-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #7C3AED;
}

.salary-report-unchanged-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.salary-report-unchanged-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #7C3AED;
}

.salary-report-comparison-note {
    align-self: center;
    padding: 10px 12px;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.65;
}

.salary-report-change-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    padding: 22px 28px 10px;
}

.salary-change-comparison-summaries {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 22px 28px 10px;
}

.salary-change-comparison-empty,
.salary-change-month-summary {
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: 10px;
    background: var(--surface);
}

.salary-change-comparison-empty {
    grid-column: 1 / -1;
    padding: 18px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 800;
}

.salary-change-month-summary {
    overflow: hidden;
}

.salary-change-month-summary > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.12);
    background: rgba(124, 58, 237, 0.055);
    color: var(--text-muted);
    font-size: 0.78rem;
}

.salary-change-month-summary > header strong {
    color: #6D28D9;
}

.salary-change-month-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
}

.salary-change-month-metrics > span {
    display: grid;
    gap: 4px;
    padding: 8px;
    border-radius: 8px;
    background: var(--bg-table-odd);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.salary-change-month-metrics b {
    color: var(--text-main);
    font-size: 0.94rem;
}

.salary-change-month-metrics small {
    font-size: 0.68rem;
}

.salary-change-month-summary > footer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 9px 12px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.salary-change-month-summary > footer b {
    color: #6D28D9;
}

.salary-report-kpi.is-decrease {
    --salary-kpi-color: #DC2626;
}

.salary-report-kpi.is-decrease strong,
.salary-change-negative,
#salary-change-net-total.is-negative {
    color: #B42318 !important;
    font-weight: 900;
}

.salary-change-positive {
    color: #047857 !important;
    font-weight: 900;
}

.salary-change-status-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 28px 4px;
}

.salary-change-status-strip > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-table-odd);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.salary-change-status-strip strong {
    color: #6D28D9;
    font-size: 1rem;
}

.salary-change-type-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 28px 4px;
}

.salary-change-type-filters button {
    min-height: 36px;
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 900;
    cursor: pointer;
}

.salary-change-type-filters button.is-active {
    border-color: rgba(124, 58, 237, 0.35);
    background: rgba(124, 58, 237, 0.1);
    color: #6D28D9;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.08);
}

.salary-change-department-table {
    min-width: 0;
}

.salary-change-employee-table {
    min-width: 0;
}

.salary-change-employee-table th:nth-child(1),
.salary-change-employee-table .salary-change-summary-row td:nth-child(1) { width: 4%; }
.salary-change-employee-table th:nth-child(2),
.salary-change-employee-table .salary-change-summary-row td:nth-child(2) { width: 8%; }
.salary-change-employee-table th:nth-child(3),
.salary-change-employee-table .salary-change-summary-row td:nth-child(3) { width: 15%; }
.salary-change-employee-table th:nth-child(4),
.salary-change-employee-table .salary-change-summary-row td:nth-child(4) { width: 15%; }
.salary-change-employee-table th:nth-child(5),
.salary-change-employee-table .salary-change-summary-row td:nth-child(5) { width: 20%; }
.salary-change-employee-table th:nth-child(6),
.salary-change-employee-table .salary-change-summary-row td:nth-child(6) { width: 20%; }
.salary-change-employee-table th:nth-child(7),
.salary-change-employee-table .salary-change-summary-row td:nth-child(7) { width: 10%; }
.salary-change-employee-table th:nth-child(8),
.salary-change-employee-table .salary-change-summary-row td:nth-child(8) { width: 8%; }

.salary-change-summary-cell {
    color: var(--text-main);
    font-weight: 800 !important;
    line-height: 1.55;
}

.salary-change-summary-row.is-expanded td {
    background: rgba(124, 58, 237, 0.045) !important;
}

.salary-change-expand-btn {
    min-width: 62px !important;
    min-height: 32px !important;
    padding: 5px 10px !important;
    border-color: rgba(124, 58, 237, 0.28) !important;
    background: rgba(124, 58, 237, 0.07) !important;
    color: #6D28D9 !important;
}

.salary-change-expanded-row.hidden {
    display: none;
}

.salary-change-expanded-row > td {
    padding: 0 14px 14px !important;
    background: rgba(124, 58, 237, 0.025) !important;
}

.salary-change-expanded-row:hover > td {
    transform: none !important;
    box-shadow: none !important;
}

.salary-change-expanded-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: 10px;
    background: var(--surface);
}

.salary-change-month-differences {
    display: grid;
    gap: 5px;
}

.salary-change-month-differences > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--bg-table-odd);
    font-size: 0.72rem;
}

.salary-change-month-differences em {
    color: var(--text-muted);
    font-style: normal;
    font-weight: 900;
}

.salary-change-month-detail {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg-table-odd);
}

.salary-change-month-detail > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.salary-change-total-comparison {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.salary-change-total-comparison > span {
    display: grid;
    align-content: center;
    gap: 6px;
    min-height: 64px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-table-odd);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.salary-change-total-comparison strong {
    color: var(--text-main);
    font-size: 0.88rem !important;
    white-space: nowrap;
}

.salary-change-employee-table td:nth-child(4) strong,
.salary-change-employee-table td:nth-child(4) small {
    display: block;
}

.salary-change-employee-table td:nth-child(4) small {
    margin-top: 4px;
    color: var(--text-muted);
}

.salary-change-details-cell {
    min-width: 0;
    white-space: normal !important;
}

.salary-change-line {
    display: grid;
    grid-template-columns: minmax(105px, 0.75fr) minmax(170px, 1.35fr) auto;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    text-align: right;
}

.salary-change-line + .salary-change-line {
    margin-top: 6px;
}

.salary-change-line.is-increase {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.05);
}

.salary-change-line.is-decrease {
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(220, 38, 38, 0.04);
}

.salary-change-line strong {
    color: var(--text-main);
    font-size: 0.76rem;
}

.salary-change-line span {
    color: var(--text-muted);
    font-size: 0.73rem;
}

.salary-change-line em {
    color: #047857;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 900;
}

.salary-change-line.is-decrease em {
    color: #B42318;
}

.salary-change-special-note {
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-table-odd);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.salary-change-special-note.is-new {
    border-color: rgba(14, 165, 233, 0.2);
    background: rgba(14, 165, 233, 0.06);
    color: #0369A1;
}

.salary-change-special-note.is-removed {
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(245, 158, 11, 0.07);
    color: #B45309;
}

.salary-change-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 150px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #F1F5F9;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 900;
    white-space: normal;
}

.salary-change-status.is-increase { background: rgba(16, 185, 129, 0.1); color: #047857; }
.salary-change-status.is-decrease { background: rgba(220, 38, 38, 0.09); color: #B42318; }
.salary-change-status.is-neutral { background: rgba(124, 58, 237, 0.09); color: #6D28D9; }
.salary-change-status.is-new { background: rgba(14, 165, 233, 0.1); color: #0369A1; }
.salary-change-status.is-removed { background: rgba(245, 158, 11, 0.11); color: #B45309; }
.salary-change-status.is-unchanged { background: #F1F5F9; color: #64748B; }
.salary-change-status.is-mixed { background: rgba(124, 58, 237, 0.09); color: #6D28D9; }

@media (max-width: 1180px) {
    .salary-report-change-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .salary-report-comparison-controls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .salary-report-comparison-note {
        grid-column: 1 / -1;
    }

    .salary-change-expanded-content {
        grid-template-columns: 1fr;
    }

    .salary-change-comparison-summaries {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .salary-report-workspace {
        grid-template-columns: 1fr;
        min-height: 0;
        height: auto;
    }

    .salary-report-master {
        max-height: 300px;
    }

    .salary-report-detail .salary-report-table-wrap {
        max-height: min(70vh, 640px);
    }
}

@media (max-width: 900px) {
    #salary-report-employee-table,
    .salary-change-employee-table,
    .salary-change-department-table {
        min-width: 860px;
    }

    .salary-report-table-wrap {
        overflow: auto;
    }
}

@media (max-width: 680px) {
    .salary-report-tabs {
        padding: 12px 14px 0;
    }

    .salary-report-tab {
        flex: 1;
        padding-inline: 10px;
    }

    .salary-report-comparison-controls,
    .salary-report-change-kpis,
    .salary-change-status-strip {
        grid-template-columns: 1fr;
    }

    .salary-report-comparison-controls {
        padding: 14px;
    }

    .salary-report-comparison-note {
        grid-column: auto;
    }

    .salary-report-change-kpis {
        padding: 16px 14px 4px;
    }

    .salary-change-comparison-summaries {
        grid-template-columns: 1fr;
        padding: 16px 14px 4px;
    }

    .salary-change-month-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .salary-change-status-strip {
        margin: 10px 14px 2px;
    }

    .salary-change-type-filters {
        gap: 6px;
        margin: 10px 14px 2px;
    }

    .salary-change-type-filters button {
        flex: 1 1 calc(50% - 6px);
    }

    .salary-report-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .salary-report-pagination-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .salary-report-pagination-actions label {
        width: 100%;
        justify-content: space-between;
    }

    .salary-change-expanded-content,
    .salary-change-total-comparison {
        grid-template-columns: 1fr;
    }

    .salary-report-actions {
        width: 100%;
        flex-direction: column;
    }

    .salary-report-actions button {
        width: 100%;
        flex: none;
    }
}

/* ========================================================================== 
   Unified data-table typography and actions
   ========================================================================== */
html,
body,
button,
input,
select,
textarea,
.app-data-table {
    font-family: var(--font-ui) !important;
}

.app-data-table {
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
}

.app-data-table th {
    font-family: var(--font-ui) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    line-height: 1.45;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.app-data-table td {
    font-family: var(--font-ui) !important;
    font-size: 0.82rem !important;
    font-weight: 500;
    line-height: 1.6;
}

.app-data-table td strong {
    font-family: inherit;
    font-size: inherit !important;
    font-weight: 800;
    line-height: 1.55;
}

.app-data-table td small {
    font-family: inherit;
    font-size: 0.74rem !important;
    font-weight: 500;
    line-height: 1.55;
}

.app-data-table td button:not(.close-modal),
.app-data-table td .btn-primary,
.app-data-table td .btn-secondary,
.app-data-table td .btn-outline,
.table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 74px;
    max-width: 100%;
    min-height: 36px !important;
    padding: 7px 12px !important;
    border-width: 1px !important;
    border-style: solid;
    border-radius: 8px !important;
    font-family: var(--font-ui) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
    box-shadow: none !important;
}

.table-actions,
.app-data-table .dir-actions-wrapper,
.app-data-table .advance-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.table-action-view,
.app-data-table .dir-btn-view,
.table-action-success,
.app-data-table .btn-advance-decision.is-approve {
    color: #047857 !important;
    background: #ECFDF5 !important;
    border-color: #A7F3D0 !important;
}

.table-action-edit,
.app-data-table .dir-btn-edit,
.table-action-primary,
.app-data-table .btn-advance-edit,
.app-data-table .btn-advance-execute {
    color: #1D4ED8 !important;
    background: #EFF6FF !important;
    border-color: #BFDBFE !important;
}

.table-action-warning,
.app-data-table .btn-advance-opinion {
    color: #B45309 !important;
    background: #FFFBEB !important;
    border-color: #FDE68A !important;
}

.table-action-danger,
.app-data-table .btn-advance-delete,
.app-data-table .btn-advance-decision.is-reject,
.app-data-table .ticket-action-btn-danger {
    color: #B91C1C !important;
    background: #FEF2F2 !important;
    border-color: #FECACA !important;
}

@media (hover: hover) {
    .app-data-table td button:not(:disabled):hover,
    .table-action-btn:not(:disabled):hover {
        transform: translateY(-1px);
        filter: brightness(0.97);
        box-shadow: 0 4px 10px rgba(16, 24, 40, 0.1) !important;
    }
}

/* The advance workflow has fourteen data columns. Keep the table on the full
   page width, distribute that width deliberately, and let text wrap in-cell. */
#advance-requests-section {
    width: calc(100% - 24px);
    max-width: none;
    padding-inline: 0;
    margin: 12px auto 24px;
}

.advance-workflow-summary {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (min-width: 769px) {
    .advance-table-wrap {
        overflow-x: auto;
    }

    body:not([data-user-role="admin"]) .advance-requests-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }
}

    .advance-requests-table th,
    .advance-requests-table td {
        padding: 12px 10px !important;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .advance-requests-table th:nth-child(1),
    .advance-requests-table td:nth-child(1) { width: 2.5%; }
    .advance-requests-table th:nth-child(2),
    .advance-requests-table td:nth-child(2) { width: 2.5%; }
    .advance-requests-table th:nth-child(3),
    .advance-requests-table td:nth-child(3) { width: 11%; }
    .advance-requests-table th:nth-child(4),
    .advance-requests-table td:nth-child(4) { width: 7%; }
    .advance-requests-table th:nth-child(5),
    .advance-requests-table td:nth-child(5) { width: 5%; }
    .advance-requests-table th:nth-child(6),
    .advance-requests-table td:nth-child(6) { width: 4%; }
    .advance-requests-table th:nth-child(7),
    .advance-requests-table td:nth-child(7) { width: 6%; }
    .advance-requests-table th:nth-child(8),
    .advance-requests-table td:nth-child(8) { width: 10%; }
    .advance-requests-table th:nth-child(9),
    .advance-requests-table td:nth-child(9) { width: 11%; }
    .advance-requests-table th:nth-child(10),
    .advance-requests-table td:nth-child(10) { width: 6%; }
    .advance-requests-table th:nth-child(11),
    .advance-requests-table td:nth-child(11) { width: 7%; }
    .advance-requests-table th:nth-child(12),
    .advance-requests-table td:nth-child(12) { width: 10%; }
    .advance-requests-table th:nth-child(13),
    .advance-requests-table td:nth-child(13) { width: 10%; }
    .advance-requests-table th:nth-child(14),
    .advance-requests-table td:nth-child(14) { width: 8%; }

    .advance-requests-table .advance-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .advance-requests-table .advance-actions > :only-child {
        grid-column: 1 / -1;
    }

    .advance-requests-table td button:not(.close-modal) {
        width: 100%;
        min-width: 0;
    }
}

/* ============================================
   PROJECT APPEARANCE (admin-controlled)
   ============================================ */
html[data-theme="navy"] {
    --brand-red: #1E3A8A;
    --brand-red-dark: #172554;
    --bg-page: #E8EEF5;
    --surface: #FFFFFF;
    --primary: #1E3A8A;
    --primary-light: #E0E7FF;
    --secondary: #E2E8F0;
    --bg-color: var(--bg-page);
    --text-main: #0F172A;
    --text-muted: #475569;
    --border: #C9D4E5;
    --danger: #DC2626;
    --success: #0F766E;
    --grad-primary: linear-gradient(135deg, #1E3A8A 0%, #172554 100%);
    --grad-sidebar: linear-gradient(180deg, #FFFFFF 0%, #EEF3F9 100%);
    --color-focus-teal: #1D4ED8;
    --color-red-light: #E0E7FF;
    --color-red-dark: #1E3A8A;
    --bg-accordion-header: rgba(226, 232, 240, 0.55);
    --bg-accordion-header-hover: rgba(226, 232, 240, 0.85);
    --bg-accordion-header-active: rgba(219, 234, 254, 0.95);
    --border-card: #C9D4E5;
    --bg-table-header: #E8EEF5;
    --bg-table-odd: #F3F6FB;
    --bg-table-even: #FFFFFF;
    --border-table: #D7E0EC;
    --text-table-th: #1E3A8A;
    --bg-footer: #F8FAFC;
    --border-footer: #C9D4E5;
    --btn-secondary-bg: #FFFFFF;
    --btn-secondary-bg-hover: #EEF3F9;
    --btn-secondary-bg-active: #E2E8F0;
}

html[data-theme="teal"] {
    --brand-red: #0F766E;
    --brand-red-dark: #115E59;
    --bg-page: #E7F4F1;
    --surface: #FFFFFF;
    --primary: #0F766E;
    --primary-light: #CCFBF1;
    --secondary: #D1FAE5;
    --bg-color: var(--bg-page);
    --text-main: #134E4A;
    --text-muted: #3F746E;
    --border: #B7D8D1;
    --danger: #DC2626;
    --success: #059669;
    --grad-primary: linear-gradient(135deg, #0F766E 0%, #115E59 100%);
    --grad-sidebar: linear-gradient(180deg, #FFFFFF 0%, #ECF8F5 100%);
    --color-focus-teal: #0F766E;
    --color-red-light: #CCFBF1;
    --color-red-dark: #115E59;
    --bg-accordion-header: rgba(204, 251, 241, 0.4);
    --bg-accordion-header-hover: rgba(204, 251, 241, 0.7);
    --bg-accordion-header-active: rgba(153, 246, 228, 0.85);
    --border-card: #B7D8D1;
    --bg-table-header: #E7F4F1;
    --bg-table-odd: #F1FAF8;
    --bg-table-even: #FFFFFF;
    --border-table: #CDE6E1;
    --text-table-th: #115E59;
    --bg-footer: #F0FAF7;
    --border-footer: #B7D8D1;
    --btn-secondary-bg: #FFFFFF;
    --btn-secondary-bg-hover: #ECF8F5;
    --btn-secondary-bg-active: #D1FAE5;
}

html[data-theme="sand"] {
    --brand-red: #9A3412;
    --brand-red-dark: #7C2D12;
    --bg-page: #F6EDE0;
    --surface: #FFFBF5;
    --primary: #9A3412;
    --primary-light: #FFEDD5;
    --secondary: #F3E6D4;
    --bg-color: var(--bg-page);
    --text-main: #431407;
    --text-muted: #7C6A58;
    --border: #E4D2BA;
    --danger: #B91C1C;
    --success: #3F6212;
    --grad-primary: linear-gradient(135deg, #C2410C 0%, #9A3412 100%);
    --grad-sidebar: linear-gradient(180deg, #FFFBF5 0%, #F6EDE0 100%);
    --color-focus-teal: #B45309;
    --color-red-light: #FFEDD5;
    --color-red-dark: #9A3412;
    --bg-accordion-header: rgba(255, 237, 213, 0.55);
    --bg-accordion-header-hover: rgba(255, 237, 213, 0.85);
    --bg-accordion-header-active: rgba(254, 215, 170, 0.9);
    --border-card: #E4D2BA;
    --bg-table-header: #F3E6D4;
    --bg-table-odd: #FBF4EA;
    --bg-table-even: #FFFBF5;
    --border-table: #E8D7C2;
    --text-table-th: #7C2D12;
    --bg-footer: #FFF8EE;
    --border-footer: #E4D2BA;
    --btn-secondary-bg: #FFFBF5;
    --btn-secondary-bg-hover: #F6EDE0;
    --btn-secondary-bg-active: #F3E6D4;
}

html[data-theme] {
    font-family: var(--font-ui);
}

html[data-theme] body {
    font-family: var(--font-ui);
    font-size: var(--font-size-body);
}

html[data-theme] h1,
html[data-theme] h2,
html[data-theme] h3,
html[data-theme] h4,
html[data-theme] .nav-page-title,
html[data-theme] .login-card h2,
html[data-theme] .admin-command-intro h1,
html[data-theme] .admin-command-intro h2,
html[data-theme] .admin-navigation-heading strong {
    font-family: var(--font-ui);
    font-size: var(--font-size-heading);
}

.appearance-settings-shell {
    max-width: 920px;
    margin: 0 auto;
    padding: 24px;
}

.appearance-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.appearance-settings-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.appearance-unsaved-badge {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 800;
}

.appearance-preview {
    border: 1px solid var(--border);
    background: var(--bg-table-odd);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 22px;
}

.appearance-preview-kicker {
    display: inline-block;
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 6px;
}

.appearance-preview h3 {
    margin: 0 0 8px;
    color: var(--text-main);
}

.appearance-preview p {
    margin-bottom: 12px;
}

.appearance-preview-table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.appearance-settings-block {
    margin-bottom: 22px;
}

.appearance-settings-block h3 {
    margin-bottom: 6px;
}

.appearance-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.appearance-choice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: right;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-main);
    cursor: pointer;
    min-height: 92px;
}

.appearance-choice small {
    color: var(--text-muted);
}

.appearance-choice-sample {
    margin-top: 4px;
    color: var(--text-main);
}

.appearance-choice.is-selected,
.appearance-choice[aria-pressed="true"] {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    background: var(--primary-light);
}

.appearance-theme-swatch {
    display: block;
    width: 100%;
    height: 18px;
    border-radius: 999px;
    margin-bottom: 4px;
    border: 1px solid var(--border);
}

.appearance-theme-swatch-ghazawy {
    background: linear-gradient(90deg, #B91C1C 0 32%, #F6F7F9 32% 66%, #111827 66% 100%);
}

.appearance-theme-swatch-navy {
    background: linear-gradient(90deg, #1E3A8A 0 32%, #E8EEF5 32% 66%, #0F172A 66% 100%);
}

.appearance-theme-swatch-teal {
    background: linear-gradient(90deg, #0F766E 0 32%, #E7F4F1 32% 66%, #134E4A 66% 100%);
}

.appearance-theme-swatch-sand {
    background: linear-gradient(90deg, #9A3412 0 32%, #F6EDE0 32% 66%, #431407 66% 100%);
}

.appearance-size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.appearance-size-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 700;
    color: var(--text-main);
}

.appearance-size-field input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-main);
}

.appearance-size-hint,
.appearance-settings-status {
    margin-top: 10px;
    color: var(--text-muted);
}

.appearance-settings-status[data-tone="success"] {
    color: var(--success);
}

.appearance-settings-status[data-tone="danger"] {
    color: var(--danger);
}

.appearance-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

@media (max-width: 720px) {
    .appearance-settings-header {
        flex-direction: column;
    }
}
