/* =====================================================================
   Attendance — admin design system
   A ClickUp-flavoured workspace: fixed sidebar hierarchy, dense data
   surfaces, status pills, and a right-hand slide-out for detail work.
   ===================================================================== */

:root {
    --purple:        #7B68EE;
    --purple-dark:   #6552d8;
    --purple-soft:   #f0edff;
    --pink:          #FD71AF;
    --blue:          #49CCF9;
    --green:         #2ECC71;
    --amber:         #FFC53D;
    --red:           #E5484D;

    --ink:           #1a1f36;
    --ink-2:         #4a5568;
    --ink-3:         #7c8698;
    --ink-4:         #a3aab8;

    --bg:            #f7f8fa;
    --surface:       #ffffff;
    --surface-2:     #fbfbfd;
    --sidebar:       #1f2233;
    --sidebar-hover: #2b2f45;

    --line:          #e6e8ee;
    --line-2:        #eef0f4;

    --radius:        8px;
    --radius-lg:     12px;
    --shadow-sm:     0 1px 2px rgba(20, 25, 50, .06);
    --shadow:        0 4px 14px rgba(20, 25, 50, .10);
    --shadow-lg:     0 12px 40px rgba(20, 25, 50, .16);

    --sidebar-w:     248px;
    --header-h:      56px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout shell --------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--sidebar);
    color: #cdd2e0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.sidebar__logo {
    width: 28px; height: 28px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    display: grid; place-items: center;
    font-size: 14px;
    flex: 0 0 auto;
}

.sidebar__section {
    padding: 14px 12px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6f7791;
    font-weight: 600;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin: 1px 8px;
    border-radius: 6px;
    color: #cdd2e0;
    font-weight: 500;
    transition: background .12s, color .12s;
}
.sidebar__link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.sidebar__link.is-active { background: var(--purple); color: #fff; }
.sidebar__link .count {
    margin-left: auto;
    background: rgba(255,255,255,.14);
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
}
.sidebar__link.is-active .count { background: rgba(0,0,0,.22); }

/* Hierarchy tree: Organization > Region > Department */
.tree { padding: 2px 8px 16px; }
.tree__node {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px 5px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #aab1c6;
    cursor: default;
}
.tree__node:hover { background: var(--sidebar-hover); }
.tree__node--child { padding-left: 28px; font-size: 12.5px; }
.tree__dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }

.sidebar__foot {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex; align-items: center; gap: 10px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* --- Header --------------------------------------------------------- */

.header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.header__title { font-size: 16px; font-weight: 650; margin: 0; }
.header__spacer { flex: 1; }

.viewtabs { display: flex; gap: 2px; background: var(--bg); padding: 3px; border-radius: 8px; }
.viewtabs a {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 550;
    color: var(--ink-2);
}
.viewtabs a:hover { background: rgba(0,0,0,.04); text-decoration: none; }
.viewtabs a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.content { padding: 20px; flex: 1; }

/* --- Buttons -------------------------------------------------------- */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 6px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 550;
    font-family: inherit;
    cursor: pointer;
    transition: background .12s, border-color .12s, box-shadow .12s;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: #d6dae4; text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.btn--primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); }

.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: rgba(0,0,0,.05); }

.btn--danger { color: var(--red); border-color: #f3c6c8; }
.btn--danger:hover { background: #fdf2f2; }

.btn--sm { padding: 4px 9px; font-size: 12px; }

.icon-btn {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 6px;
    border: none; background: transparent;
    cursor: pointer; color: var(--ink-2);
    position: relative;
}
.icon-btn:hover { background: rgba(0,0,0,.05); }

.badge-dot {
    position: absolute; top: 5px; right: 5px;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    background: var(--red); color: #fff;
    border-radius: 10px;
    font-size: 10px; font-weight: 700;
    display: grid; place-items: center;
    border: 2px solid var(--surface);
}

/* --- Widgets / cards ------------------------------------------------ */

.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--split { grid-template-columns: 1.35fr 1fr; align-items: start; }

@media (max-width: 1100px) { .grid--split { grid-template-columns: 1fr; } }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card__head {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-2);
}
.card__title { font-size: 13.5px; font-weight: 650; margin: 0; }
.card__sub { font-size: 12px; color: var(--ink-3); }
.card__body { padding: 16px; }
.card__body--flush { padding: 0; }

.stat { padding: 16px; }
.stat__label {
    font-size: 11.5px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .05em; color: var(--ink-3);
    display: flex; align-items: center; gap: 6px;
}
.stat__value { font-size: 27px; font-weight: 700; line-height: 1.15; margin-top: 6px; }
.stat__meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.stat--accent .stat__value { color: var(--purple); }
.stat--warn .stat__value { color: var(--amber); }
.stat--danger .stat__value { color: var(--red); }
.stat--good .stat__value { color: var(--green); }

/* Donut for the attendance-rate widget */
.donut { display: flex; align-items: center; gap: 18px; }
.donut__ring {
    width: 108px; height: 108px; border-radius: 50%;
    display: grid; place-items: center;
    flex: 0 0 auto;
    position: relative;
}
.donut__hole {
    width: 78px; height: 78px; background: var(--surface);
    border-radius: 50%;
    display: grid; place-items: center;
    text-align: center;
}
.donut__pct { font-size: 20px; font-weight: 700; line-height: 1; }
.donut__cap { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.legend { display: grid; gap: 7px; font-size: 12.5px; }
.legend__row { display: flex; align-items: center; gap: 8px; }
.legend__swatch { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.legend__value { margin-left: auto; font-weight: 650; }

/* Sparkline bars for the 14-day trend */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.spark__bar {
    flex: 1; min-width: 4px;
    background: var(--purple-soft);
    border-radius: 3px 3px 0 0;
    position: relative;
    transition: background .12s;
}
.spark__bar > span { display: block; background: var(--purple); border-radius: 3px 3px 0 0; width: 100%; }
.spark__bar:hover { background: #e2ddff; }
.spark__bar.is-weekend { opacity: .45; }
.spark__axis { display: flex; gap: 3px; margin-top: 6px; font-size: 10px; color: var(--ink-4); }
.spark__axis span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }

/* --- Pills / status ------------------------------------------------- */

.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--line-2);
    color: var(--ink-2);
}
.pill::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex: 0 0 auto;
}
.pill--none::before { display: none; }

.pill--green  { background: #e7f8ee; color: #14804a; }
.pill--amber  { background: #fff5e0; color: #9a6700; }
.pill--red    { background: #fdeced; color: #b42318; }
.pill--blue   { background: #e6f4fd; color: #0d5c8a; }
.pill--purple { background: var(--purple-soft); color: #5b46c9; }
.pill--grey   { background: #f0f1f5; color: var(--ink-2); }

/* --- Tables --------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table.grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.grid-table th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--ink-3);
    font-weight: 600;
    padding: 9px 12px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 2;
    white-space: nowrap;
}
.grid-table td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}
.grid-table tbody tr:hover { background: #fafaff; }
.grid-table tbody tr.is-flagged { background: #fffaf0; }
.grid-table tbody tr.is-flagged:hover { background: #fff5e6; }

.cell-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Inline-editable cell: click to turn into an input */
.editable { cursor: text; border-radius: 4px; padding: 3px 6px; margin: -3px -6px; display: inline-block; }
.editable:hover { background: var(--purple-soft); box-shadow: inset 0 0 0 1px #d9d2ff; }
.editable.is-editing { background: #fff; box-shadow: inset 0 0 0 2px var(--purple); }
.editable input {
    border: none; outline: none; background: transparent;
    font: inherit; color: inherit; width: 100%; min-width: 90px;
}
.cell-saving { opacity: .5; }
.cell-saved { animation: flash-ok .9s ease-out; }
@keyframes flash-ok {
    from { background: #d6f5e3; }
    to   { background: transparent; }
}

/* --- Person chip ---------------------------------------------------- */

.person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--purple-soft); color: #5b46c9;
    display: grid; place-items: center;
    font-size: 11.5px; font-weight: 700;
    flex: 0 0 auto; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 46px; height: 46px; font-size: 16px; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.person__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__meta { font-size: 11.5px; color: var(--ink-3); }

/* --- Exceptions feed ------------------------------------------------ */

.feed { max-height: 520px; overflow-y: auto; }
.feed__item {
    display: flex; gap: 11px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-2);
    position: relative;
}
.feed__item:hover { background: var(--surface-2); }
.feed__item::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.feed__item--warning::before  { background: var(--amber); }
.feed__item--critical::before { background: var(--red); }
.feed__item--info::before     { background: var(--blue); }

.feed__body { flex: 1; min-width: 0; }
.feed__title { font-weight: 600; font-size: 13px; }
.feed__meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.feed__actions { display: flex; gap: 5px; margin-top: 8px; opacity: 0; transition: opacity .12s; }
.feed__item:hover .feed__actions { opacity: 1; }
.feed__actions .btn { padding: 3px 9px; font-size: 12px; }

/* --- Board (Kanban) ------------------------------------------------- */

.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.board__col {
    flex: 0 0 290px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    display: flex; flex-direction: column;
    max-height: calc(100vh - 190px);
}
.board__head {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 13px;
    border-bottom: 1px solid var(--line-2);
    font-size: 12.5px; font-weight: 650;
}
.board__head .count {
    background: var(--line-2); color: var(--ink-2);
    border-radius: 20px; padding: 1px 7px; font-size: 11px;
}
.board__items { padding: 9px; overflow-y: auto; display: grid; gap: 8px; flex: 1; min-height: 60px; }
.board__col.is-drop-target { outline: 2px dashed var(--purple); outline-offset: -3px; }

.kcard {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 11px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: box-shadow .12s, transform .12s;
}
.kcard:hover { box-shadow: var(--shadow); }
.kcard.is-dragging { opacity: .45; cursor: grabbing; }
.kcard__top { display: flex; align-items: center; gap: 9px; }
.kcard__meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }

/* --- Map ------------------------------------------------------------ */

/*
 * The map must own its stacking, or it climbs over the interface.
 *
 * Leaflet gives its internal panes z-index 400-700 and its controls 800-1000.
 * Those are positioned descendants, so without a stacking context on the
 * container they compete directly with the page's own layers — and beat the
 * slide-out panel (100), the header (40) and the sidebar. The visible symptom
 * is a panel that opens *underneath* the map.
 *
 * `isolation: isolate` confines all of that to the map element; the z-index:0
 * is the fallback for browsers that would otherwise not create the context.
 */
.map {
    height: 460px;
    width: 100%;
    border-radius: var(--radius);
    background: #eceff4;
    position: relative;
    z-index: 0;
    isolation: isolate;
}
.map--tall { height: calc(100vh - 132px); border-radius: 0; }

.leaflet-container {
    font-family: var(--font);
    font-size: 12px;
    position: relative;
    z-index: 0;
    isolation: isolate;
}

.marker-pin {
    width: 28px; height: 28px; border-radius: 50% 50% 50% 2px;
    transform: rotate(-45deg);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    display: grid; place-items: center;
}
.marker-pin span {
    transform: rotate(45deg);
    color: #fff; font-size: 10px; font-weight: 700;
}
.marker-pin.is-stale { opacity: .5; }

/* --- Slide-out panel ------------------------------------------------ */

.overlay {
    position: fixed; inset: 0;
    background: rgba(17, 21, 40, .38);
    opacity: 0; pointer-events: none;
    transition: opacity .18s;
    z-index: 90;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }

.panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(520px, 94vw);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
    z-index: 100;
    display: flex; flex-direction: column;
}
.panel.is-open { transform: translateX(0); }
.panel--wide { width: min(720px, 96vw); }

.panel__head {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}
.panel__title { font-size: 15px; font-weight: 650; margin: 0; }
.panel__body { padding: 18px; overflow-y: auto; flex: 1; }
.panel__foot {
    padding: 13px 18px;
    border-top: 1px solid var(--line);
    display: flex; gap: 8px; justify-content: flex-end;
    background: var(--surface-2);
}

/* --- Forms ---------------------------------------------------------- */

.field { margin-bottom: 14px; }
.field__label {
    display: block;
    font-size: 12px; font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 5px;
}
.field__hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.field__error { font-size: 11.5px; color: var(--red); margin-top: 4px; }

.input, .select, .textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 11px;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    background: var(--surface);
    transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(123, 104, 238, .13);
}
.input.is-invalid { border-color: var(--red); }
.textarea { min-height: 74px; resize: vertical; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch__track {
    width: 36px; height: 20px; border-radius: 20px;
    background: #cfd4e0; position: relative;
    transition: background .15s; flex: 0 0 auto;
}
.switch__track::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: var(--shadow-sm);
    transition: transform .15s;
}
.switch input:checked + .switch__track { background: var(--purple); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }

.checkline { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }

/* --- Filter bar ----------------------------------------------------- */

.filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-bottom: 14px;
}
.filters .input, .filters .select { width: auto; min-width: 130px; }
.search-box { position: relative; }
.search-box .input { padding-left: 30px; min-width: 210px; }
.search-box svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-4); }

/* --- Notifications menu --------------------------------------------- */

.menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    width: 350px; max-height: 460px; overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 60;
    display: none;
}
.menu.is-open { display: block; }
.menu__head {
    padding: 11px 14px; border-bottom: 1px solid var(--line-2);
    display: flex; align-items: center; gap: 8px;
    font-weight: 650; font-size: 13px;
    position: sticky; top: 0; background: var(--surface);
}
.menu__group-label {
    padding: 8px 14px 4px;
    font-size: 11px; font-weight: 650; text-transform: uppercase;
    letter-spacing: .05em; color: var(--ink-3);
}
.menu__item { padding: 9px 14px; border-bottom: 1px solid var(--line-2); display: flex; gap: 9px; }
.menu__item:hover { background: var(--surface-2); }
.menu__item.is-unread { background: #f8f6ff; }
.menu__empty { padding: 28px 14px; text-align: center; color: var(--ink-3); font-size: 13px; }

.header__notif { position: relative; }

/* --- Toast ---------------------------------------------------------- */

.toasts {
    position: fixed; bottom: 20px; right: 20px;
    display: grid; gap: 8px; z-index: 200;
}
.toast {
    background: var(--ink); color: #fff;
    padding: 11px 15px; border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 13px; font-weight: 500;
    display: flex; align-items: center; gap: 9px;
    animation: toast-in .2s ease-out;
    max-width: 380px;
}
.toast--error { background: var(--red); }
.toast--ok { background: #14804a; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

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

.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty__icon { font-size: 30px; margin-bottom: 8px; opacity: .5; }
.empty__title { font-weight: 650; color: var(--ink-2); margin-bottom: 3px; }

.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 16px; }

hr.sep { border: none; border-top: 1px solid var(--line-2); margin: 16px 0; }

/* --- Login ---------------------------------------------------------- */

.auth {
    min-height: 100vh;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #f3f1ff 0%, var(--bg) 55%, #eef7ff 100%);
    padding: 20px;
}
.auth__card {
    width: 100%; max-width: 390px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 30px;
}
.auth__brand {
    display: flex; align-items: center; gap: 11px;
    margin-bottom: 22px;
    font-weight: 700; font-size: 17px;
}
.auth__alert {
    background: #fdeced; color: #b42318;
    border: 1px solid #f6c9cb;
    border-radius: 6px; padding: 9px 12px;
    font-size: 12.5px; margin-bottom: 15px;
}

/* --- Detail drawer bits --------------------------------------------- */

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 7px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); font-size: 12px; }
.kv dd { margin: 0; font-weight: 550; }

.selfie {
    width: 100%; max-width: 190px;
    border-radius: var(--radius); border: 1px solid var(--line);
    display: block;
}

.timeline { display: grid; gap: 0; }
.timeline__item {
    display: flex; gap: 11px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line-2);
    font-size: 12.5px;
}
.timeline__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--purple); margin-top: 6px; flex: 0 0 auto;
}

/* --- Review queues ---------------------------------------------------
   A worker registered by a foreman and a site declared from the field are
   the same shape of problem: somebody in the field did a thing and an
   administrator ratifies it. They share one look so the two screens read
   as one product rather than two features.
   ------------------------------------------------------------------- */

.viewtabs .count {
    display: inline-block; margin-left: 5px;
    background: var(--amber); color: #6a4c00;
    border-radius: 20px; padding: 0 6px;
    font-size: 10.5px; font-weight: 700;
}
.viewtabs a.is-active .count { background: var(--purple); color: #fff; }

/* The standing rule a reviewer must read before deciding. Amber, not red:
   it is a fact about what the decision does, not a warning about danger. */
.notice {
    display: flex; gap: 10px; align-items: flex-start;
    border: 1px solid #f6dfae; background: #fffaf0;
    border-radius: var(--radius);
    padding: 11px 13px; font-size: 12.5px; color: var(--ink-2);
    margin-bottom: 14px;
}
.notice__icon { flex: 0 0 auto; opacity: .7; }
.notice strong { color: var(--ink); }

.queue { display: grid; gap: 10px; }
.queue__row {
    display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); padding: 12px 14px;
}
.queue__row.is-deciding { opacity: .55; pointer-events: none; }
.queue__body { flex: 1 1 260px; min-width: 0; }
.queue__actions { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; align-items: center; }
.queue__photo {
    width: 58px; height: 58px; border-radius: var(--radius);
    object-fit: cover; border: 1px solid var(--line); flex: 0 0 auto;
    background: var(--purple-soft);
}
.queue__facts {
    display: flex; flex-wrap: wrap; gap: 4px 16px;
    margin-top: 7px; font-size: 12px; color: var(--ink-3);
}
.queue__facts b { color: var(--ink-2); font-weight: 600; }

/* --- Rule builder --------------------------------------------------- */

.rule-row {
    display: grid;
    grid-template-columns: 1.4fr .9fr 1fr auto;
    gap: 7px; align-items: center;
    margin-bottom: 7px;
}
@media (max-width: 640px) { .rule-row { grid-template-columns: 1fr; } }

.rule-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (max-width: 900px) {
    .sidebar { position: fixed; transform: translateX(-100%); z-index: 120; transition: transform .2s; }
    .sidebar.is-open { transform: none; }
    .shell { display: block; }
    .content { padding: 14px; }
}
