/* Presenze V4 - Award Winning Dark Mode */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    /* Colors - Nexai Navy Theme */
    --bg-app: #0B1120;
    --surface: #151e32;
    --surface-btn: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --brand: #2DAAE1;
    /* Nexai Cyan */
    --brand-glow: rgba(45, 170, 225, 0.3);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);

    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);

    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);

    /* Event palette (shared across client and consultant) */
    --evt-work: #10b981;
    --evt-vacation: #3b82f6;
    --evt-absence: #ef4444;
    --evt-permit: #f59e0b;
    --evt-rest: #94a3b8;
    --evt-overtime: #8b5cf6;
    --evt-recovery: #84cc16;
    --evt-smart: #4f46e5;
    --evt-training: #0ea5e9;
    --evt-travel: #14b8a6;

    /* Fonts */
    --font-head: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Phase 1: Visual Token Stabilization */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --border-soft: 1px solid rgba(255, 255, 255, 0.05);
    --border-strong: 1px solid rgba(255, 255, 255, 0.1);

    --elev-1: 0 2px 10px rgba(2, 6, 23, 0.25);
    --elev-2: 0 8px 24px rgba(2, 6, 23, 0.32);

    --t-fast: 140ms;
    --t-base: 220ms;
    --ease-out-premium: cubic-bezier(0.22, 1, 0.36, 1);

    /* Type Scale - Consistent Typography */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;

    /* Safe-area insets for notch/status/navigation areas */
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);

    /* Measured client bottom-nav height (set by client-mobile-home.js
       at runtime). Fallback covers the static height (8 + 48 + 8) plus
       any device safe-area inset, so the layout is safe even if JS
       has not yet measured the nav. */
    --client-bottom-nav-h: calc(64px + var(--safe-area-inset-bottom, 0px));
}

/* iOS 11.0-11.2 fallback */
@supports (padding-top: constant(safe-area-inset-top)) {
    :root {
        --safe-area-inset-top: constant(safe-area-inset-top);
        --safe-area-inset-right: constant(safe-area-inset-right);
        --safe-area-inset-bottom: constant(safe-area-inset-bottom);
        --safe-area-inset-left: constant(safe-area-inset-left);
    }
}

/* Phase 7: Award Foundation - Nexai Edition */
body[data-ui-skin="award"] {
    --award-brand-1: #2DAAE1;
    --award-brand-2: #0ea5e9;
    --award-brand-3: #3b82f6;
    --award-surface-1: rgba(13, 22, 40, 0.92);
    --award-surface-2: rgba(18, 30, 55, 0.88);
    --award-edge: rgba(45, 170, 225, 0.22);
    --award-glow-soft: 0 0 0 1px rgba(45, 170, 225, 0.15), 0 12px 30px rgba(8, 15, 35, 0.38);
    --award-glow-strong: 0 0 0 1px rgba(45, 170, 225, 0.3), 0 14px 34px rgba(4, 12, 30, 0.46);

    --award-ease: cubic-bezier(0.18, 0.9, 0.22, 1);
    --award-duration: 240ms;
}

/* =========================================
   PHASE 8: AWARD SKIN OVERRIDES
   ========================================= */

body[data-ui-skin="award"] {
    background:
        radial-gradient(1000px 640px at 12% -5%, rgba(45, 170, 225, 0.12), transparent 60%),
        radial-gradient(920px 520px at 90% 0%, rgba(59, 130, 246, 0.1), transparent 60%),
        linear-gradient(165deg, #0B1120, #0f182b 48%, #132038);
    background-attachment: fixed;
    /* fix gradient on scroll */
}

body[data-ui-skin="award"] .app-header,
body[data-ui-skin="award"] .context-bar,
body[data-ui-skin="award"] .bottom-nav {
    background: transparent;
    border-color: rgba(188, 210, 255, 0.12);
}

body[data-ui-skin="award"] .bottom-nav {
    background: rgba(7, 16, 35, 0.85);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(188, 210, 255, 0.15);
}

body[data-ui-skin="award"] .kpi-card-interactive,
body[data-ui-skin="award"] .exception-card,
body[data-ui-skin="award"] .detail-panel,
body[data-ui-skin="award"] .kpi-card,
body[data-ui-skin="award"] .employee-card,
body[data-ui-skin="award"] .diary-card,
body[data-ui-skin="award"] .team-filter-chip {
    background: rgba(17, 30, 56, 0.6);
    border: 1px solid rgba(188, 210, 255, 0.12);
    box-shadow: 0 12px 32px rgba(2, 8, 20, 0.3);
    backdrop-filter: blur(4px);
}

body[data-ui-skin="award"] .kpi-card-interactive:hover,
body[data-ui-skin="award"] .exception-card:active {
    border-color: rgba(188, 210, 255, 0.3);
    background: rgba(24, 41, 73, 0.7);
    box-shadow: 0 0 0 1px rgba(124, 77, 255, 0.15), 0 18px 42px rgba(2, 6, 18, 0.45);
}

body[data-ui-skin="award"] .quick-action-card {
    background: linear-gradient(180deg, rgba(20, 30, 50, 0.6) 0%, rgba(10, 15, 30, 0.8) 100%);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

body[data-ui-skin="award"] .logo-mark {
    box-shadow: 0 0 0 1px rgba(124, 77, 255, 0.2), 0 12px 26px rgba(6, 16, 39, 0.42);
}

body[data-ui-skin="award"] .nav-item.active {
    background: rgba(91, 124, 255, 0.15);
    color: #a7bfff;
}

body[data-ui-skin="award"] .nav-item.active .icon svg {
    filter: drop-shadow(0 0 8px rgba(91, 124, 255, 0.5));
}


* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

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

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.gap-4 {
    gap: 16px;
}

/* ============================================
   HEADER SYSTEM - Presenze AI Unified Design
   ============================================ */

/* Global App Header - Presenze AI branding (Home only) */
.app-header {
    padding: calc(18px + var(--safe-area-inset-top)) 24px 18px;
    background: var(--bg-app);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Logo - The Stacked Compact (Typographic Only) */
.logo-stack {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 6px;
    line-height: 1;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
}

.logo-main {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--text-secondary);
}

.logo-sub {
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    text-transform: none;
    margin-top: 0;
    opacity: 0.76;
}

/* Page Header - Used on all secondary screens */
.page-header {
    padding: calc(16px + var(--safe-area-inset-top)) 20px 16px;
    background: var(--bg-app);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-flow: row nowrap;
    /* Force row layout */
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-header-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    /* Take up available space */
    min-width: 0;
    /* Enable text truncation */
    justify-content: center;
    /* Center content vertically */
}

.page-header-content h1 {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-header-content .job-badge {
    margin-top: 2px;
    align-self: flex-start;
    /* Ensure left alignment */
}

.page-header h1 {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.page-header .subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

/* Back Button - Restored & Improved */
.back-btn {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    flex-shrink: 0;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.back-btn:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.25);
}

.back-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Context Header - Restored */
.context-bar {
    padding: 8px 20px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-app);
}

.context-bar h2 {
    font-family: var(--font-head);
    font-size: var(--text-base);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.context-note {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    line-height: 1.35;
    letter-spacing: 0.01em;
    font-weight: 700;
    max-width: 250px;
}

.context-note strong {
    color: var(--text-primary);
    font-weight: 800;
}

.avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* Branded Title - Restored */
.page-header h1.brand-title {
    background: linear-gradient(90deg, #818cf8, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Unified Profile Header Styles */
.employee-profile-header .page-header {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-app) 100%);
    padding-bottom: 24px;
    border-bottom: none;
}

.employee-profile-header .page-header-content {
    align-items: flex-start;
    /* Ensure left alignment */
}

.employee-profile-header .profile-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #4f46e5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
    /* Force proper display */
    position: relative;
    z-index: 10;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.profile-info h1 {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.job-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--brand);
    background: rgba(45, 170, 225, 0.12);
    border: 1px solid rgba(45, 170, 225, 0.2);
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

/* KPI Cards - Unified styling */
.kpi-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.kpi-val {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}

.kpi-val.danger {
    color: var(--danger);
}

.kpi-val.success {
    color: var(--success);
}

.kpi-val.info {
    color: var(--brand);
}

.kpi-lbl {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-kpi-hero {
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(17, 30, 56, 0.82), rgba(22, 36, 66, 0.9));
    border: 1px solid rgba(188, 210, 255, 0.18);
    box-shadow: 0 12px 28px rgba(2, 8, 20, 0.3);
}

.detail-kpi-hero-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-kpi-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.detail-kpi-value {
    margin-top: 4px;
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.detail-kpi-hint {
    margin-top: 4px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.detail-kpi-progress-wrap {
    margin-top: 10px;
}

.detail-kpi-progress-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.24);
    overflow: hidden;
}

.detail-kpi-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2DAAE1, #10b981);
    transition: width 240ms var(--ease-out-premium);
}

.detail-kpi-gap {
    margin-top: 8px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.detail-kpi-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.detail-group {
    margin-bottom: 12px;
}

.detail-group:last-of-type {
    margin-bottom: 10px;
}

.detail-group-title {
    margin: 0 2px 8px;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.detail-year-strip {
    margin: -2px 0 0;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(188, 210, 255, 0.14);
    background: rgba(15, 27, 50, 0.5);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.detail-year-strip #detail-year-strip-label {
    color: var(--text-primary);
    font-weight: 700;
}

.detail-kpi-align-left {
    text-align: left;
}

.detail-kpi-inline-value {
    display: block;
    margin-top: 6px;
    color: var(--text-primary);
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.detail-kpi-inline-note {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: var(--text-xs);
}

.detail-weekdays-card {
    margin-top: 2px;
    margin-bottom: 0;
}

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

.detail-weekday-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(188, 210, 255, 0.08);
    padding-bottom: 5px;
    font-size: var(--text-xs);
}

.detail-weekday-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-weekday-row span:first-child {
    color: var(--text-secondary);
    font-weight: 600;
}

.detail-weekday-row span:last-child {
    color: var(--text-primary);
    font-family: var(--font-head);
    font-weight: 600;
    text-align: right;
}

/* Mini Month Navigation (for detail views) */
.mini-month-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-month-nav button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.mini-month-nav button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.mini-month-nav span {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
    text-align: center;
}

/* DEPRECATED: Old classes kept for compatibility */
.client-header {
    padding: 12px 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: var(--bg-app);
}

.client-info h1 {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.client-info p {
    margin: 2px 0 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* Navigation & Controls */
.month-control-group {
    background: var(--bg-app);
    padding: 12px 0 18px;
}

.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 12px;
}

.nav-arrow {
    width: 44px;
    height: 44px;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: 0.2s;
}

.nav-arrow svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.nav-arrow:hover {
    background: var(--surface-btn);
}

.nav-arrow:active {
    transform: scale(0.92);
    background: var(--surface-btn);
}

.nav-arrow:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.month-label {
    font-size: 18px;
    font-weight: 700;
    font-family: var(--font-head);
}

.month-year {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.control-strip {
    display: flex;
    gap: 10px;
    padding: 0 20px;
}

.action-btn {
    flex: 1;
    height: 42px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-primary {
    background: var(--success);
    color: #0f172a;
}

.btn-locked {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
    cursor: default;
}

/* Main Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: calc(var(--client-bottom-nav-h, 90px) + 24px);
    scroll-padding-bottom: calc(var(--client-bottom-nav-h, 90px) + 24px);
}

/* Cards & Lists */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
}

.employee-card {
    position: relative;
    background: var(--surface);
    padding: 12px 12px 12px 14px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease-out-premium), border-color var(--t-base) var(--ease-out-premium), box-shadow var(--t-base) var(--ease-out-premium);
    box-shadow: 0 6px 18px rgba(2, 10, 24, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.employee-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: rgba(145, 168, 207, 0.45);
}

.employee-card.status-success::before,
.employee-card.status-work::before {
    background: var(--evt-work);
}

.employee-card.status-warning::before,
.employee-card.status-permit::before {
    background: var(--evt-permit);
}

.employee-card.status-danger::before,
.employee-card.status-absence::before {
    background: var(--evt-absence);
}

.employee-card.status-vacation::before {
    background: var(--evt-vacation);
}

.employee-card.status-rest::before {
    background: var(--evt-rest);
}

.employee-card.status-overtime::before {
    background: var(--evt-overtime);
}

.employee-card.status-recovery::before {
    background: var(--evt-recovery);
}

.employee-card.status-smart::before {
    background: var(--evt-smart);
}

.employee-card.status-training::before {
    background: var(--evt-training);
}

.employee-card.status-travel::before {
    background: var(--evt-travel);
}

.employee-card:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--elev-2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.employee-card:active {
    transform: translateY(0) scale(0.99);
    filter: brightness(0.98);
}

.employee-card:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.emp-main {
    min-width: 0;
}

.emp-name {
    font-weight: 700;
    font-size: var(--text-base);
    line-height: 1.25;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emp-meta {
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    margin-top: 2px;
}

.emp-status-inline {
    margin-top: 5px;
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 800;
}

.emp-status-inline.status-success,
.emp-status-inline.status-work {
    color: var(--evt-work);
}

.emp-status-inline.status-warning,
.emp-status-inline.status-permit {
    color: var(--evt-permit);
}

.emp-status-inline.status-danger,
.emp-status-inline.status-absence {
    color: var(--evt-absence);
}

.emp-status-inline.status-vacation {
    color: var(--evt-vacation);
}

.emp-status-inline.status-rest {
    color: var(--evt-rest);
}

.emp-status-inline.status-overtime {
    color: var(--evt-overtime);
}

.emp-status-inline.status-recovery {
    color: var(--evt-recovery);
}

.emp-status-inline.status-smart {
    color: var(--evt-smart);
}

.emp-status-inline.status-training {
    color: var(--evt-training);
}

.emp-status-inline.status-travel {
    color: var(--evt-travel);
}

.emp-chevron {
    color: var(--text-secondary);
    flex-shrink: 0;
    padding-left: 4px;
    display: flex;
    align-items: center;
}

.emp-chevron svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.st-sick {
    background: var(--danger-bg);
    color: var(--danger);
}

.st-present {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.st-vac {
    background: var(--warning-bg);
    color: var(--warning);
}

/* Alerts - Compact Premium Style */
.alert-banner-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%);
    border: 1px solid rgba(251, 191, 36, 0.18);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alert-banner-compact:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(245, 158, 11, 0.06) 100%);
    border-color: rgba(251, 191, 36, 0.28);
}

.alert-banner-compact:active {
    transform: scale(0.98);
}

.alert-banner-compact:focus-visible {
    outline: 2px solid rgba(251, 191, 36, 0.5);
    outline-offset: 2px;
}

.alert-icon-svg {
    width: 18px;
    height: 18px;
    color: #fbbf24;
    flex-shrink: 0;
}

.alert-banner-compact .alert-text {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: 500;
    color: #fde68a;
    letter-spacing: -0.01em;
}

.alert-banner-compact .alert-text strong {
    font-weight: 700;
    color: #fef3c7;
}

.alert-action-btn {
    border: 0;
    font-size: var(--text-xs);
    font-weight: 600;
    color: #451a03;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    padding: 6px 12px;
    border-radius: 8px;
    letter-spacing: 0;
    cursor: pointer;
}

.alert-action-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.alert-banner-compact--actions {
    cursor: default;
}

.alert-banner-compact--actions:active {
    transform: none;
}

.alert-action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.alert-action-btn--secondary {
    color: #fde68a;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.28);
}

/* Old alert-banner (deprecated, kept for compatibility) */
.alert-banner {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    cursor: pointer;
}

.alert-text {
    font-size: var(--text-sm);
    color: var(--warning);
    font-weight: 600;
}

/* Phase 2: Home Screen Premium Classes */
.kpi-card-interactive {
    background: var(--surface);
    padding: 20px 18px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease-out-premium), border-color var(--t-base) var(--ease-out-premium), box-shadow var(--t-base) var(--ease-out-premium);
    border: 1px solid transparent;
}

.kpi-card-interactive:hover,
.kpi-card-interactive:active {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--surface-btn);
    transform: translateY(-1px);
}

.kpi-card-interactive:active {
    transform: translateY(0) scale(0.98);
}

.kpi-card-interactive:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.kpi-card-title {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.kpi-card-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-head);
    font-variant-numeric: tabular-nums;
}

.kpi-card-value.success {
    color: var(--success);
}

.kpi-card-value.danger {
    color: var(--danger);
}

.exception-card {
    background: var(--surface);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--t-base) var(--ease-out-premium);
}

.exception-card:active {
    transform: scale(0.98);
    background: var(--surface-btn);
}

.exception-card:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.detail-panel {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    border: var(--border-soft);
    box-shadow: var(--elev-1);
    animation: slideDown 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.quick-action-card {
    background: linear-gradient(145deg, rgba(45, 170, 225, 0.15) 0%, rgba(99, 102, 241, 0.08) 100%);
    padding: 24px;
    border-radius: 16px;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--elev-1);
    border: 1px solid rgba(45, 170, 225, 0.2);
}

.quick-action-title {
    font-weight: 600;
    font-size: var(--text-base);
    font-family: var(--font-head);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.quick-action-input-wrap {
    position: relative;
    margin-top: 2px;
}

.quick-action-input {
    width: 100%;
    padding: 14px 52px 14px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(17, 30, 56, 0.6);
    color: var(--text-primary);
    outline: none;
    backdrop-filter: blur(4px);
    font-size: var(--text-base);
    transition: all 0.2s;
}

.quick-action-input::placeholder {
    color: var(--text-secondary);
}

.quick-action-input:focus {
    background: rgba(17, 30, 56, 0.8);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.quick-action-send {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--brand);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.2s, background-color 0.2s;
}

.quick-action-send:hover {
    background: var(--brand);
    filter: brightness(1.1);
}

.quick-action-send:active {
    transform: translateY(-50%) scale(0.94);
}

.team-header-compact {
    padding: 0 12px 8px;
}

.search-input-compact {
    width: 100%;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: var(--font-body);
    outline: none;
    margin-bottom: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-compact:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-glow);
}

.search-input-compact::placeholder {
    color: var(--text-muted);
}

.team-filters-compact {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 -12px;
    padding: 0 12px 4px 12px;
}

.team-filters-compact::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    min-height: 36px;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.filter-btn:active {
    transform: scale(0.96);
}

.filter-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: white;
}

body[data-ui-skin="award"] .filter-btn {
    border-color: rgba(188, 210, 255, 0.12);
}

body[data-ui-skin="award"] .filter-btn:hover {
    border-color: rgba(188, 210, 255, 0.2);
}

body[data-ui-skin="award"] .filter-btn.active {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 2px 6px rgba(45, 170, 225, 0.2);
}

/* Search (legacy - kept for other views) */
.search-container {
    padding: 0 16px 16px;
    width: 100%;
}

.team-day-filter-row {
    padding: 0 12px 4px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.team-day-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid rgba(45, 170, 225, 0.3);
    background: rgba(45, 170, 225, 0.12);
    color: #d8efff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font-body);
    transition: all 0.15s ease;
}

.team-day-filter-chip:hover {
    border-color: rgba(45, 170, 225, 0.5);
    background: rgba(45, 170, 225, 0.18);
}

.team-day-filter-close {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    background: rgba(45, 170, 225, 0.2);
    color: #d8efff;
    transition: background-color 0.15s ease;
}

body[data-ui-skin="award"] .team-day-filter-chip {
    background: rgba(19, 59, 91, 0.5);
    border-color: rgba(74, 184, 236, 0.4);
}

body[data-ui-skin="award"] .team-day-filter-chip:hover {
    background: rgba(25, 71, 108, 0.6);
    border-color: rgba(104, 195, 240, 0.5);
}

.team-list-count {
    padding: 0 12px 8px;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

.search-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: var(--font-body);
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--brand);
    background: var(--bg-app);
    box-shadow: 0 0 0 4px var(--brand-glow);
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    padding-bottom: max(8px, var(--safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    gap: 4px;
    z-index: 50;
    max-width: 480px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.1;
    cursor: pointer;
    font-weight: 500;
    padding: 7px 4px;
    border-radius: 12px;
    transition: all 0.2s ease;
    min-width: 0;
    min-height: 48px;
    text-align: center;
    white-space: nowrap;
}

.nav-item.active {
    color: var(--brand);
    background: rgba(99, 102, 241, 0.1);
}

.nav-item .icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2px;
    stroke: currentColor;
    fill: none;
}

.nav-item.active .icon svg {
    stroke-width: 2.5px;
}

.nav-item:active {
    transform: scale(0.94);
}

.nav-item.active:active {
    transform: scale(0.96);
}

.nav-item:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Chat specific */
.msg {
    max-width: 80%;
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: var(--text-sm);
    line-height: 1.4;
}

.msg.user {
    background: var(--brand);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.msg.system {
    background: var(--surface);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.msg-time {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 6px;
}

.chat-input-bar {
    position: fixed;
    bottom: calc(90px + var(--safe-area-inset-bottom));
    left: 0;
    right: 0;
    padding: 12px 16px;
    display: flex;
    gap: 12px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 40;
    max-width: 480px;
    margin: 0 auto;
}

.chat-input {
    flex: 1;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 12px 16px;
    color: white;
    font-size: var(--text-sm);
    outline: none;
}

.send-btn {
    width: 48px;
    height: 48px;
    background: var(--brand);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.send-btn:hover {
    filter: brightness(1.1);
}

.send-btn:active {
    transform: scale(0.94);
}

/* Mobile frame: fill parent height via percentage chain.
   100vh/dvh are unreliable in Android WebView after multi-window;
   100% chains from html → body → .mobile-frame and resolves to
   the actual WebView viewport size. */
.mobile-frame {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Desktop container constraint */
@media (min-width: 480px) {
    body {
        background-color: #020617;
    }

    .mobile-frame {
        max-width: 450px;
        background: var(--bg-app);
        margin: 0 auto;
        border-left: 1px solid #334155;
        border-right: 1px solid #334155;
    }
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.calendar-day:active {
    transform: scale(0.92);
}

.calendar-day.current-day {
    border-color: rgba(94, 107, 126, 0.5);
    /* Neutral grey border */
    background: rgba(94, 107, 126, 0.15);
    /* Slight elevate feel */
    box-shadow: inset 0 0 0 1px rgba(117, 131, 153, 0.1);
    /* Inner glow */
    font-weight: 800;
}

.calendar-day.has-event {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.calendar-day.bad-event {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.calendar-day.selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-glow);
}

.calendar-day.empty {
    background: transparent;
    cursor: default;
}

.day-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 8px;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 600;
}

.day-detail-panel {
    background: var(--surface);
    padding: 16px;
    border-radius: 12px;
    margin-top: 10px;
}

/* Calendar Updates */
.calendar-day.is-holiday {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.calendar-day.is-local-holiday {
    background: rgba(249, 115, 22, 0.09);
    border-color: rgba(249, 115, 22, 0.24);
    color: #9a3412;
}

.calendar-day.is-closure {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.36);
    color: #92400e;
}

.calendar-day-flag {
    position: absolute;
    top: 3px;
    right: 3px;
    min-width: 12px;
    height: 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    border: 1px solid transparent;
}

.day-flag-closure {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #92400e;
}

.day-flag-local {
    background: #ffedd5;
    border-color: #fdba74;
    color: #9a3412;
}

.dots-container {
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 2px;
}

.cal-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.dot-red {
    background-color: var(--danger);
}

.dot-yellow {
    background-color: var(--warning);
}

.dot-blue {
    background-color: var(--brand);
}

/* Month/Detail Diary Cards */
.month-diary,
.detail-exceptions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.diary-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 8px;
    align-items: stretch;
}

.diary-date {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 4px;
}

.diary-date::after {
    content: "";
    position: absolute;
    top: 32px;
    bottom: -8px;
    width: 1px;
    background: linear-gradient(180deg, rgba(145, 168, 207, 0.38), rgba(145, 168, 207, 0.06));
}

.diary-row:last-child .diary-date::after {
    display: none;
}

.date-day {
    display: block;
    font-family: var(--font-head);
    font-size: 24px;
    line-height: 0.9;
    color: var(--text-primary);
    font-weight: 700;
}

.date-month {
    display: block;
    margin-top: 2px;
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.diary-card {
    position: relative;
    padding: 12px 12px 12px 14px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: var(--border-soft);
    box-shadow: var(--elev-1);
    overflow: hidden;
}

.exception-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out-premium);
}

.exception-delete-btn:active {
    transform: scale(0.92);
}

/* In case the content is provided in HTML as text/icon */
.exception-delete-btn:hover,
.exception-delete-btn:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

.exception-delete-btn:focus-visible {
    outline: 2px solid rgba(148, 163, 184, 0.5);
    outline-offset: 1px;
}

.diary-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: rgba(145, 168, 207, 0.45);
}

.diary-card.status-success::before,
.diary-card.status-work::before {
    background: var(--evt-work);
}

.diary-card.status-warning::before,
.diary-card.status-permit::before {
    background: var(--evt-permit);
}

.diary-card.status-danger::before,
.diary-card.status-absence::before {
    background: var(--evt-absence);
}

.diary-card.status-vacation::before {
    background: var(--evt-vacation);
}

.diary-card.status-rest::before {
    background: var(--evt-rest);
}

.diary-card.status-overtime::before {
    background: var(--evt-overtime);
}

.diary-card.status-recovery::before {
    background: var(--evt-recovery);
}

.diary-card.status-smart::before {
    background: var(--evt-smart);
}

.diary-card.status-training::before {
    background: var(--evt-training);
}

.diary-card.status-travel::before {
    background: var(--evt-travel);
}

.diary-name {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

.diary-name-link {
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    width: 100%;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(148, 163, 184, 0.35);
    text-underline-offset: 2px;
    transition: color var(--t-fast) var(--ease-out-premium), text-decoration-color var(--t-fast) var(--ease-out-premium);
}

.diary-name-link:hover,
.diary-name-link:focus-visible {
    color: var(--brand);
    text-decoration-color: rgba(129, 140, 248, 0.65);
}

.diary-name-link:active {
    color: var(--text-primary);
    text-decoration-color: var(--brand);
}

.diary-name-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

.diary-meta {
    margin-top: 2px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 600;
}

.diary-range {
    font: inherit;
}

.diary-status-text {
    margin-top: 5px;
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.diary-status-text.status-success,
.diary-status-text.status-work {
    color: var(--evt-work);
}

.diary-status-text.status-warning,
.diary-status-text.status-permit {
    color: var(--evt-permit);
}

.diary-status-text.status-danger,
.diary-status-text.status-absence {
    color: var(--evt-absence);
}

.diary-status-text.status-vacation {
    color: var(--evt-vacation);
}

.diary-status-text.status-rest {
    color: var(--evt-rest);
}

.diary-status-text.status-overtime {
    color: var(--evt-overtime);
}

.diary-status-text.status-recovery {
    color: var(--evt-recovery);
}

.diary-status-text.status-smart {
    color: var(--evt-smart);
}

.diary-status-text.status-training {
    color: var(--evt-training);
}

.diary-status-text.status-travel {
    color: var(--evt-travel);
}

.exception-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.64);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 14px 16px;
}

.exception-delete-sheet {
    width: 100%;
    max-width: 452px;
    border-radius: 20px;
    border: var(--border-soft);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(10, 18, 35, 0.98));
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.45);
    padding: 10px 12px 12px;
}

.exception-sheet-handle {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    margin: 2px auto 10px;
    background: rgba(148, 163, 184, 0.45);
}

.exception-sheet-title {
    color: var(--text-primary);
    font-size: var(--text-lg);
    font-weight: 800;
    text-align: center;
    font-family: var(--font-head);
}

.exception-sheet-subtitle {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    text-align: center;
}

.exception-sheet-options {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exception-sheet-option {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.68);
    color: var(--text-primary);
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out-premium);
}

.exception-sheet-option:hover,
.exception-sheet-option:focus-visible {
    border-color: rgba(148, 163, 184, 0.5);
    background: rgba(30, 41, 59, 0.88);
}

.exception-sheet-option-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.25;
}

.exception-sheet-option-hint {
    display: block;
    margin-top: 2px;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 600;
}

.exception-sheet-option-danger {
    border-color: rgba(248, 113, 113, 0.36);
    background: rgba(127, 29, 29, 0.2);
}

.exception-sheet-option-danger:hover,
.exception-sheet-option-danger:focus-visible {
    border-color: rgba(252, 165, 165, 0.64);
    background: rgba(127, 29, 29, 0.34);
}

.exception-sheet-preview {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.62);
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: 600;
    text-align: center;
    padding: 10px 12px;
}

.exception-sheet-action {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.76);
    color: var(--text-primary);
    text-align: center;
    font-size: var(--text-sm);
    font-weight: 800;
    padding: 12px 14px;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out-premium);
}

.exception-sheet-action-danger {
    border-color: rgba(248, 113, 113, 0.5);
    background: linear-gradient(180deg, rgba(190, 24, 24, 0.46), rgba(127, 29, 29, 0.56));
    color: #ffe4e6;
}

.exception-sheet-action-danger:hover,
.exception-sheet-action-danger:focus-visible {
    border-color: rgba(252, 165, 165, 0.72);
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.56), rgba(127, 29, 29, 0.68));
}

.exception-sheet-loading {
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 700;
    padding: 12px 0;
}

.exception-sheet-cancel {
    margin-top: 8px;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.48);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 600;
    padding: 9px 12px;
    cursor: pointer;
}

.exception-sheet-cancel:hover,
.exception-sheet-cancel:focus-visible {
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.45);
}

.exception-undo-toast {
    position: fixed;
    left: 50%;
    bottom: calc(78px + var(--safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 95;
    width: min(92vw, 420px);
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(5, 46, 22, 0.94);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.4);
    color: #dcfce7;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: var(--text-xs);
    font-weight: 700;
}

.exception-undo-btn {
    border: 1px solid rgba(134, 239, 172, 0.45);
    border-radius: 999px;
    background: rgba(22, 101, 52, 0.95);
    color: #ecfdf5;
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 10px;
    cursor: pointer;
}

.exception-undo-btn:hover,
.exception-undo-btn:focus-visible {
    background: rgba(21, 128, 61, 0.95);
}

/* Phase 4: Chat Premium Polish */

/* Context Heading */
.chat-context-title {
    font-size: 20px;
    background: linear-gradient(90deg, #818cf8, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    margin: 0;
    font-weight: 700;
    font-family: var(--font-head);
}

.chat-context-subtitle {
    margin: 2px 0 0 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 400;
}

/* Chat Date & Separators */
.chat-date-header {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin: 20px 0 10px 0;
    font-weight: 700;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chat-session-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    opacity: 0.4;
}

.chat-session-separator::before,
.chat-session-separator::after {
    content: '';
    height: 1px;
    background: var(--text-secondary);
    flex: 1;
    margin: 0 12px;
}

.chat-session-separator span {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.chat-history-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chat-history-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.chat-history-toggle:active {
    transform: scale(0.98);
}

.chat-history-toggle svg {
    opacity: 0.7;
}

/* Bubbles */
.msg {
    position: relative;
    padding: 12px 16px 20px;
    /* Extra bottom padding for time */
    min-width: 80px;
    border: 1px solid transparent;
    transition: all 0.2s;
    animation: bubble-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes bubble-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

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

.msg.user {
    background: linear-gradient(135deg, var(--brand), #4f46e5);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.msg.system {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-soft);
    box-shadow: var(--elev-1);
}

.msg-time {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: var(--text-xs);
    opacity: 0.8;
    font-weight: 600;
    font-family: var(--font-body);
    letter-spacing: 0.02em;
}

.msg.user .msg-time {
    color: rgba(255, 255, 255, 0.9);
}

.msg.system .msg-time {
    color: var(--text-secondary);
}

/* Spinner */
.chat-spinner {
    position: absolute;
    right: 50%;
    bottom: 110px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--brand);
    animation: spin 0.8s linear infinite;
    display: none;
    z-index: 60;
    pointer-events: none;
    transform: translateX(50%);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chat-spinner.visible {
    display: block;
}

@keyframes spin {
    to {
        transform: translateX(50%) rotate(360deg);
    }
}

/* Modern Alert Banner (from embedded styles) */
.alert-banner-modern {
    padding: 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    background: var(--surface);
    /* Fallback */
}

.alert-banner-modern:active {
    transform: scale(0.98);
}

.alert-banner-modern.critical {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(185, 28, 28, 0.02) 100%);
    border-color: rgba(239, 68, 68, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.alert-banner-modern.critical .alert-icon-box {
    background: transparent;
    color: #f87171;
    font-size: 22px;
    padding: 0;
    width: auto;
    height: auto;
}

.alert-banner-modern.critical .alert-title {
    color: #fca5a5;
    font-size: 15px;
}

.alert-banner-modern.critical .alert-action {
    color: #fca5a5;
    background: transparent;
    border: 1px solid rgba(252, 165, 165, 0.2);
    padding: 4px 10px;
}

/* Quick Action Updates - "Magic Input" Style */
body[data-ui-skin="award"] .quick-action-card {
    background: transparent;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    padding: 0;
    margin-top: 4px;
    gap: 10px;
}

.quick-action-card .quick-action-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
    padding-left: 2px;
}

.quick-action-input {
    background: linear-gradient(180deg, rgba(20, 30, 50, 0.5) 0%, rgba(15, 20, 35, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 52px 16px 18px;
    font-size: var(--text-base);
    border-radius: 14px;
    transition: all 0.25s ease;
}

.quick-action-input:focus {
    background: rgba(20, 30, 50, 0.8);
    border-color: rgba(180, 200, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(180, 200, 255, 0.1);
    transform: translateY(-1px);
}

/* Hide description in CSS or HTML, making it cleaner */
.quick-action-card p {
    display: none;
}

.alert-banner-modern.info {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(180, 83, 9, 0.05) 100%);
    border-color: rgba(245, 158, 11, 0.2);
}

.alert-banner-modern.info .alert-title {
    color: #fbbf24;
}

.alert-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alert-title {
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.alert-desc {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    opacity: 0.9;
    line-height: 1.3;
}

.alert-action {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    transition: 0.2s;
}

/* Award Skin Overrides for Chat */
body[data-ui-skin="award"] .msg.user {
    background: linear-gradient(135deg, var(--award-brand-1), var(--award-brand-2));
    border: 1px solid var(--award-edge);
    box-shadow: var(--award-glow-soft);
}

body[data-ui-skin="award"] .msg.system {
    background: var(--award-surface-1);
    border: 1px solid var(--award-edge);
}

body[data-ui-skin="award"] .chat-input-bar {
    background: rgba(7, 16, 35, 0.85);
    border-top: 1px solid var(--award-edge);
}

body[data-ui-skin="award"] .send-btn {
    background: linear-gradient(135deg, var(--award-brand-1), var(--award-brand-2));
    box-shadow: var(--award-glow-soft);
}

/* Header Client Name Text (No Badge) */
.header-client-text {
    font-family: var(--font-head);
    font-size: clamp(15px, 4.6vw, 17px);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.08;
    text-align: left;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.header-consultant-text {
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    line-height: 1.1;
    text-align: right;
    flex: 1 1 auto;
    min-width: 0;
    max-width: min(44vw, 188px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0.78;
}

.app-header-brand {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    width: 100%;
    gap: 18px;
}

/* =========================================
   EMPLOYEE DETAIL - 3-TAB STRUCTURE
   ========================================= */

/* Add Button in Header */
.detail-add-btn {
    padding: 8px 14px;
    background: var(--brand);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.detail-add-btn:active {
    transform: scale(0.96);
}

.detail-add-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

/* Tab Bar */
.detail-tab-bar {
    display: flex;
    padding: 12px 16px;
    gap: 6px;
    background: var(--bg-app);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.detail-tab-btn {
    flex: 1;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    font-family: var(--font-body);
    position: relative;
}

.detail-tab-btn:hover {
    background: rgba(255,255,255,0.03);
}

.detail-tab-btn.active {
    background: var(--surface);
    color: var(--text-primary);
}

.detail-tab-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.detail-tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 30px);
    background: var(--warning);
    color: #0f172a;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

.detail-tab-btn.active .detail-tab-badge {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* Tab Content */
.detail-tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.detail-tab-content.active {
    display: flex;
    flex-direction: column;
}

.detail-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 100px;
}

/* Detail Card */
.detail-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 12px;
    overflow: hidden;
}

.detail-card-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.detail-card-icon {
    width: 36px;
    height: 36px;
    background: rgba(45, 170, 225, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    flex-shrink: 0;
}

.detail-card-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.detail-card-title {
    font-size: 13px;
    font-weight: 600;
}

.detail-card-badge {
    margin-left: auto;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.detail-card-badge.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.detail-card-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.detail-card-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.detail-card-badge.brand {
    background: rgba(45, 170, 225, 0.15);
    color: var(--brand);
}

.detail-card-body {
    padding: 16px;
}

/* Key-Value Grid */
.detail-kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.settings-consultant-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.settings-consultant-grid .settings-kv-wide {
    grid-column: 1 / -1;
}

.settings-consultant-grid .detail-kv-value,
.settings-consultant-grid .settings-inline-link {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-kv-item {
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
}

.detail-kv-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.detail-kv-value {
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.detail-kv-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.detail-kv-sub.warning {
    color: var(--warning);
}

.detail-kv-value.brand { color: var(--brand); }
.detail-kv-value.success { color: var(--success); }
.detail-kv-value.warning { color: var(--warning); }
.detail-kv-value.danger { color: var(--danger); }

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
}

.settings-row + .settings-row {
    margin-top: 10px;
}

.settings-row-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-row-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

.settings-inline-link {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.settings-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.settings-action-btn {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(45, 170, 225, 0.32);
    background: rgba(45, 170, 225, 0.12);
    color: #b9e9ff;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.settings-action-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
}

.settings-action-btn.secondary {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.12);
    color: #d7deea;
}

.settings-action-btn:active {
    transform: scale(0.98);
    filter: brightness(1.05);
}

.settings-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
    text-decoration: none;
    color: var(--text-primary);
}

.settings-link-row + .settings-link-row {
    margin-top: 10px;
}

.settings-link-text {
    font-size: 13px;
    font-weight: 600;
}

.settings-link-row svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-secondary);
    stroke-width: 2.3;
    fill: none;
}

/* Stats Grid (3 columns) */
.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.detail-stat-item {
    text-align: center;
    padding: 14px 8px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
}

.detail-stat-value {
    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.detail-stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Schedule Block */
.detail-schedule {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-schedule-summary {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: none;
}

.detail-schedule-summary.show {
    display: block;
}

.detail-schedule-chips {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.detail-schedule-chip {
    min-height: 72px;
    padding: 8px 6px 7px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-align: center;
}

.detail-schedule-chip.off {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border-color: rgba(148, 163, 184, 0.15);
}

.detail-schedule-chip.on {
    background: rgba(45, 170, 225, 0.15);
    color: var(--brand);
    border-color: rgba(45, 170, 225, 0.3);
}

.detail-schedule-chip.today {
    box-shadow: 0 0 0 2px var(--brand);
    transform: scale(1.05);
}

.detail-schedule-chip-letter {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-schedule-chip-time {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.detail-schedule-chip-time.end {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.75;
}

.detail-schedule-chip-off {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.7;
    margin-top: 6px;
}

/* Warning Banner */
.detail-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    margin-bottom: 12px;
}

.detail-warning-icon {
    width: 36px;
    height: 36px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    flex-shrink: 0;
}

.detail-warning-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.detail-warning-text {
    flex: 1;
}

.detail-warning-title {
    font-size: 13px;
    font-weight: 600;
    color: #fca5a5;
}

.detail-warning-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Section Header */
.detail-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.detail-section-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.detail-section-count {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Award Skin Overrides for Detail */
body[data-ui-skin="award"] .detail-card {
    background: rgba(17, 30, 56, 0.6);
    border: 1px solid rgba(188, 210, 255, 0.12);
}

body[data-ui-skin="award"] .detail-tab-btn.active {
    background: rgba(17, 30, 56, 0.6);
}

/* =========================================
   RESPONSIVE: Small Phones (< 390px)
   Galaxy S series, Pixel, etc.
   ========================================= */
@media (max-width: 389px) {
    .content {
        padding: 16px;
        padding-bottom: calc(var(--client-bottom-nav-h, 80px) + 20px);
        scroll-padding-bottom: calc(var(--client-bottom-nav-h, 80px) + 20px);
    }

    .app-header {
        padding: calc(14px + var(--safe-area-inset-top)) 16px 14px;
        gap: 8px;
    }

    .logo-stack {
        gap: 5px;
    }

    .logo-main {
        font-size: 13px;
    }

    .logo-sub {
        font-size: 12px;
    }

    .header-client-text {
        font-size: clamp(14px, 4.4vw, 15px);
    }

    .header-consultant-text {
        font-size: 12px;
        max-width: min(46vw, 162px);
    }

    .app-header-brand {
        gap: 14px;
    }

    .month-control-group {
        padding: 10px 0 14px;
    }

    .control-strip {
        padding: 0 16px;
    }

    .calendar-grid {
        gap: 4px;
    }

    .detail-schedule-chips {
        gap: 4px;
    }

    .detail-schedule-chip {
        min-height: 56px;
        padding: 6px 4px;
    }

    .detail-schedule-chip-letter {
        font-size: 10px;
    }

    .detail-schedule-chip-time {
        font-size: 11px;
    }

    .detail-schedule-chip-off {
        font-size: 9px;
    }

    .detail-kv-grid {
        gap: 8px;
    }

    .detail-stats-grid {
        gap: 6px;
    }

    .detail-stat-item {
        padding: 10px 6px;
    }

    .detail-stat-value {
        font-size: 18px;
    }

    .team-header-compact {
        padding: 0 8px 8px;
    }

    .team-filters-compact {
        margin: 0 -8px;
        padding: 0 8px 4px 8px;
        flex-wrap: wrap;
    }

    .filter-btn {
        padding: 5px 8px;
        font-size: 10px;
        min-height: 32px;
    }

    .team-list-count {
        padding: 0 8px 8px;
    }

    .kpi-card-interactive {
        padding: 16px 14px;
    }

    .kpi-card-value {
        font-size: 28px;
    }

    .quick-action-card {
        padding: 18px;
    }

    .quick-action-input {
        padding: 14px 48px 14px 14px;
    }

    .detail-card-body {
        padding: 12px;
    }

    .detail-tab-bar {
        padding: 10px 12px;
    }

    .detail-tab-btn {
        padding: 8px 6px;
        font-size: 10px;
    }
}

/* =========================================
   LOADING OVERLAY (Reusable)
   ========================================= */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-overlay__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: loading-overlay-spin 0.8s linear infinite;
}

.loading-overlay__text {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-family: var(--font-body);
}

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

/* =========================================
   MOBILE KEYBOARD LAYOUT
   ========================================= */
:root {
    --keyboard-bottom-offset: 0px;
    --keyboard-viewport-height: 100vh;
}

.bottom-nav,
.chat-input-bar {
    transition: transform 0.18s ease, opacity 0.18s ease, bottom 0.18s ease;
}

:root.keyboard-open .bottom-nav,
body.keyboard-open .bottom-nav,
:root.keyboard-open .keyboard-hide-when-open,
body.keyboard-open .keyboard-hide-when-open {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 16px));
}

:root.keyboard-open .keyboard-dock-above-keyboard,
body.keyboard-open .keyboard-dock-above-keyboard {
    bottom: var(--keyboard-bottom-offset, 0px) !important;
}

:root.keyboard-open .content,
body.keyboard-open .content {
    padding-bottom: calc(24px + var(--keyboard-bottom-offset, 0px)) !important;
    scroll-padding-bottom: calc(24px + var(--keyboard-bottom-offset, 0px));
}

:root.keyboard-open .chat-input-bar,
body.keyboard-open .chat-input-bar {
    bottom: var(--keyboard-bottom-offset, 0px);
    z-index: 70;
}

:root.keyboard-open #chat-scroller,
body.keyboard-open #chat-scroller {
    padding-bottom: calc(96px + var(--keyboard-bottom-offset, 0px)) !important;
    scroll-padding-bottom: calc(96px + var(--keyboard-bottom-offset, 0px));
}
