/* =============================================================================
   steamify-pages.css — page compositions on the Steamify design system.
   Loaded right after steamify.css (php/ds_head.php). Each section is one page or
   one shared page pattern; all values come from the --sz-* tokens.
   ========================================================================== */

/* ---- Shared page patterns ----------------------------------------------------- */
/* Page subtitle under the h1 */
:root body .page-header :is(.page-subtitle, .page-header-content > p, .page-header > div > p, .subtitle) {
    color: var(--sz-text-muted);
    font-size: 14.5px;
    margin: 4px 0 0;
    max-width: 75ch;
}
/* "glass" cards were blur over a gradient; on the flat chalk ground they are panels */
:root body .card.glass-card,
:root body .glass-card {
    background: var(--sz-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--sz-border);
    box-shadow: none;
    border-radius: var(--sz-r-panel);
}
/* Panel titles carry an icon in the accent, never a coloured block */
:root body :is(.card, .glass-card) > :is(h2, h3):first-child i,
:root body :is(.card-header, .section-header, .panel-header) :is(h2, h3) i { color: var(--sz-accent-text); }

/* ---- Tasks (home) -------------------------------------------------------------- */
:root body .task-filters-new {
    background: var(--sz-surface);
    border: 1px solid var(--sz-border);
    border-radius: var(--sz-r-panel);
    padding: 12px;
    box-shadow: none;
}
:root body .task-list { gap: 12px; }
:root body .task-item-container {
    background: var(--sz-surface);
    border: 1px solid var(--sz-border);
    border-radius: var(--sz-r-panel);
    padding: 0;
    overflow: hidden;
}
:root body .task-item-container .task-header {
    height: auto; min-height: 56px; margin: 0;
    padding: 0 18px; border-radius: 0;
    border-bottom: 1px solid var(--sz-border);
    cursor: pointer;
    transition: background-color var(--sz-t-1) ease;
}
:root body .task-item-container.collapsed .task-header { border-bottom: 0; }
@media (hover: hover) and (pointer: fine) {
    :root body .task-item-container .task-header:hover { background: var(--sz-surface-2); }
}
:root body .task-department {
    font-size: 16px; font-weight: 740; font-stretch: var(--sz-stretch-head);
    color: var(--sz-text-strong); letter-spacing: -0.005em;
}
/* the CSS triangle becomes a chevron */
:root body .task-header-actions .dropdown-arrow {
    width: 9px; height: 9px; border: 0;
    border-right: 2px solid var(--sz-text-muted); border-bottom: 2px solid var(--sz-text-muted);
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform var(--sz-t-2) var(--sz-ease);
}
:root body .task-header-actions .dropdown-arrow.rotated { transform: rotate(-135deg) translate(-2px, -2px); }
:root body .task-item-container .task-list-content { padding: 6px; }
:root body .task-item-container .task-content {
    padding: 14px 14px 14px 16px; margin: 0; border-radius: var(--sz-r-ctl);
    transition: background-color var(--sz-t-1) ease;
}
:root body .task-item-container .task-content + .task-content { margin-top: 2px; }
@media (hover: hover) and (pointer: fine) {
    html body .task-content:hover,
    html body .task-item-container .task-content:hover { background-color: var(--sz-accent-tint) !important; color: inherit !important; }
    html body .task-details:hover .task-tag { color: inherit; }
}
:root body .task-title-line { margin: 0 0 6px; gap: 10px; }
:root body .task-title { font-size: 15.5px; font-weight: 680; color: var(--sz-text-strong); }
:root body .task-item-container .task-description { background: transparent; padding: 0; min-height: 0; color: var(--sz-text-muted); font-size: 14px; margin: 0; }
:root body .importance-indicator { width: 9px; height: 9px; box-shadow: none; }
:root body .task-status-circle {
    width: 34px; height: 34px; border-width: 2px; border-color: var(--sz-border-strong);
    transition: border-color var(--sz-t-1) ease, background-color var(--sz-t-1) ease;
}
@media (hover: hover) and (pointer: fine) {
    :root body .task-content:hover .task-status-circle { border-color: var(--sz-accent); }
}
:root body .task-tag {
    background: var(--sz-surface-3); color: var(--sz-text-muted); border: 0;
}
/* "I need help" + "Create task" lose their inline colours to the system buttons */
:root body #open-create-task {
    background: var(--sz-accent) !important; color: var(--sz-on-accent) !important;
    border-radius: var(--sz-r-ctl) !important; min-height: 38px; padding: 0 16px !important;
    display: inline-flex; align-items: center; gap: 8px;
}
:root body #open-create-task:hover { background: var(--sz-accent-hover) !important; filter: none; }
:root body #need-help-btn[data-raised="0"] { background: var(--sz-surface) !important; color: var(--sz-text) !important; border: 1px solid var(--sz-border-strong) !important; }
:root body #need-help-btn[data-raised="1"] { background: var(--sz-loss-solid) !important; color: var(--sz-on-accent) !important; }

/* ---- Calendar: a month grid, one hairline system ----------------------------- */
:root body #main-calendar-card { padding: 20px; }
:root body .main-calendar-header { padding: 0 0 16px; }
:root body .main-calendar-header h2 { font-size: 1.6rem; color: var(--sz-text-strong); }
:root body .calendar-nav-buttons .btn {
    background: var(--sz-surface); color: var(--sz-text); border: 1px solid var(--sz-border-strong);
    min-height: 36px; width: 36px; padding: 0; justify-content: center;
}
:root body .calendar-header-grid { gap: 0; margin: 0; border: 1px solid var(--sz-border); border-bottom: 0; border-radius: var(--sz-r-panel) var(--sz-r-panel) 0 0; overflow: hidden; background: var(--sz-surface-2); }
:root body .calendar-header {
    background: transparent; color: var(--sz-text-muted); border-radius: 0;
    font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    padding: 9px 10px; text-align: start;
}
:root body .calendar-grid {
    gap: 1px; background: var(--sz-border);
    border: 1px solid var(--sz-border); border-radius: 0 0 var(--sz-r-panel) var(--sz-r-panel); overflow: hidden;
}
:root body .calendar-day {
    background: var(--sz-surface); background-image: none;
    border: 0; border-radius: 0; padding: 8px 10px;
    transition: background-color var(--sz-t-1) ease;
}
@media (hover: hover) and (pointer: fine) {
    html body .calendar-day:hover { background: var(--sz-surface-2); transform: none; box-shadow: none; }
}
:root body .calendar-day .date-number { font-weight: 650; font-size: 13.5px; color: var(--sz-text); margin-bottom: 4px; }
:root body .calendar-day.today .date-number {
    background: var(--sz-accent); color: var(--sz-on-accent); width: 26px; height: 26px; line-height: 26px;
}
:root body .calendar-day.other-month { background: var(--sz-surface-2); color: var(--sz-text-faint); }
:root body .calendar-day.other-month .date-number { color: var(--sz-text-faint); }
:root body .calendar-day.has-event { background: var(--sz-surface); box-shadow: inset 0 0 0 9999px var(--sz-accent-soft); }
:root body .calendar-day.deadline { background: var(--sz-accent-tint); color: var(--sz-text); }
:root body .calendar-day.deadline .date-number { color: var(--sz-accent-text); }

/* ---- Admin Panel: Manage Users cards --------------------------------------------- */
:root body .intern-card {
    background: var(--sz-surface); border: 1px solid var(--sz-border);
    border-radius: var(--sz-r-panel); box-shadow: none;
}
:root body .intern-avatar { background-color: var(--sz-accent-soft); background-size: cover; background-position: center; color: var(--sz-accent-text); font-weight: 760; font-stretch: var(--sz-stretch-head); }
:root body .intern-card h4 { font-size: 15.5px; font-weight: 720; color: var(--sz-text-strong); }
/* the name opens their person page (person.php) */
:root body .intern-card .intern-name-link { color: inherit; text-decoration: none; }
:root body .intern-card .intern-name-link:hover, :root body .intern-card .intern-name-link:focus-visible { color: var(--sz-accent-text); text-decoration: underline; }
:root body .intern-card .department { color: var(--sz-text-muted); }
:root body .intern-bio { background: var(--sz-surface-2); border: 0; border-radius: var(--sz-r-ctl); color: var(--sz-text-muted); }
:root body .intern-stats .stat-number { font-size: 1.5rem; }
:root body .intern-stats .stat-label { font-size: 10.5px; letter-spacing: .03em; word-break: normal; overflow-wrap: normal; white-space: nowrap; }
:root body .btn-delete { background: transparent; color: var(--sz-loss); border-color: color-mix(in srgb, var(--sz-loss) 40%, transparent); box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
    :root body .btn-delete:hover:not(:disabled) { background: var(--sz-loss-soft); color: var(--sz-loss); border-color: var(--sz-loss); }
}

/* ---- Headcount / Team Roster ---------------------------------------------------- */
:root body .mt-table-wrap { border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel); background: var(--sz-surface); }

/* =================================================================================
   Sign-in flow (body.sz-auth): the brand field beside the form.
   Desktop: cobalt brand field on the leading side, chalk form column on the other.
   Phones: the field shrinks to a cobalt band above the form.
   ================================================================================= */
body.sz-auth {
    margin: 0; min-height: 100dvh;
    background: var(--sz-bg); color: var(--sz-text);
    font-family: var(--sz-font);
    --text: var(--sz-text); --muted: var(--sz-text-muted); --stroke: var(--sz-border-strong);
    --primary: var(--sz-accent); --primary-600: var(--sz-accent-hover);
}
body.sz-auth *, body.sz-auth *::before, body.sz-auth *::after { box-sizing: border-box; }
/* the brand field: cobalt over a faint parcel map, with a small example of the product */
.sz-auth-aside {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto; align-items: center; gap: 28px;
    padding: 40px 48px 44px;
    color: var(--sz-rail-ink);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 900' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.1'%3E%3Cpath d='M0 150H600M0 330H600M0 520H600M0 700H600M110 0V900M270 0V900M430 0V900M560 0V900'/%3E%3Cpath d='M-40 860L250 570Q310 512 392 498L660 452' stroke-width='2'/%3E%3Cpath d='M270 240H350M350 150V330M430 610H500M500 520V700M110 430H190M190 330V520M430 70H500'/%3E%3C/g%3E%3Cg fill='%23fff' stroke='none'%3E%3Crect x='354' y='154' width='72' height='82' rx='3' fill-opacity='.14'/%3E%3Crect x='504' y='524' width='52' height='82' rx='3' fill-opacity='.1'/%3E%3Crect x='114' y='334' width='72' height='92' rx='3' fill-opacity='.08'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat,
        radial-gradient(90% 60% at 85% 20%, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 65%),
        radial-gradient(80% 60% at 0% 100%, rgba(3, 14, 48, .34), rgba(3, 14, 48, 0) 70%),
        var(--sz-field-cobalt);
}
/* at night the field keeps its cobalt but sits a step deeper */
html.dark-mode .sz-auth-aside { box-shadow: inset 0 0 0 100vmax rgba(4, 12, 34, .28); border-inline-end: 1px solid var(--sz-border); }
.sz-auth-mark { display: inline-flex; align-items: center; gap: 12px; margin-top: 44px; }
.sz-auth-mark img { height: 40px; width: auto; filter: brightness(0) invert(1); }
.sz-auth-mark span {
    font-family: var(--sz-font); font-stretch: 112%; font-weight: 800; font-size: 20px;
    letter-spacing: .08em; text-transform: uppercase;
}
body.sz-auth .sz-auth-aside .sz-auth-line,
.sz-auth-line {
    margin: 0; max-width: 15ch;
    font-family: var(--sz-font); font-stretch: 80%; font-weight: 820;
    font-size: clamp(2.2rem, 3.3vw, 3.4rem); line-height: 1; letter-spacing: -0.015em;
    color: var(--sz-rail-ink); text-wrap: balance;
}
/* Arabic and Chinese glyphs need taller lines than the condensed Latin display cut */
html:is([lang="ar"], [lang="zh"]) body.sz-auth .sz-auth-aside .sz-auth-line { line-height: 1.25; letter-spacing: 0; }
html[lang="zh"] body.sz-auth .sz-auth-aside .sz-auth-line { max-width: 9em; font-size: clamp(1.9rem, 2.7vw, 2.8rem); }
.sz-auth-foot { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .86); letter-spacing: .02em; }
html.dark-mode .sz-auth-foot { color: var(--sz-rail-text); }

/* the example: a client pipeline with a checked lead resting over its corner (decorative, aria-hidden) */
.sz-auth-show { display: flex; flex-direction: column; width: min(470px, 100%); font-size: 13px; line-height: 1.3; }
.sz-auth-show :is(.sz-auth-pipe, .sz-auth-lead) {
    background: var(--sz-surface); color: var(--sz-text); border-radius: var(--sz-r-panel); overflow: hidden;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 30px 60px -28px rgba(2, 10, 34, .6), 0 2px 6px rgba(2, 10, 34, .14);
}
html.dark-mode .sz-auth-show :is(.sz-auth-pipe, .sz-auth-lead) { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 60px -28px rgba(0, 0, 0, .7); }
.sz-auth-pipe { align-self: flex-end; width: 78%; padding-bottom: 22px; }
.sz-auth-pipe__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px 9px; border-bottom: 1px solid var(--sz-border); }
.sz-auth-pipe__bar span { color: var(--sz-text-muted); font-size: 11px; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
.sz-auth-pipe__bar em { padding: 1px 8px; border-radius: var(--sz-r-pill); background: var(--sz-surface-3); color: var(--sz-text-muted); font-size: 11px; font-style: normal; font-weight: 650; }
.sz-auth-pipe ul { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 8px 14px 0; list-style: none; }
.sz-auth-pipe li { display: grid; grid-template-columns: 112px minmax(0, 1fr) 22px; align-items: center; gap: 10px; min-height: 28px; }
.sz-auth-pipe li span { overflow: hidden; color: var(--sz-text); white-space: nowrap; text-overflow: ellipsis; }
.sz-auth-pipe li i { display: block; height: 7px; border-radius: 4px; background: var(--sz-accent); transform-origin: left center; transform: scaleX(var(--v)); }
html[dir="rtl"] .sz-auth-pipe li i { transform-origin: right center; }
.sz-auth-pipe li:last-child i { background: var(--sz-win-solid); }
.sz-auth-pipe li b { color: var(--sz-text-strong); font-weight: 750; font-variant-numeric: tabular-nums; text-align: end; }
.sz-auth-lead { position: relative; z-index: 1; width: 86%; margin-top: -18px; }
.sz-auth-lead__map { display: block; width: 100%; height: 76px; border-bottom: 1px solid var(--sz-border); }
.sz-auth-lead__map .m-ground { fill: color-mix(in srgb, var(--sz-accent) 7%, var(--sz-surface-2)); }
.sz-auth-lead__map .m-road { fill: none; stroke: var(--sz-surface); stroke-width: 6; }
.sz-auth-lead__map .m-lot { fill: color-mix(in srgb, var(--sz-text) 6%, transparent); stroke: color-mix(in srgb, var(--sz-text) 14%, transparent); stroke-width: 1; }
.sz-auth-lead__map .m-parcel { fill: color-mix(in srgb, var(--sz-accent) 30%, transparent); stroke: var(--sz-accent); stroke-width: 2; }
/* a map pin drawn from one rotated rounded square */
.sz-auth-lead__pin {
    position: absolute; top: 14px; left: 41.5%; width: 20px; height: 20px;
    border-radius: 50% 50% 50% 0; background: var(--sz-accent); transform: rotate(-45deg);
    box-shadow: -2px 3px 5px rgba(2, 10, 34, .3);
}
.sz-auth-lead__pin::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--sz-surface); }
.sz-auth-lead__body { padding: 12px 14px 13px; }
.sz-auth-lead__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sz-auth-lead__top b { overflow: hidden; color: var(--sz-text-strong); font-size: 15px; font-weight: 760; white-space: nowrap; text-overflow: ellipsis; }
.sz-auth-lead small { display: block; margin-top: 2px; color: var(--sz-text-muted); font-size: 12.5px; }
/* a US street address reads left to right even on an Arabic page */
html[dir="rtl"] :is(.sz-auth-lead__top b, .sz-auth-lead small) { direction: ltr; unicode-bidi: isolate; text-align: right; }
.sz-auth-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--sz-r-pill); background: var(--sz-win-soft); color: var(--sz-win); font-size: 12px; font-weight: 700; }
.sz-auth-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--sz-win-solid); }
.sz-auth-call { display: flex; align-items: center; gap: 10px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--sz-border); }
.sz-auth-call__play { position: relative; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--sz-accent); }
.sz-auth-call__play::after { content: ""; position: absolute; inset: 9px 8px 9px 11px; background: var(--sz-on-accent); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.sz-auth-wave { display: flex; flex: 1; align-items: center; gap: 2px; height: 24px; }
.sz-auth-wave i { flex: 1; height: calc(var(--h) * 100%); min-height: 3px; border-radius: 2px; background: var(--sz-surface-3); }
.sz-auth-wave i.is-played { background: var(--sz-accent); }
.sz-auth-call b { color: var(--sz-text-muted); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
/* short desktop windows: the lead card alone */
@media (min-width: 901px) and (max-height: 700px) { .sz-auth-pipe { display: none; } .sz-auth-lead { margin-top: 0; } }
@media (prefers-reduced-motion: no-preference) {
    .sz-auth-show > * { animation: sz-rise 560ms var(--sz-ease) both; }
    .sz-auth-show > .sz-auth-lead { animation-delay: 120ms; }
}


/* login.css family: .wrap > .card */
body.sz-auth .wrap {
    position: relative;
    display: grid; grid-template-columns: minmax(360px, 42%) 1fr; place-items: stretch;
    min-height: 100dvh; padding: 0; background: var(--sz-bg);
}
body.sz-auth .wrap > .sz-auth-aside { grid-column: 1; grid-row: 1; }
body.sz-auth .wrap > .card,
html.dark-mode body.sz-auth .wrap > .card,
body.sz-auth.dark-mode .wrap > .card {
    grid-column: 2; grid-row: 1; align-self: center; justify-self: center;
    width: min(440px, calc(100% - 48px)); margin: 72px 0;
    background: var(--sz-surface); border: 1px solid var(--sz-border); border-radius: 16px;
    box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    padding: 36px 32px 28px;
}
body.sz-auth .card .header { text-align: start; margin-bottom: 24px; }
body.sz-auth .card .brand { height: auto; margin-bottom: 18px; }
body.sz-auth .card .sz-brand__icon { height: 30px; }
body.sz-auth .card .sz-brand__name { font-size: 17px; color: var(--sz-text-strong); }
body.sz-auth .card .sz-brand__sep { background: var(--sz-border-strong); height: 22px; }
body.sz-auth .card h1 { font-size: 1.75rem; font-weight: 790; font-stretch: 86%; color: var(--sz-text-strong); margin: 0 0 6px; }
body.sz-auth .card :is(.subtitle, p) { color: var(--sz-text-muted); font-size: 15px; }
body.sz-auth .card .form-group { margin-bottom: 16px; }
body.sz-auth .card .form-group label { font-size: 13.5px; font-weight: 640; color: var(--sz-text); margin-bottom: 6px; }
body.sz-auth .card .input-wrapper > i { color: var(--sz-text-faint); font-size: 14px; left: 14px; }
html[dir="rtl"] body.sz-auth .card .input-wrapper > i { left: auto; right: 14px; }
body.sz-auth .card .form-input,
html.dark-mode body.sz-auth .card .form-input {
    height: 46px; padding: 0 14px 0 40px; font-size: 15.5px;
    background: var(--sz-surface); color: var(--sz-text);
    border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl);
    box-shadow: none; transition: border-color var(--sz-t-1) ease, box-shadow var(--sz-t-1) ease;
}
html.dark-mode body.sz-auth .card .form-input { background: var(--sz-surface-2); }
html[dir="rtl"] body.sz-auth .card .form-input { padding: 0 40px 0 14px; }
body.sz-auth .card .form-input::placeholder { color: var(--sz-text-faint); }
body.sz-auth .card .form-input:focus { border-color: var(--sz-accent); box-shadow: 0 0 0 3px var(--sz-accent-ring); }
body.sz-auth .card .password-toggle { color: var(--sz-text-muted); margin: 0; right: 8px; width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; }
html[dir="rtl"] body.sz-auth .card .password-toggle { right: auto; left: 8px; }
body.sz-auth .card .password-toggle:hover { color: var(--sz-text-strong); background: var(--sz-surface-3); }
body.sz-auth .card .password-toggle i { position: static; transform: none; color: inherit; }
body.sz-auth .remember-me { color: var(--sz-text-muted); font-size: 14px; gap: 8px; }
body.sz-auth .login-btn {
    height: 48px; width: 100%; border: 0; border-radius: var(--sz-r-ctl);
    background: var(--sz-accent); color: var(--sz-on-accent);
    font-family: var(--sz-font); font-size: 16px; font-weight: 700; letter-spacing: 0;
    box-shadow: 0 1px 2px rgba(11, 16, 32, .18), inset 0 1px 0 rgba(255, 255, 255, .14);
    transition: background-color var(--sz-t-1) ease, transform var(--sz-t-1) var(--sz-ease);
}
body.sz-auth .login-btn:hover:not(:disabled) { background: var(--sz-accent-hover); transform: none; }
body.sz-auth .login-btn:active:not(:disabled) { transform: scale(.98); }
body.sz-auth .admin-links { border-top: 1px solid var(--sz-border); padding-top: 18px; margin-top: 22px; gap: 14px; justify-content: center; }
body.sz-auth .admin-links a, body.sz-auth .card a { color: var(--sz-accent-text); font-weight: 620; }
body.sz-auth .link-separator { color: var(--sz-text-faint); }
body.sz-auth .footer-credit { margin-top: 16px; text-align: center; font-size: 12.5px; }
body.sz-auth .footer-credit a { color: var(--sz-text-faint); font-weight: 500; }
body.sz-auth .footer-credit .company-name { color: var(--sz-text-muted); font-weight: 650; }
body.sz-auth .message { border-radius: var(--sz-r-ctl); font-size: 14px; }
body.sz-auth .message.error { background: var(--sz-loss-soft); color: var(--sz-loss); border: 1px solid color-mix(in srgb, var(--sz-loss) 30%, transparent); }
body.sz-auth .message.success { background: var(--sz-win-soft); color: var(--sz-win); border: 1px solid color-mix(in srgb, var(--sz-win) 30%, transparent); }
body.sz-auth .message.info { background: var(--sz-accent-soft); color: var(--sz-accent-text); border: 1px solid color-mix(in srgb, var(--sz-accent) 25%, transparent); }
body.sz-auth #company-chip > div {
    background: var(--sz-surface-2) !important; border: 1px solid var(--sz-border) !important; border-radius: var(--sz-r-ctl) !important;
}
body.sz-auth #company-chip i { color: var(--sz-accent-text) !important; }
/* back + MC: the back button rides on the brand field, the MC link on the form side */
body.sz-auth .back-button {
    position: absolute; top: 20px; left: 20px; right: auto; z-index: 5;
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
    background: rgba(255, 255, 255, .1); color: var(--sz-rail-ink); border: 1px solid rgba(255, 255, 255, .22);
    border-radius: var(--sz-r-pill); font-family: var(--sz-font); font-weight: 600; font-size: 14px; box-shadow: none;
    backdrop-filter: none;
}
html[dir="rtl"] body.sz-auth .back-button { left: auto; right: 20px; }
body.sz-auth .back-button:hover { background: rgba(255, 255, 255, .18); color: var(--sz-rail-ink); transform: none; }
body.sz-auth .mc-link {
    position: absolute; top: 20px; right: 20px; left: auto; z-index: 5;
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
    background: var(--sz-surface); color: var(--sz-text); border: 1px solid var(--sz-border-strong);
    border-radius: var(--sz-r-pill); font-weight: 620; font-size: 14px; box-shadow: none; text-decoration: none;
}
html[dir="rtl"] body.sz-auth .mc-link { right: auto; left: 20px; }
body.sz-auth .mc-link i { color: var(--sz-accent-text); }
body.sz-auth .mc-link:hover { background: var(--sz-surface-3); color: var(--sz-text-strong); transform: none; }

/* company step (verify-login): same field, its own markup */
body.sz-auth #page-content-wrapper { min-height: 100dvh; }
body.sz-auth .verify-container {
    display: grid; grid-template-columns: minmax(360px, 42%) 1fr;
    grid-template-rows: 1fr auto auto auto 1fr auto;
    grid-template-areas: "aside ." "aside head" "aside main" "aside btn" "aside ." "aside foot";
    min-height: 100dvh; max-width: none; width: 100%; padding: 0; margin: 0;
    align-items: stretch; justify-content: stretch; justify-items: stretch;
    background: var(--sz-bg); position: relative;
}
body.sz-auth:has(.verify-container) { background-image: none; overflow-x: hidden; overflow-y: auto; }
body.sz-auth .verify-container > .sz-auth-aside { grid-area: aside; }
body.sz-auth .verify-header { grid-area: head; justify-self: center; width: min(440px, calc(100% - 48px)); padding: 0; margin: 0 0 22px; position: static; background: none; border: 0; }
body.sz-auth .verify-header .sz-brand__name { color: var(--sz-text-strong); font-size: 17px; }
body.sz-auth .verify-header .sz-brand__sep { background: var(--sz-border-strong); }
body.sz-auth .verify-header .sz-brand__icon { height: 30px; filter: none; }
body.sz-auth .verify-main { grid-area: main; justify-self: center; width: min(440px, calc(100% - 48px)); padding: 0; margin: 0; text-align: start; max-width: none; }
body.sz-auth .verify-title { font-family: var(--sz-font); font-size: 1.75rem; font-weight: 790; font-stretch: 86%; color: var(--sz-text-strong); margin: 0 0 6px; letter-spacing: -0.015em; text-align: start; }
body.sz-auth .verify-description { color: var(--sz-text-muted); font-size: 15px; margin: 0 0 20px; text-align: start; }
body.sz-auth .search-wrapper { max-width: none; margin: 0; width: 100%; }
body.sz-auth .company-search {
    height: 48px; width: 100%; padding: 0 44px 0 14px; font-size: 16px; font-family: var(--sz-font);
    background: var(--sz-surface); color: var(--sz-text);
    border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl); box-shadow: none;
}
html.dark-mode body.sz-auth .company-search { background: var(--sz-surface-2); }
html[dir="rtl"] body.sz-auth .company-search { padding: 0 14px 0 44px; }
body.sz-auth .company-search::placeholder { color: var(--sz-text-faint); text-align: start; font-family: var(--sz-font); font-size: 15px; }
body.sz-auth .validation-icon-container { overflow: hidden; }
html[dir="rtl"] body.sz-auth .validation-icon-container { right: auto; left: .75rem; }
body.sz-auth .company-search:focus { border-color: var(--sz-accent); box-shadow: 0 0 0 3px var(--sz-accent-ring); outline: none; }
body.sz-auth .valid-icon { color: var(--sz-win); }
body.sz-auth .invalid-icon { color: var(--sz-loss); }
body.sz-auth .verify-button { grid-area: btn; justify-self: center; width: min(440px, calc(100% - 48px)); padding: 0; margin: 16px 0 0; max-width: none; position: static; background: none; }
body.sz-auth .continue-button {
    width: 100%; height: 48px; border: 0; border-radius: var(--sz-r-ctl);
    background: var(--sz-accent); color: var(--sz-on-accent); font-family: var(--sz-font); font-size: 16px; font-weight: 700;
}
body.sz-auth .continue-button:hover:not(:disabled) { background: var(--sz-accent-hover); transform: none; box-shadow: none; }
body.sz-auth .continue-button:disabled { opacity: .5; }
body.sz-auth .verify-footer { grid-area: foot; justify-self: stretch; width: auto; max-width: none; padding: 16px 24px 20px; margin: 0; background: none; border: 0; border-top: 1px solid var(--sz-border); position: static; }
body.sz-auth .verify-footer .footer-content { max-width: none; justify-content: space-between; }
body.sz-auth .footer-text, body.sz-auth .footer-link { color: var(--sz-text-faint); font-size: 12.5px; }
body.sz-auth .footer-link:hover { color: var(--sz-text); }
body.sz-auth .verify-message.error { background: var(--sz-loss-soft); color: var(--sz-loss); border-color: color-mix(in srgb, var(--sz-loss) 30%, transparent); }

/* phones + small tablets: the field becomes a band */
@media (max-width: 900px) {
    body.sz-auth .wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    body.sz-auth .wrap > .sz-auth-aside { grid-column: 1; grid-row: 1; }
    body.sz-auth .wrap > .card,
    html.dark-mode body.sz-auth .wrap > .card { grid-column: 1; grid-row: 2; align-self: start; margin: 20px 0 28px; padding: 26px 20px 22px; width: min(460px, calc(100% - 28px)); }
    .sz-auth-aside { grid-template-rows: auto auto; align-items: start; padding: 74px 22px 22px; gap: 10px; }
    .sz-auth-mark { margin-top: 0; }
    body.sz-auth .sz-auth-aside .sz-auth-line { font-size: 1.9rem; max-width: 18ch; }
    .sz-auth-foot, .sz-auth-show { display: none; }
    body.sz-auth .back-button { top: 16px; left: 14px; }
    html[dir="rtl"] body.sz-auth .back-button { left: auto; right: 14px; }
    body.sz-auth .mc-link { top: 16px; right: 14px; background: rgba(255, 255, 255, .1); color: var(--sz-rail-ink); border-color: rgba(255, 255, 255, .22); }
    html[dir="rtl"] body.sz-auth .mc-link { right: auto; left: 14px; }
    body.sz-auth .mc-link i { color: var(--sz-rail-ink); }
    body.sz-auth .verify-container {
        grid-template-columns: 1fr; grid-template-rows: auto auto auto auto 1fr auto;
        grid-template-areas: "aside" "head" "main" "btn" "." "foot";
    }
    body.sz-auth .verify-main { margin-top: 28px; }   /* the header is hidden, so the step's title needs its own room under the band */
    body.sz-auth .verify-footer .footer-content { flex-direction: column; gap: 6px; align-items: center; }
}
@media (prefers-reduced-motion: no-preference) {
    body.sz-auth .wrap > .card, body.sz-auth .verify-main { animation: sz-rise var(--sz-t-3) var(--sz-ease) both; }
}

/* =================================================================================
   Client portal
   ================================================================================= */
/* the portal rail carries "Streamlinerz" (12 letters) instead of "Steamify" */
:root body .sidebar:has(a.company-scope-item) .sz-brand { min-width: 0; }
:root body .sidebar:has(a.company-scope-item) .sz-brand__name { font-size: 15px; font-stretch: 92%; letter-spacing: .04em; }
/* Card titles in My Account and client Settings: ink in both themes (settingsmain.css turned them accent blue in dark) */
:root body.account-page .settings-form .form-section h3 { color: var(--sz-text-strong); }
/* Settings → Account: label, box, then its explanation under the box (the box and the text sat side by side) */
:root body.client-settings-page #account .form-group.column { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
:root body.client-settings-page #account .form-group.column > label { margin: 0; }
:root body.client-settings-page #account .form-group.column :is(input:not([type="checkbox"]):not([type="radio"]), .pw-field) { width: 100%; max-width: 350px; }
/* the account avatar (_client_sidebar.php client_account_button()): initials in a span, not the staff SVG image */
:root body .cp-avatar { display: grid; place-items: center; background: var(--sz-accent) !important; color: var(--sz-on-accent); font-size: 13px; line-height: 1; }:root body .cp-card { background: var(--sz-surface); border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel); box-shadow: none; }
/* Pipeline lead drawer: when closed it leaves the tab order (it is aria-hidden) and casts
   nothing at the edge; visibility flips only after the slide-out finishes */
:root body .pl-drawer { transition: transform var(--sz-t-3) var(--sz-ease); box-shadow: -24px 0 60px -20px rgba(11, 16, 32, .35); border-left-color: var(--sz-border); }
:root body .pl-drawer:not(.open) { visibility: hidden; box-shadow: none; transition: transform var(--sz-t-3) var(--sz-ease), visibility 0s linear var(--sz-t-3); }
/* KPI row: figure tiles. Stage colours stay only where they mean an outcome. */
:root body .cp-stats-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; }
:root body .cp-stat-card { padding: 14px 16px; gap: 12px; align-items: center; }
:root body .cp-stat-icon,
html.dark-mode body .cp-stat-icon { width: 38px; height: 38px; border-radius: var(--sz-r-ctl); font-size: 15px; background: var(--sz-accent-soft); color: var(--sz-accent-text); }
:root body .cp-stat-icon.is-purple { background: var(--sz-surface-3); color: var(--sz-text-muted); }
:root body .cp-stat-icon.is-green { background: var(--sz-win-soft); color: var(--sz-win); }
:root body .cp-stat-icon.is-red { background: var(--sz-loss-soft); color: var(--sz-loss); }
:root body .cp-stat-icon.is-orange { background: var(--sz-draw-soft); color: var(--sz-draw); }
:root body .cp-stat-info .cp-stat-value {
    font-size: 1.85rem; font-weight: 820; font-stretch: var(--sz-stretch-fig); line-height: 1; color: var(--sz-text-strong); letter-spacing: -0.01em;
}
:root body .cp-stat-info .cp-stat-label {
    margin-top: 4px; font-size: 11px; font-weight: 680; letter-spacing: .06em; text-transform: uppercase; color: var(--sz-text-muted);
}
:root body .cp-table thead th {
    background: var(--sz-surface-2); color: var(--sz-text-muted); font-size: 11.5px; font-weight: 680;
    letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--sz-border);
}
:root body .cp-table-wrap { border: 0; border-radius: 0; overflow: auto; }
:root body .cp-empty-row td { color: var(--sz-text-muted); padding: 28px 16px; }
:root body .cp-notice { background: var(--sz-accent-tint); border: 1px solid color-mix(in srgb, var(--sz-accent) 22%, transparent); color: var(--sz-text); border-radius: var(--sz-r-ctl); }
/* pipeline columns */
:root body :is(.cp-pipe-col, .pipeline-column, .kanban-column) { background: var(--sz-surface-2); border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel); }

/* ---- Notification drawer items --------------------------------------------------- */
:root body .notification-item { padding: 14px 20px; gap: 12px; transition: background-color var(--sz-t-1) ease; }
@media (hover: hover) and (pointer: fine) {
    :root body .notification-item:hover { background: var(--sz-surface-2); }
}
:root body .notification-item .notification-title { color: var(--sz-text-strong); font-weight: 680; }
:root body .notification-item .notification-message { color: var(--sz-text-muted); }
:root body .notification-item .notification-time { color: var(--sz-text-faint); font-size: 12px; }
/* dismiss: a quiet icon that turns red only when you aim at it */
:root body .notification-delete-btn.btn-danger {
    background: transparent !important; color: var(--sz-text-faint) !important; border: 0 !important;
    width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 8px; box-shadow: none; font-size: 14px;
}
@media (hover: hover) and (pointer: fine) {
    :root body .notification-delete-btn.btn-danger:hover { background: var(--sz-loss-soft) !important; color: var(--sz-loss) !important; filter: none; }
}

/* ---- Security Events / Website Sessions: keep the header actions on the title row -- */
:root body .sec-head { flex-wrap: nowrap; align-items: flex-start; }
:root body .sec-head-titles { flex: 1 1 0; }
:root body .sec-head h1 i { color: var(--sz-accent-text); font-size: .8em; margin-inline-end: 4px; }
:root body .sec-head .sub { color: var(--sz-text-muted); max-width: 80ch; }
@media (max-width: 600px) { :root body .sec-head { flex-wrap: wrap; } }

/* ---- Register employee / accept invitation: the sheet laid over the cobalt field ---- */
body.register-page {
    --text: var(--sz-text); --muted: var(--sz-text-muted); --stroke: var(--sz-border-strong);
    --primary: var(--sz-accent); --primary-600: var(--sz-accent-hover); --light-bg: var(--sz-surface); --bg-color: var(--sz-bg);
    font-family: var(--sz-font); background: var(--sz-bg); color: var(--sz-text);
}
body.register-page .wrap { background: linear-gradient(var(--sz-rail) 0 260px, var(--sz-bg) 260px); }
body.register-page .card {
    --reg-pad: 32px;
    background: var(--sz-surface); border: 1px solid var(--sz-border); box-shadow: var(--sz-shadow-modal);
    padding: 28px var(--reg-pad) 0; border-radius: 16px;
}
body.register-page .card .header { margin-bottom: 8px; }
body.register-page .card .grid { gap: 18px 20px; }
/* section headings across the form's two columns */
body.register-page .reg-sec {
    grid-column: 1 / -1; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
    margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--sz-border);
}
body.register-page .reg-sec--first { margin-top: 4px; padding-top: 18px; }
body.register-page .reg-sec h2 { margin: 0; font-size: 15px; font-weight: 720; color: var(--sz-text-strong); letter-spacing: -0.005em; }
body.register-page .reg-sec p { margin: 0; font-size: 13px; color: var(--sz-text-muted); }
body.register-page .card .field > small { font-size: 12.5px; line-height: 1.4; }
/* "Add new department / role" row: a real input + button, not a grey slab */
body.register-page .add-new-container { align-items: center; }
body.register-page .add-new-container input {
    flex: 1; min-width: 0; height: 38px; box-sizing: border-box; padding: 0 12px; font: inherit; font-size: 14px;
    background: var(--sz-surface); color: var(--sz-text); border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl);
}
html.dark-mode body.register-page .add-new-container input { background: var(--sz-surface-2); }
body.register-page .add-new-container input:focus { outline: none; border-color: var(--sz-accent); box-shadow: 0 0 0 3px var(--sz-accent-ring); }
body.register-page .add-new-container .btn-ghost {
    height: 38px; padding: 0 14px; border-radius: var(--sz-r-ctl); border: 1px solid var(--sz-border-strong);
    background: var(--sz-surface); color: var(--sz-text-strong); font-weight: 640; cursor: pointer;
}
body.register-page .add-new-container .btn-ghost:hover { border-color: var(--sz-accent); color: var(--sz-accent-text); }
body.register-page .pw-strength { height: 3px; margin-top: 2px; }
/* the action bar stays in reach at the bottom of the screen while the form scrolls */
body.register-page .card > .actions {
    position: sticky; bottom: 0; z-index: 5; align-items: center;
    margin: 28px calc(-1 * var(--reg-pad)) 0; padding: 14px var(--reg-pad);
    background: var(--sz-surface); border-top: 1px solid var(--sz-border); border-radius: 0 0 16px 16px;
}
body.register-page .card > .actions.hidden { display: none; }
body.register-page .card > .actions .back-dashboard {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
    border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl); color: var(--sz-text-strong); background: var(--sz-surface);
}
body.register-page .card > .actions .back-dashboard:hover { border-color: var(--sz-accent); color: var(--sz-accent-text); }
body.register-page .card > .actions .btn-primary { padding: 11px 22px; }
body.register-page .card > .actions .btn-primary:hover { transform: none; }
body.register-page #successContainer { padding-bottom: 28px; }
@media (max-width: 900px) {
    body.register-page .wrap { padding: 20px 12px 32px; }
    body.register-page .card { --reg-pad: 20px; width: 100% !important; padding: 22px var(--reg-pad) 0 !important; }
    /* buttons stack full width here (mobile-register.css), so a sticky bar would cover a third of the screen */
    body.register-page .card > .actions { position: static; }
    body.register-page .card > .actions .back-dashboard { justify-content: center; }
}
body.register-page .card h1 { font-size: 1.6rem; font-weight: 790; font-stretch: 86%; color: var(--sz-text-strong); }
body.register-page .card .subtitle { color: var(--sz-text-muted); }
body.register-page .card .brand .sz-brand__name { color: var(--sz-text-strong); font-size: 22px; }
body.register-page .card .brand .sz-brand__icon { height: 40px; }
body.register-page .card .brand .sz-brand__sep { height: 28px; background: var(--sz-border-strong); }
body.register-page .card label { color: var(--sz-text); font-weight: 640; font-size: 13.5px; }
body.register-page .card .input { background: var(--sz-surface); border-color: var(--sz-border-strong); border-radius: var(--sz-r-ctl); }
html.dark-mode body.register-page .card .input { background: var(--sz-surface-2); }
body.register-page .card .input:focus-within { border-color: var(--sz-accent); box-shadow: 0 0 0 3px var(--sz-accent-ring); }
body.register-page .card .input :is(input, select) { color: var(--sz-text); font-family: var(--sz-font); }
body.register-page .card small { color: var(--sz-text-muted); }

/* ---- Company registration form + thanks (company_form*.html) --------------------- */
body:has(.page-root) { background: linear-gradient(var(--sz-rail) 0 300px, var(--sz-bg) 300px) no-repeat, var(--sz-bg); font-family: var(--sz-font); color: var(--sz-text); }
.page-root :is(h1, h2, h3, p, label, a, span, input, select, textarea, button) { font-family: var(--sz-font); }
.page-root .site-header .sz-brand__icon { filter: brightness(0) invert(1); height: 34px; }
.page-root .site-header .sz-brand__name { color: var(--sz-rail-ink); font-stretch: 112%; font-weight: 800; letter-spacing: .07em; }
.page-root .site-header .sz-brand__sep { background: rgba(255, 255, 255, .4); }
.page-root .progress-indicator { color: rgba(255, 255, 255, .78); }
.page-root .progress-indicator .text-primary { color: var(--sz-rail-ink); }
.page-root .glass-panel, .page-root .form-card {
    background: var(--sz-surface); border: 1px solid var(--sz-border); box-shadow: var(--sz-shadow-modal);
    backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 16px; color: var(--sz-text);
}
.page-root .form-heading { border-bottom-color: var(--sz-border); }
.page-root .form-title { color: var(--sz-text-strong); font-weight: 790; font-stretch: 86%; letter-spacing: -0.015em; }
.page-root .lead, .page-root .note, .page-root .muted-text, .page-root .muted-link { color: var(--sz-text-muted); }
.page-root .section { border-top-color: var(--sz-border); }
.page-root .section-title { color: var(--sz-accent-text); }
.page-root .form-label { color: var(--sz-text); font-weight: 640; }
.page-root :is(.custom-input, .form-select, .form-input, textarea) {
    background: var(--sz-surface); color: var(--sz-text); border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl);
}
html.dark-mode .page-root :is(.custom-input, .form-select, .form-input, textarea) { background: var(--sz-surface-2); }
.page-root :is(.custom-input, .form-select, .form-input, textarea):focus { border-color: var(--sz-accent); box-shadow: 0 0 0 3px var(--sz-accent-ring); outline: none; }
.page-root :is(.custom-input, .form-input, textarea)::placeholder { color: var(--sz-text-faint); }
.page-root .checkbox-row { background: var(--sz-surface-2); border-color: var(--sz-border); }
.page-root .link-primary { color: var(--sz-accent-text); }
.page-root .btn-primary { background: var(--sz-accent); color: var(--sz-on-accent); border-radius: var(--sz-r-ctl); box-shadow: none; }
.page-root .btn-primary:hover { background: var(--sz-accent-hover); filter: none; transform: none; }
.page-root .site-footer { border-top-color: var(--sz-border); }
.page-root .modal-card { background: var(--sz-surface); color: var(--sz-text); }
.page-root .modal-title { color: var(--sz-text-strong); }
.page-root .modal-body { color: var(--sz-text-muted); }

/* ---- Client sign-up continuation (signup_continue.php) ------------------------------- */
body.su-body {
    --su-primary: var(--sz-accent); --su-primary-600: var(--sz-accent-hover);
    --su-text: var(--sz-text); --su-muted: var(--sz-text-muted); --su-border: var(--sz-border-strong);
    background: linear-gradient(var(--sz-rail) 0 280px, var(--sz-bg) 280px) no-repeat, var(--sz-bg);
    font-family: var(--sz-font); color: var(--sz-text);
}
body.su-body .su-header .sz-brand__icon { filter: brightness(0) invert(1); }
body.su-body :is(.su-card, .su-message-card) { background: var(--sz-surface); border: 1px solid var(--sz-border); box-shadow: var(--sz-shadow-modal); border-radius: 16px; color: var(--sz-text); }
body.su-body .su-card-head { background: var(--sz-surface-2); color: var(--sz-text-strong); border-bottom: 1px solid var(--sz-border); }
body.su-body .su-card-head h2 { font-stretch: 86%; font-weight: 780; }
body.su-body :is(.su-input, .su-textarea) { background: var(--sz-surface); color: var(--sz-text); border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl); }
html.dark-mode body.su-body :is(.su-input, .su-textarea) { background: var(--sz-surface-2); }
body.su-body .su-opt { border-color: var(--sz-border); border-radius: var(--sz-r-ctl); }
body.su-body .su-btn-primary { background: var(--sz-accent); border-radius: var(--sz-r-ctl); }
body.su-body .su-btn-primary:hover { background: var(--sz-accent-hover); transform: none; box-shadow: none; }
body.su-body .su-message-card h1, body.su-body .su-message-card h2 { color: var(--sz-text-strong); font-stretch: 86%; }

/* ---- Team Performance: the ranked table ------------------------------------------- */
/* Rank column: condensed heavy numerals, the top three in cobalt. */
:root body .tp-table td.tp-rank {
    font-weight: 820; font-stretch: var(--sz-stretch-fig); font-size: 1.15rem; line-height: 1;
    color: var(--sz-text-muted); text-align: center; width: 44px;
}
:root body .tp-table tbody tr:nth-child(-n+3) td.tp-rank { color: var(--sz-accent-text); }
:root body .tp-table .tp-agent-name { font-weight: 680; color: var(--sz-text-strong); }
:root body .tp-table .tp-agent-dept { color: var(--sz-text-muted); }
:root body :is(.tp-stat-v, .hrs-stat-v, .clf-kpi-v) {
    font-family: var(--sz-font); font-stretch: var(--sz-stretch-fig); font-weight: 820; font-size: 1.75rem;
    line-height: 1.05; color: var(--sz-text-strong); letter-spacing: -0.01em;
}
:root body :is(.tp-stat-l, .hrs-stat-l, .clf-kpi-l) {
    font-size: 11px; font-weight: 680; letter-spacing: .07em; text-transform: uppercase; color: var(--sz-text-muted);
}
:root body :is(.tp-stat, .hrm-stat, .clf-kpi) { border-radius: var(--sz-r-panel); }

/* ---- RTL: Tasks on phones pads only the left edge (the scroll list pads the right);
        mirror both so the title never touches the right edge in Arabic --------------- */
@media (max-width: 900px) {
    html[dir="rtl"] body .content-area:has(.index-scroll-container) { padding-left: 0; padding-right: .5rem; }
    html[dir="rtl"] body .index-scroll-container { padding-right: 0; padding-left: .5rem; }
}

/* ---- small contrast repairs ---------------------------------------------------------- */
:root body .user-role { color: var(--sz-accent-text); }
:root body .profile-summary-card .user-role { background: var(--sz-accent-soft); color: var(--sz-accent-text); }
/* the watermark in an empty chat pane: muted ink, not white-on-chalk */
:root body :is(.chat-area, .chat-window, .chat-placeholder, .no-chat-selected) .sz-brand__name { color: var(--sz-text-faint); }
/* Collaboration: the empty chat pane says what to do next instead of showing a logo */
:root body .sz-chat-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 36ch; padding: 24px; text-align: center; color: var(--sz-text-muted); font-size: 14px; line-height: 1.5; }
:root body .sz-chat-empty__icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 8px; border-radius: var(--sz-r-panel); background: var(--sz-accent-soft); color: var(--sz-accent-text); font-size: 18px; }
:root body .sz-chat-empty b { color: var(--sz-text-strong); font-size: 16px; font-weight: 720; }
:root body .sz-chat-list-empty { margin: 0; padding: 20px 16px; color: var(--sz-text-muted); font-size: 14px; text-align: center; }

/* =================================================================================
   Finish-review batch
   ================================================================================= */
/* Summary figures as one strip: a single hairline frame, cells split by hairlines,
   the figure at full display size with its label underneath. No card per number. */
:root body :is(.tp-summary, .hrm-summary, .cp-stats-grid) {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0;
    margin: 16px 0 18px; padding: 0;
    border-block: 1px solid var(--sz-border); background: transparent;
}
:root body :is(.tp-stat, .hrm-stat, .cp-stats-grid > .cp-stat-card),
html.dark-mode body :is(.tp-stat, .hrm-stat, .cp-stats-grid > .cp-stat-card) {
    display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 0;
    margin: 0; padding: 14px 18px 14px; min-width: 0;
    background: transparent; border: 0; border-radius: 0; box-shadow: none;
    border-inline-start: 1px solid var(--sz-border);
}
:root body :is(.tp-stat, .hrm-stat, .cp-stats-grid > .cp-stat-card):first-child { border-inline-start: 0; padding-inline-start: 2px; }
:root body .cp-stats-grid > .cp-stat-card .cp-stat-icon { display: none; }
:root body .cp-stats-grid > .cp-stat-card .cp-stat-info { display: flex; flex-direction: column; }
:root body :is(.tp-stat-v, .hrm-stat-v, .cp-stat-info .cp-stat-value) {
    order: 1; margin: 0; font-size: var(--sz-fs-fig); line-height: 1;
    font-stretch: var(--sz-stretch-fig); font-weight: 820; letter-spacing: -0.015em; color: var(--sz-text-strong);
}
:root body :is(.tp-stat-l, .hrm-stat-l, .cp-stat-info .cp-stat-label) {
    order: 2; margin: 8px 0 0; font-size: 11px; font-weight: 680; letter-spacing: .07em; text-transform: uppercase; color: var(--sz-text-muted);
}
:root body :is(.tp-stat-sub, .hrm-stat-sub) { order: 3; margin-top: 2px; font-size: 12px; opacity: 1; color: var(--sz-text-faint); }
:root body .hrm-stat.z-green .hrm-stat-v { color: var(--sz-win); }
:root body .hrm-stat.z-orange .hrm-stat-v, :root body .hrm-stat.hrm-stat-warn .hrm-stat-v { color: var(--sz-draw); }
:root body .hrm-stat.z-red .hrm-stat-v { color: var(--sz-loss); }
:root body .hrm-stat.hrm-stat-warn { border-color: var(--sz-border); }
/* HR: a salary that is not on file reads as amber text in its cell, no glyph per row */
:root body .hrm-table td.hrm-missing { color: var(--sz-draw); font-weight: 650; }
/* Team Performance: the export sits on the title row, prose holds a reading measure */
:root body .tp-head { flex-wrap: nowrap; align-items: flex-start; }
:root body .tp-head > div { flex: 1 1 0; min-width: 0; }
:root body .tp-head p, :root body .hrs-sub { max-width: 70ch; }
@media (max-width: 640px) { :root body .tp-head { flex-wrap: wrap; } }

/* Phones: short tab strips (four tabs or fewer) share the width instead of scrolling one off-screen */
@media (max-width: 600px) {
    :root body .tab-nav:not(:has(> :nth-child(5))) > :is(button, a) { flex: 1 1 0; min-width: 0; padding-inline: 6px; font-size: 14px; }
    :root body .page-header .header-actions { flex-wrap: wrap; justify-content: flex-start; max-width: 100%; min-width: 0; }
    :root body .page-header:has(.page-header-content) .header-actions { flex: 1 1 100%; }
    :root body .content-area:has(#mt-filters) { padding-inline: 14px; }
}
/* the phone header avatar: the system ring only */
:root body .sidebar-header.mobile-only .user-profile :is(.header-profile-picture, .profile-initials-avatar) { box-shadow: 0 0 0 2px var(--sz-surface), 0 0 0 3px var(--sz-border-strong); }
/* Sign-in: the field carries the brand on wide screens, so the card leads with its heading */
body.sz-auth .card h1.sz-auth-title {
    font-size: 1.75rem; font-weight: 790; font-stretch: 86%; letter-spacing: -0.015em; line-height: 1.15;
    color: var(--sz-text-strong); margin: 0;
}
@media (min-width: 901px) {
    body.sz-auth .wrap > .card .header .brand,
    body.sz-auth .verify-header { display: none; }
    body.sz-auth .verify-main { margin-top: 0; }
}
/* Tasks: each project group carries its count as a figure numeral */
:root body .task-header-actions .task-count {
    min-width: 30px; height: 26px; padding: 0 8px; border-radius: var(--sz-r-pill);
    display: inline-grid; place-items: center;
    background: var(--sz-surface-3); color: var(--sz-text-strong);
    font-weight: 820; font-stretch: var(--sz-stretch-fig); font-size: 15px; line-height: 1;
}
/* the legacy avatar layer under the rendered avatar: no blue disc or drop shadow peeking out */
:root body .user-profile::before,
html.dark-mode body .user-profile::before { background-color: transparent; box-shadow: none; }
@media (hover: hover) and (pointer: fine) { :root body .user-profile:hover::before { box-shadow: none; } }
:root body .user-profile:has(> img)::before { background-image: none; }

/* ---- Finish review, round 2 ------------------------------------------------------- */
/* Board strips with a known cell count: whole rows, a hairline between rows. */
:root body .tp-summary, :root body .cp-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
:root body .hrm-summary { grid-template-columns: repeat(5, minmax(0, 1fr)); }
:root body .tp-summary > .tp-stat:nth-child(4n+1),
:root body .cp-stats-grid > .cp-stat-card:nth-child(4n+1),
:root body .hrm-summary > .hrm-stat:nth-child(5n+1) { border-inline-start: 0; padding-inline-start: 2px; }
:root body .tp-summary > .tp-stat:nth-child(n+5),
:root body .cp-stats-grid > .cp-stat-card:nth-child(n+5),
:root body .hrm-summary > .hrm-stat:nth-child(n+6) { border-top: 1px solid var(--sz-border); }
@media (max-width: 700px) {
    :root body :is(.tp-summary, .cp-stats-grid, .hrm-summary) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    :root body :is(.tp-summary > .tp-stat, .cp-stats-grid > .cp-stat-card, .hrm-summary > .hrm-stat) { border-inline-start: 1px solid var(--sz-border); border-top: 0; padding-inline-start: 18px; }
    :root body :is(.tp-summary > .tp-stat, .cp-stats-grid > .cp-stat-card, .hrm-summary > .hrm-stat):nth-child(2n+1) { border-inline-start: 0; padding-inline-start: 2px; }
    :root body :is(.tp-summary > .tp-stat, .cp-stats-grid > .cp-stat-card, .hrm-summary > .hrm-stat):nth-child(n+3) { border-top: 1px solid var(--sz-border); }
}
/* Admin Panel: RAW Data Sync is a super-admin utility, not page content, so it is one quiet
   toolbar row: label, a one-line hint (full note in its title), two small buttons. The status
   lines join below only once a run writes to them. */
:root body #rawdata-sync-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px;
    margin: 0 0 14px; padding: 6px 6px 6px 14px;
    background: var(--sz-surface-2); border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel);
    font-size: 13px; line-height: 1.4;
}
:root body #rawdata-sync-bar .rds-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 680; color: var(--sz-text-strong); white-space: nowrap; }
:root body #rawdata-sync-bar .rds-label i { color: var(--sz-accent-text); font-size: 12px; }
:root body #rawdata-sync-bar .rds-hint { flex: 1 1 0; min-width: 0; color: var(--sz-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root body #rawdata-sync-bar .rds-actions { display: flex; gap: 6px; margin-inline-start: auto; }
:root body #rawdata-sync-bar .rds-status { flex: 1 0 100%; padding-bottom: 4px; color: var(--sz-text-muted); font-size: 12.5px; }
:root body #rawdata-sync-bar .rds-status:empty { display: none; }
@media (max-width: 767px) {
    :root body #rawdata-sync-bar { padding: 4px 4px 4px 12px; gap: 4px 10px; }
    :root body #rawdata-sync-bar :is(.rds-hint, .rds-btn-text) { display: none; }
    /* the 2rem under the title dates from when the tabs sat inside the header */
    :root .dashboard-page .page-header .page-header-top { margin-bottom: 0; }
}
/* Pay Slips: the Edit hours checkbox sits beside its label, not stacked over it like the fields */
:root body .pss-tb-item.pss-hours-toggle { flex-direction: row; align-items: center; align-self: flex-end; min-height: var(--sz-ctl-h-sm); }
:root body .pss-hours-toggle input[type="checkbox"] { margin: 0; }
/* Lead Checker: labels that are not an outcome */
:root body .lc-chip.lc-chip-neutral { background: var(--sz-surface-3); color: var(--sz-text); }
/* Sign-in: the field (or its phone band) carries the brand, so the card always leads with its h1 */
body.sz-auth .wrap > .card .header .brand,
body.sz-auth .verify-header { display: none; }
/* Headcount on phones: help + avatar stay header controls, top-right beside the menu button */
@media (max-width: 600px) {
    :root body .content-area:has(#mt-filters) .page-header { position: relative; padding-top: 0; }
    :root body .content-area:has(#mt-filters) .page-header .header-actions > .user-profile { position: absolute; top: -50px; inset-inline-end: 0; }
    :root body .content-area:has(#mt-filters) .page-header .header-actions > .sz-help-btn { position: absolute; top: -48px; inset-inline-end: 54px; }
}

/* Pages that grow with their content: the app shell locks .main-content to the window
   (overflow: hidden), so their content area is the scroller. Calendar only scrolls on
   Manage events; its month grid sizes itself to the window. */
:root body:is(.people-page, .approvals-page, .clients-page, .person-page, .payslips-page) .content-area,
:root body.calendar-page .content-area:has(> .pp-panel[data-panel="events"]:not([hidden])) { overflow-y: auto; overflow-x: hidden; }
/* Inside that padded scroller the sticky page header stops ~28px below the top, and rows scrolled
   past showed through the strip above it. A solid band of page colour above the header covers it. */
:root body:is(.people-page, .approvals-page, .clients-page, .person-page, .payslips-page, .calendar-page) .view-container > .page-header { box-shadow: 0 -40px 0 var(--sz-bg); }

/* ---- No access / not found (access_denied.php): the reason and the way out, nothing else ---- */
:root body .sz-denied {
    max-width: 580px; margin: clamp(28px, 9vh, 112px) auto 48px; padding: 36px 36px 26px;
    background: var(--sz-surface); border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel);
}
/* a quiet lock tile for "not allowed"; a plain compass tile for "not found" */
:root body .sz-denied-mark {
    display: inline-grid; place-items: center; width: 46px; height: 46px; margin: 0 0 20px;
    border-radius: var(--sz-r-panel); background: var(--sz-accent-soft); color: var(--sz-accent-text); font-size: 18px;
}
:root body .sz-denied-mark:has(.fa-compass) { background: var(--sz-surface-3); color: var(--sz-text-muted); font-size: 19px; }
:root body .sz-denied h1 { margin: 0 0 10px; font-size: clamp(1.55rem, 2.3vw, 2.05rem); line-height: 1.12; color: var(--sz-text-strong); text-wrap: balance; }
:root body .sz-denied p { margin: 0 0 22px; max-width: 48ch; color: var(--sz-text-muted); font-size: 1rem; line-height: 1.6; }
:root body .sz-denied-actions { display: flex; flex-wrap: wrap; gap: 10px; }
:root body .sz-denied-actions .btn { text-decoration: none; }
:root body .sz-denied .sz-denied-code { max-width: none;
    margin: 26px 0 0; padding-top: 14px; border-top: 1px solid var(--sz-border);
    font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--sz-text-faint);
}
@media (max-width: 640px) {
    :root body .sz-denied { margin: 64px 0 0; padding: 26px 20px 22px; }
    :root body .sz-denied-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---- Manage Users → Permissions: one section per row, a real heading for each, and
   toggles at body size (the generic .detail-item label rule had shrunk them to 0.8rem) ---- */
/* !important: dashboard.css's phone rule (1fr !important) let the widest card push the tab past the screen */
:root body #details-permissions .profile-details-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; }
:root body #details-permissions .detail-item.full-width { grid-column: 1 / -1; margin: 0; padding: 18px 20px; background: var(--sz-surface); border-radius: var(--sz-r-panel); }
:root body #details-permissions .detail-item > label:first-child { margin: 0 0 4px; font-size: 16px; font-weight: 720; letter-spacing: 0; text-transform: none; color: var(--sz-text-strong); }
:root body #details-permissions .permission-description { max-width: 74ch; margin: 0 0 14px; font-size: 14px; font-weight: 400; line-height: 1.55; color: var(--sz-text-muted); }
:root body #details-permissions label:not(:first-child) { font-size: 14px; color: var(--sz-text); }
/* Groups (Pages, Desktop app & monitoring, Tasks, HR, Account): a heading over their cards */
:root body #details-permissions .perm-group-head { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 12px 0 -4px; }
:root body #details-permissions .perm-wrap > .perm-group-head:first-child { margin-top: 0; }
:root body #details-permissions .perm-group-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--sz-text-strong); }
:root body #details-permissions :is(.perm-wrap, #page-access-editor) { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
:root body #details-permissions :is(.perm-wrap, #page-access-editor) > .permission-description { margin: 0; }
:root body #details-permissions .perm-note { padding: 12px 14px; border-radius: var(--sz-r-ctl); background: var(--sz-accent-tint); color: var(--sz-text); font-size: 14px; font-weight: 500; }
/* Pages: one row each, the box, the name and one line on what it allows */
:root body #details-permissions .detail-item.pa-list { padding: 4px 0; }
:root body #details-permissions .pa-item { padding: 12px 20px; border-top: 1px solid var(--sz-border); }
:root body #details-permissions .pa-item:first-child { border-top: 0; }
:root body #details-permissions .pa-row { display: flex; align-items: center; gap: 12px; }
:root body #details-permissions label.pa-check { display: flex; align-items: flex-start; gap: 12px; flex: 1 1 auto; min-width: 0; margin: 0; cursor: pointer; }
:root body #details-permissions :is(.pa-check, .pa-sub) input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--sz-accent); cursor: pointer; }
:root body #details-permissions .pa-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
:root body #details-permissions .pa-name { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--sz-text-strong); }
:root body #details-permissions .pa-desc { font-size: 13px; line-height: 1.45; color: var(--sz-text-muted); }
:root body #details-permissions .pa-leadcols-btn { flex: none; padding: 4px 10px; border-radius: var(--sz-r-ctl); font-size: 12.5px; }
/* What only matters while the row above is on: indented under its box, shown only then (dashboard.js [data-when]) */
:root body #details-permissions .pa-children { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 2px 30px; padding: 12px 14px; background: var(--sz-surface-2); border-radius: var(--sz-r-ctl); }
:root body #details-permissions .pa-children[hidden] { display: none; }
:root body #details-permissions .pa-children .pa-children { margin: 0 0 4px 28px; padding: 10px 12px; background: var(--sz-surface); border: 1px solid var(--sz-border); }
:root body #details-permissions .pa-children-label { margin: 0; font-size: 12.5px; font-weight: 650; color: var(--sz-text-muted); }
:root body #details-permissions .pa-subs { display: flex; flex-direction: column; gap: 4px; }
:root body #details-permissions label.pa-sub { display: flex; align-items: center; gap: 10px; min-height: 30px; margin: 0; font-size: 14px; font-weight: 500; color: var(--sz-text); cursor: pointer; }
:root body #details-permissions .pa-sub input { width: 16px; height: 16px; margin: 0; }
:root body #details-permissions .pa-hint { font-size: 12.5px; line-height: 1.45; color: var(--sz-text-muted); }
:root body #details-permissions .pa-input { max-width: 420px; font-size: 14px; }
/* One save bar for Pages + Desktop app, only while something is unsaved. Fixed to the bottom of the
   screen (an ancestor's overflow stops position: sticky here); it goes with the tab when the tab hides. */
:root body #details-permissions .pa-savebar {
    position: fixed; left: 50%; bottom: 16px; z-index: 50; transform: translateX(-50%);
    width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box;
    display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px;
    background: var(--sz-surface); border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-panel); box-shadow: var(--sz-shadow-pop);
    transition: opacity 160ms var(--sz-ease), translate 160ms var(--sz-ease);
}
@starting-style { :root body #details-permissions .pa-savebar { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { :root body #details-permissions .pa-savebar { transition: none; } }
:root body #details-permissions .pa-savebar[hidden] { display: none; }
:root body #details-permissions .pa-savebar-text { margin-inline-end: auto; font-size: 14px; font-weight: 600; color: var(--sz-text-strong); }
:root body #details-permissions .pa-savebar[data-state="ok"] .pa-savebar-text { color: var(--sz-win); }
:root body #details-permissions .pa-savebar[data-state="error"] .pa-savebar-text { color: var(--sz-loss); }

/* Cards with a title (Giving tasks, Roster) and cards of rows (access, HR Sheet) */
:root body #details-permissions .perm-card-title { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--sz-text-strong); }
:root body #details-permissions .perm-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 4px; }
:root body #details-permissions .perm-card-head .perm-card-title { margin: 0; }
:root body #details-permissions .detail-item.perm-rows { padding: 4px 0; }
:root body #details-permissions .perm-row { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 14px 20px; border-top: 1px solid var(--sz-border); }
:root body #details-permissions .perm-row:first-child { border-top: 0; }
:root body #details-permissions :is(.perm-row-main, label.perm-switch-row) { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
:root body #details-permissions label.perm-switch-row { margin: 0; cursor: pointer; }
/* a switch row can be a card's first child: not a card title (the .detail-item > label:first-child rule above) */
:root body #details-permissions .detail-item > label.perm-switch-row:first-child { margin: 0; font-size: 14px; font-weight: 400; color: var(--sz-text); }
:root body #details-permissions .perm-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
:root body #details-permissions .perm-name { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--sz-text-strong); }
:root body #details-permissions .perm-desc { font-size: 13px; line-height: 1.45; color: var(--sz-text-muted); }
:root body #details-permissions .perm-desc.is-suspended { font-weight: 600; color: var(--sz-loss); }
:root body #details-permissions #rf-team a { color: var(--sz-accent-text); font-weight: 600; }

/* Switch: the app's own on/off control (never the browser's checkbox) */
:root body #details-permissions input.perm-switch {
    -webkit-appearance: none; appearance: none; position: relative; flex: none; box-sizing: border-box;
    width: 42px; height: 24px; min-width: 42px; margin: 0; padding: 0; border: 0; border-radius: 999px;
    background: var(--sz-border-strong); cursor: pointer; transition: background-color 160ms var(--sz-ease);
}
:root body #details-permissions input.perm-switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border: 0; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(11, 16, 32, .3); transform: none; transition: transform 160ms var(--sz-ease);
}
:root body #details-permissions input.perm-switch:checked { background: var(--sz-accent); }
:root body #details-permissions input.perm-switch:checked::after { transform: translateX(18px); }
:root body #details-permissions input.perm-switch:focus-visible { outline: 2px solid var(--sz-accent); outline-offset: 2px; }

/* Allowed / Suspended: one two-part toggle (the radios stay underneath for keyboard and screen readers) */
:root body #details-permissions .perm-seg { position: relative; display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: var(--sz-r-ctl); background: var(--sz-surface-3); }
:root body #details-permissions .perm-seg input { position: absolute; width: 1px; height: 1px; min-width: 0; margin: 0; opacity: 0; pointer-events: none; }
:root body #details-permissions .perm-seg label {
    margin: 0; padding: 6px 14px; border-radius: calc(var(--sz-r-ctl) - 3px); font-size: 13.5px; font-weight: 600;
    color: var(--sz-text-muted); cursor: pointer; user-select: none; transition: background-color 150ms var(--sz-ease), color 150ms var(--sz-ease);
}
:root body #details-permissions .perm-seg input:checked + label { background: var(--sz-surface); color: var(--sz-text-strong); box-shadow: 0 1px 2px rgba(11, 16, 32, .14); }
:root body #details-permissions .perm-seg input[value="suspended"]:checked + label { color: var(--sz-loss); }
:root body #details-permissions .perm-seg input:focus-visible + label { outline: 2px solid var(--sz-accent); outline-offset: 1px; }
@media (hover: hover) and (pointer: fine) { :root body #details-permissions .perm-seg input:not(:checked) + label:hover { color: var(--sz-text-strong); } }
:root body #details-permissions .perm-until { display: flex; align-items: center; gap: 10px; }
:root body #details-permissions .perm-until.hidden { display: none; }
:root body #details-permissions .perm-until > label { margin: 0; font-size: 13px; font-weight: 600; color: var(--sz-text-muted); }
:root body #details-permissions .perm-until .input-wrapper { width: 210px; max-width: 100%; }

/* Roster: label over field, two columns (one on phones) */
:root body #details-permissions .perm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 14px; }
:root body #details-permissions .perm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
:root body #details-permissions .perm-field > label { margin: 0; font-size: 13px; font-weight: 600; color: var(--sz-text-muted); }
/* one field size for the text boxes and Hours (its custom button takes the select's size, dropdown_enhance.js) */
:root body #details-permissions .perm-field :is(input, select) {
    width: 100%; min-width: 0; height: 40px; box-sizing: border-box; margin: 0; padding: 0 12px;
    border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl); background: var(--sz-surface); color: var(--sz-text); font-size: 14px;
}
:root body #details-permissions .perm-field .sz-dd { display: grid; width: 100%; }
:root body #details-permissions .perm-field .sz-dd > .dropdown-button { min-height: 40px; }
:root body #details-permissions .perm-until input {
    width: 100%; height: 36px; box-sizing: border-box; margin: 0; padding: 0 36px 0 12px;
    border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl); background: var(--sz-surface); color: var(--sz-text); font-size: 14px; cursor: pointer;
}
:root body #details-permissions .perm-until .date-picker-icon { right: 12px; font-size: 14px; color: var(--sz-text-muted); pointer-events: none; }
:root body #details-permissions #rf-import-status:empty { display: none; }
@media (prefers-reduced-motion: reduce) {
    :root body #details-permissions :is(input.perm-switch, input.perm-switch::after, .perm-seg label) { transition: none; }
}
@media (max-width: 640px) {
    :root body #details-permissions .detail-item.full-width { padding: 14px; }
    :root body #details-permissions .detail-item:is(.pa-list, .perm-rows) { padding: 2px 0; }
    :root body #details-permissions :is(.pa-item, .perm-row) { padding: 12px 14px; }
    :root body #details-permissions .pa-children { margin-left: 0; }
    :root body #details-permissions .pa-children .pa-children { margin-left: 12px; }
    :root body #details-permissions .perm-row-main { flex-wrap: wrap; }
    :root body #details-permissions .perm-form { grid-template-columns: minmax(0, 1fr); }
}
/* ---- Manage Users → a person's details: their license card on the left (license.css), labelled rows in
   groups on the right. A value (p[data-field]) and its input (.edit-field) share a row; Edit details swaps
   them (dashboard.js toggleEditMode). !important: dashboard.css's own column rules carry it. ---- */
:root body #intern-details-view .intern-details-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
:root body #intern-details-view .ud-head-start { display: flex; flex-wrap: wrap; gap: 8px; }
:root body #intern-details-view .profile-grid-container { grid-template-columns: minmax(0, 400px) minmax(0, 1fr) !important; gap: 24px; align-items: start; }
/* width: the card sizes itself from its column (container query), so the column must never shrink to its content */
:root body #intern-details-view .ud-side { position: sticky; top: 16px; width: 100%; min-width: 0; }
:root body #intern-details-view .ud-license:empty { aspect-ratio: 1.6; border-radius: 20px; background: var(--sz-surface-2); }   /* while it loads */
@media (max-width: 1180px) {
    :root body #intern-details-view .profile-grid-container { grid-template-columns: minmax(0, 1fr) !important; }
    :root body #intern-details-view .ud-side { position: static; max-width: 520px; }
}
:root body #intern-details-view .ud-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
:root body #intern-details-view .ud-group { min-width: 0; padding: 4px 18px 6px; border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel); }
:root body #intern-details-view .ud-group--wide { grid-column: 1 / -1; }
:root body #intern-details-view .ud-group-title { margin: 12px 0 2px; font-size: 13px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--sz-text-muted); }
:root body #intern-details-view .ud-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 48px; padding: 8px 0; border-top: 1px solid var(--sz-border); }
:root body #intern-details-view :is(.ud-group-title + .ud-row, .ud-group > .ud-row:first-child) { border-top: 0; }
:root body #intern-details-view .ud-row--block { grid-template-columns: minmax(0, 1fr); }
:root body #intern-details-view .ud-label { font-size: 13.5px; color: var(--sz-text-muted); }
:root body #intern-details-view .ud-value { min-width: 0; }
:root body #intern-details-view .ud-value > p { margin: 0; font-size: 14.5px; font-weight: 550; line-height: 1.4; color: var(--sz-text-strong); overflow-wrap: anywhere; }
:root body #intern-details-view .ud-value > p:is(.is-empty, .ud-muted) { font-weight: 450; color: var(--sz-text-faint); }
:root body #intern-details-view .ud-value > p.ud-bio { white-space: pre-wrap; font-weight: 450; line-height: 1.55; color: var(--sz-text); }
:root body #intern-details-view :is(.ud-mono, .ud-pct) { font-variant-numeric: tabular-nums; }
:root body #intern-details-view .ud-mono { font-family: var(--sz-font-mono, ui-monospace, monospace); font-size: 13.5px; }
:root body #intern-details-view .ud-value > :is(input, select).edit-field {
    width: 100%; height: 38px; box-sizing: border-box; margin: 0; padding: 0 12px; border: 1px solid var(--sz-border-strong);
    border-radius: var(--sz-r-ctl); background: var(--sz-surface); color: var(--sz-text); font-size: 14px;
}
:root body #intern-details-view .ud-value > textarea.edit-field {
    width: 100%; box-sizing: border-box; margin: 0; padding: 10px 12px; border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl);
    background: var(--sz-surface); color: var(--sz-text); font: inherit; font-size: 14px; line-height: 1.5; resize: vertical;
}
/* Department / Role: the custom dropdown wraps the select (dropdown_enhance.js) and takes its size */
/* !important: style.css's global `select { min-width: 250px }` is copied onto the dropdown as an inline
   min-width (dropdown_enhance.js), which ran it past its column */
:root body #intern-details-view .ud-value > .sz-dd { display: grid; width: 100% !important; min-width: 0 !important; max-width: 100%; }
:root body #intern-details-view .ud-value > .sz-dd > :is(select, .dropdown-button) { width: 100% !important; min-width: 0 !important; box-sizing: border-box; }
:root body #intern-details-view .ud-value > .sz-dd > select { height: 38px; padding: 0 12px; }
:root body #intern-details-view .ud-value > .sz-dd > .dropdown-button { min-height: 38px; }
:root body #intern-details-view .ud-value > .edit-field.hidden { display: none; }
/* Activity: the live status reads at a glance */
:root body #intern-details-view .ud-status { display: inline-flex; align-items: center; gap: 8px; }
:root body #intern-details-view .ud-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sz-text-faint); }
:root body #intern-details-view .ud-status.active { color: var(--sz-win); }
:root body #intern-details-view .ud-status.active::before { background: var(--sz-win); }
/* Tasks, projects, daily reports: one row each, the thing on the left, its state on the right */
:root body #intern-details-view .ud-list { list-style: none; margin: 0; padding: 0; }
:root body #intern-details-view .ud-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--sz-border); font-size: 14px; }
:root body #intern-details-view .ud-group-title + .ud-list li:first-child { border-top: 0; }
:root body #intern-details-view .ud-list-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; color: var(--sz-text-strong); }
:root body #intern-details-view .ud-list-main a { color: var(--sz-accent-text); }
:root body #intern-details-view .ud-list-side { flex: none; font-size: 12.5px; color: var(--sz-text-muted); font-variant-numeric: tabular-nums; }
:root body #intern-details-view .ud-list li.ud-empty { font-weight: 450; color: var(--sz-text-faint); }
@media (max-width: 640px) {
    /* header actions: two to a row instead of one long column */
    :root body #intern-details-view .intern-details-header { flex-direction: column; align-items: stretch; }
    :root body #intern-details-view :is(.ud-head-start, .intern-details-header .edit-btn) { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; width: 100%; }
    :root body #intern-details-view .intern-details-header .btn:not(.hidden) { flex: 1 1 calc(50% - 4px); justify-content: center; margin: 0; }
    :root body #intern-details-view .ud-groups { grid-template-columns: minmax(0, 1fr); }
    :root body #intern-details-view .ud-group { padding: 4px 14px 6px; }
    :root body #intern-details-view .ud-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

:root body .pa-status { font-size: 13.5px; font-weight: 560; color: var(--sz-text-muted); }
:root body .pa-status[data-state="ok"] { color: var(--sz-win); }
:root body .pa-status[data-state="error"] { color: var(--sz-loss); }
:root body .pa-modal-foot .pa-status { margin-inline-end: auto; }

/* ---- Performance: score donut + legend with values, focus areas, factor grid ----
   The eight scoring factors are categories (identity, not outcome), so they get their own
   palette instead of borrowing win/draw/loss. The bar under each factor does use the
   outcome colours: it shows how that score is doing. */
:root body { --perf-quality: #1d68e5; --perf-timeliness: #0e8a7c; --perf-attendance: #7457e8; --perf-throughput: #d9731b; --perf-collaboration: #c8448a; --perf-impact: #2896cc; --perf-versatility: #a3781a; --perf-dress_code: #7d8aa0; }
html.dark-mode body { --perf-quality: #4d8cf5; --perf-timeliness: #2bb3a3; --perf-attendance: #9a84ff; --perf-throughput: #f09449; --perf-collaboration: #e36aa8; --perf-impact: #4cb6e8; --perf-versatility: #c99b3d; --perf-dress_code: #8f9bb1; }
:root body :is(.segment-quality) { stroke: var(--perf-quality); }
:root body :is(.segment-timeliness) { stroke: var(--perf-timeliness); }
:root body :is(.segment-attendance) { stroke: var(--perf-attendance); }
:root body :is(.segment-throughput) { stroke: var(--perf-throughput); }
:root body :is(.segment-collaboration) { stroke: var(--perf-collaboration); }
:root body :is(.segment-impact) { stroke: var(--perf-impact); }
:root body :is(.segment-versatility) { stroke: var(--perf-versatility); }
:root body :is(.segment-dress_code) { stroke: var(--perf-dress_code); }
:root body .dot-quality { background: var(--perf-quality); }
:root body .dot-timeliness { background: var(--perf-timeliness); }
:root body .dot-attendance { background: var(--perf-attendance); }
:root body .dot-throughput { background: var(--perf-throughput); }
:root body .dot-collaboration { background: var(--perf-collaboration); }
:root body .dot-impact { background: var(--perf-impact); }
:root body .dot-versatility { background: var(--perf-versatility); }
:root body .dot-dress_code { background: var(--perf-dress_code); }
:root body .donut-track { stroke: var(--sz-surface-3); }
/* JS draws the segments frame by frame; a CSS transition on the same property fought it */
:root body .donut-segment { stroke-linecap: butt; transition: none; }
:root body .score-card-wrapper { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 28px; height: auto; margin-top: 6px; padding: 6px 0 0; }
:root body .center-score { color: var(--sz-text-strong); font-size: 3.4rem; font-weight: 820; font-stretch: var(--sz-stretch-fig); }
:root body .center-label { margin-top: 4px; color: var(--sz-text-muted); font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
:root body .score-legend { padding: 0; border: 0; }
:root body .score-legend ul { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; }
:root body .score-legend li { display: flex; align-items: center; gap: 10px; min-height: 34px; margin: 0; border-bottom: 1px solid var(--sz-border); color: var(--sz-text); font-size: 14.5px; }
:root body .score-legend li:last-child { border-bottom: 0; }
:root body .legend-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
:root body .legend-score { margin-inline-start: auto; color: var(--sz-text-strong); font-weight: 750; font-variant-numeric: tabular-nums; }

:root body .tips-list { margin: 8px 0 0; padding: 0; list-style: none; }
:root body .tips-list li { padding: 9px 0; border-bottom: 1px solid var(--sz-border); color: var(--sz-text-muted); font-size: 14px; line-height: 1.5; }
:root body .tips-list li:last-child { border-bottom: 0; }
:root body .tips-list .focus-name { color: var(--sz-text-strong); font-weight: 700; }
:root body .tips-list strong { color: var(--sz-text-strong); font-variant-numeric: tabular-nums; }

:root body .perf-factor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
:root body .perf-factor-grid .breakdown-card {
    display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
    width: auto; min-width: 0; height: auto; margin: 0; padding: 14px 16px; text-align: left;
    background: var(--sz-surface-2); border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel); box-shadow: none;
}
:root body .perf-factor-grid .breakdown-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
:root body .perf-factor-grid .breakdown-card h4 { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; color: var(--sz-text-strong); font-size: 15px; font-weight: 700; }
:root body .perf-factor-grid .breakdown-weight { flex: 0 0 auto; margin: 0; padding: 2px 8px; border-radius: var(--sz-r-pill); background: var(--sz-surface-3); color: var(--sz-text-muted); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
:root body .perf-factor-grid .breakdown-footer { display: flex; flex-direction: column; gap: 8px; margin: 0; }
:root body .perf-factor-grid .breakdown-score { margin: 0; color: var(--sz-text-strong); font-size: 28px; font-weight: 820; font-stretch: var(--sz-stretch-fig); line-height: 1; text-align: left; }
:root body .perf-factor-grid .breakdown-score span { margin-left: 2px; color: var(--sz-text-muted); font-size: 13px; font-weight: 600; font-stretch: 100%; }
:root body .perf-factor-grid .breakdown-score .breakdown-na { margin: 0; color: var(--sz-text-faint); font-size: 14px; font-weight: 600; }
:root body .perf-factor-grid .progress-bar-container { height: 6px; margin: 0; overflow: hidden; border-radius: 3px; background: var(--sz-surface-3); }
:root body .perf-factor-grid .progress-bar { width: 0; height: 100%; border-radius: 3px; background: var(--sz-accent); transition: width 600ms var(--sz-ease); }
:root body .perf-factor-grid .progress-bar::before { display: none; }
:root body .perf-factor-grid .progress-bar.tier-high { background: var(--sz-win-solid); }
:root body .perf-factor-grid .progress-bar.tier-low { background: var(--sz-draw-solid); }
:root body .perf-adjust-grid { margin-top: 16px; }
:root body .perf-adjust-grid .breakdown-card { justify-content: flex-start; }
:root body .perf-empty { margin: 12px 0 0; color: var(--sz-text-muted); font-size: 14px; }
/* Team Performance: the amber "not landed" figure lost to the board-strip ink rule */
:root body .tp-stat-warn .tp-stat-v { color: var(--sz-draw); }
@media (max-width: 1100px) { :root body .perf-factor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    :root body .perf-factor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    :root body .score-card-wrapper { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 18px; }
    :root body .score-legend { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { :root body .perf-factor-grid .progress-bar { transition: none; } }
:root body .perf-notice { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--sz-border); border-radius: var(--sz-r-ctl); background: var(--sz-surface-2); color: var(--sz-text); font-size: 14px; }
:root body .perf-notice i { color: var(--sz-accent-text); }

/* Search field with a leading icon (.search-control): one look on every page that uses it
   (Team loads no company_admin.css, so its member search rendered as a bare 28px box) */
:root body .search-control { position: relative; display: flex; align-items: center; min-width: 0; }
:root body .search-control > i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); z-index: 1; color: var(--sz-text-muted); font-size: 13px; pointer-events: none; }
:root body .search-control > .search-input {
    box-sizing: border-box; width: 100%; min-width: 200px; min-height: var(--sz-ctl-h-sm); margin: 0;
    padding: 0 12px 0 34px; font-family: var(--sz-font); font-size: 14px; color: var(--sz-text);
    background-color: var(--sz-surface); border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl);
}
html.dark-mode body .search-control > .search-input { background-color: var(--sz-surface-2); }
html[dir="rtl"] body .search-control > .search-input { padding: 0 34px 0 12px; }
:root body .search-control > .search-input:focus { outline: none; border-color: var(--sz-accent); box-shadow: 0 0 0 3px var(--sz-accent-ring); }

/* ---- Company Admin: the add-company form and the companies table ---------------------- */
:root body .add-company-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px; padding: 16px; }
:root body .add-company-form .form-fields { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 12px 14px; flex: 1 1 540px; min-width: 0; }
:root body .add-company-form .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
:root body .add-company-form label { margin: 0; font-size: 13px; font-weight: 640; color: var(--sz-text-muted); }
:root body .add-company-form :is(input[type="text"], input[type="email"]) {
    box-sizing: border-box; width: 100%; height: var(--sz-ctl-h); min-width: 0; padding: 0 12px;
    font-family: var(--sz-font); font-size: 14.5px; color: var(--sz-text);
    background: var(--sz-surface); border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl);
}
html.dark-mode body .add-company-form :is(input[type="text"], input[type="email"]) { background: var(--sz-surface-2); }
:root body .add-company-form button[type="submit"] { height: var(--sz-ctl-h); flex: 0 0 auto; }
:root body #portal-clients-table .ca-email { max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root body .ca-icon-btn { width: 32px; padding: 0 !important; justify-content: center; }
:root body .cell-date { display: block; white-space: nowrap; }
@media (max-width: 760px) {
    :root body .add-company-form .form-fields { grid-template-columns: minmax(0, 1fr); flex-basis: 100%; }
    :root body .add-company-form button[type="submit"] { width: 100%; justify-content: center; }
    :root body #portal-clients-table { min-width: 760px; }
}

/* ---- Pay Slips (dashboard → Pay Slips): toolbar and sheet --------------------------------
   The sheet is a wide spreadsheet on purpose (every figure an admin edits or checks), so it
   keeps sticky ID / Caller columns and horizontal scroll, and gains a group row (Agent, Hours,
   Revenue, Earnings, Deductions, Pay, Leads, Slip) with a hairline between groups. Overrides
   the inline <style> in dashboard.php. */
:root body .pss-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin: 0 0 14px; }
:root body .pss-tb-filters, :root body .pss-tb-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
:root body .pss-tb-item { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 640; letter-spacing: 0; text-transform: none; color: var(--sz-text-muted); }
:root body .pss-tb-item .sz-dd, :root body .pss-tb-item .input-wrapper { min-width: 150px; }
:root body .pss-toolbar :is(.pss-month-input, .pss-rate-input) { height: var(--sz-ctl-h); box-sizing: border-box; padding: 0 12px; font-size: 14px; border-radius: var(--sz-r-ctl); }
:root body .pss-rate-input { width: 96px; }
:root body .pss-tb-item.pss-hours-toggle {
    flex-direction: row; align-items: center; gap: 8px; align-self: flex-end; height: var(--sz-ctl-h); padding: 0 12px;
    border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl); background: var(--sz-surface);
    color: var(--sz-text); font-size: 14px; font-weight: 600; cursor: pointer; user-select: none;
}
html.dark-mode body .pss-tb-item.pss-hours-toggle { background: var(--sz-surface-2); }
:root body .pss-tb-item.pss-hours-toggle:has(input:checked) { border-color: var(--sz-draw); background: var(--sz-draw-soft); }
:root body .pss-tb-btn { height: var(--sz-ctl-h); margin: 0; }
:root body .pss-meta { flex: 1 0 100%; order: 3; margin-top: -2px; color: var(--sz-text-muted); font-size: 13px; text-align: end; font-variant-numeric: tabular-nums; }

:root body .pss-table-card { border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel); background: var(--sz-surface); overflow: hidden; }
:root body .pss-table { font-size: 13px; color: var(--sz-text); }
:root body .pss-table :is(th, td) { padding: 9px 12px; border-bottom: 1px solid var(--sz-border); }
:root body .pss-table thead th {
    background: var(--sz-surface-2); color: var(--sz-text-muted);
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.25;
    border-bottom: 1px solid var(--sz-border-strong);
}
/* the group row: quieter, and the column names stick under it */
:root body .pss-table thead tr.pss-groups th {
    height: 30px; box-sizing: border-box; padding: 0 12px; border-bottom: 1px solid var(--sz-border);
    color: var(--sz-text-strong); font-size: 11px; font-weight: 760; letter-spacing: .08em; text-align: left;
}
:root body .pss-table.pss-has-groups thead tr.pss-cols th { top: 30px; }
:root body .pss-table thead tr.pss-groups th.pss-g-sticky { position: sticky; left: 0; z-index: 5; border-right: 1px solid var(--sz-border); }
:root body .pss-table thead tr.pss-groups th:not(.pss-g-sticky) { position: sticky; z-index: 3; }
:root body .pss-table :is(th, td).pss-gstart { border-left: 1px solid var(--sz-border-strong); }
:root body .pss-table tbody td:nth-child(1), :root body .pss-table tbody td:nth-child(2),
:root body .pss-table tr.pss-totals td:nth-child(1), :root body .pss-table tr.pss-totals td:nth-child(2) { background-color: var(--sz-surface); }
:root body .pss-table thead th:nth-child(1), :root body .pss-table thead th:nth-child(2) { background-color: var(--sz-surface-2); }
:root body .pss-table td:nth-child(1) { color: var(--sz-text-muted); font-size: 12.5px; }
:root body .pss-table td:nth-child(2) { color: var(--sz-text-strong); font-weight: 650; }
:root body .pss-table td.pss-strong { color: var(--sz-text-strong); font-weight: 720; }
@media (hover: hover) and (pointer: fine) {
    :root body .pss-table tbody tr:hover > td { background-image: linear-gradient(var(--sz-accent-tint), var(--sz-accent-tint)); }
}
/* Active / Inactive: a quiet tint and a status edge on the ID cell, not a coloured stripe */
:root body .pss-table tr.pss-row-active td { background-image: linear-gradient(color-mix(in srgb, var(--sz-win) 6%, transparent), color-mix(in srgb, var(--sz-win) 6%, transparent)); }
:root body .pss-table tr.pss-row-inactive td { background-image: linear-gradient(color-mix(in srgb, var(--sz-loss) 7%, transparent), color-mix(in srgb, var(--sz-loss) 7%, transparent)); }
:root body .pss-table tr.pss-row-active td:first-child { box-shadow: inset 3px 0 0 var(--sz-win-solid); }
:root body .pss-table tr.pss-row-inactive td:first-child { box-shadow: inset 3px 0 0 var(--sz-loss-solid); }
@media (hover: hover) and (pointer: fine) {
    :root body .pss-table tbody tr:is(.pss-row-active, .pss-row-inactive):hover td { background-image: linear-gradient(var(--sz-accent-tint), var(--sz-accent-tint)); }
}
:root body .pss-table tr.pss-row-susp td { color: var(--sz-text-faint); }
/* editable cells: a dotted underline instead of a dot in every corner */
:root body .pss-table td.pss-edit::after, :root body .pss-table td.pss-overridden::before { content: none; }
:root body .pss-table td.pss-edit { text-decoration: underline dotted color-mix(in srgb, var(--sz-text-faint) 70%, transparent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
    :root body .pss-table td.pss-edit:hover { background-image: none; background-color: var(--sz-accent-soft); outline: 1px solid color-mix(in srgb, var(--sz-accent) 50%, transparent); outline-offset: -1px; text-decoration-color: var(--sz-accent); }
}
:root body .pss-table td.pss-overridden { box-shadow: inset 3px 0 0 var(--sz-draw-solid); font-weight: 650; }
/* totals */
:root body .pss-table tr.pss-totals td { background-color: var(--sz-surface-2); border-top: 2px solid var(--sz-border-strong); border-bottom: 0; color: var(--sz-text-strong); font-weight: 760; }
@media (hover: hover) and (pointer: fine) { :root body .pss-table tr.pss-totals:hover td { background-image: none; } }
:root body .pss-table .pss-empty { padding: 32px 16px; color: var(--sz-text-muted); font-size: 14px; }
/* chips */
:root body .pss-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: var(--sz-r-pill); font-size: 12px; font-weight: 680; }
:root body .pss-sent, :root body .pss-rs-active { background: var(--sz-win-soft); color: var(--sz-win); }
:root body .pss-draft { background: var(--sz-surface-3); color: var(--sz-text-muted); }
:root body .pss-susp, :root body .pss-rs-inactive { background: var(--sz-loss-soft); color: var(--sz-loss); }
/* row actions */
:root body .pss-table td.pss-actions { text-align: right; padding-top: 6px; padding-bottom: 6px; }
:root body .pss-btn {
    display: inline-flex; align-items: center; height: 30px; margin: 0; padding: 0 11px;
    border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl); background: var(--sz-surface); color: var(--sz-text);
    font-size: 13px; font-weight: 620;
}
html.dark-mode body .pss-btn { background: var(--sz-surface-2); }
@media (hover: hover) and (pointer: fine) { :root body .pss-btn:hover { background: var(--sz-surface-3); border-color: var(--sz-text-faint); color: var(--sz-text-strong); } }
:root body .pss-btn.pss-btn-send { background: var(--sz-accent-soft); border-color: transparent; color: var(--sz-accent-text); }
@media (hover: hover) and (pointer: fine) { :root body .pss-btn.pss-btn-send:hover { background: var(--sz-accent); color: var(--sz-on-accent); } }
:root body .pss-table .sz-more-btn { width: 30px; height: 30px; }
@media (max-width: 900px) {
    :root body .pss-toolbar { align-items: stretch; }
    :root body .pss-tb-filters, :root body .pss-tb-actions { flex: 1 1 100%; }
    :root body .pss-tb-actions .pss-tb-btn { flex: 1 1 auto; justify-content: center; }
}

/* ---- Client Management (dashboard): the billing table ----------------------------------- */
:root body .cb-table :is(td, th) { white-space: nowrap; }
:root body .cb-table :is(td.cb-base, td.cb-months, td.cb-due, td.cb-paid) { text-align: end; font-variant-numeric: tabular-nums lining-nums; }
:root body .cb-table :is(td.cb-leads) { white-space: normal; min-width: 140px; color: var(--sz-text-muted); font-size: 13px; }
:root body .cb-table :is(input, select):not(.sz-dd-native) { height: 34px; min-height: 0; padding: 0 10px; border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl); background: var(--sz-surface); color: var(--sz-text); font: inherit; font-size: 13.5px; }
html.dark-mode body .cb-table :is(input, select):not(.sz-dd-native) { background: var(--sz-surface-2); }
:root body .cb-table .sz-dd { min-width: 150px; }
/* phones: each company is a card (name + status, email, dates, then the actions) */
@media (max-width: 600px) {
    :root body #portal-clients-table { min-width: 0; }
    :root body #portal-clients-table thead { display: none; }
    :root body #portal-clients-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 14px 12px; border-bottom: 1px solid var(--sz-border); }
    :root body #portal-clients-table tbody tr:last-child { border-bottom: 0; }
    :root body #portal-clients-table tbody td { display: block; padding: 0; border: 0; background: none; }
    :root body #portal-clients-table tbody td[colspan] { grid-column: 1 / -1; padding: 20px 0; }
    :root body #portal-clients-table td.ca-status { grid-column: 2; grid-row: 1; text-align: end; }
    :root body #portal-clients-table td.ca-status .cell-sub { text-align: end; }
    :root body #portal-clients-table td.ca-email { grid-column: 1 / -1; max-width: none; color: var(--sz-text-muted); }
    :root body #portal-clients-table td[data-label]:not(.ca-email) { grid-column: 1 / -1; display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--sz-text-muted); }
    :root body #portal-clients-table td[data-label]:not(.ca-email)::before { content: attr(data-label) ":"; font-weight: 640; }
    :root body #portal-clients-table td[data-label] .cell-date { display: inline; }
    :root body #portal-clients-table td[data-label] .cell-date .cell-sub { display: inline; margin-inline-start: 4px; }
    :root body #portal-clients-table td.col-actions { grid-column: 1 / -1; width: auto; margin-top: 6px; text-align: start; }
    :root body #portal-clients-table .sz-row-actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* ---- Performance → HR Sheet -------------------------------------------------------------
   A dense sheet: column groups over the columns, Agent and Caller Name stay put while the
   36 columns scroll, both header rows stay on top, zeros fade so activity stands out. */
:root body .hrs-how { margin: 2px 0 0; max-width: 70ch; font-size: 13px; color: var(--sz-text-muted); }
:root body .hrs-how > summary { width: fit-content; cursor: pointer; color: var(--sz-accent-text); font-weight: 640; }
:root body .hrs-how > p { margin: 6px 0 0; line-height: 1.55; }
:root body .hrs-controls-card .tp-summary[hidden] { display: none; }
:root body .hrs-controls-card .hrs-filters { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--sz-border); }
:root body .hrs-idle-toggle { color: var(--sz-text); font-size: 13px; padding-bottom: 10px; }
:root body .hrs-meta { margin-inline-start: auto; align-self: flex-end; padding-bottom: 10px; font-size: 12.5px; color: var(--sz-text-muted); }
:root body .hrs-stat-over .tp-stat-v { color: var(--sz-loss); }

/* seven figures: one row on a desktop screen, then 4 and 2 per row (the shared strip assumes 4) */
:root body #hrs-summary { grid-template-columns: repeat(7, minmax(0, 1fr)); }
:root body #hrs-summary > .tp-stat { border-inline-start: 1px solid var(--sz-border); border-top: 0; padding-inline-start: 18px; }
:root body #hrs-summary > .tp-stat:first-child { border-inline-start: 0; padding-inline-start: 2px; }
@media (max-width: 1180px) {
    :root body #hrs-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    :root body #hrs-summary > .tp-stat:nth-child(4n+1) { border-inline-start: 0; padding-inline-start: 2px; }
    :root body #hrs-summary > .tp-stat:nth-child(n+5) { border-top: 1px solid var(--sz-border); }
}
@media (max-width: 700px) {
    :root body #hrs-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    :root body #hrs-summary > .tp-stat:nth-child(n) { border-inline-start: 1px solid var(--sz-border); border-top: 0; padding-inline-start: 18px; }
    :root body #hrs-summary > .tp-stat:nth-child(2n+1) { border-inline-start: 0; padding-inline-start: 2px; }
    :root body #hrs-summary > .tp-stat:nth-child(n+3) { border-top: 1px solid var(--sz-border); }
}

/* The sheet itself works like the Lead Checker: a name box and formula bar on top, column
   letters and row numbers that light up for the selection, gridlines, one selected cell. */
:root body .hrs-table-card { margin-top: 16px; padding: 12px; overflow: hidden; }
:root body .hrs-fxrow { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
:root body .hrs-fxbar {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: stretch; min-height: 34px;
    background: var(--sz-surface); border: 1px solid var(--sz-border); border-radius: var(--sz-r-ctl);
}
:root body .hrs-fxbar:focus-within { border-color: var(--sz-accent); box-shadow: 0 0 0 3px var(--sz-accent-ring); }
:root body #hrs-namebox {
    flex: 0 0 96px; width: 96px; min-height: 0; height: auto; padding: 0 10px; margin: 0;
    border: 0 !important; border-inline-end: 1px solid var(--sz-border) !important; border-radius: var(--sz-r-ctl) 0 0 var(--sz-r-ctl);
    background: transparent !important; box-shadow: none !important; cursor: default;
    color: var(--sz-text-strong) !important; font: 650 13.5px var(--sz-font); text-align: center; font-variant-numeric: tabular-nums;
}
:root body .hrs-fx { display: flex; align-items: center; padding: 0 12px; border-inline-end: 1px solid var(--sz-border); color: var(--sz-text-faint); font: italic 600 14px var(--sz-font); user-select: none; }
:root body #hrs-fx {
    flex: 1 1 auto; min-width: 0; min-height: 0; height: auto; padding: 0 12px; margin: 0;
    border: 0 !important; border-radius: 0 var(--sz-r-ctl) var(--sz-r-ctl) 0;
    background: transparent !important; box-shadow: none !important; color: var(--sz-text) !important; font: 400 14px var(--sz-font);
}
:root body :is(#hrs-fx, #hrs-namebox):focus { outline: none; box-shadow: none !important; }
:root body #hrs-fx[readonly] { color: var(--sz-text-muted) !important; cursor: default; }
:root body .hrs-savestate { display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; font-size: 13px; font-weight: 560; color: var(--sz-text-muted); }
:root body .hrs-savestate:empty { display: none; }
:root body .hrs-savestate::before { font: var(--fa-font-solid); font-size: 11px; }
:root body .hrs-savestate.is-saving::before { content: "\f021"; color: var(--sz-accent-text); }
:root body .hrs-savestate.is-ok::before { content: "\f00c"; color: var(--sz-win); }
:root body .hrs-savestate.is-info::before { content: "\f05a"; color: var(--sz-text-faint); }
:root body .hrs-savestate.is-error { color: var(--sz-loss); }
:root body .hrs-savestate.is-error::before { content: "\f071"; }
:root body #hrs-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:root body #tab-hrsheet .hrs-table-scroll {
    max-height: calc(100vh - 170px); overflow: auto; overscroll-behavior: contain;
    background: var(--sz-surface); border: 1px solid var(--sz-border); border-radius: var(--sz-r-ctl);
}
:root body #tab-hrsheet .hrs-table-scroll:focus { outline: none; }
:root body #tab-hrsheet .hrs-table-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--sz-accent-ring); }
:root body .hrs-table {
    border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%;
    font: 400 13.5px/1.25 var(--sz-font); background: var(--sz-surface); user-select: none; -webkit-user-select: none;
}
:root body .hrs-table :is(th, td) { white-space: nowrap; border-right: 1px solid var(--sz-border); border-bottom: 1px solid var(--sz-border); }
:root body .hrs-table td {
    height: 28px; padding: 0 10px; box-sizing: border-box; text-align: end; vertical-align: middle;
    font-variant-numeric: tabular-nums; color: var(--sz-text); background-color: var(--sz-surface);
    overflow: hidden; text-overflow: ellipsis; cursor: cell;
}
/* a sheet marks the selected cell, not the hovered row */
@media (hover: hover) and (pointer: fine) { :root body .hrs-table tbody tr:hover > td { background-image: none; } }

/* three header rows pinned to the top: letters, column groups, column names */
:root body .hrs-table thead th { position: sticky; z-index: 3; padding: 0 10px; background-color: var(--sz-surface-2); }
:root body .hrs-table .hrs-letters th {
    top: 0; height: 22px; padding: 0; text-align: center; cursor: pointer;
    color: var(--sz-text-muted); font: 600 12px var(--sz-font); letter-spacing: 0; text-transform: none;
}
:root body .hrs-table .hrs-groups th {
    top: 22px; height: 24px; text-align: start;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--sz-text-strong);
}
:root body .hrs-table .hrs-cols th {
    top: 46px; height: 30px; text-align: start; background-color: var(--sz-surface);
    color: var(--sz-text-strong); font: 700 13px var(--sz-font); letter-spacing: 0; text-transform: none;
    border-bottom: 2px solid var(--sz-border-strong);
}
:root body .hrs-table .hrs-cols th.hrs-n { text-align: end; }
:root body .hrs-table .hrs-groups .hrs-gl { position: sticky; left: 416px; }
:root body .hrs-table .hrs-groups .hrs-c1 .hrs-gl { position: static; }

/* row numbers */
:root body .hrs-table .hrs-rn {
    position: sticky; left: 0; z-index: 3; width: 44px; min-width: 44px; max-width: 44px; padding: 0;
    background-color: var(--sz-surface-2); color: var(--sz-text-muted); font: 500 12px var(--sz-font);
    text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; letter-spacing: 0; text-transform: none;
}
:root body .hrs-table thead .hrs-rn { z-index: 6; }
:root body .hrs-table .hrs-group-row .hrs-rn { cursor: default; }
/* opaque: these headers are sticky and cells scroll underneath them */
:root body .hrs-table th.hrs-hi { background-color: color-mix(in srgb, var(--sz-accent) 16%, var(--sz-surface-2)); color: var(--sz-accent-text); font-weight: 700; }

/* Agent + Caller Name pinned after the row numbers */
:root body .hrs-table .hrs-c1 { position: sticky; left: 44px; z-index: 2; width: 210px; min-width: 210px; max-width: 210px; text-align: start; }
:root body .hrs-table .hrs-c2 { position: sticky; left: 254px; z-index: 2; width: 150px; min-width: 150px; max-width: 150px; text-align: start; box-shadow: inset -1px 0 0 var(--sz-border-strong); }
:root body .hrs-table thead :is(.hrs-c1, .hrs-c2) { z-index: 5; }
:root body .hrs-table :is(.hrs-groups .hrs-c1, .hrs-subtotal td.hrs-c1, .hrs-grand td.hrs-c1) { width: 360px; min-width: 360px; max-width: 360px; box-shadow: inset -1px 0 0 var(--sz-border-strong); }
:root body .hrs-table tbody td.hrs-c1 { color: var(--sz-text-strong); font-weight: 640; }
:root body .hrs-table .hrs-id { margin-inline-end: 7px; color: var(--sz-text-muted); font-weight: 500; font-size: 12px; }
/* a stronger line where a column group starts */
:root body .hrs-table .hrs-gs { box-shadow: inset 1px 0 0 var(--sz-border-strong); }
/* zeros recede; an agent with nothing in the range is muted as a whole */
:root body .hrs-table td.hrs-zero { color: var(--sz-text-faint); }
:root body .hrs-table tr.hrs-idle td:is(.hrs-c1, .hrs-c2) { color: var(--sz-text-muted); font-weight: 500; }
/* over the allowance */
:root body .hrs-table td.hrs-neg { color: var(--sz-loss); font-weight: 650; }
/* team band, subtotal, grand total */
:root body .hrs-table .hrs-group-row td { height: 30px; padding: 0 10px; text-align: start; background-color: var(--sz-surface-2); cursor: default; overflow: visible; }   /* visible: its sticky label measures from the sheet, not the cell */
:root body .hrs-table .hrs-group-label { position: sticky; left: 54px; display: inline-flex; align-items: baseline; gap: 8px; color: var(--sz-text-strong); font-weight: 720; }
:root body .hrs-table .hrs-group-label > i { color: var(--sz-accent-text); }
:root body .hrs-table .hrs-count { color: var(--sz-text-muted); font-weight: 500; font-size: 12px; }
:root body .hrs-table .hrs-subtotal td { background-color: color-mix(in srgb, var(--sz-accent) 5%, var(--sz-surface)); font-weight: 680; }
:root body .hrs-table .hrs-grand td { background-color: var(--sz-surface-2); font-weight: 800; color: var(--sz-text-strong); border-top: 2px solid var(--sz-text-strong); }
:root body .hrs-table .hrs-grand td.hrs-neg { color: var(--sz-loss); }
/* the selection */
:root body .hrs-table td.hrs-rng { background-image: linear-gradient(color-mix(in srgb, var(--sz-accent) 12%, transparent), color-mix(in srgb, var(--sz-accent) 12%, transparent)); }
:root body .hrs-table td.hrs-sel { outline: 2px solid var(--sz-accent); outline-offset: -2px; }
/* in-cell editor (admins): the value saved as an override for the shown range */
:root body .hrs-table td.hrs-editing { padding: 0; outline: none; }
:root body #hrs-table .hrs-editor {
    display: block; width: 100%; height: 28px; min-height: 0; box-sizing: border-box; margin: 0; padding: 0 8px;
    border: 2px solid var(--sz-accent) !important; border-radius: 0; background: var(--sz-surface) !important; box-shadow: var(--sz-shadow-pop) !important;
    color: var(--sz-text-strong) !important; font: 400 13.5px var(--sz-font); text-align: end; outline: none;
    user-select: text; -webkit-user-select: text;
}
/* an overridden cell carries an amber dot */
:root body .hrs-table td.hrs-ovr { position: relative; }
:root body .hrs-table td.hrs-ovr::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--sz-draw); }
/* states */
:root body .hrs-table td.hrs-empty { height: auto; padding: 28px 16px; text-align: center; color: var(--sz-text-muted); font-size: 14px; background-color: var(--sz-surface); cursor: default; }
:root body .hrs-table td.hrs-empty .btn { margin-inline-start: 8px; }
@media (max-width: 600px) {
    /* phones: only the Agent column stays pinned, narrower */
    :root body .hrs-table .hrs-c1 { width: 150px; min-width: 150px; max-width: 150px; }
    :root body .hrs-table .hrs-c2 { position: static; box-shadow: none; }
    :root body .hrs-table :is(.hrs-groups .hrs-c1, .hrs-subtotal td.hrs-c1, .hrs-grand td.hrs-c1) { width: 300px; min-width: 300px; max-width: 300px; box-shadow: none; }
    :root body .hrs-meta { margin-inline-start: 0; flex-basis: 100%; padding-bottom: 0; }
    :root body .hrs-table .hrs-groups .hrs-gl { left: 206px; }
    :root body .hrs-table-card { padding: 8px; }
    :root body .hrs-fxrow { flex-wrap: wrap; }
    :root body #hrs-namebox { flex-basis: 70px; width: 70px; }
}

/* ---- Task desk: Dashboard task list + task view, project page, task popup -----------------
   One row anatomy everywhere (.tk-row): the title over one muted line | chips | due | actions.
   The due cell carries the meaning: late reads in loss red, due within two days in amber.
   Markup: dashboard.php (#tasks-all-view, #admin-task-edit-view), dashboard.js taskRowHtml,
   project_details.php / project_details.js; date and chip helpers in utils.js. */

/* filter bar: a plain row (no card) */
:root body #tasks-all-view .tk-filters {
    display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 12px;
    background: transparent; border: 0; padding: 0; margin: 0 0 16px; box-shadow: none;
}
:root body .tk-search { position: relative; display: flex; align-items: center; flex: 1 1 320px; min-width: 0; margin: 0; }
:root body .tk-search > i { position: absolute; inset-inline-start: 14px; font-size: 14px; color: var(--sz-text-faint); pointer-events: none; }
:root body .tk-filters .tk-search input { width: 100%; min-height: var(--sz-ctl-h); padding-inline-start: 40px; }
:root body .tk-filters > :is(.custom-dropdown, .sz-dd, select) { flex: 0 0 auto; width: 260px; max-width: 100%; }
/* style.css stacks .task-filters-new on narrow screens (column !important): no flex-basis may turn into a height */
@media (max-width: 760px) { :root body #tasks-all-view .tk-filters > * { flex: 0 0 auto; width: 100%; } }

/* project groups */
:root body .project-task-list { display: flex; flex-direction: column; gap: 12px; }
:root body .tk-group { background: var(--sz-surface); border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel); overflow: hidden; }
:root body .tk-group-h { margin: 0; font: inherit; }
:root body .tk-group-head {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 16px;
    border: 0; border-bottom: 1px solid var(--sz-border); border-radius: 0; background: transparent; box-shadow: none;
    color: var(--sz-text-strong); font-family: var(--sz-font); text-align: start; cursor: pointer;
    transition: background-color var(--sz-t-1) ease;
}
:root body .tk-group.is-collapsed .tk-group-head { border-bottom-color: transparent; }
@media (hover: hover) and (pointer: fine) { :root body .tk-group-head:hover { background: var(--sz-surface-2); } }
:root body .tk-group-name { font-size: var(--sz-fs-lg); font-weight: 720; font-stretch: var(--sz-stretch-head); letter-spacing: -0.005em; }
:root body .tk-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 8px;
    border-radius: var(--sz-r-pill); background: var(--sz-accent-soft); color: var(--sz-accent-text);
    font-size: 12.5px; font-weight: 760; font-stretch: var(--sz-stretch-fig);
}
:root body .tk-caret { margin-inline-start: auto; font-size: 13px; color: var(--sz-text-muted); transition: transform var(--sz-t-2) var(--sz-ease); }
:root body .tk-group.is-collapsed .tk-caret { transform: rotate(-90deg); }
html[dir="rtl"] body .tk-group.is-collapsed .tk-caret { transform: rotate(90deg); }
:root body .tk-group.is-collapsed .tk-list { display: none; }

/* the row */
:root body .tk-list { display: block; }
:root body .tk-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto 104px auto; align-items: center; gap: 8px 20px;
    padding: 12px 16px; color: var(--sz-text); cursor: pointer;
    transition: background-color var(--sz-t-1) ease;
}
:root body .tk-row + .tk-row { border-top: 1px solid var(--sz-border); }
@media (hover: hover) and (pointer: fine) { :root body .tk-row:hover { background: var(--sz-accent-tint); } }
:root body .tk-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
:root body .tk-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
:root body .tk-open {
    min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 4px; background: none; box-shadow: none;
    font-family: var(--sz-font); font-size: 15px; font-weight: 660; line-height: 1.35; color: var(--sz-text-strong);
    text-align: start; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
:root body .tk-open:focus-visible { outline: 2px solid var(--sz-accent); outline-offset: 2px; }
:root body .tk-sub { display: flex; align-items: center; gap: 16px; min-width: 0; font-size: 13.5px; line-height: 1.4; color: var(--sz-text-muted); }
:root body .tk-desc { flex: 0 1 auto; min-width: 0; max-width: 64ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root body :is(.tk-who, .tk-ms) { display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap; }
:root body :is(.tk-who, .tk-ms) > i { font-size: 11px; color: var(--sz-text-faint); }
:root body .tk-who.is-none { color: var(--sz-text-faint); }
:root body .tk-tags { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
:root body .tk-due { display: flex; flex-direction: column; align-items: flex-end; text-align: end; line-height: 1.3; }
:root body .tk-due-date { font-size: 14px; font-weight: 620; color: var(--sz-text-strong); white-space: nowrap; }
:root body .tk-due-rel { font-size: 12.5px; color: var(--sz-text-muted); white-space: nowrap; }
:root body :is(.tk-due.is-late .tk-due-rel, .tk-due-rel.is-late) { color: var(--sz-loss); font-weight: 640; }
:root body :is(.tk-due.is-soon .tk-due-rel, .tk-due-rel.is-soon) { color: var(--sz-draw); font-weight: 640; }
:root body .tk-due.is-none .tk-due-date { font-weight: 500; color: var(--sz-text-faint); }
:root body .tk-actions { display: flex; align-items: center; gap: 6px; }
/* dashboard.css paints Assign as a blue text link with !important; here it is the secondary button */
:root body .tk-actions .btn.assign-task-btn { background-color: var(--sz-surface) !important; color: var(--sz-text) !important; }
html.dark-mode body .tk-actions .btn.assign-task-btn { background-color: var(--sz-surface-3) !important; }
@media (hover: hover) and (pointer: fine) { :root body .tk-actions .btn.assign-task-btn:hover { background-color: var(--sz-surface-3) !important; color: var(--sz-text-strong) !important; } }

/* stacked rows: the "Blocks" layout (Appearance setting) as cards, and every list on narrow screens */
:root body .tk-list.blocks-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 12px; }
:root body .tk-list.blocks-view .tk-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main main" "tags due" "actions actions";
    padding: 14px; border: 1px solid var(--sz-border); border-radius: var(--sz-r-ctl);
}
:root body .tk-list.blocks-view .tk-row + .tk-row { border-top: 1px solid var(--sz-border); }
:root body .tk-list.blocks-view .tk-row > .tk-main { grid-area: main; }
:root body .tk-list.blocks-view .tk-row > .tk-tags { grid-area: tags; justify-content: flex-start; }
:root body .tk-list.blocks-view .tk-row > .tk-due { grid-area: due; }
:root body .tk-list.blocks-view .tk-row > .tk-actions { grid-area: actions; }
:root body .tk-list.blocks-view .tk-sub { flex-wrap: wrap; gap: 2px 12px; }
:root body .tk-list.blocks-view .tk-desc { flex-basis: 100%; }
@media (max-width: 760px) {
    :root body .tk-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main due" "tags actions"; gap: 10px 12px; }
    :root body .tk-row > .tk-main { grid-area: main; }
    :root body .tk-row > .tk-tags { grid-area: tags; justify-content: flex-start; }
    :root body .tk-row > .tk-due { grid-area: due; }
    :root body .tk-row > .tk-actions { grid-area: actions; justify-content: flex-end; }
    :root body .tk-sub { flex-wrap: wrap; gap: 2px 12px; }
    :root body .tk-desc { flex-basis: 100%; }
}

/* ---- Task view (Dashboard → a task) ---- */
:root body .tk-view-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
:root body .tk-back { margin-inline-start: -10px; padding-inline: 10px 14px; }
:root body .tk-view-actions { display: flex; flex-wrap: wrap; gap: 8px; }
:root body .tk-sheet { position: relative; background: var(--sz-surface); border: 1px solid var(--sz-border); border-radius: var(--sz-r-panel); color: var(--sz-text); }
:root body .tk-sheet-head { display: flex; flex-direction: column; gap: 10px; padding: 24px 24px 20px; border-bottom: 1px solid var(--sz-border); }
:root body .tk-sheet-title {
    margin: 0; font-size: var(--sz-fs-2xl); font-weight: 790; font-stretch: var(--sz-stretch-head);
    line-height: 1.2; letter-spacing: -0.01em; color: var(--sz-text-strong); overflow-wrap: anywhere;
}
:root body .tk-sheet-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
:root body .tk-sheet-meta:empty { display: none; }
:root body .tk-meta-proj { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 4px; font-size: 13.5px; color: var(--sz-text-muted); }
:root body .tk-meta-proj > i { font-size: 12px; color: var(--sz-text-faint); }
:root body .tk-lead { margin: 2px 0 0; max-width: 75ch; font-size: 15.5px; line-height: 1.55; color: var(--sz-text); white-space: pre-line; overflow-wrap: anywhere; }
:root body .tk-lead.is-empty { display: none; }
:root body .tk-sheet-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
:root body .tk-sheet-main { min-width: 0; padding: 4px 24px 12px; }
:root body .tk-sheet-side { min-width: 0; padding: 20px 24px 24px; border-inline-start: 1px solid var(--sz-border); }
:root body .tk-sec { padding: 18px 0; }
:root body .tk-sec + .tk-sec { border-top: 1px solid var(--sz-border); }
:root body .tk-sec-title {
    display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px;
    font-family: var(--sz-font); font-size: var(--sz-fs-md); font-weight: 700; font-stretch: var(--sz-stretch-head); color: var(--sz-text-strong);
}
:root body .tk-sec-title label { margin: 0; font: inherit; color: inherit; cursor: default; }
:root body .tk-sec-count { font-size: 13px; font-weight: 520; font-stretch: 100%; color: var(--sz-text-muted); }
:root body .tk-prose { margin: 0; max-width: 75ch; line-height: 1.6; color: var(--sz-text); white-space: pre-wrap; overflow-wrap: anywhere; }
:root body .tk-prose.is-empty { color: var(--sz-text-faint); }
:root body .tk-empty { margin: 0; padding: 4px 0; list-style: none; font-size: 14px; color: var(--sz-text-faint); }

/* subtasks, milestones, attachments */
:root body .tk-items { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
:root body .tk-item { display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 0; padding: 6px 0; background: none; border: 0; border-radius: 0; color: var(--sz-text); }
:root body .tk-item + .tk-item { border-top: 1px solid var(--sz-border); }
:root body .tk-item-mark { flex: none; width: 16px; font-size: 15px; text-align: center; color: var(--sz-text-faint); }
:root body .tk-item.is-done .tk-item-mark { color: var(--sz-win); }
:root body .tk-item.is-done .tk-item-text { color: var(--sz-text-muted); }
:root body .tk-item-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
:root body .tk-item-sub { display: block; font-size: 12.5px; color: var(--sz-text-muted); }
:root body a.tk-file { color: var(--sz-accent-text); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { :root body a.tk-file:hover { text-decoration: underline; } }
:root body .tk-item input[type="text"] { flex: 1; min-width: 0; min-height: var(--sz-ctl-h-sm); }
:root body .tk-item input[type="checkbox"] { flex: none; }
:root body #admin-task-edit-view .tk-remove {
    flex: none; width: 32px; min-height: 32px; padding: 0; justify-content: center; font-size: 14px; color: var(--sz-text-faint); background: transparent; border-color: transparent;
}
:root body #admin-task-edit-view .tk-remove > i { font-size: 14px; }
@media (hover: hover) and (pointer: fine) {
    :root body #admin-task-edit-view .tk-remove:hover:not(:disabled) { color: var(--sz-loss); background: var(--sz-loss-soft); }
}
:root body .tk-adder { display: flex; gap: 8px; margin-top: 10px; }
:root body .tk-adder input { flex: 1; min-width: 0; }
:root body .tk-adder input[type="file"] { align-self: center; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; font-size: 13.5px; color: var(--sz-text-muted); }
:root body .tk-adder input[type="file"]::file-selector-button {
    height: 34px; margin-inline-end: 10px; padding: 0 12px; border: 1px solid var(--sz-border-strong); border-radius: var(--sz-r-ctl);
    background: var(--sz-surface-3); color: var(--sz-text); font: inherit; font-weight: 620; cursor: pointer;
}
/* text fields in the ticket and the popup carry their own inset (the old .form-group rule gave it before) */
:root body :is(.tk-sheet, .tk-pop) :is(input[type="text"], input[type="date"], input[type="number"], textarea) { padding-inline: 12px; }
:root body :is(.tk-sheet, .tk-pop) textarea { padding-block: 8px; line-height: 1.5; }
:root body .pd-desc textarea { padding: 8px 12px; line-height: 1.5; }
:root body .pd-panel .tk-item { font-size: 14.5px; }

/* summary facts */
:root body .tk-facts { display: flex; flex-direction: column; margin: 0; }
:root body .tk-fact { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 10px 0; }
:root body .tk-fact + .tk-fact { border-top: 1px solid var(--sz-border); }
:root body .tk-fact dt { margin: 0; }
:root body .tk-fact dt label { margin: 0; font-size: 13px; font-weight: 640; color: var(--sz-text-muted); cursor: default; }
:root body .tk-fact dd { min-width: 0; margin: 0; font-weight: 560; color: var(--sz-text-strong); overflow-wrap: anywhere; }
:root body .tk-fact dd > .is-empty { font-weight: 500; color: var(--sz-text-faint); }
:root body .tk-fact-sub { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; color: var(--sz-text-muted); }
:root body .tk-work { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--sz-border); }
:root body .tk-work[hidden] { display: none; }
:root body .tk-work-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
:root body .tk-work-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
:root body .tk-work-name { flex: 1; min-width: 0; font-weight: 560; color: var(--sz-text-strong); }
:root body .tk-work-time { font-size: 13px; color: var(--sz-text-muted); font-variant-numeric: tabular-nums; }

/* edit mode: labels appear, fields take the full width, facts stack */
:root body .tk-edit-label { display: none; margin: 0; font-size: 13px; font-weight: 640; color: var(--sz-text-muted); }
:root body .tk-sheet.is-editing .tk-edit-label { display: block; }
:root body .tk-sheet.is-editing .tk-sheet-head { gap: 6px; }
:root body .tk-sheet.is-editing .tk-sheet-meta { display: none; }
:root body .tk-sheet .edit-field { width: 100%; box-sizing: border-box; }
:root body .tk-sheet textarea.edit-field { min-height: 64px; resize: vertical; }
:root body #tk-f-name { min-height: 44px; margin-bottom: 8px; font-size: 17px; font-weight: 660; }
:root body .tk-sheet.is-editing .tk-fact { grid-template-columns: 1fr; gap: 6px; align-items: stretch; }

/* loading: the ticket's shape with blank values; failure: the reason in its place */
:root body .tk-sheet.is-loading :is(.tk-sheet-title, .tk-prose, .tk-fact dd > [data-field]) { display: block; height: 14px; border-radius: 6px; background: var(--sz-skel); }
:root body .tk-sheet.is-loading .tk-sheet-title { width: 45%; height: 28px; }
:root body .tk-sheet.is-loading .tk-prose { width: 70%; }
:root body .tk-sheet.is-loading .tk-fact dd > [data-field] { width: 60%; }
:root body .tk-load-error { display: flex; align-items: flex-start; gap: 12px; margin: 16px 24px 0; padding: 12px 14px; border-radius: var(--sz-r-ctl); background: var(--sz-loss-soft); color: var(--sz-loss); }
:root body .tk-load-error p { margin: 2px 0 0; color: var(--sz-text); }

@media (max-width: 1100px) {
    :root body .tk-sheet-grid { grid-template-columns: minmax(0, 1fr); }
    :root body .tk-sheet-side { order: -1; border-inline-start: 0; border-bottom: 1px solid var(--sz-border); }
}
@media (max-width: 600px) {
    :root body :is(.tk-sheet-head, .tk-sheet-side, .tk-sheet-main) { padding-inline: 16px; }
    :root body .tk-sheet-title { font-size: var(--sz-fs-xl); }
    :root body .tk-load-error { margin-inline: 16px; }
}

/* ---- Project page (project_details.php) ---- */
:root body .pd-head { flex-direction: column; align-items: flex-start; gap: 8px; }
:root body .pd-title-row { display: flex; align-items: center; gap: 10px; }
:root body .pd-title-row h1 { margin: 0; }
:root body .pd-desc { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; max-width: 75ch; }
:root body .pd-desc-text { margin: 0; line-height: 1.55; color: var(--sz-text); white-space: pre-line; overflow-wrap: anywhere; }
:root body .pd-desc-text:empty { display: none; }
:root body .pd-desc textarea { width: 100%; box-sizing: border-box; resize: vertical; }
:root body .pd-desc-actions { display: flex; gap: 8px; }
:root body .pd-desc-actions .btn-ghost { margin-inline-start: -10px; padding-inline: 10px 12px; }
:root body .pd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 16px; }
:root body .pd-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
:root body .card.pd-panel { padding: 0; margin: 0; overflow: hidden; }
:root body .card .pd-panel-title {
    display: flex; align-items: baseline; gap: 8px; margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--sz-border);
    font-size: var(--sz-fs-lg); font-weight: 720; font-stretch: var(--sz-stretch-head); color: var(--sz-text-strong);
}
/* every panel body sits 16px in from the panel edge, like the title above it */
:root body .pd-panel-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
:root body .pd-panel > .tk-empty { padding: 14px 16px 16px; }
:root body .pd-panel > .tk-items { padding: 4px 16px 8px; }
:root body .pd-tasks .tk-row { grid-template-columns: minmax(0, 1fr) auto 104px 34px; }
:root body .pd-label { display: block; margin: 0; font-size: 13px; font-weight: 640; color: var(--sz-text-muted); }
:root body .pd-manager-row { display: flex; gap: 8px; margin: 0; }
:root body .pd-manager-row > :is(select, .sz-dd, .custom-dropdown) { flex: 1; min-width: 0; }
:root body .pd-status { margin: 2px 0 0; font-size: 13px; color: var(--sz-win); }
:root body .pd-status:empty { display: none; }
@media (max-width: 1000px) { :root body .pd-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { :root body .pd-tasks .tk-row { grid-template-columns: minmax(0, 1fr) auto; } }

/* ---- Task Details popup (project page) ---- */
:root body .tk-pop { width: min(640px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); overflow-y: auto; padding: 24px; text-align: start; }
:root body .tk-pop h3 { margin: 0 40px 10px 0; font-size: 1.25rem; overflow-wrap: anywhere; }
:root body .tk-pop-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; color: var(--sz-text-muted); }
:root body .tk-pop-meta strong { font-weight: 620; color: var(--sz-text-strong); }
:root body .tk-pop-h { margin: 22px 0 8px; font-size: 14px; font-weight: 700; font-stretch: var(--sz-stretch-head); color: var(--sz-text-strong); }
:root body .tk-pop-scroll { max-height: 200px; overflow-y: auto; }
:root body .tk-pop .tk-prose { font-size: 14.5px; }
:root body .tk-code {
    margin: 8px 0 0; padding: 10px 12px; border: 1px solid var(--sz-border); border-radius: var(--sz-r-ctl); background: var(--sz-surface-2);
    font-family: var(--sz-font-mono); font-size: 13px; line-height: 1.5; color: var(--sz-text); white-space: pre-wrap; overflow-wrap: anywhere;
}
:root body .tk-pop a { color: var(--sz-accent-text); }
:root body .tk-grade { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--sz-border); }
:root body .tk-grade label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 640; color: var(--sz-text-muted); }
:root body .tk-grade-row { display: flex; align-items: center; gap: 10px; }
:root body .tk-grade-row input { width: 120px; }
:root body .tk-grade-of { font-size: 14px; color: var(--sz-text-muted); }
:root body .tk-field-error { margin: 6px 0 0; font-size: 13px; color: var(--sz-loss); }
:root body .tk-pop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---- A chart with nothing to show says so: Company Approval (company_admin.js chartEmpty) and the
   client Performance Report (client_performance.php) ---- */
:root body :is(.chart-wrapper, .cp-chart-box) .chart-empty {
    display: flex; align-items: center; justify-content: center; min-height: 160px; height: 100%; margin: 0; padding: 0 16px;
    text-align: center; font-size: 14px; line-height: 1.5; color: var(--sz-text-muted);
}
:root body :is(.chart-wrapper, .cp-chart-box) .chart-empty[hidden] { display: none; }

/* ---- Client application dialog (Approvals + Company Admin; signup_applications.js) ----------
   Fixed header (who applied) and footer (Close / Approve); the answers scroll between them,
   grouped by topic. Short answers sit beside their question, long ones under it. */
:root body #signup-apps-grid h4 .sz-chip { margin-inline-start: 6px; vertical-align: middle; }
:root body .modal-overlay > .modal-content.su-dialog { display: flex; flex-direction: column; max-width: 680px; padding: 0; overflow: hidden; }
:root body .su-head { flex: none; margin: 0; padding: 20px 24px 16px; border-bottom: 1px solid var(--sz-border); }
:root body .su-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
:root body .su-kicker { margin: 0; font-size: 13px; font-weight: 600; color: var(--sz-text-muted); }
:root body .modal-overlay .su-head h3 { display: block; font-size: 1.3rem; font-weight: 780; font-stretch: var(--sz-stretch-head); overflow-wrap: anywhere; }
:root body .su-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 6px 0 0; font-size: 13.5px; color: var(--sz-text-muted); }
:root body .su-meta:empty { display: none; }
:root body .su-meta > span:not(.sz-chip) { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
:root body .su-meta > span > i { font-size: 12px; color: var(--sz-text-faint); }
:root body .su-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px 8px; }
:root body .su-group { padding: 14px 0 6px; }
:root body .su-group + .su-group { border-top: 1px solid var(--sz-border); }
:root body .su-group-title { margin: 0 0 4px; font-size: var(--sz-fs-md); font-weight: 720; font-stretch: var(--sz-stretch-head); color: var(--sz-text-strong); }
:root body .su-ans { margin: 0; }
:root body .su-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 20px; padding: 9px 0; }
:root body .su-row + .su-row { border-top: 1px solid var(--sz-border); }
:root body .su-row dt { margin: 0; font-size: 14px; line-height: 1.45; color: var(--sz-text-muted); }
:root body .su-row dd { margin: 0; max-width: 32ch; font-size: 14.5px; font-weight: 620; line-height: 1.45; text-align: end; color: var(--sz-text-strong); overflow-wrap: anywhere; }
:root body .su-row.is-long { grid-template-columns: minmax(0, 1fr); }
:root body .su-row.is-long dd { max-width: 70ch; font-weight: 520; text-align: start; white-space: pre-line; }
/* a follow-up hangs off the question above it */
:root body .su-row.is-sub { border-top: 0; padding-top: 2px; padding-inline-start: 14px; position: relative; }
:root body .su-row.is-sub::before { content: ""; position: absolute; inset-inline-start: 2px; top: 4px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--sz-border-strong); }
:root body .su-empty { margin: 16px 0; color: var(--sz-text-faint); }
:root body .modal-overlay .su-foot { flex: none; margin: 0; padding: 14px 24px; border-top: 1px solid var(--sz-border); background: var(--sz-surface); }
/* style.css stacks dialog buttons full width under 768px; Close + Approve fit side by side */
@media (max-width: 767px) { :root body .modal-overlay .su-foot > * { flex: 1 1 0; } }
@media (max-width: 600px) {
    :root body :is(.su-head, .su-body, .modal-overlay .su-foot) { padding-inline: 16px; }
    :root body .su-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    :root body .su-row dd { max-width: none; text-align: start; }
}
