/* =================================================================
   🏠 SIDEBAR SHELL (Desktop ≥1024px)
   -----------------------------------------------------------------
   - Renders a left-side navigation column at ≥1024px when the
     <body> has the `.has-sidebar` class (set by RenderManager
     when `legacyNavigation` is OFF — the default).
   - Below 1024px the sidebar is hidden and the existing bottom-nav
     stays in place, but the body now also receives the
     `padding-bottom` it needed (fixes audit finding C1: the
     fixed bottom-nav was covering the last ~70px of every page).
   - Header stays sticky/full-width at the top; the sidebar starts
     just below it.
   ================================================================= */

.app-sidebar { display: none; }

/* Mobile / tablet: reserve space under content so the fixed
   bottom-nav (70px + 10px gap) does not cover the last rows. */
body.has-sidebar {
    padding-bottom: 80px;
}

@media (min-width: 1024px) {
    /* The "Mostrar/Ocultar Menú" toggle is only useful while the
       bottom-nav is shown; on desktop the sidebar replaces it. */
    body.has-sidebar .landscape-toggle-btn { display: none !important; }

    body.has-sidebar {
        padding-bottom: 0;
        padding-left: 240px;
    }

    body.has-sidebar .app-sidebar {
        display: flex;
        flex-direction: column;
        gap: 4px;
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 240px;
        padding: 16px 12px 16px;
        background: #0f172a;
        border-right: 1px solid rgba(255, 255, 255, 0.06);
        z-index: 50;
        overflow-y: auto;
    }

    /* Hide the mobile bottom nav at desktop width */
    body.has-sidebar .bottom-nav { display: none !important; }

    /* Allow content to use a bit more horizontal space now that
       the sidebar covers 240px on the left. */
    body.has-sidebar .container { max-width: 1480px; }
}

/* ----- Sidebar items ----- */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    line-height: 1;
    min-height: 40px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    transition: background 0.12s, color 0.12s;
    position: relative;
    width: 100%;
}

.sidebar-item:hover {
    background: #1e293b;
    color: #f1f5f9;
}

.sidebar-item:focus-visible {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

.sidebar-item.active {
    background: rgba(6, 182, 212, 0.10);
    color: #06b6d4;
    font-weight: 600;
}

.sidebar-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: #06b6d4;
    border-radius: 0 3px 3px 0;
}

.sidebar-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: none;
}

.sidebar-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-badge {
    margin-left: auto;
    background: #243049;
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-item.active .sidebar-badge {
    background: #06b6d4;
    color: #0f172a;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 8px 4px;
}

.sidebar-section {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 12px 12px 4px;
    font-weight: 700;
}

.sidebar-foot {
    margin-top: auto;
    padding: 12px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.sidebar-foot-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    flex: none;
}

.sidebar-foot-title {
    color: #f1f5f9;
    font-weight: 600;
}

.sidebar-foot-sub {
    color: #64748b;
    margin-top: 2px;
    font-size: 11px;
}

/* =================================================================
   🧭 ATTENDANCE PAGE TITLE (desktop ≥768px)
   Hidden on phones to keep the existing compact header.
   ================================================================= */
.page-title-row { display: none; }

@media (min-width: 768px) {
    .page-title-row {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 16px;
        margin: 4px 0 16px;
    }
    .page-title {
        margin: 0;
        font-size: 22px;
        font-weight: 700;
        color: #f1f5f9;
        line-height: 1.2;
    }
    .page-title-accent { color: #06b6d4; }
    .page-title-sub {
        color: #94a3b8;
        font-size: 13px;
        margin-top: 4px;
    }
    .page-title-sub b { color: #f1f5f9; font-weight: 700; }
}

/* =================================================================
   🪟 ATTENDANCE SPLIT VIEW (Desktop ≥1024px)
   -----------------------------------------------------------------
   - At ≥1024px the Asistencia screen renders the existing day view
     on the left and a new sticky detail panel on the right (6fr/4fr).
   - Below 1024px the detail panel is hidden and the day view returns
     to its original full-width layout — zero impact on mobile.
   ================================================================= */

/* Default (mobile/tablet): no split, hide the detail panel. */
.attendance-split { display: contents; }
.attendance-detail { display: none; }

@media (min-width: 1024px) {
    .attendance-split {
        display: grid;
        grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
        gap: 20px;
        align-items: start;
    }
    .attendance-main { min-width: 0; }

    .attendance-detail {
        display: block;
        position: sticky;
        top: calc(var(--header-height, 60px) + 12px);
        max-height: calc(100vh - var(--header-height, 60px) - 24px);
        overflow-y: auto;
    }
}

/* ----- Selected row indicator ----- */
.employee-row.is-detail-selected {
    position: relative;
    border-color: rgba(34, 211, 238, 0.55) !important;
    background:
        linear-gradient(90deg, rgba(6, 182, 212, 0.2), rgba(6, 182, 212, 0.06) 42%, rgba(15, 23, 42, 0.08)),
        #111827 !important;
    box-shadow:
        inset 4px 0 0 #06b6d4,
        0 0 0 1px rgba(6, 182, 212, 0.22),
        0 12px 32px rgba(6, 182, 212, 0.1);
}

.employee-row.is-detail-selected::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 9px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22d3ee;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.16), 0 0 14px rgba(34, 211, 238, 0.45);
    pointer-events: none;
}

.employee-row-compact.is-detail-selected::after {
    top: 8px;
    right: 8px;
    transform: none;
}

/* ----- Detail panel card ----- */
.detail-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    container-type: inline-size;
}

.detail-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex: none;
    background: linear-gradient(135deg, #06b6d4, #a855f7);
    color: #0f172a;
    font-weight: 800;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
}

.detail-head-meta { flex: 1; min-width: 0; }

.detail-name {
    font-size: 17px;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-sub {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.detail-pos-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.detail-pos-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.detail-status-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
}
.detail-status-pill.ok  { background: rgba(16,185,129,0.15); color: #10b981; }
.detail-status-pill.off { background: rgba(239,68,68,0.15);  color: #ef4444; }
.detail-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ----- Stats grid ----- */
.detail-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.detail-stat {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    min-width: 0;
    overflow: hidden;
}

.detail-week-stat,
.detail-hours-progress-stat {
    min-height: 104px;
    padding: clamp(10px, 2.4cqw, 14px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    background:
        radial-gradient(circle at 20px 22px, rgba(6, 182, 212, 0.1), transparent 54px),
        linear-gradient(135deg, #111c2e, #0d1626);
    border-color: rgba(148, 163, 184, 0.18);
}

.detail-progress-title {
    color: #cbd5e1;
    font-size: clamp(12px, 3.3cqw, 16px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.detail-week-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(15px, 1fr));
    align-items: end;
    gap: clamp(4px, 1.3cqw, 8px);
}

.detail-week-day {
    display: grid;
    justify-items: center;
    gap: 7px;
    min-width: 0;
}

.detail-week-day span {
    color: #94a3b8;
    font-size: clamp(9px, 2.4cqw, 12px);
    font-weight: 800;
    line-height: 1;
}

.detail-week-day i {
    width: clamp(16px, 4.5cqw, 21px);
    height: clamp(16px, 4.5cqw, 21px);
    border-radius: 50%;
    border: 2px solid #64748b;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.85);
}

.detail-week-day.present span {
    color: #5eead4;
}

.detail-week-day.present i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: transparent;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13);
}

.detail-week-day.present.check-regular i {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.detail-week-day.present.check-undertime i {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.detail-week-day.present.check-overtime i {
    background: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.16);
}

.detail-week-day.present.check-holiday i {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.detail-week-day.present.check-multiposition i {
    background: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.detail-week-day.present i::before {
    content: "";
    width: 8px;
    height: 5px;
    border-left: 2px solid #ecfeff;
    border-bottom: 2px solid #ecfeff;
    transform: rotate(-45deg) translate(1px, -1px);
}

.detail-week-day.rest i {
    opacity: 0.72;
}

.detail-week-day.present.rest i {
    opacity: 1;
}

.detail-progress-footer,
.detail-progress-head,
.detail-hours-value {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.detail-progress-footer {
    color: #94a3b8;
    font-size: clamp(11px, 2.9cqw, 14px);
    font-weight: 700;
}

.detail-progress-footer span,
.detail-progress-head .detail-progress-title,
.detail-hours-value span {
    min-width: 0;
}

.detail-progress-footer strong,
.detail-progress-head strong,
.detail-hours-value strong {
    color: #06b6d4;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.detail-progress-footer > strong,
.detail-progress-head > strong {
    font-size: clamp(12px, 3.1cqw, 16px);
}

.detail-hours-value strong {
    font-size: clamp(18px, 5cqw, 25px);
    line-height: 1;
}

.detail-hours-value span {
    color: #cbd5e1;
    font-size: clamp(14px, 3.7cqw, 18px);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-progress-track {
    height: clamp(8px, 2.1cqw, 11px);
    border-radius: 999px;
    overflow: hidden;
    background: #263449;
}

.detail-progress-track span {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
}

.detail-progress-note {
    color: #94a3b8;
    font-size: clamp(11px, 2.9cqw, 14px);
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-finance-stat {
    min-height: 96px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px 14px;
    background:
        radial-gradient(circle at 18px 24px, rgba(6, 182, 212, 0.13), transparent 48px),
        linear-gradient(135deg, #1e293b, #172235);
    border-color: rgba(148, 163, 184, 0.14);
}

.detail-finance-stat.salary {
    background:
        radial-gradient(circle at 22px 24px, rgba(16, 185, 129, 0.18), transparent 50px),
        linear-gradient(135deg, #1e293b, #172235);
}

.detail-finance-stat.loan {
    background:
        radial-gradient(circle at 22px 24px, rgba(245, 158, 11, 0.14), transparent 50px),
        linear-gradient(135deg, #1e293b, #172235);
}

.detail-finance-copy {
    min-width: 0;
}

.detail-finance-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    line-height: 1;
}

.detail-finance-icon.salary {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    font-size: 28px;
}

.detail-finance-icon.loan {
    position: relative;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.detail-finance-icon.loan::before {
    content: "";
    width: 24px;
    height: 17px;
    border: 2px solid currentColor;
    border-radius: 5px;
}

.detail-finance-icon.loan::after {
    content: "";
    position: absolute;
    right: 7px;
    width: 10px;
    height: 8px;
    border: 2px solid currentColor;
    border-left: 0;
    border-radius: 0 5px 5px 0;
    background: rgba(30, 41, 59, 0.95);
}

.detail-finance-icon.loan span {
    position: absolute;
    right: 11px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    z-index: 1;
}

.detail-stat-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.detail-stat-value {
    font-size: 18px;
    font-weight: 800;
    margin-top: 4px;
    color: #f1f5f9;
    font-variant-numeric: tabular-nums;
}
.detail-stat-value.primary { color: #06b6d4; }
.detail-stat-value.ok      { color: #10b981; }
.detail-stat-value.warn    { color: #f59e0b; }
.detail-stat-value.muted   { color: #64748b; }

.detail-finance-stat .detail-stat-label {
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
    color: #94a3b8;
}

.detail-finance-stat .detail-stat-value {
    font-size: 21px;
    line-height: 1.12;
    margin-top: 5px;
}

.detail-stat-sub {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@container (max-width: 390px) {
    .detail-stat-grid {
        grid-template-columns: 1fr;
    }

    .detail-week-stat,
    .detail-hours-progress-stat,
    .detail-finance-stat {
        min-height: auto;
    }

    .detail-progress-title {
        font-size: 15px;
    }

    .detail-week-day i {
        width: 20px;
        height: 20px;
    }

    .detail-progress-footer,
    .detail-progress-note {
        font-size: 13px;
    }
}

/* ----- Range note below the stat grid ----- */
.detail-range-note {
    margin-top: -4px;
    font-size: 11px;
    color: #64748b;
    text-align: center;
    padding: 4px 0 2px;
}

/* ----- Section title ----- */
.detail-section-title {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-top: 2px;
}

/* ----- Timeline ----- */
.detail-timeline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-timeline-row {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    font-size: 13px;
}

.detail-tl-date {
    color: #64748b;
    font-variant-numeric: tabular-nums;
    text-transform: capitalize;
}

.detail-tl-label { color: #94a3b8; }

.detail-tl-hours {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #f1f5f9;
    min-width: 36px;
    text-align: right;
}

.detail-timeline-row.present  .detail-tl-label { color: #10b981; }
.detail-timeline-row.holiday  .detail-tl-label { color: #a855f7; }
.detail-timeline-row.absent   .detail-tl-label { color: #ef4444; }
.detail-timeline-row.extra    .detail-tl-hours { color: #f59e0b; }

/* ----- Detail tabs: calendar + day hours ----- */
.detail-tabbed-panel {
    display: grid;
    gap: 10px;
}

.detail-panel-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 3px;
    background: #111827;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
}

.detail-panel-tab {
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #94a3b8;
    min-height: 34px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    cursor: pointer;
    transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.detail-panel-tab:hover,
.detail-panel-tab:focus-visible {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.08);
    outline: none;
}

.detail-panel-tab.active {
    color: #07111f;
    background: #06b6d4;
    box-shadow: 0 8px 18px rgba(6, 182, 212, 0.2);
}

.detail-panel-body {
    min-width: 0;
}

.detail-panel-body.is-calendar {
    background:
        radial-gradient(circle at 24px 20px, rgba(6, 182, 212, 0.09), transparent 58px),
        #111827;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    padding: 12px;
    overflow: hidden;
}

.detail-panel-body .premium-calendar .calendar-grid {
    gap: clamp(4px, 1.35cqw, 8px);
}

.detail-panel-body .premium-calendar .calendar-day {
    min-width: 0;
    border-radius: 8px;
    overflow: hidden;
}

.detail-panel-body .premium-calendar .calendar-day.calendar-day-inactive::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            135deg,
            rgba(148, 163, 184, 0.42) 0,
            rgba(148, 163, 184, 0.42) 2px,
            transparent 2px,
            transparent 7px
        );
    mix-blend-mode: screen;
    opacity: 0.58;
    z-index: 1;
}

.detail-panel-body .premium-calendar .calendar-day.calendar-day-inactive .day-number,
.detail-panel-body .premium-calendar .calendar-day.calendar-day-inactive .hours-dot,
.detail-panel-body .premium-calendar .calendar-day.calendar-day-inactive .calendar-position-dots,
.detail-panel-body .premium-calendar .calendar-day.calendar-day-inactive .today-marker,
.detail-panel-body .premium-calendar .calendar-day.calendar-day-inactive .payday-indicator,
.detail-panel-body .premium-calendar .calendar-day.calendar-day-inactive .money-badge {
    position: relative;
    z-index: 2;
}

.detail-panel-body .premium-calendar .calendar-day.selected {
    border-color: #22d3ee !important;
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.26), inset 0 0 0 1px rgba(8, 47, 73, 0.8) !important;
}

.detail-panel-body .premium-calendar .calendar-day.has-attendance.check-regular {
    background: #10b981 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.detail-panel-body .premium-calendar .calendar-day.has-attendance.check-undertime {
    background: #ef4444 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.detail-panel-body .premium-calendar .calendar-day.has-attendance.check-overtime {
    background: #06b6d4 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.detail-panel-body .premium-calendar .calendar-day.has-attendance.check-holiday {
    background: #f59e0b !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.detail-panel-body .premium-calendar .calendar-day.has-attendance.check-multiposition {
    background: #8b5cf6 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.detail-panel-body .premium-calendar .calendar-day.has-attendance .day-number,
.detail-panel-body .premium-calendar .calendar-day.has-attendance .hours-dot {
    color: #ffffff !important;
}

.detail-panel-body .premium-calendar .calendar-day.has-attendance.selected {
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.52), inset 0 0 0 1px rgba(15, 23, 42, 0.55) !important;
}

.detail-panel-body .premium-calendar .calendar-day-name {
    padding-bottom: 4px;
}

.detail-panel-body .premium-calendar .calendar-month-title {
    font-size: clamp(12px, 3.3cqw, 14px) !important;
}

.detail-panel-body .premium-calendar .day-number {
    font-size: clamp(11px, 3.1cqw, 13px);
    font-weight: 800;
}

.detail-panel-body .premium-calendar .hours-dot {
    font-size: clamp(9px, 2.5cqw, 11px);
    font-weight: 800;
}

.detail-panel-body .premium-calendar .calendar-position-dots {
    gap: clamp(2px, 0.9cqw, 4px);
    margin-top: 2px;
}

.detail-panel-body .premium-calendar .calendar-position-dot {
    width: clamp(5px, 1.8cqw, 7px);
    height: clamp(5px, 1.8cqw, 7px);
}

.detail-panel-body .premium-calendar .calendar-position-more {
    font-size: clamp(7px, 2cqw, 9px);
}

.detail-hours-editor {
    display: grid;
    gap: 10px;
}

.detail-hours-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: #111827;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 10px;
}

.detail-hours-editor-head span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.detail-hours-editor-head strong {
    display: block;
    color: #f8fafc;
    margin-top: 3px;
    font-size: 13px;
    text-transform: capitalize;
}

.detail-hours-state {
    flex: none;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: #94a3b8 !important;
    background: rgba(148, 163, 184, 0.11);
}

.detail-hours-state.present {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.14);
}

.detail-position-hours-list {
    display: grid;
    gap: 10px;
}

.detail-position-hours-card {
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-left: 3px solid var(--pos-color, #06b6d4);
    border-radius: 10px;
    padding: 11px;
}

.detail-position-hours-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

.detail-position-hours-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--pos-color, #06b6d4);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--pos-color, #06b6d4) 18%, transparent);
}

.detail-position-hours-title strong {
    color: #f1f5f9;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-position-hours-title small {
    color: #64748b;
    font-size: 10px;
    white-space: nowrap;
}

.detail-position-hours-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.detail-position-hours-fields label {
    display: grid;
    gap: 4px;
}

.detail-position-hours-fields span {
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
}

.detail-position-hours-fields input {
    width: 100%;
    min-width: 0;
    height: 34px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 7px;
    color: #f8fafc;
    padding: 6px 8px;
    font: inherit;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    outline: none;
}

.detail-position-hours-fields input:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.14);
}

.detail-hours-total-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    background: linear-gradient(135deg, #1e293b, #263449);
    border: 1px solid #06b6d4;
    border-radius: 10px;
    padding: 11px;
}

.detail-hours-total-card span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.detail-hours-total-card strong {
    color: #10b981;
    font-size: 19px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.detail-hours-empty {
    color: #94a3b8;
    background: #111827;
    border: 1px dashed #334155;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    font-size: 13px;
}

.detail-hours-save {
    width: 100%;
}

/* ----- Quick note textarea ----- */
.detail-quick-note {
    width: 100%;
    min-height: 64px;
    resize: vertical;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 12px;
    color: #f1f5f9;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.12s, background 0.12s;
}
.detail-quick-note::placeholder {
    color: #64748b;
}
.detail-quick-note:focus {
    border-color: #06b6d4;
    background: #243049;
}

/* ----- Actions ----- */
.detail-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.detail-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.detail-btn.primary {
    background: #06b6d4;
    color: #0f172a;
}
.detail-btn.primary:hover { background: #0891b2; }

.detail-btn.ghost {
    background: #1e293b;
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.06);
}
.detail-btn.ghost:hover { background: #243049; }

/* =================================================================
   🪪 HEADER ADDITIONS — subtitle + user pill + emoji button
   ================================================================= */

.header-brand-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    line-height: 1.15;
}

.header-context-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 1px;
}

.header-icon-emoji {
    font-size: 18px;
    line-height: 1;
}

.header-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-left: 4px;
    cursor: default;
}
.header-user-pill .header-user-avatar,
.header-user-pill .header-user-avatar-img {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #475569;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex: none;
}
.header-user-pill .header-user-avatar-img {
    object-fit: cover;
    background: #475569;
}
.header-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
}

/* Hide the user pill on small screens to save header room */
@media (max-width: 640px) {
    .header-user-pill .header-user-name { display: none; }
    .header-user-pill { padding: 2px; }
    .header-context-sub { display: none; }
}

/* ----- Empty state ----- */
.attendance-detail.empty .detail-empty-state {
    background: #0f172a;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 32px 18px;
    text-align: center;
    color: #64748b;
}
.attendance-detail.empty .detail-empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
}
.attendance-detail.empty .detail-empty-title {
    color: #f1f5f9;
    font-weight: 700;
    font-size: 14px;
}
.attendance-detail.empty .detail-empty-sub {
    font-size: 12px;
    margin-top: 4px;
}
