/* =====================================================================
   Meeting Manager — design system (shared with Campus Event Manager)
   Square geometry · hard shadows · soft-charcoal ink · colour reserved
   for meaning (status + category), never for decoration
   ===================================================================== */

/* Self-hosted so the UI renders in Inter/JetBrains Mono even with no
   internet access — each is one variable-weight file per Latin subset,
   so a single download covers every weight the app uses (400–800). */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../fonts/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                   U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                   U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("../fonts/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
                   U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                   U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                   U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                   U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
                   U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                   U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Surfaces — a soft, slightly warm paper rather than clinical white */
    --bg:            #EDEDF0;
    --panel:         #FFFFFF;
    --panel-alt:     #F6F6F8;

    /* Ink — soft charcoal, not pure black (easier on the eye, still 15.6:1) */
    --ink:           #22232A;
    --ink-strong:    #16171C;
    --ink-soft:      #3A3B44;
    --muted:         #6B6B76;
    --muted-light:   #9A9AA4;
    --line:          #DEDEE3;
    --line-strong:   #22232A;

    /* ------------------------------------------------------------------
       STATUS PALETTE — reserved for state, never for a category.
       Each role is a trio: soft tint, mid border, dark readable text.
       Every text/tint pair clears 4.5:1 (checked, not guessed).
       ------------------------------------------------------------------ */
    --good:        #0B6B2B;   --good-tint:  #E7F5EA;   --good-line:  #A8DDB5;   --good-solid:  #1BA34A;
    --warn:        #7A5200;   --warn-tint:  #FDF3DC;   --warn-line:  #F2D488;   --warn-solid:  #EDA100;
    --info:        #1A4F94;   --info-tint:  #E7F0FC;   --info-line:  #A9C8F0;   --info-solid:  #2A78D6;
    --crit:        #A32F2C;   --crit-tint:  #FDEBEA;   --crit-line:  #F3B6B3;   --crit-solid:  #D03B3B;
    --neutral:     #55555E;   --neutral-tint:#F0F0F2;  --neutral-line:#D6D6DB;  --neutral-solid:#8A8A94;

    /* ------------------------------------------------------------------
       CATEGORICAL SERIES — fixed slot order, assigned by category name,
       never by rank. Validated for colour-blind separation on white.
       ------------------------------------------------------------------ */
    --series-1: #2a78d6;   /* blue   */
    --series-2: #eb6834;   /* orange */
    --series-3: #1baf7a;   /* aqua   */
    --series-4: #eda100;   /* yellow */
    --series-5: #e87ba4;   /* magenta*/
    --series-6: #008300;   /* green  */
    --series-7: #4a3aa7;   /* violet */
    --series-8: #e34948;   /* red    */
    --series-other: #9A9AA4;

    /* Hard shadows — the signature of the whole UI */
    --shadow-sm:     3px 3px 0 rgba(34, 35, 42, .07);
    --shadow:        5px 5px 0 rgba(34, 35, 42, .08);
    --shadow-lg:     8px 8px 0 rgba(34, 35, 42, .11);
    --shadow-ink:    4px 4px 0 var(--ink);

    --sidebar-w:     256px;
    --topbar-h:      68px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

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

/* Subtle grid paper behind everything — reads as "planning board" */
body.app::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(11, 11, 12, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 11, 12, .028) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none;
        stroke-width: 1.9; stroke-linecap: square; stroke-linejoin: miter; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }

/* ==================================================================
   TYPOGRAPHY HELPERS
   ================================================================== */

.label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

.muted { color: var(--muted); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================================================================
   LAYOUT SHELL
   ================================================================== */

.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--ink);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    border-right: 1px solid #000;
}

.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
    min-height: var(--topbar-h);
}

.brand-mark {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    background: #fff; color: var(--ink);
    display: grid; place-items: center;
    box-shadow: 3px 3px 0 rgba(255, 255, 255, .22);
}

.brand-name { font-weight: 700; font-size: 14px; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub  { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em;
              text-transform: uppercase; color: rgba(255, 255, 255, .48); }

.nav { padding: 18px 14px; flex: 1; overflow-y: auto; }
.nav-group { margin-bottom: 22px; }
.nav-group > .label { padding: 0 10px 9px; color: rgba(255, 255, 255, .38); display: block; }

.nav-link {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, .72);
    font-weight: 500; font-size: 13.5px;
    border: 1px solid transparent;
    margin-bottom: 3px;
    transition: background .13s, color .13s, transform .13s;
}

.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.nav-link.active {
    background: #fff; color: var(--ink); font-weight: 600;
    box-shadow: 3px 3px 0 rgba(255, 255, 255, .2);
}

.nav-link .badge-count {
    margin-left: auto;
    font-family: var(--mono); font-size: 10px; font-weight: 700;
    background: rgba(255, 255, 255, .16); color: #fff;
    padding: 2px 6px; min-width: 20px; text-align: center;
}

.nav-link.active .badge-count { background: var(--crit-solid); color: #fff; }

.sidebar-foot {
    border-top: 1px solid rgba(255, 255, 255, .14);
    padding: 14px;
}

/* "Download app" — the member APK, just above the signed-in user */
.app-download {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px; padding: 9px 11px;
    color: #fff; text-decoration: none;
    border: 1px dashed rgba(255, 255, 255, .28);
    transition: background .12s, border-color .12s;
}
.app-download:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .55); }
.app-download .icon { flex: 0 0 auto; color: var(--good-solid); }
.app-download span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.app-download b { font-size: 12.5px; font-weight: 600; }
.app-download small { font-size: 10.5px; color: rgba(255, 255, 255, .5); }

.user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 9px; background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
}

.avatar {
    width: 32px; height: 32px; flex: 0 0 32px;
    background: #fff; color: var(--ink);
    display: grid; place-items: center;
    font-family: var(--mono); font-weight: 700; font-size: 12px;
}

.avatar-lg { width: 52px; height: 52px; flex-basis: 52px; font-size: 18px; }

.main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 16px;
    padding: 0 26px;
    position: sticky; top: 0; z-index: 50;
}

.topbar h1 { font-size: 19px; }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.menu-toggle.btn-icon { display: none; }

.content { padding: 26px; flex: 1; }
.content-narrow { max-width: 880px; }

/* ==================================================================
   CARDS
   ================================================================== */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}

.card-head h2, .card-head h3 { margin-right: auto; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.card-foot {
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    background: var(--panel-alt);
    display: flex; align-items: center; gap: 10px;
}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 20px; }
.mb-3 { margin-bottom: 14px; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }

/* ==================================================================
   STAT TILES
   ================================================================== */

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    position: relative;
    transition: transform .14s, box-shadow .14s;
}

.stat:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }

.stat-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }

.stat-icon {
    width: 34px; height: 34px; flex: 0 0 34px;
    background: var(--ink); color: #fff;
    display: grid; place-items: center;
}

.stat-value {
    font-family: var(--mono);
    font-size: 30px; font-weight: 700;
    letter-spacing: -.03em; line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-value.sm { font-size: 22px; }
.stat-meta { font-size: 11.5px; color: var(--muted); margin-top: 7px; display: flex; gap: 10px; flex-wrap: wrap; }

.stat.invert { background: var(--ink); color: #fff; border-color: var(--ink); }
.stat.invert .label, .stat.invert .stat-meta { color: rgba(255, 255, 255, .6); }
.stat.invert .stat-icon { background: #fff; color: var(--ink); }
.stat.invert .progress-track { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .28); }
.stat.invert .progress-fill { background: #fff; }
.stat.invert .progress-value { color: #fff; }

/* Tinted icon chips — the tile's colour says what kind of number it is */
.stat-icon.is-good    { background: var(--good-tint);    color: var(--good); }
.stat-icon.is-warn    { background: var(--warn-tint);    color: var(--warn); }
.stat-icon.is-info    { background: var(--info-tint);    color: var(--info); }
.stat-icon.is-crit    { background: var(--crit-tint);    color: var(--crit); }
.stat-icon.is-neutral { background: var(--neutral-tint); color: var(--neutral); }

/* A hairline of the tile's colour along the top edge */
.stat.is-good    { border-top: 3px solid var(--good-solid); }
.stat.is-warn    { border-top: 3px solid var(--warn-solid); }
.stat.is-info    { border-top: 3px solid var(--info-solid); }
.stat.is-crit    { border-top: 3px solid var(--crit-solid); }
.stat.is-neutral { border-top: 3px solid var(--neutral-solid); }

/* ==================================================================
   BUTTONS
   ================================================================== */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px;
    background: var(--ink); color: #fff;
    border: 1px solid var(--ink);
    font-size: 13px; font-weight: 600; letter-spacing: -.01em;
    cursor: pointer;
    box-shadow: var(--shadow-ink);
    transition: transform .1s, box-shadow .1s, background .1s;
    white-space: nowrap;
}

.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-ink); }

.btn-ghost {
    background: var(--panel); color: var(--ink);
    box-shadow: 3px 3px 0 rgba(34, 35, 42, .1);
}
.btn-ghost:hover { background: var(--panel-alt); box-shadow: 1px 1px 0 rgba(34, 35, 42, .12); }

.btn-quiet {
    background: transparent; color: var(--muted);
    border-color: var(--line); box-shadow: none;
}
.btn-quiet:hover { background: var(--panel-alt); color: var(--ink); border-color: var(--ink);
                   transform: none; box-shadow: none; }

.btn-danger { background: var(--crit-solid); border-color: var(--crit-solid);
              box-shadow: 4px 4px 0 rgba(163, 47, 44, .28); }
.btn-danger:hover { box-shadow: 2px 2px 0 rgba(163, 47, 44, .28); }

.btn-sm { padding: 6px 11px; font-size: 12px; box-shadow: 3px 3px 0 var(--ink); }
.btn-sm.btn-ghost, .btn-sm.btn-quiet { box-shadow: 2px 2px 0 rgba(34, 35, 42, .1); }
.btn-sm.btn-danger { box-shadow: 3px 3px 0 rgba(163, 47, 44, .28); }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 20px; font-size: 14px; }

.btn-icon {
    width: 32px; height: 32px; padding: 0;
    background: var(--panel); color: var(--ink);
    border: 1px solid var(--line);
    display: grid; place-items: center; cursor: pointer;
    box-shadow: 2px 2px 0 rgba(34, 35, 42, .08);
    transition: transform .1s, box-shadow .1s, border-color .1s, color .1s;
}
.btn-icon:hover { border-color: var(--ink); transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(34, 35, 42, .12); }
.btn-icon.is-danger:hover { border-color: var(--crit-solid); color: var(--crit); }

/* ==================================================================
   FORMS — square fields with inset + focus shadow
   ================================================================== */

.field { margin-bottom: 16px; }
/* :not(.check) — a checkbox row inside a field is not a field label */
.field > label:not(.check), .field-label {
    display: block; margin-bottom: 6px;
    font-family: var(--mono); font-size: 10px; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
}

.input, .select, .textarea {
    width: 100%;
    padding: 11px 13px;
    background: var(--panel);
    border: 1px solid #C9C9D1;
    border-radius: 0;
    box-shadow: inset 2px 2px 0 rgba(34, 35, 42, .04);
    font-size: 13.5px;
    transition: border-color .12s, box-shadow .12s;
    appearance: none;
}

.input::placeholder, .textarea::placeholder { color: var(--muted-light); }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--info-solid);
    box-shadow: 4px 4px 0 rgba(42, 120, 214, .22);
}

.input:disabled, .select:disabled { background: var(--panel-alt); color: var(--muted); }

.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }

.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2322232A' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
    cursor: pointer;
}

.input-group { position: relative; }
.input-group .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
                     color: var(--muted); pointer-events: none; }
.input-group .input { padding-left: 40px; }
.input-group .input-action {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    background: none; border: none; padding: 7px; cursor: pointer; color: var(--muted);
}
.input-group .input-action:hover { color: var(--ink); }
.input-group .input-action .icon { position: static; transform: none; pointer-events: auto; color: inherit; }

.field-error { font-size: 11.5px; color: var(--crit); margin-top: 5px; font-weight: 600; display: none; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea {
    border-color: var(--crit-solid); box-shadow: inset 0 0 0 1px var(--crit-solid);
}
.field.has-error .field-error { display: block; }

.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* Square custom checkbox */
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }

.check-box {
    width: 19px; height: 19px; flex: 0 0 19px;
    border: 1.5px solid var(--ink);
    background: var(--panel);
    box-shadow: 2px 2px 0 rgba(34, 35, 42, .14);
    display: grid; place-items: center;
    transition: background .12s, box-shadow .12s, border-color .12s;
}

.check-box svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 2.6; opacity: 0; transition: opacity .1s; }
.check input:checked + .check-box { background: var(--good-solid); border-color: var(--good-solid); }
.check input:checked + .check-box svg { opacity: 1; }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 3px rgba(42, 120, 214, .3); }
.check-text { font-size: 13px; font-weight: 500; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

/* One new guest per block in the create-event forms: name on top, phone and email under it */
.guest-row.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: start; padding-bottom: 4px; margin-bottom: 10px; border-bottom: 1px dashed var(--line); }
.guest-row .field:first-child { grid-column: 1 / 3; }
.guest-row [data-guest-remove] { grid-column: 3; grid-row: 1; }
.guest-row .field { margin-bottom: 10px; }

/* pickList(): a searchable checklist for choosing several guests or events */
.pick { border: 1px solid var(--line); background: var(--panel); }
.pick-head { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel-alt); }
.pick-count { white-space: nowrap; }
.pick-list { max-height: 280px; overflow-y: auto; }
.pick-item { padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.pick-item:last-of-type { border-bottom: 0; }
.pick-item:hover { background: var(--panel-alt); }
.pick-item.is-picked { background: var(--good-tint); }
.pick-item .check-box { margin-top: 1px; flex: 0 0 auto; }
.pick-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.pick-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-tag { margin-left: auto; flex: 0 0 auto; }
.pick-empty, .pick-none { padding: 16px 12px; }

/* openGuestListModal(): search + Add guest on top, tick saved guests below */
.gl-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.gl-toolbar .input-group { flex: 1; min-width: 0; }
.gl-toolbar > .btn { flex: 0 0 auto; }
.gl-toolbar-sub { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

/* A small dialog stacked above an open one (openNewGuestDialog) */
.modal-backdrop.sub-dialog { z-index: 240; background: rgba(11, 11, 12, .35); padding-top: 70px; }
.gl-list { border: 1px solid var(--line); max-height: 380px; overflow-y: auto; background: var(--panel); }
.gl-item { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.gl-pick { gap: 12px; }
.gl-role { margin: 8px 0 2px 70px; width: calc(100% - 70px); height: 34px; font-size: 12.5px; background: var(--panel); }
.gl-item:last-child { border-bottom: 0; }
.gl-item:hover { background: var(--panel-alt); }
.gl-item.is-picked { background: var(--good-tint); }
.gl-item .avatar { border: 1px solid var(--line); }
.gl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.gl-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gl-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-tag { flex: 0 0 auto; }
.gl-empty { padding: 20px 14px; text-align: center; }
@media (max-width: 560px) {
    .gl-toolbar { flex-wrap: wrap; }
    .gl-role { margin-left: 0; width: 100%; }
}

/* The short guest list at the top of an event page */
.guest-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.guest-chip { display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 6px; max-width: 260px;
              border: 1px solid var(--line); background: var(--panel-alt); }
.guest-chip .avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 10.5px; border: 1px solid var(--line); }
.guest-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.guest-chip-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-chip-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Role picker — a checkbox list of roles with their level and description */
.role-picker {
    display: grid; gap: 1px;
    background: var(--line); border: 1px solid var(--line);
    max-height: 260px; overflow-y: auto;
}

.role-option {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 13px; background: var(--panel); cursor: pointer;
    transition: background .12s;
}
.role-option:hover { background: var(--panel-alt); }
.role-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.role-option input:checked + .check-box { background: var(--good-solid); border-color: var(--good-solid); }
.role-option input:checked + .check-box svg { opacity: 1; }
.role-option-text { flex: 1; min-width: 0; }
.role-option-text strong { display: block; font-size: 13px; }
.role-option-text span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.4; }

.role-option.is-locked { opacity: .5; cursor: not-allowed; background: var(--panel-alt); }
.role-option.is-locked .check-box { border-color: var(--muted-light); box-shadow: none; }

/* Assign-to trigger — opens the user picker modal instead of a native select */
.assignee-btn {
    width: 100%; justify-content: flex-start; gap: 8px;
    font-weight: 500; color: var(--muted);
}
.assignee-btn .assignee-avatar { display: flex; flex: 0 0 auto; }
.assignee-btn .assignee-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignee-btn.is-assigned { color: var(--ink); border-color: var(--ink); }

/* User picker modal — a searchable, single-select list of people */
.user-picker-search { margin-bottom: 12px; }
.user-picker-list {
    display: grid; gap: 1px;
    background: var(--line); border: 1px solid var(--line);
    max-height: 320px; overflow-y: auto;
}
.user-picker-group-head {
    padding: 7px 13px; background: var(--panel-alt);
    font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.user-option {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 8px 13px; background: var(--panel); cursor: pointer;
    border: none; font: inherit; color: inherit; text-align: left;
    transition: background .12s;
}
.user-option:hover { background: var(--panel-alt); }
.user-option.is-selected { background: var(--info-tint); }
.user-option .avatar { width: 30px; height: 30px; flex: 0 0 30px; font-size: 11px; }
.user-option-text { flex: 1; min-width: 0; }
.user-option-text strong { display: block; font-size: 13px; }
.user-option-text span { display: block; font-size: 11.5px; color: var(--muted); }
.user-option .check-mark { flex: 0 0 auto; color: var(--info-solid); opacity: 0; }
.user-option.is-selected .check-mark { opacity: 1; }
.user-picker-empty { padding: 26px 13px; text-align: center; color: var(--muted); font-size: 13px; }

/* The template form's task editor: a table with headings — task (and its
   description), costs money, budget, priority — and a summary bar. */
.tte { border: 1px solid var(--line); background: var(--panel); }
.tte-head, .task-row-item {
    display: grid; align-items: center; gap: 10px;
    grid-template-columns: 26px minmax(0, 1.4fr) minmax(0, 1fr) 70px 120px 110px 30px;
    padding: 8px 12px;
}
.tte-head {
    background: var(--panel-alt); border-bottom: 1px solid var(--line);
    font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.task-rows { max-height: 46vh; overflow-y: auto; }
.task-row-item { border-bottom: 1px solid var(--line); }
.task-row-item:nth-child(even) { background: #FAFAFB; }
.task-row-item:last-child { border-bottom: none; }
.task-row-item .row-no {
    width: 24px; height: 24px; display: grid; place-items: center;
    font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--muted); background: var(--panel-alt); border: 1px solid var(--line);
}
.task-row-item .t-title { font-weight: 600; }
.task-row-item .t-desc { font-size: 12.5px; }
.task-row-item .t-money { justify-content: center; }
.tte-budget { position: relative; }
.tte-budget .tte-cur { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; color: var(--muted); pointer-events: none; }
.tte-budget .t-budget { padding-left: 36px; text-align: right; }
.tte-budget .t-budget:disabled { background: var(--panel-alt); }
.tte-foot {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 12px; background: var(--panel-alt); border-top: 1px solid var(--line);
}
.tte-summary { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.tte-summary strong { font-family: var(--mono); font-size: 13px; color: var(--ink); }

/* Narrow: each task becomes a small card — the task on top, the rest beneath. */
@media (max-width: 760px) {
    .tte-head { display: none; }
    .task-row-item { grid-template-columns: 26px minmax(0, 1fr) 30px; }
    .task-row-item [data-task-remove] { grid-column: 3; grid-row: 1; }
    .task-row-item .t-title, .task-row-item .t-desc, .task-row-item .t-money,
    .task-row-item .tte-budget, .task-row-item .t-priority { grid-column: 2; justify-content: flex-start; }
}

/* Permission matrix in the role editor */
.perm-group { border: 1px solid var(--line); margin-bottom: 14px; }
.perm-group-head {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 13px; background: var(--panel-alt); border-bottom: 1px solid var(--line);
}
.perm-group-head .label { margin-right: auto; }
.perm-option {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 10px 13px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.perm-option:last-child { border-bottom: none; }
.perm-option:hover { background: var(--panel-alt); }
.perm-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.perm-option input:checked + .check-box { background: var(--good-solid); border-color: var(--good-solid); }
.perm-option input:checked + .check-box svg { opacity: 1; }
.perm-option input:disabled + .check-box { opacity: .4; }
.perm-option-text strong { display: block; font-size: 13px; }
.perm-option-text span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.perm-option .check-box { margin-top: 1px; }

/* ==================================================================
   BADGES / STATUS
   ================================================================== */

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px;
    font-family: var(--mono); font-size: 9.5px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    border: 1px solid var(--neutral-line); color: var(--neutral); background: var(--neutral-tint);
    white-space: nowrap;
}

.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; flex: 0 0 6px; }

/* Status variants — colour is the second channel; the label carries the meaning */
.badge-good    { background: var(--good-tint);    border-color: var(--good-line);    color: var(--good); }
.badge-warn    { background: var(--warn-tint);    border-color: var(--warn-line);    color: var(--warn); }
.badge-info    { background: var(--info-tint);    border-color: var(--info-line);    color: var(--info); }
.badge-crit    { background: var(--crit-tint);    border-color: var(--crit-line);    color: var(--crit); }
.badge-neutral { background: var(--neutral-tint); border-color: var(--neutral-line); color: var(--neutral); }

.badge-solid  { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge-muted  { background: var(--panel); border-color: var(--line); color: var(--muted); }
.badge-dash   { border-style: dashed; }
.badge-stripe {
    background-image: repeating-linear-gradient(45deg, rgba(34,35,42,.10) 0 4px, transparent 4px 8px);
}
.badge-plain::before { display: none; }

/* Priority marker — severity ramp, always shown beside its text label */
.prio { display: inline-flex; gap: 2px; align-items: center; }
.prio i { width: 4px; height: 12px; background: var(--line); display: block; }
.prio.high   i:nth-child(-n+3) { background: var(--crit-solid); }
.prio.medium i:nth-child(-n+2) { background: var(--warn-solid); }
.prio.low    i:nth-child(-n+1) { background: var(--neutral-solid); }

.prio-label { display: inline-flex; align-items: center; gap: 6px; }

/* ==================================================================
   PROGRESS
   ================================================================== */

.progress-track { height: 8px; background: #E4E4E9; border: 1px solid var(--line); overflow: hidden; }
.progress-fill  { height: 100%; background: var(--ink); transition: width .4s ease; }
.progress-fill.striped {
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.28) 0 5px, transparent 5px 10px);
}

/* Meter tones — used where the number carries a health meaning (budget use, completion) */
.progress-fill.is-good    { background: var(--good-solid); }
.progress-fill.is-warn    { background: var(--warn-solid); }
.progress-fill.is-crit    { background: var(--crit-solid); }
.progress-fill.is-info    { background: var(--info-solid); }
.progress-fill.is-neutral { background: var(--neutral-solid); }

.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .progress-track { flex: 1; }
.progress-value { font-family: var(--mono); font-size: 11px; font-weight: 700; min-width: 34px; text-align: right; }
.progress-value.is-crit { color: var(--crit); }
.progress-value.is-warn { color: var(--warn); }
.progress-value.is-good { color: var(--good); }

/* Category swatch for the spend-by-category bars */
.swatch { width: 10px; height: 10px; flex: 0 0 10px; display: inline-block; }
.cat-1 { background: var(--series-1); } .cat-2 { background: var(--series-2); }
.cat-3 { background: var(--series-3); } .cat-4 { background: var(--series-4); }
.cat-5 { background: var(--series-5); } .cat-6 { background: var(--series-6); }
.cat-7 { background: var(--series-7); } .cat-8 { background: var(--series-8); }
.cat-other { background: var(--series-other); }

/* Ranked horizontal bar — an identity (event, person) directly labelled
   above its own bar, so no separate legend box is needed. The value sits
   right at the bar's tip, the way a bar chart labels its mark. */
.rank-bar { margin-bottom: 16px; }
.rank-bar:last-child { margin-bottom: 0; }
.rank-bar-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rank-bar-head .swatch { flex: 0 0 10px; }
.rank-bar-name { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; }
.rank-bar-name .cell-sub { font-weight: 400; }

.hbar-row { display: flex; align-items: center; gap: 10px; }
.hbar-track { flex: 1; height: 18px; background: var(--panel-alt); border: 1px solid var(--line); min-width: 0; }
.hbar-fill  { height: 100%; border-radius: 0 4px 4px 0; min-width: 3px; }
.hbar-value { font-family: var(--mono); font-size: 12px; font-weight: 700; white-space: nowrap; flex: 0 0 auto; }

/* Column (vertical bar) chart — a fixed-height plot per category, growing
   from one shared baseline, with light 3-step gridlines behind the bars
   and the value directly labelled at the bar's cap. */
.col-chart { display: flex; align-items: flex-end; gap: 14px; }
.col-chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.col-chart-value { font-family: var(--mono); font-size: 11.5px; font-weight: 700; margin-bottom: 6px; }
.col-chart-plot {
    width: 100%; height: 130px;
    display: flex; align-items: flex-end; justify-content: center;
    background-image: linear-gradient(var(--line) 1px, transparent 1px);
    background-size: 100% 33.333%; background-position: top; background-repeat: repeat-y;
    border-bottom: 1.5px solid var(--line-strong);
}
.col-chart-bar { width: 100%; max-width: 22px; min-height: 2px; border-radius: 4px 4px 0 0; transition: height .3s ease; }
.col-chart-bar.is-good    { background: var(--good-solid); }
.col-chart-bar.is-warn    { background: var(--warn-solid); }
.col-chart-bar.is-crit    { background: var(--crit-solid); }
.col-chart-bar.is-info    { background: var(--info-solid); }
.col-chart-bar.is-neutral { background: var(--neutral-solid); }
.col-chart-label {
    font-size: 10.5px; color: var(--muted); margin-top: 8px; text-align: center;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ==================================================================
   TABLES
   ================================================================== */

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

table.table { width: 100%; border-collapse: collapse; }

.table th {
    text-align: left;
    padding: 11px 16px;
    font-family: var(--mono); font-size: 9.5px; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
    background: var(--panel-alt);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--panel-alt); }
.table tbody tr.is-done { background: var(--good-tint); }
.table tbody tr.is-done:hover { background: #DCEFE0; }
.table tbody tr.is-done .cell-title { text-decoration: line-through; color: var(--muted); }
.table tbody tr.is-muted { opacity: .6; }

/* Row tint that follows a status pill's tone — e.g. an event's row colours
   itself as its status changes, so the whole row reads at a glance. No hover
   variant: the tint stays put instead of shifting shade on mouseover. */
.table tbody tr.row-tone-info,    .table tbody tr.row-tone-info:hover    { background: var(--info-tint); }
.table tbody tr.row-tone-good,    .table tbody tr.row-tone-good:hover    { background: var(--good-tint); }
.table tbody tr.row-tone-warn,    .table tbody tr.row-tone-warn:hover    { background: var(--warn-tint); }
.table tbody tr.row-tone-crit,    .table tbody tr.row-tone-crit:hover    { background: var(--crit-tint); }
.table tbody tr.row-tone-neutral, .table tbody tr.row-tone-neutral:hover { background: var(--neutral-tint); }
.table .num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.table .nowrap { white-space: nowrap; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Two-line cell: a strong title with a quiet second line under it */
.cell-title { font-weight: 600; font-size: 13.5px; }
.cell-title a:hover { text-decoration: underline; }
/* A title that opens its detail page: always underlined so it reads as a link */
.title-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.title-link:hover { text-decoration-thickness: 2px; color: var(--info); }
/* A small number inside a button, e.g. how many guests an event has */
.count-pill { font-family: var(--mono); font-size: 10.5px; font-weight: 700; min-width: 20px; padding: 1px 6px;
              margin-left: 4px; text-align: center; background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.cell-sub   { font-size: 11.5px; color: var(--muted); margin-top: 2px;
              overflow: hidden; text-overflow: ellipsis; }
.cell-link  { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cell-static { font-weight: 600; }

/* Hover card: reveals extra detail (e.g. a full description) near a cell
   on mouseover/focus, without needing a click-triggered modal.
   position: fixed + JS-set coordinates (see initHoverCards) so it always
   escapes ancestor scroll containers like .table-wrap instead of being
   clipped by them. */
.hover-info { position: relative; display: inline-block; cursor: help; }
.hover-info .cell-static { text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--line); }
.hover-info .hover-card {
    display: none;
    position: fixed; z-index: 1000;
    width: max-content; max-width: 300px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    padding: 12px 14px; font-size: 12.5px; line-height: 1.55; color: var(--ink);
    font-weight: 400; white-space: normal;
}
.hover-info .hover-card.is-open { display: block; }
.hover-info .hover-card .hover-card-title {
    font-weight: 700; font-size: 13px; margin-bottom: 8px; display: block;
}
.hover-info .hover-card-meta { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.hover-info .hover-card-meta .label { margin-right: 6px; }
.hover-info .hover-card-desc { padding-top: 8px; border-top: 1px solid var(--line); }

/* A person in a table cell */
.cell-person { display: flex; align-items: center; gap: 8px; }
.cell-person .avatar { width: 26px; height: 26px; flex-basis: 26px; font-size: 9.5px; }

/* Narrow meter that still lines up column to column */
.table .meter { min-width: 120px; }
.table .meter .progress-track { height: 6px; }

/* Compact select used inside a row (status changers) */
.select-inline {
    width: auto; padding: 5px 26px 5px 9px; font-size: 11.5px;
    box-shadow: 2px 2px 0 rgba(34, 35, 42, .1);
    background-position: right 9px center;
}

/* Square tick used as the first column of a to-do table */
.cell-tick {
    width: 20px; height: 20px;
    border: 1.5px solid var(--ink); background: var(--panel);
    display: grid; place-items: center; cursor: pointer;
    box-shadow: 2px 2px 0 rgba(34, 35, 42, .12);
    transition: background .12s, transform .1s, border-color .12s;
}
.cell-tick svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 2.8; opacity: 0; }
.cell-tick:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(34, 35, 42, .12); }
tr.is-done .cell-tick { background: var(--good-solid); border-color: var(--good-solid); }
tr.is-done .cell-tick svg { opacity: 1; }

/* Toolbar sitting above a table */
.table-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.table-toolbar .label { margin-left: auto; }

/* On a phone a wide table becomes a stack of cards — one per row — instead
   of a shrunk table. Each row is its own tappable-looking tile, the way a
   task list in a phone app would present them, not a spreadsheet. */
@media (max-width: 760px) {
    .table-wrap:has(.table.responsive) { background: var(--panel-alt); padding: 10px; }
    .table.responsive thead { display: none; }
    .table.responsive tbody { display: block; }
    .table.responsive tbody tr {
        display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 10px;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 12px;
        box-shadow: var(--shadow-sm);
        padding: 12px 14px;
        margin-bottom: 10px;
    }
    .table.responsive tbody tr:last-child { margin-bottom: 0; }

    /* Re-assert the status tints at the same higher specificity as the card
       background above — otherwise a completed/tone-coloured row would lose
       its colour on a phone, since the two rules would otherwise tie and
       source order alone would pick the plain card background. */
    .table.responsive tbody tr.is-done            { background: var(--good-tint); }
    .table.responsive tbody tr.row-tone-info      { background: var(--info-tint); }
    .table.responsive tbody tr.row-tone-good      { background: var(--good-tint); }
    .table.responsive tbody tr.row-tone-warn      { background: var(--warn-tint); }
    .table.responsive tbody tr.row-tone-crit      { background: var(--crit-tint); }
    .table.responsive tbody tr.row-tone-neutral   { background: var(--neutral-tint); }

    /* Every field is its own full-width row by default... */
    .table.responsive tbody td {
        flex: 1 1 100%;
        display: grid; grid-template-columns: 80px minmax(0, 1fr);
        align-items: start; gap: 3px 12px;
        padding: 0; border: none;
    }
    .table.responsive tbody td::before {
        content: attr(data-label);
        grid-column: 1; grid-row: 1;
        font-family: var(--mono); font-size: 9px; font-weight: 700;
        letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
        padding-top: 2px;
    }
    /* ...except a leading label-less cell (a tick or a bulk-select checkbox)
       and whatever comes right after it (the row's title) — those pair up
       on one line, unlabelled, the way a checkbox sits next to its item's
       name in any to-do app. */
    .table.responsive tbody td[data-label=""] {
        flex: 0 0 auto; display: flex; align-items: center;
    }
    .table.responsive tbody td[data-label=""] + td {
        flex: 1 1 0; min-width: 0; display: block;
    }
    .table.responsive tbody td[data-label=""] + td::before { content: none; }

    /* ...and short, glanceable fields — a priority mark, a status pill, a
       money figure — read as small stat chips, two to a row, instead of
       each claiming a full labelled line the way a long value needs to. */
    .table.responsive tbody td[data-label="Priority"],
    .table.responsive tbody td[data-label="Status"],
    .table.responsive tbody td[data-label="Estimated"],
    .table.responsive tbody td[data-label="Spent"],
    .table.responsive tbody td[data-label="Team"] {
        flex: 1 1 calc(50% - 5px); min-width: 0;
        display: block;
        background: var(--panel-alt);
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 7px 10px;
    }
    .table.responsive tbody td[data-label="Priority"]::before,
    .table.responsive tbody td[data-label="Status"]::before,
    .table.responsive tbody td[data-label="Estimated"]::before,
    .table.responsive tbody td[data-label="Spent"]::before,
    .table.responsive tbody td[data-label="Team"]::before {
        display: block; margin-bottom: 3px;
    }

    /* Items sit at their natural width — a badge must not span the column */
    .table.responsive tbody td > * { grid-column: 2; min-width: 0; justify-self: start; }
    .table.responsive tbody td .meter,
    .table.responsive tbody td .progress-row { justify-self: stretch; width: 100%; }
    .table.responsive tbody td.num { text-align: left; }
    .table.responsive tbody td .actions { justify-content: flex-start; }
    .table.responsive .meter { min-width: 0; flex: 1; }

    /* The trailing icon-only actions cell (also label-less, but with nothing
       after it) reads better as a right-aligned strip under the card. */
    .table.responsive tbody td[data-label=""]:last-child {
        flex: 1 1 100%; justify-content: flex-end;
        padding-top: 8px; border-top: 1px solid var(--line);
    }
}

/* ==================================================================
   LISTS  (tasks, activity, members)
   ================================================================== */

.list { list-style: none; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: none; }

.task-row {
    display: flex; align-items: flex-start; gap: 13px;
    padding: 14px 18px;
    transition: background .1s;
}
.task-row:hover { background: var(--panel-alt); }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }

.task-tick {
    width: 22px; height: 22px; flex: 0 0 22px;
    border: 1.5px solid var(--ink); background: var(--panel);
    display: grid; place-items: center; cursor: pointer;
    box-shadow: 2px 2px 0 rgba(11, 11, 12, .12);
    transition: background .12s, transform .1s;
    margin-top: 1px;
}
.task-tick svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 2.6; opacity: 0; }
.task-tick:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(11, 11, 12, .12); }
.task-row.done .task-tick { background: var(--good-solid); border-color: var(--good-solid); }
.task-row.done .task-tick svg { opacity: 1; }

.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 13.5px; }
.task-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
             margin-top: 5px; font-size: 11.5px; color: var(--muted); }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }

.activity-item { display: flex; gap: 12px; padding: 12px 18px; }
.activity-dot {
    width: 26px; height: 26px; flex: 0 0 26px;
    border: 1px solid var(--neutral-line); background: var(--neutral-tint);
    color: var(--neutral);
    display: grid; place-items: center;
}
.activity-dot.is-good { background: var(--good-tint); border-color: var(--good-line); color: var(--good); }
.activity-dot.is-warn { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.activity-dot.is-info { background: var(--info-tint); border-color: var(--info-line); color: var(--info); }
.activity-dot.is-crit { background: var(--crit-tint); border-color: var(--crit-line); color: var(--crit); }
.activity-text { font-size: 12.5px; line-height: 1.45; }
.activity-time { font-family: var(--mono); font-size: 10px; color: var(--muted-light);
                 letter-spacing: .05em; margin-top: 3px; }

.member-row { display: flex; align-items: center; gap: 11px; padding: 11px 18px; }

/* ==================================================================
   EVENT CARDS
   ================================================================== */

.event-card {
    background: var(--panel); border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: flex; flex-direction: column;      /* keeps every footer aligned */
    transition: transform .14s, box-shadow .14s;
}
.event-card > a { flex: 1; display: flex; flex-direction: column; }
.event-card > a > .event-card-body { flex: 1; }
.event-card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lg); }

.event-card-top { padding: 16px 18px 14px; border-bottom: 1px solid var(--line); }
.event-card-body { padding: 14px 18px; }
.event-card-foot {
    padding: 11px 18px; border-top: 1px solid var(--line);
    background: var(--panel-alt);
    display: flex; align-items: center; gap: 14px;
    font-size: 11.5px; color: var(--muted);
}
.event-card-foot span { display: inline-flex; align-items: center; gap: 5px; }

.date-block {
    width: 52px; flex: 0 0 52px; text-align: center;
    border: 1px solid var(--info-line); background: var(--panel); overflow: hidden;
}
.date-block .m { background: var(--info-solid); color: #fff; font-family: var(--mono);
                 font-size: 9px; letter-spacing: .12em; padding: 2px 0; text-transform: uppercase; }
.date-block .d { font-family: var(--mono); font-size: 19px; font-weight: 700; padding: 3px 0 4px; }

/* ==================================================================
   EVENT HEADER BAR — the whole event summary in one slim strip
   ================================================================== */

.event-bar {
    background: var(--panel); border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.event-bar-metrics {
    display: flex; flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
}

.metric {
    flex: 1 1 0; min-width: 110px;
    padding: 7px 12px;
    border-right: 1px solid var(--line);
}
.metric:last-child { border-right: none; }

.metric .label { display: block; margin-bottom: 2px; }
.metric-value {
    font-family: var(--mono); font-size: 15px; font-weight: 700;
    letter-spacing: -.02em; line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.metric-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.metric .progress-track { height: 4px; margin-top: 4px; }
.metric.is-crit .metric-value { color: var(--crit); }
.metric.is-warn .metric-value { color: var(--warn); }
.metric.is-good .metric-value { color: var(--good); }

.event-bar-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
    padding: 10px 16px; background: var(--panel-alt);
    font-size: 12px; color: var(--muted);
}
.event-bar-meta span { display: inline-flex; align-items: center; gap: 6px; }
.event-bar-meta .desc {
    flex: 1 1 260px; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--ink-soft);
}

@media (max-width: 760px) {
    .metric { flex-basis: 50%; border-bottom: 1px solid var(--line); }
    .event-bar-meta .desc { flex-basis: 100%; white-space: normal; }
}

/* ==================================================================
   TABS
   ================================================================== */

/* Folder tabs: the unselected ones sit back on the strip, the selected one
   comes forward as a sheet and merges into the panel underneath it. */
.tabs {
    display: flex; gap: 3px; align-items: flex-end;
    padding: 8px 10px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    /* On a phone the strip scrolls sideways instead of wrapping a tab's
       label onto a second line or overflowing the page itself. */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 10px 20px;
    font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    margin-bottom: -1px;          /* overlap the strip's line */
    cursor: pointer; display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
    transition: color .12s, background .12s, border-color .12s;
}
.tab:hover:not(.active) { color: var(--ink); background: var(--panel); }
.tab.active {
    color: var(--ink);
    background: var(--panel);
    border-bottom-color: var(--panel);   /* erase the strip line under this tab */
    box-shadow: inset 0 3px 0 var(--info-solid);
    cursor: default;
}
.tab .count {
    font-family: var(--mono); font-size: 10px; font-weight: 700;
    background: var(--panel-alt); border: 1px solid var(--line); padding: 1px 5px;
}
.tab.active .count { background: var(--ink); color: #fff; border-color: var(--ink); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* A page whose list and add / edit form are two tabs of one sheet. */
.tab-sheet { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.tab-sheet > .tabs { margin: -1px -1px 0; }

.form-tab { padding: 16px 16px 0; }
.form-tab .card { box-shadow: none; }
.form-tab .card-body { padding: 14px 16px 4px; }
.form-tab-grid { display: grid; gap: 14px; align-items: start; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-tab-col  { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.form-tab-grid .field label .muted { font-weight: 400; }
.form-tab-foot {
    position: sticky; bottom: 0; z-index: 5; margin: 16px -16px 0; padding: 12px 16px;
    display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
    background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -6px 12px rgba(34, 35, 42, .06);
}
.form-tab-foot .label { margin-right: auto; }
@media (max-width: 900px) { .form-tab-grid { grid-template-columns: minmax(0, 1fr); } }

/* Filter pills */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill {
    padding: 6px 12px; font-family: var(--mono); font-size: 10px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    border: 1px solid var(--line); background: var(--panel); color: var(--muted);
    cursor: pointer; transition: all .12s;
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink);
               box-shadow: 2px 2px 0 rgba(11, 11, 12, .18); }

/* ==================================================================
   MODAL
   ================================================================== */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(11, 11, 12, .55);
    backdrop-filter: blur(2px);
    display: none; align-items: flex-start; justify-content: center;
    padding: 40px 20px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal {
    width: 100%; max-width: 620px;
    background: var(--panel);
    border: 1px solid var(--ink);
    box-shadow: 10px 10px 0 rgba(11, 11, 12, .28);
    animation: modal-in .16s ease-out;
}
.modal.narrow { max-width: 460px; }
.modal.wide   { max-width: 1040px; }

@keyframes modal-in { from { opacity: 0; transform: translate(-6px, -10px); } to { opacity: 1; transform: none; } }

.modal-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin-right: auto; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot {
    padding: 14px 20px; border-top: 1px solid var(--line);
    background: var(--panel-alt);
    display: flex; gap: 10px; justify-content: flex-end;
}

/* ==================================================================
   TOASTS
   ================================================================== */

.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 300;
          display: flex; flex-direction: column; gap: 10px; max-width: 340px; }

.toast {
    background: var(--ink); color: #fff;
    border: 1px solid #000;
    box-shadow: 5px 5px 0 rgba(11, 11, 12, .3);
    padding: 12px 15px;
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; font-weight: 500;
    animation: toast-in .18s ease-out;
}
.toast { background: var(--good); border-color: var(--good); }
.toast.err { background: var(--panel); color: var(--crit); border: 2px solid var(--crit-solid); }
.toast .icon { flex: 0 0 18px; margin-top: 1px; }

@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ==================================================================
   EMPTY / LOADING STATES
   ================================================================== */

.empty { padding: 46px 24px; text-align: center; }
.empty-mark {
    width: 52px; height: 52px; margin: 0 auto 14px;
    border: 2px dashed var(--line); display: grid; place-items: center; color: var(--muted-light);
}
.empty h3 { margin-bottom: 5px; }
.empty p { color: var(--muted); font-size: 13px; max-width: 380px; margin: 0 auto; }
.empty .btn { margin-top: 16px; }

.skeleton {
    background: linear-gradient(90deg, #E6E6E9 25%, #F0F0F2 50%, #E6E6E9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    height: 14px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    animation: spin .6s linear infinite;
}
.spinner.dark { border-color: rgba(11, 11, 12, .2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================================================================
   LOGIN SCREEN
   ================================================================== */

.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

.auth-side {
    background: var(--ink); color: #fff;
    padding: 46px 52px;
    display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}

.auth-side::after {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 34px 34px;
    pointer-events: none;
}

.auth-side > * { position: relative; z-index: 1; }

.auth-headline { font-size: 40px; font-weight: 700; letter-spacing: -.035em; line-height: 1.08; margin: 0 0 22px; }
.auth-headline em { font-style: normal; display: block; color: rgba(255, 255, 255, .42); }
.auth-lead { color: rgba(255, 255, 255, .62); font-size: 14.5px; max-width: 420px; margin-bottom: 34px; }

.auth-features { display: grid; gap: 1px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .14); }
.auth-feature { background: var(--ink); padding: 15px 16px; display: flex; gap: 12px; align-items: flex-start; }
.auth-feature .icon { flex: 0 0 18px; margin-top: 2px; }
.auth-feature strong { display: block; font-size: 13px; margin-bottom: 2px; color: #fff; }
.auth-feature span { font-size: 11.5px; color: rgba(255, 255, 255, .52); line-height: 1.45; }

.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); position: relative; }

.auth-main::before {
    content: ""; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(11, 11, 12, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 11, 12, .03) 1px, transparent 1px);
    background-size: 28px 28px;
}

.auth-card {
    width: 100%; max-width: 410px;
    background: var(--panel);
    border: 1px solid var(--ink);
    box-shadow: 10px 10px 0 rgba(11, 11, 12, .12);
    padding: 34px;
    position: relative; z-index: 1;
}

.auth-card h1 { font-size: 25px; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }

.auth-alert {
    display: none; gap: 9px; align-items: flex-start;
    border: 1.5px solid var(--ink); background: var(--panel-alt);
    padding: 11px 13px; margin-bottom: 18px; font-size: 12.5px; font-weight: 500;
    box-shadow: 3px 3px 0 rgba(11, 11, 12, .1);
}
.auth-alert.show { display: flex; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted-light); }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.auth-divider span { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; }

.demo-creds { display: grid; gap: 8px; }
.demo-cred {
    display: flex; align-items: center; gap: 10px;
    border: 1px dashed var(--line); padding: 9px 11px;
    font-size: 12px; cursor: pointer; background: var(--panel-alt);
    transition: border-color .12s, transform .1s;
}
.demo-cred:hover { border-color: var(--ink); border-style: solid; transform: translate(-1px, -1px); }
.demo-cred .mono { margin-left: auto; font-size: 11px; color: var(--muted); }

/* ==================================================================
   PAGINATION & BULK ROW SELECTION
   ================================================================== */

.pagination {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 13px 16px; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.page-btn {
    min-width: 30px; height: 30px; padding: 0 8px;
    font-family: var(--mono); font-size: 12px; font-weight: 700;
    border: 1px solid var(--line); background: var(--panel); color: var(--muted);
    cursor: pointer; transition: color .12s, background .12s, border-color .12s;
}
.page-btn:hover:not(:disabled):not(.active) { color: var(--ink); border-color: var(--ink); }
.page-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); cursor: default; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }
.page-ellipsis { color: var(--muted-light); font-family: var(--mono); font-size: 12px; padding: 0 2px; }

/* Toolbar that replaces the filter bar once a row is checked */
.bulk-toolbar { background: var(--panel-alt); }
.bulk-toolbar .bulk-count { font-size: 13px; font-weight: 600; }

.select-cell { width: 32px; }
.select-cell .check { display: inline-flex; }
th.select-cell { vertical-align: middle; }

/* ==================================================================
   RESPONSIVE
   ================================================================== */

@media (max-width: 1100px) {
    .grid-main { grid-template-columns: minmax(0, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: none; box-shadow: 14px 0 0 rgba(11, 11, 12, .18); }
    .main { margin-left: 0; }
    .menu-toggle.btn-icon { display: grid; }
    .content { padding: 18px 16px; }
    .topbar { padding: 0 16px; }
    .grid-3, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .scrim { position: fixed; inset: 0; background: rgba(11,11,12,.45); z-index: 55; }
}

@media (max-width: 560px) {
    .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .auth-card { padding: 24px; }
    .col-chart { gap: 6px; }
    .col-chart-plot { height: 110px; }
    .col-chart-label { font-size: 9.5px; }
    .toasts { left: 16px; right: 16px; max-width: none; }

    /* The topbar has to fit a title and two actions on a phone */
    .topbar { padding: 0 12px; gap: 10px; }
    .topbar h1 { font-size: 16px; }
    .topbar-sub { display: none; }
    .topbar-actions { gap: 6px; }
    .topbar-actions .btn { padding: 8px 11px; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }
    .topbar-actions .btn-ghost { box-shadow: 2px 2px 0 rgba(11, 11, 12, .1); }
    .modal-head h2 { font-size: 15px; }
    .card-head { padding: 13px 14px; flex-wrap: wrap; }
    .task-row, .activity-item, .member-row { padding: 12px 14px; }

    /* Bigger touch targets — a mouse-sized 32px icon button is fiddly under
       a thumb; this brings the tappable area closer to the ~40px an app
       would use, without changing the icon itself. */
    .btn-icon { width: 40px; height: 40px; }
    .cell-tick { width: 24px; height: 24px; }
    .task-tick { width: 26px; height: 26px; }

    /* Modals become bottom sheets — anchored to the bottom edge and sliding
       up, the way a native app would present them, instead of a dialog
       floating in the middle of a small screen. */
    .modal-backdrop { align-items: flex-end; padding: 0; }
    .modal {
        max-width: none; width: 100%;
        max-height: 92vh; overflow-y: auto;
        border-left: none; border-right: none; border-bottom: none;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 0 rgba(11, 11, 12, .18);
        animation: sheet-in .18s ease-out;
        position: relative;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .modal.narrow, .modal.wide { max-width: none; }
    .modal::before {
        content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
        width: 36px; height: 4px; background: var(--line); border-radius: 2px;
    }
    .modal-head { padding-top: 22px; }
}

@keyframes sheet-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

@media print {
    .sidebar, .topbar-actions, .btn, .tabs { display: none !important; }
    .main { margin-left: 0; }
    .card { box-shadow: none; border: 1px solid #000; }
}

/* ==================================================================
   TASK NOTES — the thread of notes, questions and ideas on a task
   ================================================================== */

.note-btn {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 3px 8px;
    border: 1px dashed var(--line); background: none; cursor: pointer; color: var(--muted);
    font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.note-btn:hover { border-style: solid; color: var(--ink); }
.note-btn.has-notes { border-style: solid; border-color: var(--info-line); background: var(--info-tint); color: var(--info); }
.note-btn .icon { width: 12px; height: 12px; }
.btn-icon.note-icon { position: relative; }
.btn-icon.note-icon.has-notes { border-color: var(--info-line); background: var(--info-tint); color: var(--info); }
.note-icon .note-count {
    position: absolute; top: -7px; right: -7px; min-width: 16px; padding: 1px 4px;
    font-family: var(--mono); font-size: 9px; font-weight: 700; line-height: 1.3; text-align: center;
    background: var(--info-solid); color: #fff;
}

.nt-list { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; margin-bottom: 16px; }
.nt-item { border: 1px solid var(--line); background: var(--panel-alt); padding: 10px 12px; }
.nt-item.is-question    { border-left: 3px solid var(--warn-solid); }
.nt-item.is-improvement { border-left: 3px solid var(--good-solid); }
.nt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.nt-head strong { color: var(--ink); font-size: 13px; }
.nt-actions { margin-left: auto; display: flex; gap: 4px; }
.nt-body { margin-top: 6px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.nt-empty { padding: 18px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed var(--line); }
.nt-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.nt-form .textarea, .nt-item .textarea { min-height: 84px; resize: vertical; }
.nt-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }

/* ==================================================================
   NOTIFICATIONS — the bell, its panel, and the dashboard card
   ================================================================== */

.notif-bell { position: relative; }
.notif-bell .notif-count {
    position: absolute; top: -7px; right: -7px; min-width: 17px; padding: 1px 4px;
    font-family: var(--mono); font-size: 9.5px; font-weight: 700; line-height: 1.35; text-align: center;
    background: var(--crit-solid); color: #fff; border: 1px solid var(--panel);
}
.notif-bell.has-new { animation: notif-ring .5s ease-in-out 2; }
@keyframes notif-ring { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }

.notif-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 210;
    width: 400px; max-width: 100%;
    display: flex; flex-direction: column;
    background: var(--panel); border-left: 1px solid var(--ink);
    box-shadow: -10px 0 0 rgba(11, 11, 12, .12);
    animation: notif-in .16s ease-out;
}
@keyframes notif-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.notif-scrim { position: fixed; inset: 0; z-index: 205; background: rgba(11, 11, 12, .35); }
.notif-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.notif-head h2 { font-size: 16px; margin-right: auto; }
.notif-tabs { display: flex; gap: 6px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.notif-body { flex: 1; overflow-y: auto; }
.notif-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel-alt); }

.notif-list { display: flex; flex-direction: column; }
.notif-item {
    display: flex; gap: 12px; width: 100%; padding: 13px 18px; text-align: left;
    background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; color: inherit; font: inherit;
}
.notif-item:hover { background: var(--panel-alt); }
.notif-item.is-unread { background: var(--info-tint); }
.notif-item.is-unread:hover { background: var(--panel-alt); }
.notif-icon { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel); }
.notif-icon .icon { width: 15px; height: 15px; }
.notif-icon.is-info { color: var(--info); border-color: var(--info-line); }
.notif-icon.is-warn { color: var(--warn); border-color: var(--warn-line); }
.notif-icon.is-good { color: var(--good); border-color: var(--good-line); }
.notif-icon.is-crit { color: var(--crit); border-color: var(--crit-line); }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.notif-item.is-unread .notif-title { font-weight: 700; }
.notif-text { margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.notif-time { margin-top: 4px; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-light); }
.notif-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 6px; background: var(--info-solid); }
.notif-empty { padding: 36px 18px; text-align: center; font-size: 13px; color: var(--muted); }
.card .notif-item:last-child { border-bottom: 0; }

@media (max-width: 760px) {
    .notif-panel { width: 100%; border-left: 0; }
}

/* ==================================================================
   TEMPLATE TASK PICKER — which of its template's tasks an event takes
   ================================================================== */

tr.is-skipped td:not(.select-cell) { opacity: .45; }
.tt-pick { border: 1px solid var(--line); }
.tt-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel-alt); border-bottom: 1px solid var(--line); }
.tt-head .label { margin-left: auto; }
.tt-list { max-height: 300px; overflow-y: auto; }
.tt-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.tt-item:last-child { border-bottom: 0; }
.tt-item:hover { background: var(--panel-alt); }
.tt-item.is-locked { cursor: not-allowed; }
.tt-body { flex: 1; min-width: 0; }
.tt-title { font-size: 13px; font-weight: 600; display: block; }
.tt-sub { font-size: 11.5px; color: var(--muted); display: block; margin-top: 1px; }
.tt-tag { flex: 0 0 auto; }
.tt-foot { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ==================================================================
   S.N. — the serial-number column every table starts with
   ================================================================== */

.table .sn-cell {
    width: 52px; text-align: right; white-space: nowrap;
    font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}
.table thead th.sn-cell { font-size: 10px; }

/* On a phone the number becomes a small "#3" in front of the row's title. */
@media (max-width: 760px) {
    .table.responsive tbody td.sn-cell {
        flex: 0 0 auto; display: block; width: auto;
        font-size: 11px; font-weight: 700; padding-top: 2px;
    }
    .table.responsive tbody td.sn-cell::before { content: '#'; font: inherit; letter-spacing: 0; color: inherit; padding: 0; }
    .table.responsive tbody td.sn-cell + td:not([data-label=""]) { flex: 1 1 0; min-width: 0; display: block; }
    .table.responsive tbody td.sn-cell + td:not([data-label=""])::before { content: none; }
}

/* ==================================================================
   SPEND VS ESTIMATE — the over / under / on-budget chip on a task
   ================================================================== */

.variance {
    display: inline-block; margin-top: 4px; padding: 2px 6px; white-space: nowrap;
    font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
    border: 1px solid;
}
.variance.is-over  { background: var(--crit-tint); border-color: var(--crit-line); color: var(--crit); }
.variance.is-under { background: var(--good-tint); border-color: var(--good-line); color: var(--good); }
.variance.is-even  { background: var(--info-tint); border-color: var(--info-line); color: var(--info); }
.num .variance { text-align: right; }

/* The template-budget review: task, then the three amounts side by side */
.tb-table .input { max-width: 120px; padding: 6px 8px; text-align: right; }
.tb-table tr.is-skipped td:not(.select-cell) { opacity: .45; }

/* ==================================================================
   SYNC BUTTONS — how much still differs from the template, or a tick
   ================================================================== */

.sync-btn { gap: 6px; }
.sync-btn .sync-count {
    min-width: 18px; padding: 1px 5px; line-height: 1.35; text-align: center;
    font-family: var(--mono); font-size: 10px; font-weight: 700;
    background: var(--warn-solid); color: #fff;
}
.sync-btn .sync-done { display: inline-grid; place-items: center; color: var(--good); }
.sync-btn .sync-done .icon { width: 14px; height: 14px; stroke-width: 3; }
.sync-btn.is-synced { color: var(--muted); }
.sync-btn.has-pending { border-color: var(--warn-line); }

/* A status shown as text, not a control: icon + label in its tone */
.status-text { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.status-text.is-neutral { color: var(--muted); }
.status-text.is-warn    { color: var(--warn); }
.status-text.is-good    { color: var(--good); }

/* ==================================================================
   EVENT DETAILS — overview, partner organisations, report, photos
   ================================================================== */


/* Overview: when / how long / where / status, as tiles */
.ev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.ev-fact { padding: 14px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ev-fact .label { display: block; margin-bottom: 5px; }
.ev-fact-value { font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.ev-fact-sub { font-size: 12px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.ev-desc { padding: 14px 18px; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; color: var(--ink); }

/* Partner organisations: one card each */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.org-card { border: 1px solid var(--line); background: var(--panel); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.org-card-head { display: flex; align-items: flex-start; gap: 8px; }
.org-card-name { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.org-card-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.org-card-line .icon { width: 13px; height: 13px; flex: 0 0 13px; }
.org-card-line a { color: var(--ink); text-decoration: underline; }
.org-card-notes { font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; padding-top: 6px; border-top: 1px dashed var(--line); }

/* The report: labelled sections of free text */
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.report-part { min-width: 0; }
.report-part.is-wide { grid-column: 1 / -1; }
.report-part .label { display: block; margin-bottom: 5px; }
.report-text { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) { .report-grid { grid-template-columns: minmax(0, 1fr); } }

/* Photo gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.gallery-item { display: flex; flex-direction: column; border: 1px solid var(--line); background: var(--panel); }
.gallery-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; background: var(--panel-alt); border: 0; padding: 0; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-caption { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-wrap: anywhere; }
.gallery-title { font-size: 13px; font-weight: 700; line-height: 1.35; }
.gallery-title.is-empty { color: var(--muted-light); font-weight: 500; font-style: italic; }
.gallery-desc { font-size: 12px; line-height: 1.45; color: var(--muted);
                display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Edit (✎) and delete (✕) sit on the photo's corner — quiet until the photo is hovered */
.gallery-media { position: relative; }
.gallery-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.gallery-tool { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; cursor: pointer;
                border: 1px solid rgba(255, 255, 255, .6); background: rgba(17, 17, 20, .62); color: #fff; }
.gallery-tool:hover { background: var(--ink); }
.gallery-tool.is-danger:hover { background: var(--crit-solid); border-color: var(--crit-solid); }
@media (hover: hover) {
    .gallery-tools { opacity: 0; transition: opacity .15s; }
    .gallery-item:hover .gallery-tools, .gallery-tools:focus-within { opacity: 1; }
}

/* The uploader: chosen photos on the left, the selected one's details on the right */
.up-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 18px; min-height: 380px; }
.up-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.up-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.up-tile { position: relative; display: flex; gap: 10px; align-items: center; padding: 6px 30px 6px 6px; cursor: pointer;
           border: 1px solid var(--line); background: var(--panel); }
.up-tile:hover { background: var(--panel-alt); }
.up-tile.is-selected { border-color: var(--info-solid); box-shadow: inset 3px 0 0 var(--info-solid); background: var(--info-tint); }
.up-tile.is-done { opacity: .7; }
.up-thumb { position: relative; width: 64px; height: 48px; flex: 0 0 64px; display: grid; place-items: center; overflow: hidden; background: var(--panel-alt); }
.up-thumb img { width: 100%; height: 100%; object-fit: cover; }
.up-state { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: #fff; }
.up-state.is-done { background: rgba(22, 128, 61, .55); }
.up-state.is-failed { background: rgba(190, 18, 60, .6); font-size: 18px; }
.up-tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.up-tile-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-tile-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-tile-bar { height: 4px; }
.up-tile-bar .progress-fill { transition: width .15s linear; }
.up-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0;
             border: 0; background: none; color: var(--muted); cursor: pointer; }
.up-remove:hover { color: var(--crit); background: var(--crit-tint); }
.up-more { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; cursor: pointer;
           border: 1px dashed var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.up-more:hover { border-color: var(--ink); color: var(--ink); }
.up-more.is-disabled { pointer-events: none; opacity: .5; }
.up-editor { min-width: 0; }
.up-preview { display: grid; place-items: center; height: 260px; background: #111114; overflow: hidden; }
.up-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.up-overall { flex: 1; display: flex; flex-direction: column; gap: 5px; margin-right: auto; min-width: 0; max-width: 380px; }
.up-overall-text { font-size: 12px; color: var(--muted); }
.up-bar { height: 6px; }
.up-bar .progress-fill { transition: width .15s linear; }
@media (max-width: 760px) {
    .up-grid { grid-template-columns: minmax(0, 1fr); }
    .up-list { max-height: 30vh; }
    .up-preview { height: 200px; }
}

/* Full-size viewer */
.lightbox { position: fixed; inset: 0; z-index: 220; background: rgba(11, 11, 12, .9); display: flex; flex-direction: column;
            align-items: center; justify-content: center; padding: 24px; gap: 12px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; background: #111; }
.lightbox-caption { color: #fff; font-size: 14px; max-width: 900px; text-align: center; line-height: 1.5; }
.lightbox-bar { position: absolute; top: 14px; right: 14px; left: 14px; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.lightbox-bar .btn-icon { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }
.lightbox-count { font-family: var(--mono); font-size: 12px; }

/* ==================================================================
   TASK VERIFICATION — under a completed task's status
   ================================================================== */

.verify-btn {
    height: 32px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; white-space: nowrap;
    font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
    border: 1px solid var(--info-line); background: var(--info-tint); color: var(--info);
}
.verify-btn .icon { width: 14px; height: 14px; }
button.verify-btn:hover { border-color: var(--info-solid); background: var(--info-solid); color: #fff; }
.verify-btn.is-done { border-color: var(--good-line); background: var(--good-tint); color: var(--good); }
button.verify-btn.is-done:hover { border-color: var(--good-solid); background: var(--good-solid); color: #fff; }
.verify-btn.is-static { cursor: default; }
.verify-btn.is-waiting { border: 1px dashed var(--line); background: none; color: var(--muted); font-weight: 600; }

/* The small tag form, under a task's status on My Tasks and All Tasks */
.verify-mark {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; padding: 2px 7px;
    font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    border: 1px solid var(--line); background: var(--panel); color: var(--muted); white-space: nowrap;
}
.verify-mark .icon { width: 12px; height: 12px; }
.verify-mark.is-done { border-color: var(--good-line); background: var(--good-tint); color: var(--good); }
.verify-mark.is-waiting { border-style: dashed; }

/* ==================================================================
   TASK DEADLINE — the chip under a task's title
   ================================================================== */

.due-chip {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; padding: 2px 7px;
    font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
    border: 1px solid var(--line); background: var(--panel); color: var(--muted);
}
.due-chip .icon { width: 12px; height: 12px; }
button.due-chip { cursor: pointer; }
button.due-chip:hover { border-color: var(--ink); color: var(--ink); }
.due-chip.is-empty { border-style: dashed; }
.due-chip.is-near { border-color: var(--info-line); background: var(--info-tint); color: var(--info); }
.due-chip.is-soon { border-color: var(--warn-line); background: var(--warn-tint); color: var(--warn); }
.due-chip.is-late { border-color: var(--crit-line); background: var(--crit-tint); color: var(--crit); }
.due-chip.is-done { color: var(--muted-light); }

/* ==================================================================
   EVENT UPDATES — posts from the event's creator and coordinator
   ================================================================== */

.upd-list { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.upd-item { border: 1px solid var(--line); border-left: 3px solid var(--neutral-line); background: var(--panel-alt); padding: 10px 12px; }
.upd-item.is-summary  { border-left-color: var(--info-solid); }
.upd-item.is-feedback { border-left-color: var(--good-solid); }
.upd-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.upd-head strong { color: var(--ink); font-size: 13px; }
.upd-actions { margin-left: auto; display: flex; gap: 4px; }
.upd-body { margin-top: 6px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.upd-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.upd-form .textarea { min-height: 72px; resize: vertical; }
.upd-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }

/* The latest feedback, previewed on the event page's Feedback card */
.fb-peek { display: flex; flex-direction: column; gap: 10px; }
.fb-peek-item { border-left: 3px solid var(--good-solid); padding: 2px 0 2px 10px; }
.fb-peek-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.fb-peek-body { margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--ink);
                display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }

/* The Photos window opened from the events list */
.media-modal-body { max-height: 62vh; overflow-y: auto; }

/* ==================================================================
   MEETINGS — action-item dialog, range input, workflow stepper
   ================================================================== */

.range { width: 100%; accent-color: var(--ink); margin-top: 8px; }

.ai-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.ai-desc { padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); background: var(--panel-alt);
           font-size: 13px; line-height: 1.55; }
.ai-desc .label { display: block; margin-bottom: 4px; }
.ai-progress { margin-bottom: 16px; }

/* The meeting's journey, one step per stage: done steps are ticked, the
   current one is ink, the rest stay quiet. Text always carries the state. */
.stepper { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); }
.step {
    flex: 1 0 auto; display: flex; align-items: center; gap: 8px; padding: 12px 14px;
    font-size: 11.5px; font-weight: 600; color: var(--muted-light); white-space: nowrap;
    border-right: 1px solid var(--line);
}
.step:last-child { border-right: none; }
.step-dot {
    width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center;
    border: 1.5px solid var(--line); font-family: var(--mono); font-size: 10px; background: var(--panel);
}
.step.is-done { color: var(--good); }
.step.is-done .step-dot { background: var(--good-solid); border-color: var(--good-solid); color: #fff; }
.step.is-current { color: var(--ink); background: var(--panel-alt); }
.step.is-current .step-dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.step .icon { width: 11px; height: 11px; stroke-width: 3; }

/* Agenda list editor: numbered rows, each renamed in place, reordered by
   dragging the grip or with the arrows. */
.ag-edit { border: 1px solid var(--line); background: var(--panel); }
.ag-edit-list { list-style: none; max-height: 340px; overflow-y: auto; }
.ag-edit-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ag-edit-row .input { flex: 1; min-width: 0; padding: 6px 9px; font-size: 13px; box-shadow: none; }
.ag-edit-row .btn-icon { width: 28px; height: 28px; }
.ag-edit-row .btn-icon:disabled { opacity: .3; cursor: default; }
.ag-edit-row.is-dragging { opacity: .45; }
.ag-edit-row.is-drop { box-shadow: inset 0 3px 0 var(--info-solid); }
.ag-edit-grip { cursor: grab; color: var(--muted-light); display: grid; place-items: center; }
.ag-edit-num { width: 24px; flex: 0 0 24px; text-align: center; font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--muted); }
.ag-edit-empty { padding: 14px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); }
.ag-edit-add { display: flex; gap: 8px; padding: 8px; background: var(--panel-alt); }
.ag-edit-add .input { flex: 1; min-width: 0; }
