/* =====================================================================
   Campus Event Manager — design system
   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;
}

.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; }

/* 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; }

/* Repeatable task rows inside the template form */
.task-rows { border: 1px solid var(--line); }
.task-row-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.task-row-item:last-child { border-bottom: none; }
.task-row-item .row-no {
    font-family: var(--mono); font-size: 10px; font-weight: 700;
    color: var(--muted-light); width: 16px; flex: 0 0 16px; text-align: right;
}
/* Title, description and budget share the row evenly; priority gets a fixed slot. */
.task-row-item .t-title,
.task-row-item .t-desc,
.task-row-item .t-budget { flex: 1 1 0; min-width: 0; }
.task-row-item .t-priority { flex: 0 0 130px; }

/* Too narrow for one line — let the row wrap instead of crushing every field. */
@media (max-width: 700px) {
    .task-row-item { flex-wrap: wrap; }
    .task-row-item .t-title, .task-row-item .t-desc,
    .task-row-item .t-budget, .task-row-item .t-priority { flex: 1 1 100%; }
}
.task-rows-foot {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 11px; background: var(--panel-alt); border-top: 1px solid var(--line);
}
.task-rows-foot .total { margin-left: auto; font-family: var(--mono); font-size: 12px; font-weight: 700; }

/* 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-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); }

/* ==================================================================
   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 .cell-title { text-decoration: line-through; color: var(--muted); }
.table tbody tr.is-muted { opacity: .6; }
.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; }
.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; }

/* 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 labelled rows */
@media (max-width: 760px) {
    .table.responsive thead { display: none; }
    .table.responsive tbody tr {
        display: block; border-bottom: 1px solid var(--line); padding: 12px 14px;
    }
    .table.responsive tbody tr:last-child { border-bottom: none; }
    /* Grid, not flex: a cell with a title AND a sub-line stacks instead of
       laying both out side by side next to the label. */
    .table.responsive tbody td {
        display: grid; grid-template-columns: 88px minmax(0, 1fr);
        align-items: start; gap: 3px 12px;
        padding: 5px 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;
    }
    /* 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; }
}

/* ==================================================================
   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);
}

.tab {
    padding: 10px 20px;
    font-size: 13px; font-weight: 600; color: var(--muted);
    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;
    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; }

/* 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; }
    .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; }
}

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