/*
 * Akyana RH design system. Shared with the Akyana ecosystem: logo lock-up, Outfit + JetBrains Mono,
 * mono uppercase labels, the login page layout. Own charter: pine green, light + automatic dark.
 * Fonts: Outfit (text) + JetBrains Mono (labels, pills, codes). Icons: Phosphor.
 * Radius rule: surfaces 16px, controls 10px, chips and pills fully rounded.
 */

@font-face {
    font-family: 'Outfit';
    src: url("../fonts/outfit/outfit-latin-3BR0lLl.woff2") format('woff2');
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Outfit';
    src: url("../fonts/outfit/outfit-latin-ext-6bPR0nO.woff2") format('woff2');
    font-weight: 100 900;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url("../fonts/jetbrains-mono/jetbrains-mono-latin-qI6BF9f.woff2") format('woff2');
    font-weight: 100 800;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url("../fonts/jetbrains-mono/jetbrains-mono-latin-ext-5t87yUl.woff2") format('woff2');
    font-weight: 100 800;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------------ tokens: Akyana RH charter (pine green), light */

:root {
    color-scheme: light;

    --bg: #f3f4f6;
    --surface: #fcfcfd;
    --surface-2: #f6f7f9;
    --surface-press: #eef0f3;
    --line: #e3e5ea;
    --line-strong: #d2d6dd;
    --input-bg: #fcfcfd;

    --text: #15171c;
    --text-2: #474d5a;
    --text-3: #676d7a;

    /* RH accent: actions */
    --accent: #12715b;
    --accent-press: #0d5c49;
    --accent-soft: #e1f0ea;
    --accent-text: #0d634f;
    --on-accent: #f6fbf9;
    --link: #0d634f;

    /* Selection and focus follow the RH accent */
    --brand: #12715b;
    --brand-2: #12715b;
    --brand-soft: #e1f0ea;
    --brand-text: #0d634f;
    --on-brand: #f6fbf9;
    --focus: #12715b;
    --focus-ring: rgb(18 113 91 / .18);

    --success-soft: #e1f0ea;
    --success-text: #0d634f;
    --warning-soft: #fdf0d9;
    --warning-text: #8a5100;
    --danger: #b42318;
    --danger-soft: #fdeceb;
    --danger-text: #a01f15;
    --ink: #22262e;
    --on-ink: #f3f4f6;

    --toast-bg: #22262e;
    --toast-text: #f3f4f6;
    --toast-success: #3eb592;
    --toast-warning: #f0b95a;

    --sidebar-bg: #fcfcfd;
    --sidebar-text: #474d5a;
    --sidebar-text-strong: #15171c;
    --sidebar-hover: #eef0f3;
    --sidebar-active-bg: #e1f0ea;
    --sidebar-active-text: #0d634f;
    --sidebar-line: #e3e5ea;

    --shadow-sm: 0 1px 2px rgb(21 23 28 / .05);
    --shadow-md: 0 1px 2px rgb(21 23 28 / .04), 0 8px 24px -12px rgb(21 23 28 / .12);
    --shadow-lg: 0 24px 64px -24px rgb(21 23 28 / .28);

    /* Product pill next to the Akyana logo, in the RH colour (CRM uses gold). */
    --brand-pill-text: #0d634f;
    --brand-pill-bg: rgb(18 113 91 / .08);
    --brand-pill-border: rgb(18 113 91 / .25);

    --r-surface: 16px;
    --r-control: 10px;
    --r-full: 999px;

    --font: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --ease: cubic-bezier(.16, 1, .3, 1);

    --topbar-h: 56px;
    --tabbar-h: 64px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --gutter: 16px;

    /* Planning categories: tint, outline (at least 3:1 on the card) and ink (at least 4.5:1 on the tint). */
    --cat-leave-bg: #cfe9df;
    --cat-leave-line: #12715b;
    --cat-leave-ink: #0b4f3f;
    --cat-sick-bg: #f8d4d1;
    --cat-sick-line: #b42318;
    --cat-sick-ink: #8a1a12;
    --cat-other-bg: #dde1e8;
    --cat-other-line: #5b6472;
    --cat-other-ink: #353b45;
    --cat-pending-bg: #fdf3e2;
    --cat-pending-stripe: #f6d9a6;
    --cat-pending-line: #a15c07;
    --cat-pending-ink: #6f3e00;
    --planning-off: #eceef2;
}

/* ------------------------------------------------------------------ tokens: dark (follows the phone) */

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;

        --bg: #0e1013;
        --surface: #16191e;
        --surface-2: #1c2026;
        --surface-press: #232830;
        --line: #262a32;
        --line-strong: #333944;
        --input-bg: #16191e;

        --text: #eceef2;
        --text-2: #b6bbc6;
        --text-3: #8d939f;

        --accent: #3eb592;
        --accent-press: #34a080;
        --accent-soft: #15302a;
        --accent-text: #6cd2b1;
        --on-accent: #05241b;
        --link: #6cd2b1;

        --brand: #3eb592;
        --brand-2: #3eb592;
        --brand-soft: #15302a;
        --brand-text: #6cd2b1;
        --on-brand: #05241b;
        --focus: #3eb592;
        --focus-ring: rgb(62 181 146 / .22);

        --success-soft: #15302a;
        --success-text: #6cd2b1;
        --warning-soft: #33260f;
        --warning-text: #f0b95a;
        --danger: #f0776c;
        --danger-soft: #3a1714;
        --danger-text: #f59a91;
        --ink: #e6e8ec;
        --on-ink: #16191e;

        --toast-bg: #e6e8ec;
        --toast-text: #16191e;
        --toast-success: #12715b;
        --toast-warning: #8a5100;

        --sidebar-bg: #16191e;
        --sidebar-text: #b6bbc6;
        --sidebar-text-strong: #eceef2;
        --sidebar-hover: #232830;
        --sidebar-active-bg: #15302a;
        --sidebar-active-text: #6cd2b1;
        --sidebar-line: #262a32;

        --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
        --shadow-md: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .5);
        --shadow-lg: 0 24px 64px -24px rgb(0 0 0 / .7);

        --brand-pill-text: #6cd2b1;
        --brand-pill-bg: rgb(62 181 146 / .1);
        --brand-pill-border: rgb(62 181 146 / .22);

        --cat-leave-bg: #173a31;
        --cat-leave-line: #3eb592;
        --cat-leave-ink: #9be3c9;
        --cat-sick-bg: #3f1c19;
        --cat-sick-line: #f0776c;
        --cat-sick-ink: #f8b8b1;
        --cat-other-bg: #2a2f37;
        --cat-other-line: #8a93a1;
        --cat-other-ink: #d8dde5;
        --cat-pending-bg: #2e2512;
        --cat-pending-stripe: #4a3714;
        --cat-pending-line: #e0a24a;
        --cat-pending-ink: #f3c57a;
        --planning-off: #1b1f25;
    }
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }

/* The hidden attribute always wins over component display rules (grid, flex). */
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 6px;
}

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.small { font-size: 14px; }
.xsmall { font-size: 13px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ph, .ph-fill { font-size: 1.25em; line-height: 1; vertical-align: -0.2em; }

/* ------------------------------------------------------------------ app shell */

.app { min-height: 100dvh; }

.sidebar { display: none; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: calc(var(--topbar-h) + var(--safe-top));
    padding: var(--safe-top) var(--gutter) 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar-title {
    font-size: 16px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .3s var(--ease);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56vw;
}
.topbar.is-scrolled .topbar-title { opacity: 1; transform: none; }
.topbar-start { display: flex; align-items: center; justify-self: start; min-width: 0; }
.topbar-end { display: flex; align-items: center; gap: 4px; justify-self: end; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}
.brand:hover { text-decoration: none; }
/* Same lock-up as Akyana CRM: full Akyana logo + product pill. */
.brand-logo { display: block; height: 24px; width: auto; }
.brand-product {
    font-family: var(--mono);
    padding: 2px 7px;
    border: 1px solid var(--brand-pill-border);
    border-radius: 100px;
    background: var(--brand-pill-bg);
    color: var(--brand-pill-text);
    font-size: 9px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.brand--lg .brand-logo { height: 32px; }
.brand--lg .brand-product { font-size: 11px; padding: 3px 9px; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--r-full);
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: background .15s ease, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-press); text-decoration: none; }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ph { font-size: 22px; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: -8px;
    padding: 8px;
    border-radius: var(--r-control);
    font-weight: 500;
    color: var(--link);
}
.back-link:hover { text-decoration: none; background: var(--surface-press); }
.back-link .ph { font-size: 20px; }

.avatar {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--r-full);
    background: var(--brand-soft);
    color: var(--brand-text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    flex: none;
}
.avatar--lg { width: 48px; height: 48px; font-size: 17px; }

.main {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 4px var(--gutter) calc(var(--tabbar-h) + var(--safe-bottom) + 32px);
}
.main--wide { max-width: 1120px; }
.no-tabbar .main { padding-bottom: calc(var(--safe-bottom) + 32px); }

/* Bottom tab bar (mobile) */
.tabbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    height: calc(var(--tabbar-h) + var(--safe-bottom));
    padding: 0 8px var(--safe-bottom);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--line);
}
.no-tabbar .tabbar { display: none; }
.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: none;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 550;
    letter-spacing: .01em;
    cursor: pointer;
    transition: color .15s ease, transform .15s var(--ease);
}
.tab:hover { text-decoration: none; color: var(--text-2); }
.tab:active { transform: scale(.94); }
.tab .ph, .tab .ph-fill { font-size: 24px; vertical-align: 0; }
.tab.is-active { color: var(--brand-text); }
.tab-add-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: var(--r-full);
    background: var(--accent);
    color: var(--on-accent);
}
.tab-add-icon .ph { font-size: 18px; }

@media (min-width: 1024px) {
    .app {
        display: grid;
        grid-template-columns: 256px minmax(0, 1fr);
    }
    .sidebar {
        display: flex;
        flex-direction: column;
        gap: 4px;
        position: sticky;
        top: 0;
        height: 100dvh;
        padding: 20px 14px;
        border-right: 1px solid var(--sidebar-line);
        background: var(--sidebar-bg);
    }
    .sidebar .brand { padding: 6px 10px 22px; }
    .side-link {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 10px 12px;
        border: 0;
        border-radius: var(--r-control);
        background: none;
        color: var(--sidebar-text);
        font-weight: 500;
        font-size: 15px;
        text-align: left;
        cursor: pointer;
        transition: background .15s ease, color .15s ease;
    }
    .side-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-strong); text-decoration: none; }
    .side-link.is-active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
    .side-link .ph, .side-link .ph-fill { font-size: 20px; vertical-align: 0; }
    .side-link--primary { margin: 8px 0 12px; background: var(--accent); color: var(--on-accent); justify-content: center; font-weight: 600; }
    .side-link--primary:hover { background: var(--accent-press); color: var(--on-accent); }
    .side-spacer { flex: 1; }
    .side-user {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px;
        border-radius: var(--r-control);
        color: var(--sidebar-text-strong);
    }
    .side-user:hover { background: var(--sidebar-hover); text-decoration: none; }
    .side-user-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
    .side-user-meta { font-size: 12px; color: var(--sidebar-text); line-height: 1.3; }

    .tabbar, .topbar-brand-mobile { display: none; }
    .topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); }
    .main { padding: 8px 40px 64px; }
    .no-tabbar .main { padding-bottom: 64px; }
}

/* Impersonation banner */
.impersonation {
    position: relative;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(var(--safe-top) + 8px) var(--gutter) 8px;
    background: var(--ink);
    color: var(--on-ink);
    font-size: 14px;
}
.impersonation a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.impersonation + .app .topbar { padding-top: 0; height: var(--topbar-h); }

/* ------------------------------------------------------------------ page header */

.page-head { padding: 4px 0 20px; }
.page-title {
    font-size: 30px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.025em;
}
.page-sub { margin-top: 6px; color: var(--text-3); font-size: 15px; }
.page-head-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (min-width: 1024px) {
    .page-head { padding: 8px 0 28px; }
    .page-title { font-size: 32px; }
}

.section { margin-top: 32px; }
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 4px 10px;
}
.section-title { font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.section-link { font-size: 15px; font-weight: 550; }

/* Month switcher */
.month-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: var(--r-full);
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.month-switch a {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--r-full);
    color: var(--text-2);
}
.month-switch a:hover { background: var(--surface-press); text-decoration: none; }
.month-switch-label { padding: 0 8px; font-weight: 600; font-size: 15px; min-width: 128px; text-align: center; }

/* ------------------------------------------------------------------ surfaces */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-surface);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card + .card { margin-top: 12px; }

.callout {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--r-surface);
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 15px;
    color: var(--text-2);
}
.callout > .ph { font-size: 22px; flex: none; margin-top: 1px; color: var(--text-3); }
.callout strong { color: var(--text); }
.callout--warning { background: var(--warning-soft); border-color: transparent; color: var(--warning-text); }
.callout--warning > .ph, .callout--warning strong { color: var(--warning-text); }
.callout--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.callout--accent > .ph, .callout--accent strong { color: var(--accent-text); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout li + li { margin-top: 4px; }

/* ------------------------------------------------------------------ stats */

.hero-stat {
    display: grid;
    gap: 16px;
    padding: 20px;
}
.hero-stat-label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.hero-stat-value {
    font-size: 44px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
}
.hero-stat-value small { font-size: 18px; font-weight: 550; letter-spacing: -.01em; color: var(--text-3); margin-left: 6px; }
.hero-stat-split {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    margin: 0 -20px -20px;
}
.hero-stat-split > * { padding: 14px 20px; }
.hero-stat-split > * + * { border-left: 1px solid var(--line); }
.hero-stat-split a { color: inherit; }
.hero-stat-split a:hover { text-decoration: none; background: var(--surface-2); }

.kv-label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.kv-value { font-size: 19px; font-weight: 650; letter-spacing: -.015em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kv-value.is-negative { color: var(--danger-text); }
.kv-hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }

@media (max-width: 420px) {
    .hero-stat-split > * { padding: 12px 14px; }
    .kv-value { font-size: 17px; }
}

.kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.kpis > div { background: var(--surface); padding: 16px 18px; }
@media (min-width: 768px) { .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ------------------------------------------------------------------ chips */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 550;
    white-space: nowrap;
    background: var(--surface-press);
    color: var(--text-2);
}
.chip .ph, .chip .ph-fill { font-size: 15px; vertical-align: 0; }
.chip--neutral { background: var(--surface-press); color: var(--text-2); }
.chip--warning { background: var(--warning-soft); color: var(--warning-text); }
.chip--success { background: var(--success-soft); color: var(--success-text); }
.chip--accent { background: var(--accent-soft); color: var(--accent-text); }
.chip--brand { background: var(--brand-soft); color: var(--brand-text); }
.chip--ink { background: var(--ink); color: var(--on-ink); }
.chip--danger { background: var(--danger-soft); color: var(--danger-text); }
.chip--sm { height: 22px; padding: 0 8px; font-size: 12px; }

/* ------------------------------------------------------------------ lists (inset grouped) */

.list {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.list-row {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 60px;
    padding: 12px 16px;
    color: var(--text);
    transition: background .15s ease;
}
.list-row + .list-row::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 66px;
    border-top: 1px solid var(--line);
}
a.list-row:hover, button.list-row:hover { background: var(--surface-2); text-decoration: none; }
a.list-row:active, button.list-row:active { background: var(--surface-press); }
button.list-row { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.list-row--plain { grid-template-columns: minmax(0, 1fr) auto; }
.list-row--plain + .list-row--plain::before { left: 16px; }
.list-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-press);
    color: var(--text-2);
}
.list-icon .ph { font-size: 20px; vertical-align: 0; }
.list-icon--accent { background: var(--brand-soft); color: var(--brand-text); }
.list-icon--warning { background: var(--warning-soft); color: var(--warning-text); }
.list-title { font-weight: 550; line-height: 1.3; }
.list-meta { font-size: 14px; color: var(--text-3); line-height: 1.35; margin-top: 2px; }
.list-trail { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.list-trail .ph-caret-right { color: var(--text-3); font-size: 16px; vertical-align: 0; }
.list-value { font-weight: 600; color: var(--text); }
.list-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 13px;
    color: var(--text-3);
}

/* ------------------------------------------------------------------ weeks */

.week {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.week + .week { margin-top: 10px; }
.week > summary {
    list-style: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
}
.week > summary::-webkit-details-marker { display: none; }
.week > summary:hover { background: var(--surface-2); }
.week-name { font-weight: 600; }
.week-dates { font-size: 14px; color: var(--text-3); }
.week-total { font-weight: 650; font-variant-numeric: tabular-nums; }
.week-caret { color: var(--text-3); transition: transform .25s var(--ease); }
.week[open] .week-caret { transform: rotate(90deg); }
.week-body { border-top: 1px solid var(--line); }

.day {
    position: relative;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    padding: 8px 16px;
    color: var(--text);
}
.day + .day::before { content: ''; position: absolute; top: 0; left: 74px; right: 0; border-top: 1px solid var(--line); }
a.day:hover { background: var(--surface-2); text-decoration: none; }
.day-date { text-align: center; line-height: 1.1; }
.day-dow { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.day-num { display: block; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.day.is-today .day-num {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-top: 2px;
    border-radius: var(--r-full);
    background: var(--brand);
    color: var(--on-brand);
    font-size: 15px;
}
.day.is-weekend, .day.is-outside { color: var(--text-3); }
.day.is-weekend .day-num, .day.is-outside .day-num { color: var(--text-3); font-weight: 500; }
.day-detail { font-size: 15px; min-width: 0; }
.day-detail > div + div { margin-top: 2px; }
.day-detail .muted { font-size: 14px; }
.day-add { color: var(--text-3); font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
a.day:hover .day-add { color: var(--link); }
.day-hours { font-weight: 600; font-variant-numeric: tabular-nums; }
.day-absence { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-text); font-weight: 500; }

.week-foot {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 14px;
}
.week-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.week-alert { display: flex; gap: 8px; color: var(--warning-text); }
.week-alert .ph { flex: none; margin-top: 1px; }

/* Segmented control */
.segmented {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 3px;
    border-radius: var(--r-control);
    background: var(--surface-press);
}
.segmented button, .segmented label {
    min-width: 96px;
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.segmented .is-selected {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 3px rgb(21 23 28 / .12);
}

/* ------------------------------------------------------------------ buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: var(--r-control);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .45; pointer-events: none; }
.btn .ph { font-size: 19px; vertical-align: 0; }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-press); color: var(--on-accent); box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn--secondary:hover { background: var(--surface-2); color: var(--text); }
.btn--soft { background: var(--accent-soft); color: var(--accent-text); }
.btn--soft:hover { filter: brightness(.97); color: var(--accent-text); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-press); color: var(--text); }
.btn--danger { background: transparent; color: var(--danger-text); }
.btn--danger:hover { background: var(--danger-soft); color: var(--danger-text); }
.btn--danger-solid { background: var(--danger); color: #fff; }
.btn--lg { height: 52px; font-size: 16px; border-radius: 14px; }
.btn--sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn--block { display: flex; width: 100%; }

/* ------------------------------------------------------------------ forms */

.form-card { padding: 20px; }
.form-stack { display: grid; gap: 20px; }
.form-grid { display: grid; gap: 20px; }
@media (min-width: 640px) {
    .form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .span-2 { grid-column: span 2; }
}
.form-section-title { font-size: 15px; font-weight: 650; margin-bottom: -6px; }

.field { display: grid; gap: 8px; min-width: 0; }
.label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; color: var(--text-2); }
.label .optional { font-family: var(--font); text-transform: none; letter-spacing: 0; font-size: 12px; }
.label .optional { font-weight: 400; color: var(--text-3); }
.help { font-size: 13px; color: var(--text-3); line-height: 1.4; }
.field-error { font-size: 13px; color: var(--danger-text); font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.field-error ul { list-style: none; margin: 0; padding: 0; }

.input, .select, .textarea {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
.textarea { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.45; }
.select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 256 256'%3E%3Cpath fill='%238a88a3' d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
.input[type='date'], .input[type='time'] { line-height: 46px; }
.input[type='date']::-webkit-date-and-time-value, .input[type='time']::-webkit-date-and-time-value { text-align: left; }
.input[type='file'] { padding: 10px 14px; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); }

.input-affix { position: relative; }
.input-affix .input { padding-right: 44px; }
.input-affix-suffix {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

/* Big time inputs */
.time-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; }
.time-pair-arrow { padding-bottom: 14px; color: var(--text-3); }
.time-pair .input { font-size: 22px; font-weight: 600; min-height: 60px; line-height: 58px; text-align: center; font-variant-numeric: tabular-nums; }
.time-pair .input::-webkit-date-and-time-value { text-align: center; }

.duration-preview {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 16px 18px;
    border-radius: var(--r-control);
    background: var(--accent-soft);
    color: var(--accent-text);
}
.duration-preview strong { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.duration-preview.is-error { background: var(--danger-soft); color: var(--danger-text); }
.duration-preview:empty { display: none; }

/* Toggle switch (checkbox) */
.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 48px;
    cursor: pointer;
}
.switch-row .label { font-family: var(--font); text-transform: none; letter-spacing: 0; color: var(--text); font-size: 15px; font-weight: 500; }
.switch {
    position: relative;
    flex: none;
    width: 51px;
    height: 31px;
    margin: 0;
    border-radius: var(--r-full);
    background: var(--line-strong);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background .2s ease;
}
.switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: var(--r-full);
    background: #fff;
    box-shadow: 0 2px 6px rgb(0 0 0 / .2);
    transition: transform .25s var(--ease);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

/* Choice chips (radio / select as tiles) */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .choice-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.choice-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    height: 100%;
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-control);
    background: var(--surface);
    font-size: 14px;
    font-weight: 550;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s var(--ease);
}
.choice-tile .ph { font-size: 22px; color: var(--text-3); vertical-align: 0; }
.choice-tile:active { transform: scale(.98); }
.choice input:checked + .choice-tile { border-color: var(--brand-2); background: var(--brand-soft); color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand-2); }
.choice input:checked + .choice-tile .ph { color: var(--brand-text); }
.choice input:focus-visible + .choice-tile { outline: 2px solid var(--focus); outline-offset: 2px; }

.chip-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-choice {
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-full);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 550;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chip-choice:hover { border-color: var(--text-3); }
.chip-choice.is-selected { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* File drop */
.file-drop {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-control);
    background: var(--surface-2);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.file-drop:hover { border-color: var(--focus); }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop-title { font-weight: 550; font-size: 15px; }
.file-drop-meta { font-size: 13px; color: var(--text-3); }
.file-drop.has-file { border-style: solid; border-color: var(--brand-2); background: var(--brand-soft); }
.file-drop.has-file .list-icon { background: var(--brand); color: var(--on-brand); }

/* Sticky form actions */
.form-actions {
    display: grid;
    gap: 8px;
    margin-top: 24px;
}
@media (max-width: 1023px) {
    .form-actions--sticky {
        position: sticky;
        bottom: 0;
        z-index: 10;
        margin: 24px calc(var(--gutter) * -1) calc((var(--safe-bottom) + 32px) * -1);
        padding: 12px var(--gutter) calc(12px + var(--safe-bottom));
        background: color-mix(in srgb, var(--bg) 88%, transparent);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        border-top: 1px solid var(--line);
    }
}
@media (min-width: 1024px) {
    .form-actions { grid-auto-flow: column; justify-content: start; }
}
.danger-zone { margin-top: 28px; text-align: center; }

/* ------------------------------------------------------------------ dialogs & sheets */

dialog.sheet {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 48px);
    margin: auto 0 0;
    padding: 0;
    border: 0;
    border-radius: 24px 24px 0 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    overflow: auto;
    overscroll-behavior: contain;
}
dialog.sheet::backdrop { background: rgb(10 12 16 / .45); }
dialog.sheet[open] { animation: sheet-in .38s var(--ease); }
dialog.sheet[open]::backdrop { animation: fade-in .25s ease; }
dialog.sheet.is-closing { animation: sheet-out .22s ease forwards; }
dialog.sheet.is-closing::backdrop { animation: fade-out .22s ease forwards; }
.sheet-grabber { width: 36px; height: 5px; margin: 8px auto 0; border-radius: var(--r-full); background: var(--line-strong); }
.sheet-body { padding: 16px 20px calc(20px + var(--safe-bottom)); }
.sheet-title { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.sheet-text { margin-top: 6px; color: var(--text-2); font-size: 15px; }
.sheet-actions { display: grid; gap: 8px; margin-top: 20px; }
.sheet-list { margin: 16px -20px 0; }
.sheet-list .list-row { padding-left: 20px; padding-right: 20px; }
.sheet-list .list-row + .list-row::before { left: 70px; }

@media (min-width: 640px) {
    dialog.sheet {
        width: min(460px, calc(100% - 32px));
        margin: auto;
        border-radius: var(--r-surface);
    }
    dialog.sheet[open] { animation: pop-in .3s var(--ease); }
    dialog.sheet.is-closing { animation: pop-out .18s ease forwards; }
    .sheet-grabber { display: none; }
    .sheet-body { padding: 24px; }
    .sheet-list { margin-left: -24px; margin-right: -24px; }
    .sheet-list .list-row { padding-left: 24px; padding-right: 24px; }
    .sheet-actions { grid-auto-flow: column; justify-content: end; }
}

@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pop-out { to { opacity: 0; transform: translateY(4px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* ------------------------------------------------------------------ toasts */

.toasts {
    position: fixed;
    top: calc(var(--safe-top) + 12px);
    left: 50%;
    z-index: 60;
    display: grid;
    gap: 8px;
    width: min(440px, calc(100% - 24px));
    transform: translateX(-50%);
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--toast-bg);
    color: var(--toast-text);
    border: 1px solid var(--line-strong);
    font-size: 15px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in .4s var(--ease);
}
.toast .ph-fill { font-size: 20px; flex: none; vertical-align: 0; }
.toast--success .ph-fill { color: var(--toast-success); }
.toast--warning .ph-fill, .toast--danger .ph-fill { color: var(--toast-warning); }
.toast.is-leaving { animation: toast-out .25s ease forwards; }
.toast button { margin-left: auto; border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 0 0 0 8px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ------------------------------------------------------------------ empty states */

.empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 28px 20px;
    text-align: center;
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    border-radius: var(--r-full);
    background: var(--surface-press);
    color: var(--text-3);
}
.empty-icon .ph { font-size: 24px; vertical-align: 0; }
.empty-title { font-weight: 600; }
.empty-text { color: var(--text-3); font-size: 14px; max-width: 34ch; }
.empty .btn { margin-top: 10px; }

/* ------------------------------------------------------------------ employer roster */

.roster-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px 14px;
    align-items: center;
    padding: 14px 16px;
    color: var(--text);
    position: relative;
}
.roster-row + .roster-row::before { content: ''; position: absolute; top: 0; left: 62px; right: 0; border-top: 1px solid var(--line); }
a.roster-row:hover { background: var(--surface-2); text-decoration: none; }
.roster-name { font-weight: 600; line-height: 1.3; }
.roster-sub { font-size: 13px; color: var(--text-3); }
.roster-figures {
    grid-column: 2 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 14px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}
.roster-figures b { font-weight: 600; color: var(--text); }
.roster-head { display: none; }

@media (min-width: 1240px) {
    .roster-head, .roster-row {
        grid-template-columns: 36px minmax(160px, 1.6fr) 104px repeat(4, minmax(72px, 1fr)) 44px 16px;
    }
    .roster-head {
        display: grid;
        gap: 14px;
        padding: 10px 16px;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-3);
        border-bottom: 1px solid var(--line);
        background: var(--surface-2);
    }
    .roster-head > :nth-child(n+4) { text-align: right; }
    .roster-figures { display: contents; }
    .roster-figures > span { text-align: right; }
    .roster-figures .fig-label { display: none; }
    .roster-row .roster-status { order: 0; }
}
.fig-label { color: var(--text-3); }

/* ------------------------------------------------------------------ login (same page as Akyana CRM, RH colours) */

.auth-shell {
    --a-bg: #0a0a12;
    --a-bg2: #0f0f1a;
    --a-surface2: rgb(255 255 255 / .07);
    --a-border: rgb(255 255 255 / .08);
    --a-border2: rgb(255 255 255 / .14);
    --a-text: #f0eff8;
    --a-text2: #9896b0;
    --a-text3: #807e96;
    --a-violet: #613f92;
    --a-violet2: #9670c7;
    --a-green: #3eb592;
    --a-green2: #34a080;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: calc(var(--safe-top) + 32px) 0 calc(var(--safe-bottom) + 32px);
    overflow: hidden;
    background: var(--a-bg);
    color: var(--a-text);
    color-scheme: dark;
}
.auth-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgb(255 255 255 / .02) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / .02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}
.auth-orb { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .35; pointer-events: none; }
.auth-orb--brand { width: 500px; height: 500px; top: -150px; right: -100px; background: var(--a-violet); }
.auth-orb--product { width: 400px; height: 400px; bottom: -120px; left: -80px; background: var(--a-green2); opacity: .16; }

.auth-wrapper { position: relative; z-index: 1; width: 100%; max-width: 420px; padding: 0 20px; }
.auth-head { margin-bottom: 36px; text-align: center; }
.auth-head .brand { justify-content: center; margin-bottom: 12px; }
.auth-head p { font-size: 14px; color: var(--a-text3); }
.brand--xl { gap: 10px; }
.brand--xl .brand-logo { height: 44px; }
.brand--xl .brand-product { padding: 3px 10px; font-size: 10px; color: #6cd2b1; background: rgb(62 181 146 / .1); border-color: rgb(62 181 146 / .22); }

.auth-card {
    padding: 36px 32px;
    border: 1px solid var(--a-border2);
    border-radius: 16px;
    background: var(--a-bg2);
    box-shadow: 0 40px 80px rgb(0 0 0 / .4), 0 0 0 1px var(--a-border);
}
.auth-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid rgb(226 68 92 / .2);
    border-radius: 10px;
    background: rgb(226 68 92 / .1);
    color: #fca5a5;
    font-size: 13px;
}
.auth-alert .ph { flex: none; font-size: 16px; vertical-align: 0; }

.auth-field { margin-bottom: 18px; }
.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--a-text2);
}
.auth-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--a-border);
    border-radius: 10px;
    background: var(--a-surface2);
    color: var(--a-text);
    font: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.auth-input::placeholder { color: var(--a-text3); }
.auth-input:focus { border-color: var(--a-violet2); box-shadow: 0 0 0 3px rgb(150 112 199 / .15); }

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--a-green);
    color: #04231a;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
}
.auth-btn:hover { background: var(--a-green2); box-shadow: 0 8px 24px rgb(62 181 146 / .2); transform: translateY(-1px); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: .6; transform: none; box-shadow: none; }
.auth-btn .ph { font-size: 18px; vertical-align: 0; }
.auth-btn--secondary { border-color: var(--a-border2); background: transparent; color: var(--a-text); }
.auth-btn--secondary:hover { background: var(--a-surface2); box-shadow: none; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--a-text3);
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; border-top: 1px solid var(--a-border); }
.auth-message { margin-top: 10px; font-size: 13px; color: #fca5a5; text-align: center; }
.auth-hint { margin-top: 18px; font-size: 13px; line-height: 1.5; color: var(--a-text3); text-align: center; }
.auth-footer { margin-top: 28px; font-family: var(--mono); font-size: 12px; color: var(--a-text3); text-align: center; }
.auth-footer a { color: var(--a-violet2); }
.auth-empty { text-align: center; }
.auth-empty .ph { font-size: 36px; color: var(--a-text2); }
.auth-empty h1 { margin-top: 12px; font-size: 20px; font-weight: 600; }
.auth-empty p { margin: 8px 0 22px; font-size: 14px; color: var(--a-text2); }

@media (max-width: 480px) { .auth-card { padding: 28px 22px; } }

/* ------------------------------------------------------------------ misc */

.install-card { display: flex; gap: 14px; align-items: center; }
.install-card[hidden] { display: none; }

.table-simple { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table-simple th { white-space: nowrap; text-align: left; font-family: var(--mono); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); font-size: 11px; padding: 10px 16px; background: var(--surface-2); }
.table-simple td { padding: 10px 16px; border-top: 1px solid var(--line); }
.table-scroll { overflow-x: auto; }

.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ motion */

@media (prefers-reduced-motion: no-preference) {
    .reveal > * { animation: rise .45s var(--ease) both; }
    .reveal > *:nth-child(2) { animation-delay: .04s; }
    .reveal > *:nth-child(3) { animation-delay: .08s; }
    .reveal > *:nth-child(4) { animation-delay: .12s; }
    .reveal > *:nth-child(5) { animation-delay: .16s; }
    .reveal > *:nth-child(n+6) { animation-delay: .2s; }
    @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}

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

@media print {
    .sidebar, .topbar, .tabbar, .btn, form, .toasts { display: none !important; }
    body { background: #fff; }
}

/* ------------------------------------------------------------------ adjustments */
.app-col { min-width: 0; }
.hero-stat-value.is-negative { color: var(--danger-text); }
@media (min-width: 640px) { .sheet-actions > .btn--ghost { order: -1; } }
@media (max-width: 1239px) { .roster-figures > span:last-child { display: none; } }
/* On scroll the compact page title takes the centre of the bar: the brand steps aside. */
.topbar-brand-mobile { transition: opacity .2s ease; }
.topbar.is-scrolled .topbar-brand-mobile { opacity: 0; pointer-events: none; }
.input--chip { min-height: 36px; height: 36px; border-radius: var(--r-full); padding: 0 40px 0 14px; font-size: 14px; font-weight: 550; }
.input-affix .input--chip + .input-affix-suffix { font-size: 14px; }
.form-actions--sticky { gap: 4px; }
.choice-grid--3 .choice-tile { padding: 12px; font-size: 13px; gap: 6px; }
@media (max-width: 767px) { .kpis > div:first-child { grid-column: span 2; } }

/* ------------------------------------------------------------------ time clock */
.punch { display: grid; gap: 20px; justify-items: center; text-align: center; padding-top: 4px; }
.punch > * { width: 100%; }
.punch-head { display: grid; gap: 6px; justify-items: center; }
.punch-date { font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--text-2); }
.punch-clock { font-size: 64px; line-height: 1; font-weight: 700; letter-spacing: -.045em; }
.punch-seconds { font-size: 22px; font-weight: 600; color: var(--text-3); margin-left: 4px; letter-spacing: 0; display: inline-block; min-width: 1.4em; text-align: left; }
.punch-status {
    display: inline-flex; align-items: center; gap: 8px; width: auto; margin-top: 6px;
    padding: 6px 12px; border-radius: var(--r-full); background: var(--surface-press);
    color: var(--text-2); font-size: 14px; font-weight: 550;
}
.punch-status--working { background: var(--success-soft); color: var(--success-text); }
.punch-status--break { background: var(--warning-soft); color: var(--warning-text); }
.live-dot { width: 8px; height: 8px; border-radius: var(--r-full); background: var(--accent); }

.punch-button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    width: min(64vw, 232px); aspect-ratio: 1; margin: 8px auto 0;
    border: 0; border-radius: var(--r-full);
    background: var(--accent); color: var(--on-accent);
    font-size: 21px; font-weight: 650; letter-spacing: -.01em; line-height: 1.15;
    box-shadow: 0 0 0 10px var(--accent-soft), 0 24px 48px -24px color-mix(in srgb, var(--accent) 70%, transparent);
    cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none;
    transition: transform .18s var(--ease), box-shadow .2s ease, background .15s ease;
}
.punch-button .ph { font-size: 44px; vertical-align: 0; }
.punch-button:active { transform: scale(.96); }
.punch-button:disabled { opacity: .6; transform: scale(.97); }
.punch-button--break_start { background: var(--surface); color: var(--accent-text); box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 10px var(--accent-soft), 0 24px 48px -28px rgb(21 23 28 / .3); }
.punch-button--exit { background: var(--ink); color: var(--on-ink); box-shadow: 0 0 0 10px var(--surface-press), 0 24px 48px -24px rgb(21 23 28 / .45); }
.punch-done {
    display: grid; place-items: center; width: 160px; aspect-ratio: 1; margin: 8px auto 0;
    border-radius: var(--r-full); background: var(--surface-press); color: var(--text-3);
}
.punch-done .ph { font-size: 56px; vertical-align: 0; }

.punch-secondary { display: grid; justify-items: center; gap: 2px; min-height: 44px; }
.punch-secondary form { width: auto; }
.punch-secondary form[hidden] { display: none; }

.punch-summary { padding: 0; text-align: left; overflow: hidden; }
.punch-totals { display: grid; grid-template-columns: 1fr 1fr; }
.punch-totals > div { padding: 16px 18px; }
.punch-totals > div + div { border-left: 1px solid var(--line); }
.punch-timeline { list-style: none; margin: 0; padding: 4px 0; border-top: 1px solid var(--line); }
.punch-timeline li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 8px 18px; }
.punch-timeline .list-icon { width: 32px; height: 32px; }
.punch-help { font-size: 14px; color: var(--text-3); }

@media (prefers-reduced-motion: no-preference) {
    .punch-status--working .live-dot { animation: breathe 2.4s ease-in-out infinite; }
    @keyframes breathe { 50% { opacity: .35; transform: scale(.8); } }
}
@media (min-width: 1024px) { .punch { max-width: 480px; margin: 0 auto; } }
.punch-guards { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 2px; font-size: 13px; color: var(--text-3); }
.punch-guards span { display: inline-flex; align-items: center; gap: 5px; }
.punch-guards .is-warning { color: var(--warning-text); font-weight: 550; }
.passkey-card { display: flex; gap: 14px; align-items: flex-start; text-align: left; }
.passkey-card .btn { margin-top: 12px; }
.punch-error { justify-content: center; text-align: center; }

/* ------------------------------------------------------------------ form polish */
/* A field never stretches its label: inputs of a row stay aligned even if a neighbour has help text. */
.field { align-content: start; }
.form-grid { align-items: start; }

/* No native spinners on number inputs. */
.input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
.input[type='number']::-webkit-inner-spin-button,
.input[type='number']::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Native date / time picker icons replaced by a quiet line icon (Phosphor paths, same stroke as the UI). */
.input[type='date']::-webkit-calendar-picker-indicator,
.input[type='time']::-webkit-calendar-picker-indicator {
    width: 18px;
    height: 18px;
    padding: 0;
    color: transparent;
    cursor: pointer;
    opacity: .55;
    background: no-repeat center / 18px 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%238a88a3' d='M208 32h-24v-8a8 8 0 0 0-16 0v8H88v-8a8 8 0 0 0-16 0v8H48a16 16 0 0 0-16 16v160a16 16 0 0 0 16 16h160a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16ZM72 48v8a8 8 0 0 0 16 0v-8h80v8a8 8 0 0 0 16 0v-8h24v32H48V48Zm136 160H48V96h160v112Z'/%3E%3C/svg%3E");
}
.input[type='time']::-webkit-calendar-picker-indicator {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%238a88a3' d='M128 24a104 104 0 1 0 104 104A104.11 104.11 0 0 0 128 24Zm0 192a88 88 0 1 1 88-88 88.1 88.1 0 0 1-88 88Zm64-88a8 8 0 0 1-8 8h-56a8 8 0 0 1-8-8V72a8 8 0 0 1 16 0v48h48a8 8 0 0 1 8 8Z'/%3E%3C/svg%3E");
}
.input[type='date']::-webkit-calendar-picker-indicator:hover,
.input[type='time']::-webkit-calendar-picker-indicator:hover { opacity: .9; }
.time-pair .input[type='time']::-webkit-calendar-picker-indicator { display: none; }

/* Buttons side by side stay centred on one line; one radius for every control. */
.form-actions { align-items: center; }
.btn--lg { border-radius: var(--r-control); }

/* Install card: icon aligned with the title, not floating in the middle. */
.install-card { align-items: flex-start; }
.input--chip.is-selected { border-color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-2); }
.disclosure {
    display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer;
    font-size: 14px; font-weight: 550; color: var(--link);
}
.disclosure::-webkit-details-marker { display: none; }
.disclosure .ph { font-size: 16px; vertical-align: 0; transition: transform .2s var(--ease); }
details[open] > .disclosure .ph { transform: rotate(180deg); }
.file-drop-title, .file-drop-meta { display: block; }

/* ------------------------------------------------------------------ month picker */
.month-switch-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 128px;
    height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-full);
    background: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease;
}
.month-switch-label:hover { background: var(--surface-press); }
.month-switch-label .ph { font-size: 16px; color: var(--text-3); vertical-align: 0; }
.month-picker-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; text-align: center; }
.month-picker-head .icon-btn:disabled { opacity: .3; cursor: default; }
.month-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.month-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 60px;
    padding: 6px 4px;
    border: 1px solid var(--line);
    border-radius: var(--r-control);
    background: var(--surface-2);
    color: var(--text);
    transition: border-color .15s ease, background .15s ease, transform .15s var(--ease);
}
.month-cell:hover { border-color: var(--text-3); text-decoration: none; }
.month-cell:active { transform: scale(.97); }
.month-cell-name { font-size: 15px; font-weight: 600; line-height: 1.2; }
.month-cell-status { min-height: 14px; font-size: 11px; font-weight: 550; line-height: 1.25; color: var(--text-3); }
.month-cell.is-today { border-color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-2); }
.month-cell.is-selected { border-color: var(--brand); background: var(--brand); color: var(--on-brand); box-shadow: none; }
.month-cell.is-selected .month-cell-status { color: inherit; opacity: .85; }
.tone-warning { color: var(--warning-text); }
.tone-success { color: var(--success-text); }
.tone-accent { color: var(--accent-text); }
.tone-brand { color: var(--brand-text); }
.tone-ink { color: var(--text-2); }

/* Login: remember me + forgotten password row, as on the Akyana CRM login. */
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.auth-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--a-text2); cursor: pointer; user-select: none; }
.auth-link { font-size: 13px; color: #6cd2b1; }
.auth-link:hover { color: #8fe0c6; }
.auth-checkbox {
    position: relative;
    flex: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1px solid var(--a-border2);
    border-radius: 4px;
    background: rgb(255 255 255 / .04);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.auth-checkbox:checked { border-color: var(--a-green); background: var(--a-green); }
.auth-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 1.5px;
    left: 4.5px;
    width: 5px;
    height: 9px;
    border: solid var(--a-bg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.auth-checkbox:focus-visible { outline: 2px solid var(--a-violet2); outline-offset: 2px; }
.auth-field .field-error { margin-top: 6px; color: #fca5a5; }
.auth-intro { margin-bottom: 20px; font-size: 14px; line-height: 1.55; color: var(--a-text2); }
.auth-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; font-size: 13px; color: var(--a-text3); }
.auth-back:hover { color: var(--a-violet2); text-decoration: none; }
.auth-back .ph { font-size: 13px; vertical-align: 0; }
/* Figures in a row keep their values aligned: labels stay on one line. */
.kpis .kv-label, .hero-stat-split .kv-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------------ leave (V2) */

/* Count of things waiting: tab bar, sidebar, segmented nav. */
.tab-icon { position: relative; display: grid; place-items: center; }
.tab-badge, .count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--r-full);
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.tab-badge { position: absolute; top: -4px; left: calc(50% + 6px); box-shadow: 0 0 0 2px var(--surface); }
.side-link .count-badge { margin-left: auto; }

.segmented--nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 104px;
    height: 32px;
    padding: 0 12px;
    border-radius: 9px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 550;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.segmented--nav a:hover { text-decoration: none; color: var(--text); }

/* A locked form: every control reads as disabled. */
fieldset.card { margin: 0; min-width: 0; }
fieldset:disabled .input, fieldset:disabled .select, fieldset:disabled .textarea,
fieldset:disabled .choice-tile, fieldset:disabled .checkbox { opacity: .6; cursor: default; }

.text-danger { color: var(--danger-text); }

.leave-request + .leave-request { margin-top: 12px; }
.leave-request-dates { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.leave-request-actions { display: flex; gap: 8px; margin-top: 16px; }
.leave-request-actions > * { flex: 1; }
.leave-request-actions form .btn { width: 100%; }
@media (min-width: 640px) {
    .leave-request-actions { justify-content: flex-end; }
    .leave-request-actions > * { flex: none; }
    .leave-request-actions form .btn { width: auto; }
}

/* Team planning: one row per employee, one column per day. */
.planning-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 0 4px 12px; }
.planning-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.planning-today-link { margin-left: 6px; font-size: 14px; }
@media (max-width: 639px) {
    /* Stacked full width: the switch and the arrows line up with the cards. */
    .planning-controls { display: grid; width: 100%; gap: 8px; }
    .planning-controls .segmented { display: grid; width: 100%; }
    .planning-controls .month-switch { display: flex; width: 100%; justify-content: space-between; }
}
.planning { padding: 0; overflow: hidden; }
.planning-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.planning-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.planning-grid th, .planning-grid td { padding: 0; }
.planning-grid thead th { height: 52px; text-align: center; font-weight: 500; color: var(--text-3); border-bottom: 1px solid var(--line); }
.planning-dow { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.planning-day { display: block; width: 24px; height: 24px; margin: 2px auto 0; border-radius: var(--r-full); line-height: 24px; font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.planning-grid thead th.is-today .planning-day { background: var(--accent); color: var(--on-accent); }
.planning-grid thead th.is-today .planning-dow { color: var(--accent-text); }
.planning-name {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 132px;
    padding: 0 12px 0 16px !important;
    background: var(--surface);
    border-right: 1px solid var(--line);
    text-align: left !important;
    white-space: nowrap;
    font-weight: 550;
    color: var(--text);
}
.planning-name .avatar { width: 28px; height: 28px; font-size: 12px; margin-right: 8px; vertical-align: middle; }
.planning-grid td { position: relative; height: 48px; min-width: 30px; border-bottom: 1px solid var(--line); }
.planning-grid tbody tr:last-child > * { border-bottom: 0; }
.planning-grid .is-off { background: var(--planning-off); }
.planning-grid td.is-today { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.planning-bar {
    position: absolute;
    inset: 10px 0;
    display: flex;
    align-items: center;
    padding-left: 5px;
    font-size: 15px;
    background: var(--bar-bg);
    color: var(--bar-ink);
    /* One bar is drawn day by day: outline top and bottom, closed at its ends. */
    border: 1.5px solid var(--bar-line);
    border-left-width: 0;
    border-right-width: 0;
}
.planning-bar.is-start { left: 3px; border-left-width: 1.5px; border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.planning-bar.is-end { right: 3px; border-right-width: 1.5px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.planning-bar.is-half { right: 50%; }
.planning-bar--leave { --bar-bg: var(--cat-leave-bg); --bar-line: var(--cat-leave-line); --bar-ink: var(--cat-leave-ink); }
.planning-bar--sick { --bar-bg: var(--cat-sick-bg); --bar-line: var(--cat-sick-line); --bar-ink: var(--cat-sick-ink); }
.planning-bar--other { --bar-bg: var(--cat-other-bg); --bar-line: var(--cat-other-line); --bar-ink: var(--cat-other-ink); }
/* Waiting for an answer: hatched and dashed, not only another colour. */
.planning-bar.is-pending {
    --bar-line: var(--cat-pending-line);
    --bar-ink: var(--cat-pending-ink);
    border-style: dashed;
    background: repeating-linear-gradient(-45deg, var(--cat-pending-stripe) 0 5px, var(--cat-pending-bg) 5px 10px);
}
.planning-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 4px 0; font-size: 13px; color: var(--text-2); }
.planning-legend span { display: inline-flex; align-items: center; gap: 7px; }
.planning-legend i { width: 20px; height: 14px; border-radius: 4px; border: 1.5px solid; }
.planning-legend .is-leave { background: var(--cat-leave-bg); border-color: var(--cat-leave-line); }
.planning-legend .is-sick { background: var(--cat-sick-bg); border-color: var(--cat-sick-line); }
.planning-legend .is-other { background: var(--cat-other-bg); border-color: var(--cat-other-line); }
.planning-legend .is-pending { background: repeating-linear-gradient(-45deg, var(--cat-pending-stripe) 0 3px, var(--cat-pending-bg) 3px 6px); border: 1.5px dashed var(--cat-pending-line); }
.planning-legend .is-off { background: var(--planning-off); border-color: var(--line-strong); }
.callout--link { align-items: center; margin-bottom: 12px; text-decoration: none; }
.callout--link:hover { text-decoration: none; filter: brightness(.98); }
.callout--link > span { flex: 1; }
.callout--link > .ph:last-child { margin: 0; font-size: 18px; }

.segmented--sm a { min-width: 76px; height: 30px; font-size: 13px; }
.segmented--sm { align-self: center; }

/* Week planning: wide screens get the grid, phones the day-by-day agenda. */
.planning--week { display: none; }
.planning-grid--week { table-layout: fixed; }
.planning-grid--week col.planning-col-name { width: 148px; }
.planning-grid--week col.planning-col-weekend { width: 64px; }
.planning-grid--week col.is-off { background: var(--planning-off); }
.planning-grid--week col.is-today { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.planning-grid--week thead th { height: 56px; }
.planning-grid--week .planning-dow { font-size: 11px; }
.planning-grid--week td { height: 60px; }
.planning-grid--week .planning-bar { inset: 9px 0; gap: 8px; padding: 0 10px; font-size: 16px; overflow: hidden; }
.planning-grid--week .planning-bar.is-start { left: 6px; }
.planning-grid--week .planning-bar.is-end { right: 6px; }
.planning-grid--week .planning-bar.is-half { right: 50%; }
.planning-bar-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.planning-bar-label { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planning-bar-meta { font-size: 11px; font-weight: 500; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planning-grid--week thead th:has(.planning-holiday) { height: 72px; }
.planning-holiday { display: block; margin-top: 3px; padding: 0 4px; overflow: hidden; font-size: 10px; font-weight: 500; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; color: var(--text-3); }

.week-agenda { padding: 0; overflow: hidden; }
.agenda-day { padding: 14px 16px; }
.agenda-day + .agenda-day { border-top: 1px solid var(--line); }
.agenda-day.is-today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.agenda-day-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.agenda-item { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.agenda-item .avatar { width: 28px; height: 28px; font-size: 12px; }
.agenda-item-text { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 0 6px; }
.agenda-empty { font-size: 14px; color: var(--text-3); }

@media (min-width: 640px) {
    .planning--week { display: block; }
    .week-agenda { display: none; }
}
@media (max-width: 639px) {
    /* More days on screen: the first name alone labels the row. */
    .planning-grid:not(.planning-grid--week) .planning-name { min-width: 84px; padding: 0 8px 0 12px !important; }
    .planning-grid:not(.planning-grid--week) .planning-name .avatar { display: none; }
}

/* ------------------------------------------------------------------ practice logo */

/* Always on a white plate: a dark logo stays readable in dark mode. */
.company-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--line);
}
.company-logo img { display: block; width: auto; height: auto; max-width: 100%; object-fit: contain; }
.company-logo--side { display: flex; margin-bottom: 8px; padding: 12px; }
.company-logo--side img { max-height: 44px; }
.company-logo--home { margin-bottom: 14px; }
.company-logo--home img { max-width: 180px; max-height: 36px; }
@media (min-width: 1024px) {
    /* On a computer the menu shows it already. */
    .company-logo--home { display: none; }
}

.logo-card { margin-bottom: 12px; }
.logo-field { display: flex; gap: 20px; align-items: flex-start; margin-top: 14px; }
.logo-preview {
    display: grid;
    place-items: center;
    flex: none;
    width: 168px;
    height: 96px;
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--line);
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview.is-empty { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.logo-preview.is-empty .ph { font-size: 32px; color: var(--text-3); }
.logo-field-body { min-width: 0; }
.logo-field-body .help { margin-top: 4px; }
.logo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.logo-actions form[aria-busy='true'] .btn { opacity: .6; pointer-events: none; }
@media (max-width: 639px) {
    .logo-field { flex-direction: column; }
    .logo-preview { width: 100%; }
}

/* ------------------------------------------------------------------ planned hours */

.schedule { display: grid; gap: 8px; }
.schedule-head, .schedule-row { display: grid; grid-template-columns: 96px 1fr 1fr; gap: 8px 14px; align-items: center; }
.schedule-head span { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.schedule-day { font-weight: 600; }
.schedule-range { display: flex; align-items: center; gap: 6px; color: var(--text-3); }
.schedule-range input { flex: 1 1 0; width: 100%; min-width: 0; padding-inline: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.schedule-error { grid-column: 1 / -1; }
.schedule-tools { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -8px; }
.schedule-total { font-size: 14px; font-weight: 600; color: var(--success-text); }
.schedule-total.is-off { color: var(--warning-text); }
@media (max-width: 639px) {
    /* One range per line, named, since the column heads are gone. */
    .schedule-head { display: none; }
    .schedule-row { grid-template-columns: 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
    .schedule-row:first-of-type { border-top: 0; padding-top: 0; }
    .schedule-range::before { content: attr(data-label); flex: none; width: 84px; font-size: 14px; color: var(--text-2); }
}
.punch-plan { display: flex; align-items: center; gap: 6px; max-width: 320px; margin-top: 4px; font-size: 13px; line-height: 1.35; text-align: left; color: var(--text-2); }
.punch-plan .ph { flex: none; font-size: 18px; color: var(--text-3); }

/* ------------------------------------------------------------------ kiosk (QR code to punch) */

.kiosk-body { min-height: 100dvh; background: var(--bg); }
.kiosk {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 24px;
    min-height: 100dvh;
    max-width: 980px;
    margin: 0 auto;
    padding: max(24px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom));
}
.kiosk-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.kiosk-head .company-logo img { max-width: 260px; max-height: 56px; }
.kiosk-company { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.kiosk-clock { font-size: 44px; font-weight: 700; letter-spacing: -.035em; }
.kiosk-card {
    align-self: center;
    justify-self: center;
    display: grid;
    justify-items: center;
    gap: 18px;
    width: min(100%, 540px);
    padding: 32px 28px;
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}
.kiosk-title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.kiosk-qr-wrap { padding: 18px; border-radius: 22px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.kiosk-qr { display: block; width: min(62vmin, 380px); height: auto; aspect-ratio: 1; transition: opacity .25s ease; }
.kiosk-qr.is-stale { opacity: .12; }
.kiosk-code { font-family: var(--mono); font-size: 42px; font-weight: 600; letter-spacing: .14em; }
.kiosk-timer { width: 100%; height: 6px; overflow: hidden; border-radius: var(--r-full); background: var(--surface-press); }
.kiosk-timer span { display: block; height: 100%; background: var(--accent); transform-origin: left center; }
.kiosk-help { max-width: 440px; text-align: center; font-size: 16px; line-height: 1.45; color: var(--text-2); }
.kiosk-offline { font-weight: 600; color: var(--warning-text); }
.kiosk-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.kiosk-foot .brand-logo { height: 18px; }

.kiosk-message { display: grid; place-items: center; min-height: 100dvh; padding: 24px; }
.kiosk-message .card { display: grid; justify-items: center; gap: 12px; max-width: 460px; text-align: center; }
.kiosk-message .brand { margin-top: 12px; }

/* Settings: kiosks */
.radio-list { display: grid; gap: 4px; }
.radio-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; cursor: pointer; }
.radio-row input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.kiosk-pairing { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.kiosk-pairing img { flex: none; padding: 8px; border-radius: 12px; background: #fff; }
.kiosk-pairing-body { display: grid; gap: 6px; min-width: 0; }
.kiosk-pairing strong { color: var(--text); }
.copy-field { display: flex; gap: 8px; align-items: center; }
.copy-field .input { min-width: 0; flex: 1; font-size: 13px; }
.kiosk-actions { gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 479px) {
    /* Small phones: the actions go under the name, the name keeps its width. */
    .kiosk-row { grid-template-columns: auto minmax(0, 1fr); }
    .kiosk-row .kiosk-actions { grid-column: 2; justify-content: flex-start; margin: -4px 0 0 -12px; }
}
.settings-link { margin: 0 -20px -20px; padding-inline: 20px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-surface) var(--r-surface); }
.kiosk-add { display: flex; gap: 8px; }
.kiosk-add .input { min-width: 0; flex: 1; }
@media (max-width: 639px) {
    .kiosk-pairing { flex-direction: column; align-items: stretch; }
    .kiosk-pairing img { align-self: center; }
    .kiosk-add { flex-direction: column; }
}

/* Punch: scanning the kiosk */
.scan-view { position: relative; overflow: hidden; margin-top: 14px; border-radius: 20px; background: #0e1013; aspect-ratio: 1; }
.scan-view video { display: block; width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
    position: absolute;
    inset: 18%;
    border-radius: 18px;
    box-shadow: 0 0 0 999px rgb(0 0 0 / .35);
    outline: 3px solid rgb(255 255 255 / .9);
    pointer-events: none;
}
.scan-status { margin-top: 10px; font-size: 14px; font-weight: 550; color: var(--warning-text); }
.scan-manual { display: grid; gap: 6px; margin-top: 16px; }
.scan-manual .input { font-size: 20px; letter-spacing: .12em; text-align: center; }
.punch-kiosk { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent-text); font-size: 14px; font-weight: 550; }
@media (min-width: 640px) { .scan-sheet .scan-view { max-width: 360px; margin-inline: auto; } }
/* A landscape screen (reception computer, tablet on its side): QR on the left, the rest beside it, all on one screen. */
@media (orientation: landscape) and (min-width: 820px) {
    .kiosk { gap: 16px; }
    .kiosk-card {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "qr title" "qr code" "qr timer" "qr help" "qr offline";
        align-content: center;
        justify-items: start;
        column-gap: 40px;
        row-gap: 14px;
        width: min(100%, 920px);
        padding: 28px 36px;
    }
    .kiosk-qr-wrap { grid-area: qr; }
    .kiosk-qr { width: min(56vh, 380px); }
    .kiosk-title { grid-area: title; }
    .kiosk-code { grid-area: code; }
    .kiosk-timer { grid-area: timer; }
    .kiosk-help { grid-area: help; text-align: left; }
    .kiosk-offline { grid-area: offline; }
}
/* An old phone as the kiosk: tighter, still on one screen. */
@media (max-width: 519px) {
    .kiosk { gap: 12px; padding: max(14px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom)); }
    .kiosk-head .company-logo img { max-width: 180px; max-height: 40px; }
    .kiosk-clock { font-size: 30px; }
    .kiosk-card { gap: 12px; padding: 20px 16px; border-radius: 22px; }
    .kiosk-title { font-size: 20px; }
    .kiosk-qr-wrap { padding: 12px; }
    .kiosk-code { font-size: 32px; }
    .kiosk-help { font-size: 14px; }
}
