:root {
    --brand-primary: #007f67;
    --brand-primary-dark: #005f4f;
    --brand-primary-strong: #006f5a;
    --brand-primary-soft: #eaf7f3;
    --brand-primary-softer: #f4fbf8;
    --brand-gold: #d6a84b;
    --brand-gold-dark: #a97618;
    --brand-gold-soft: #fbf5e8;
    --brand-navy: #07111f;
    --brand-navy-soft: #101c2e;

    --surface: #ffffff;
    --surface-subtle: #fbfcfc;
    --surface-muted: #f4f7f6;
    --surface-raised: #ffffff;
    --border: #e3eae7;
    --border-strong: #d4ded9;

    --text: #16231f;
    --text-strong: #081710;
    --text-muted: #6f7e78;
    --text-soft: #91a09a;

    --success: #15875f;
    --success-soft: #ecf9f3;
    --warning: #c77b10;
    --warning-soft: #fff8e9;
    --danger: #d44555;
    --danger-soft: #fff0f2;
    --info: #3164c9;
    --info-soft: #eff5ff;

    --shadow-xs: 0 1px 2px rgba(10, 38, 30, .04);
    --shadow-sm: 0 8px 24px rgba(14, 45, 36, .06);
    --shadow-md: 0 18px 48px rgba(14, 45, 36, .09);
    --shadow-menu: 0 22px 60px rgba(8, 23, 17, .14);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 30px;

    --sidebar-width: 276px;
    --sidebar-collapsed-width: 88px;
    --topbar-height: 76px;

    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--surface-muted);
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 100% 0%, rgba(214, 168, 75, .055), transparent 28rem),
        linear-gradient(180deg, #f8faf9 0%, var(--surface-muted) 26rem, var(--surface-muted) 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(0, 127, 103, .16);
    color: var(--text-strong);
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button,
a {
    touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(0, 127, 103, .17);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   STEP 12 FOUNDATION
   -------------------------------------------------------------------------- */

.app-shell {
    min-height: 100vh;
}

.app-main {
    min-height: 100vh;
}

.app-content {
    width: 100%;
    padding: 24px 20px 40px;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: var(--topbar-height);
    border-bottom: 1px solid rgba(212, 222, 217, .72);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(18px) saturate(1.15);
}

.app-topbar-inner {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
}

.app-page-heading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 50px;
}

.app-page-eyebrow {
    align-items: center;
    gap: 7px;
    margin-bottom: 2px;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.app-page-eyebrow-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--brand-gold);
}

.app-page-title {
    margin: 0;
    color: var(--text-strong);
    font-size: 19px;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: -.025em;
}

.app-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-clock {
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.app-role-pill {
    min-height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccecdf;
    border-radius: 999px;
    background: #f0fbf6;
    padding: 0 12px;
    color: #0c7658;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.app-icon-button {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: #53635d;
    box-shadow: var(--shadow-xs);
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease;
}

.app-icon-button:hover {
    border-color: var(--border-strong);
    background: #f7faf9;
    color: var(--text-strong);
}

.app-icon-button:active {
    transform: scale(.97);
}

.app-avatar {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -.01em;
}

.app-avatar-dark {
    background: var(--brand-navy);
    color: white;
    box-shadow: 0 7px 18px rgba(7, 17, 31, .14);
}

.app-avatar-soft {
    border: 1px solid #d6f1e6;
    background: #e9faf3;
    color: #087354;
}

.app-user-menu-trigger {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    padding: 3px 4px;
    transition: background-color .18s ease, border-color .18s ease;
}

.app-user-menu-trigger:hover,
.app-user-menu-trigger[aria-expanded="true"] {
    border-color: var(--border);
    background: rgba(247, 250, 249, .95);
}

.app-user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 70;
    width: min(300px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, .98);
    padding: 8px;
    box-shadow: var(--shadow-menu);
    backdrop-filter: blur(16px);
    transform-origin: top right;
}

.app-user-menu:not(.hidden) {
    animation: app-menu-in .16s ease-out both;
}

.app-user-menu-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
}

.app-user-menu-separator {
    height: 1px;
    margin: 4px 8px;
    background: var(--border);
}

.app-user-menu-item {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    padding: 9px 11px;
    color: #44534e;
    font-size: 13px;
    font-weight: 750;
    text-align: left;
    transition: background-color .16s ease, color .16s ease;
}

.app-user-menu-item:hover {
    background: #f4f8f6;
    color: var(--text-strong);
}

.app-user-menu-item-danger:hover {
    background: var(--danger-soft);
    color: #b72f40;
}

@keyframes app-menu-in {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --------------------------------------------------------------------------
   SIDEBAR
   -------------------------------------------------------------------------- */

.app-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    background: rgba(7, 17, 31, .34);
    backdrop-filter: blur(3px);
    transition: opacity .2s ease;
}

.app-sidebar-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    width: min(var(--sidebar-width), calc(100vw - 46px));
    height: 100vh;
    flex-direction: column;
    border-right: 1px solid rgba(212, 222, 217, .74);
    background: rgba(255, 255, 255, .985);
    box-shadow: 18px 0 50px rgba(8, 30, 22, .08);
    transform: translateX(-102%);
    transition: transform .24s cubic-bezier(.2, .8, .2, 1), width .22s ease;
}

.app-sidebar.is-open {
    transform: translateX(0);
}

.app-sidebar-brand {
    position: relative;
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
}

.app-brand-link {
    min-width: 0;
    display: flex;
    flex: 1;
    align-items: center;
    gap: 12px;
    border-radius: 15px;
    color: inherit;
}

.app-brand-link:hover .app-brand-title {
    color: var(--brand-primary-dark);
}

.app-brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    letter-spacing: .02em;
    box-shadow: 0 12px 25px rgba(0, 127, 103, .18);
}

.app-brand-copy {
    min-width: 0;
}

.app-brand-title {
    overflow: hidden;
    color: var(--text-strong);
    font-size: 14px;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -.015em;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .16s ease;
}

.app-brand-subtitle {
    overflow: hidden;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-sidebar-mobile-close {
    margin-left: auto;
}

.app-sidebar-collapse {
    position: absolute;
    right: -15px;
    top: 24px;
    z-index: 2;
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(18, 48, 39, .09);
}

.app-nav {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 18px;
    scrollbar-width: thin;
    scrollbar-color: #d7e1dd transparent;
}

.app-nav-group + .app-nav-group {
    margin-top: 18px;
}

.app-nav-group-label {
    padding: 0 11px 8px;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-nav-list {
    display: grid;
    gap: 4px;
}

.app-nav-link {
    position: relative;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 0 12px;
    color: #52615c;
    font-size: 13px;
    font-weight: 720;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.app-nav-link:hover {
    background: #f5f8f7;
    color: var(--text-strong);
}

.app-nav-link.is-active {
    border-color: #d9eee6;
    background: #ebf8f3;
    color: #066f54;
    font-weight: 820;
}

.app-nav-icon {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    place-items: center;
    color: #74847e;
}

.app-nav-link.is-active .app-nav-icon {
    color: var(--brand-primary);
}

.app-nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-nav-active-dot {
    width: 5px;
    height: 5px;
    margin-left: auto;
    flex: 0 0 5px;
    border-radius: 999px;
    background: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(0, 127, 103, .09);
}

.app-sidebar-footer {
    border-top: 1px solid #edf1ef;
    padding: 14px 16px 16px;
}

.app-sidebar-user {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 16px;
    background: #f7f9f8;
    padding: 10px;
}

.app-sidebar-footnote {
    overflow: hidden;
    margin-top: 8px;
    padding: 0 10px;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   FLASH & GLOBAL UI TOKENS FOR NEXT STEP 12 PATCHES
   -------------------------------------------------------------------------- */

.app-flash {
    width: min(100%, 1280px);
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 11px 14px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
}

.app-flash-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 999px;
}

.app-flash-success {
    border-color: #cbeadb;
    background: var(--success-soft);
    color: #116e50;
}

.app-flash-success .app-flash-dot {
    background: var(--success);
}

.app-flash-error {
    border-color: #f3cbd1;
    background: var(--danger-soft);
    color: #ae3040;
}

.app-flash-error .app-flash-dot {
    background: var(--danger);
}

.ui-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface-raised);
    box-shadow: var(--shadow-sm);
}

.ui-kicker {
    color: var(--brand-primary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.ui-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 13px;
    padding: 0 15px;
    font-size: 13px;
    font-weight: 800;
    transition: transform .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.ui-button:active {
    transform: translateY(1px);
}

.ui-button-primary {
    background: var(--brand-primary);
    color: white;
    box-shadow: 0 7px 18px rgba(0, 127, 103, .15);
}

.ui-button-primary:hover {
    background: var(--brand-primary-dark);
}

.ui-button-secondary {
    border-color: var(--border);
    background: #fff;
    color: #43534d;
}

.ui-button-secondary:hover {
    border-color: var(--border-strong);
    background: #f8faf9;
}

.ui-input {
    min-height: 46px;
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: #fff;
    padding: 0 14px;
    color: var(--text);
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.ui-input:focus {
    outline: none;
    border-color: #5bb49c;
    box-shadow: 0 0 0 4px rgba(0, 127, 103, .09);
}

.ui-skeleton {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #edf2f0;
}

.ui-skeleton::after {
    position: absolute;
    inset: 0;
    content: '';
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
    animation: ui-skeleton-wave 1.25s infinite;
}

@keyframes ui-skeleton-wave {
    100% {
        transform: translateX(100%);
    }
}

/* --------------------------------------------------------------------------
   EXISTING COMPATIBILITY HELPERS
   -------------------------------------------------------------------------- */

.glass-card {
    border: 1px solid rgba(227, 234, 231, .92);
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
}

.brand-gradient {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
}

.gold-ring {
    box-shadow: 0 0 0 7px var(--brand-gold-soft);
}

.sidebar-link {
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.sidebar-link:hover {
    transform: translateX(2px);
}

.focus-brand:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(0, 127, 103, .12);
}

/* --------------------------------------------------------------------------
   DESKTOP SIDEBAR / COLLAPSED MODE
   -------------------------------------------------------------------------- */

@media (min-width: 1024px) {
    .app-sidebar {
        position: sticky;
        top: 0;
        z-index: 35;
        width: var(--sidebar-width);
        height: 100vh;
        flex: 0 0 var(--sidebar-width);
        box-shadow: none;
        transform: translateX(0);
    }

    .app-content {
        padding: 28px 32px 46px;
    }

    .app-topbar-inner {
        padding: 0 32px;
    }

    html[data-sidebar-collapsed="1"] .app-sidebar {
        width: var(--sidebar-collapsed-width);
        flex-basis: var(--sidebar-collapsed-width);
    }

    html[data-sidebar-collapsed="1"] [data-sidebar-copy] {
        display: none !important;
    }

    html[data-sidebar-collapsed="1"] .app-sidebar-brand {
        justify-content: center;
        padding-left: 12px;
        padding-right: 12px;
    }

    html[data-sidebar-collapsed="1"] .app-brand-link {
        flex: 0 0 auto;
    }

    html[data-sidebar-collapsed="1"] .app-sidebar-collapse {
        right: -15px;
    }

    html[data-sidebar-collapsed="1"] .app-nav {
        padding-left: 10px;
        padding-right: 10px;
    }

    html[data-sidebar-collapsed="1"] .app-nav-group + .app-nav-group {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #edf2ef;
    }

    html[data-sidebar-collapsed="1"] .app-nav-link {
        justify-content: center;
        padding: 0;
    }

    html[data-sidebar-collapsed="1"] .app-nav-active-dot {
        position: absolute;
        right: 5px;
        width: 4px;
        height: 18px;
        margin: 0;
        border-radius: 999px;
        box-shadow: none;
    }

    html[data-sidebar-collapsed="1"] .app-sidebar-footer {
        padding: 12px 10px 14px;
    }

    html[data-sidebar-collapsed="1"] .app-sidebar-user {
        justify-content: center;
        background: transparent;
        padding: 4px;
    }
}

/* --------------------------------------------------------------------------
   MOBILE
   -------------------------------------------------------------------------- */

@media (max-width: 639px) {
    :root {
        --topbar-height: 68px;
    }

    .app-topbar-inner {
        gap: 10px;
        min-height: 68px;
        padding: 0 14px;
    }

    .app-page-title {
        font-size: 17px;
    }

    .app-content {
        padding: 18px 14px 32px;
    }

    .app-sidebar {
        width: min(300px, calc(100vw - 34px));
    }

    .app-sidebar-brand {
        min-height: 72px;
        padding: 12px 14px 12px 18px;
    }

    .app-user-menu-trigger {
        min-height: 42px;
        padding: 1px;
    }

    .app-user-menu-trigger .app-avatar {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .app-flash {
        margin-bottom: 14px;
        border-radius: 13px;
    }
}


/* --------------------------------------------------------------------------
   STEP 12.2.2 — MATRIX SCROLL / VISUAL BALANCE
   -------------------------------------------------------------------------- */

.matrix-scroll-viewport {
    width: 100%;
    max-width: 100%;
    background: #fff;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    scrollbar-width: thin;
    scrollbar-color: #9aa9a3 #f3f6f5;
}

.matrix-scroll-viewport:focus-visible {
    outline: 3px solid rgba(0, 127, 103, .14);
    outline-offset: -3px;
}

.matrix-scroll-viewport::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.matrix-scroll-viewport::-webkit-scrollbar-track {
    background: #f3f6f5;
}

.matrix-scroll-viewport::-webkit-scrollbar-thumb {
    border: 2px solid #f3f6f5;
    border-radius: 999px;
    background: #9aa9a3;
}

.matrix-scroll-viewport::-webkit-scrollbar-thumb:hover {
    background: #72827b;
}

.matrix-scroll-viewport::-webkit-scrollbar-button,
.matrix-scroll-viewport::-webkit-scrollbar-corner {
    display: none;
    width: 0;
    height: 0;
    background: transparent;
}

.matrix-sticky-edge {
    box-shadow: 12px 0 18px -18px rgba(15, 23, 42, .7);
}

.matrix-scroll-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    flex: 0 0 42px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: #fff;
    color: #334155;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}

.matrix-scroll-button:hover:not(:disabled) {
    border-color: #9ad7c5;
    background: #eefaf5;
    color: var(--brand-primary-dark);
    transform: translateY(-1px);
}

.matrix-scroll-button:disabled {
    cursor: default;
    opacity: .35;
}

@media (max-width: 767px) {
    .matrix-scroll-viewport {
        max-height: 68vh;
        cursor: grab;
    }

    .matrix-scroll-viewport:active {
        cursor: grabbing;
    }

    .matrix-scroll-button {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* --------------------------------------------------------------------------
   STEP 12.3 — EMPLOYEE WORKSPACE / MOBILE-FIRST CLOSING
   -------------------------------------------------------------------------- */

.employee-workspace,
.closing-workspace,
.closing-edit-workspace {
    position: relative;
}

.employee-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    overflow: hidden;
    border-radius: 28px;
    background:
        radial-gradient(circle at 92% 15%, rgba(0, 127, 103, .28), transparent 19rem),
        linear-gradient(135deg, #07111f, #071724 65%, #082c2b);
    padding: 28px 30px;
    color: #fff;
    box-shadow: 0 20px 50px rgba(7, 17, 31, .12);
}

.employee-hero-copy h2 {
    margin: 8px 0 0;
    font-size: clamp(27px, 4vw, 38px);
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: -.035em;
}

.employee-hero-copy p {
    margin: 10px 0 0;
    color: #b8c7c3;
    font-size: 13px;
    font-weight: 600;
}

.employee-primary-action {
    min-width: 205px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px;
    background: #07916f;
    padding: 13px 16px;
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 127, 103, .24);
    transition: transform .16s ease, background-color .16s ease;
}

.employee-primary-action:hover {
    background: #087c63;
    transform: translateY(-1px);
}

.employee-primary-action-soft {
    background: rgba(255, 255, 255, .09);
    box-shadow: none;
}

.employee-primary-action-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, .13);
    font-size: 22px;
    font-weight: 800;
}

.employee-primary-action strong,
.employee-primary-action small {
    display: block;
}

.employee-primary-action strong {
    font-size: 14px;
    font-weight: 900;
}

.employee-primary-action small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .7);
    font-size: 11px;
    font-weight: 650;
}

.employee-history-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    border: 1px solid #d6e4f8;
    border-radius: 16px;
    background: #f2f7ff;
    padding: 12px 15px;
    color: #315b9a;
    font-size: 12px;
}

.employee-history-banner strong,
.employee-history-banner span {
    display: block;
}

.employee-history-banner span {
    margin-top: 2px;
    color: #7187a7;
}

.employee-history-banner a {
    color: #275dc1;
    font-weight: 850;
    white-space: nowrap;
}

.employee-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.employee-kpi {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 21px;
    background: rgba(255, 255, 255, .94);
    padding: 17px 18px;
    box-shadow: var(--shadow-sm);
}

.employee-kpi span,
.employee-kpi small,
.employee-kpi strong {
    display: block;
}

.employee-kpi span {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.employee-kpi strong {
    overflow: hidden;
    margin-top: 6px;
    color: var(--text-strong);
    font-size: 26px;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-kpi small {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.employee-kpi-primary {
    border-color: #cce9df;
    background: linear-gradient(145deg, #fff, #f0faf6);
}

.employee-metric-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.employee-metric-chips span {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, .84);
    padding: 0 11px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

.employee-metric-chips strong {
    color: #31413b;
    font-weight: 900;
}

.employee-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(300px, .58fr);
    align-items: start;
    gap: 18px;
    margin-top: 18px;
}

.employee-activity-card,
.employee-report-card,
.employee-shortcut-card {
    overflow: hidden;
}

.employee-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    padding: 20px 22px 17px;
}

.employee-section-head h3,
.employee-report-head h3,
.employee-shortcut-card h3 {
    margin: 5px 0 0;
    color: var(--text-strong);
    font-size: 20px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -.025em;
}

.employee-section-head a,
.employee-shortcut-card a {
    color: var(--brand-primary);
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.employee-empty-state {
    display: grid;
    min-height: 290px;
    place-items: center;
    align-content: center;
    padding: 28px;
    text-align: center;
}

.employee-empty-state strong {
    margin-top: 13px;
    color: var(--text-strong);
    font-size: 18px;
    font-weight: 900;
}

.employee-empty-state p {
    max-width: 390px;
    margin: 7px 0 17px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.65;
}

.employee-empty-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 16px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    font-size: 22px;
    font-weight: 900;
}

.employee-activity-list {
    padding: 3px 0;
}

.employee-activity-item {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 14px;
    padding: 15px 20px;
    transition: background-color .15s ease;
}

.employee-activity-item + .employee-activity-item {
    border-top: 1px solid #edf2ef;
}

.employee-activity-item:hover {
    background: #fafcfb;
}

.employee-activity-item.is-void {
    opacity: .55;
}

.employee-activity-time {
    padding-top: 2px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
}

.employee-activity-time small {
    display: block;
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 800;
}

.employee-activity-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.employee-activity-title strong {
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 900;
}

.employee-activity-title span {
    border-radius: 999px;
    background: var(--danger-soft);
    padding: 3px 7px;
    color: #b43747;
    font-size: 9px;
    font-weight: 850;
}

.employee-activity-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 7px;
}

.employee-activity-metrics span {
    border-radius: 9px;
    background: #f2f6f4;
    padding: 5px 8px;
    color: #51615b;
    font-size: 10px;
    font-weight: 800;
}

.employee-report-card,
.employee-shortcut-card {
    padding: 21px;
}

.employee-report-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.employee-report-card > p,
.employee-shortcut-card > p {
    margin: 10px 0 17px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.65;
}

.employee-status-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    margin-top: 5px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 0 0 5px rgba(148, 163, 184, .11);
}

.employee-status-success .employee-status-dot {
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(21, 135, 95, .11);
}

.employee-status-warning .employee-status-dot {
    background: #e49a17;
    box-shadow: 0 0 0 5px rgba(228, 154, 23, .11);
}

.employee-report-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.employee-report-meta > div {
    border-radius: 13px;
    background: #f6f8f7;
    padding: 10px 11px;
}

.employee-report-meta span,
.employee-report-meta strong {
    display: block;
}

.employee-report-meta span {
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.employee-report-meta strong {
    margin-top: 3px;
    color: #33433d;
    font-size: 11px;
    font-weight: 850;
}

.employee-mobile-fab {
    display: none;
}

/* Closing page */

.closing-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.closing-add-button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 15px;
    background: var(--brand-primary);
    padding: 0 18px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(0, 127, 103, .16);
    transition: transform .16s ease, background-color .16s ease;
}

.closing-add-button:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-1px);
}

.closing-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.closing-summary-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 19px;
    background: rgba(255, 255, 255, .95);
    padding: 15px 16px;
    box-shadow: var(--shadow-xs);
}

.closing-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    align-items: start;
    gap: 18px;
    margin-top: 18px;
}

.closing-activity-panel,
.closing-side-card {
    border-radius: 23px;
}

.closing-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    padding: 18px 20px;
}

.closing-entry {
    padding: 16px 20px;
}

.closing-entry + .closing-entry {
    border-top: 1px solid #edf2ef;
}

.closing-entry.is-void {
    background: #f7f9f8;
    opacity: .6;
}

.closing-entry-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.closing-entry-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
}

.closing-side-stack {
    display: grid;
    align-self: start;
    gap: 18px;
}

.closing-side-card {
    padding: 20px;
}

.closing-modal {
    opacity: 0;
    transition: opacity .17s ease;
}

.closing-modal.is-open {
    opacity: 1;
}

.closing-modal-panel {
    transform: translateY(18px);
    transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}

.closing-modal.is-open .closing-modal-panel {
    transform: translateY(0);
}

.closing-modal-head {
    min-height: 78px;
}

.closing-modal-form {
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
}

.closing-product-list {
    scrollbar-width: thin;
    scrollbar-color: #c5d0cc transparent;
}

.closing-product-option {
    min-height: 52px;
    border: 1px solid transparent;
    transition: border-color .14s ease, background-color .14s ease, transform .14s ease;
}

.closing-product-option:hover {
    border-color: #d8ece5;
}

.closing-product-option:active {
    transform: scale(.992);
}

.closing-product-empty {
    margin-top: 9px;
    border-radius: 13px;
    background: #f5f7f6;
    padding: 12px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
    text-align: center;
}

.closing-selected-product {
    position: relative;
    overflow: hidden;
}

.closing-selected-product::after {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    border-radius: 999px;
    background: var(--brand-primary);
    content: '';
}

.closing-metric-fields input,
.closing-metric-fields select,
.closing-metric-fields textarea {
    min-height: 50px;
    font-size: 16px;
}

.closing-save-button:disabled,
[data-submit-report-form] button[type="submit"]:disabled,
[data-edit-save-button]:disabled {
    cursor: wait;
    opacity: .68;
}

.closing-mobile-action {
    display: none;
}

/* Edit closing */

.closing-edit-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.closing-edit-head h2 {
    margin: 4px 0 0;
    color: var(--text-strong);
    font-size: 29px;
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -.035em;
}

.closing-edit-head p {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.closing-edit-card {
    overflow: hidden;
}

.closing-edit-product-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    background: #fbfcfc;
    padding: 14px 20px;
}

.closing-edit-product-summary span,
.closing-edit-product-summary small {
    color: var(--text-muted);
    font-size: 11px;
}

.closing-edit-product-summary strong {
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
}

.closing-edit-product-summary small {
    margin-left: auto;
}

.closing-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
}

.closing-field label {
    display: block;
    margin-bottom: 7px;
    color: #40504a;
    font-size: 12px;
    font-weight: 850;
}

.closing-field-wide,
.closing-edit-actions {
    grid-column: 1 / -1;
}

.closing-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 18px;
}

@media (min-width: 1024px) {
    .closing-modal-panel {
        transform: translateX(22px);
    }

    .closing-modal.is-open .closing-modal-panel {
        transform: translateX(0);
    }
}

@media (max-width: 1023px) {
    .employee-dashboard-grid,
    .closing-main-grid {
        grid-template-columns: 1fr;
    }

    .employee-dashboard-grid aside {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .closing-side-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 639px) {
    .employee-workspace,
    .closing-workspace {
        padding-bottom: 78px;
    }

    .employee-hero {
        align-items: stretch;
        border-radius: 22px;
        padding: 21px 19px;
    }

    .employee-hero-copy h2 {
        font-size: 26px;
    }

    .employee-hero-copy p {
        font-size: 11px;
    }

    .employee-primary-action {
        display: none;
    }

    .employee-history-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .employee-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
        margin-top: 12px;
    }

    .employee-summary-grid .employee-kpi:nth-child(2) {
        grid-column: span 1;
    }

    .employee-summary-grid .employee-kpi:nth-child(3) {
        grid-column: 1 / -1;
    }

    .employee-kpi {
        border-radius: 17px;
        padding: 13px 14px;
    }

    .employee-kpi strong {
        font-size: 22px;
    }

    .employee-kpi small {
        font-size: 10px;
    }

    .employee-metric-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 3px;
        scrollbar-width: none;
    }

    .employee-metric-chips::-webkit-scrollbar {
        display: none;
    }

    .employee-dashboard-grid {
        gap: 13px;
        margin-top: 13px;
    }

    .employee-dashboard-grid aside {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .employee-section-head {
        padding: 17px 16px 14px;
    }

    .employee-section-head h3,
    .employee-report-head h3,
    .employee-shortcut-card h3 {
        font-size: 18px;
    }

    .employee-empty-state {
        min-height: 245px;
        padding: 22px 18px;
    }

    .employee-activity-item {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 10px;
        padding: 14px 15px;
    }

    .employee-report-card,
    .employee-shortcut-card {
        padding: 17px;
    }

    .employee-mobile-fab,
    .closing-mobile-action {
        position: fixed;
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        z-index: 34;
        display: inline-flex;
        min-height: 50px;
        align-items: center;
        justify-content: center;
        gap: 7px;
        border: 1px solid rgba(255, 255, 255, .3);
        border-radius: 17px;
        background: var(--brand-primary);
        padding: 0 17px;
        color: #fff;
        font-size: 13px;
        font-weight: 900;
        box-shadow: 0 14px 36px rgba(0, 75, 60, .28);
    }

    .employee-mobile-fab span,
    .closing-mobile-action span {
        font-size: 20px;
        line-height: 1;
    }

    .closing-page-head {
        align-items: flex-start;
    }

    .closing-page-head h2 {
        font-size: 27px;
    }

    .closing-add-button {
        display: none;
    }

    .closing-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 13px;
    }

    .closing-summary-card {
        border-radius: 16px;
        padding: 12px 13px;
    }

    .closing-summary-card .text-3xl {
        font-size: 21px !important;
    }

    .closing-summary-card .text-sm {
        font-size: 10px !important;
    }

    .closing-main-grid {
        gap: 13px;
        margin-top: 13px;
    }

    .closing-activity-panel,
    .closing-side-card {
        border-radius: 19px;
    }

    .closing-panel-head {
        padding: 15px;
    }

    .closing-panel-head p {
        display: none;
    }

    .closing-entry {
        padding: 14px 15px;
    }

    .closing-entry-row {
        gap: 10px;
    }

    .closing-entry-row > div:first-child {
        width: 42px !important;
        height: 42px !important;
        flex-basis: 42px !important;
        border-radius: 13px !important;
    }

    .closing-entry-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .closing-entry-actions a,
    .closing-entry-actions button {
        min-width: 52px;
        padding: 7px 9px !important;
    }

    .closing-side-stack {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .closing-side-card {
        padding: 17px;
    }

    .closing-modal-panel {
        max-height: 94dvh;
        border-radius: 24px 24px 0 0 !important;
    }

    .closing-modal-head {
        min-height: 68px;
        padding: 14px 16px !important;
    }

    .closing-modal-head h3 {
        font-size: 21px !important;
    }

    .closing-modal-form {
        padding: 15px 15px calc(24px + env(safe-area-inset-bottom)) !important;
    }

    .closing-product-list {
        max-height: 215px !important;
    }

    .closing-product-option {
        min-height: 49px;
        padding: 9px 10px !important;
    }

    .closing-metric-fields {
        margin-top: 15px !important;
    }

    .closing-metric-fields > div.grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .closing-edit-head h2 {
        font-size: 25px;
    }

    .closing-edit-card {
        border-radius: 20px;
    }

    .closing-edit-product-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
        padding: 13px 15px;
    }

    .closing-edit-product-summary small {
        margin-left: 0;
    }

    .closing-edit-form {
        grid-template-columns: 1fr;
        gap: 13px;
        padding: 16px;
    }

    .closing-field-wide,
    .closing-edit-actions {
        grid-column: auto;
    }

    .closing-edit-actions {
        flex-direction: column-reverse;
    }

    .closing-edit-actions .ui-button {
        width: 100%;
    }
}


/* ============================================================
   STEP 12.3.1 - MOBILE ACTION SAFETY
   Keep the primary action reachable without covering forms/content.
   ============================================================ */
@media (max-width: 1023px) {
    .employee-mobile-fab,
    .closing-mobile-action {
        transition:
            opacity 160ms ease,
            transform 180ms ease,
            box-shadow 180ms ease;
    }

    .employee-mobile-fab-label,
    .closing-mobile-action-label {
        font-size: 13px !important;
        line-height: 1 !important;
    }

    .employee-mobile-fab.is-hidden,
    .closing-mobile-action.is-hidden {
        opacity: 0;
        transform: translateY(16px) scale(.92);
        pointer-events: none;
    }
}

@media (max-width: 639px) {
    .employee-mobile-fab,
    .closing-mobile-action {
        width: 54px;
        min-width: 54px;
        height: 54px;
        min-height: 54px;
        padding: 0;
        border-radius: 999px;
    }

    .employee-mobile-fab-label,
    .closing-mobile-action-label {
        display: none;
    }

    .employee-mobile-fab .employee-mobile-fab-icon,
    .closing-mobile-action .closing-mobile-action-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 23px;
        line-height: 1;
    }
}
