/* =================================================================
   DistributionPL shared design system
   Used by: DistributionPL.cshtml, CrateAllocation.cshtml
   Excludes: .side-rail, .page-hero, .hero-* (kept per-page; values
   differ between pages).
   ================================================================= */

:root {
    --bg:        #eef5f3;
    --bg-2:      #e2efeb;
    --surface:   #ffffff;
    --surface-2: #f8fbfb;
    --border:rgba(11,47,94,.14);
    --border-2:  rgba(245,130,32,.24);
    --text-1:    #0B2F5E;
    --text-2:#1e3a5f;
    --text-3:#F58220;
    --text-mute: #7ba8a1;
    --teal:#F58220;
    --teal-b:    #FF9F4D;
    --teal-d:    #083057;
    --teal-dim:rgba(245,130,32,.08);
    --teal-grad: linear-gradient(135deg, #F58220 0%, #FF9F4D 50%, #FFD84D 100%);
    --amber:     #d97706;
    --red:       #dc2626;
    --green:     #059669;
    --blue:      #2563eb;
    --orange:    #F58220;
    --pink:      #E4032E;
    --ink-900:   #020617;
    --font-b:    'Roboto', system-ui, -apple-system, sans-serif;
    --font-h:    'Roboto', system-ui, -apple-system, sans-serif;
    --ease:      cubic-bezier(.22,1,.36,1);
    --sh-xs:     0 1px 2px rgba(8,41,37,.05);
    --sh-sm:     0 2px 6px rgba(245,130,32,.07);
    --sh-md:     0 6px 22px rgba(245,130,32,.09);
    --sh-lg:     0 14px 44px rgba(8,41,37,.12);
    /* The carved-surface pair, consumed by `.btn` below. Declared here as well
       as in `Pages/Shared/_Layout.cshtml` and `Pages/PlanningManager.cshtml` so
       that each file stands on its own: a `var()` whose token resolves nowhere
       makes the whole `box-shadow` declaration invalid at computed-value time,
       and an invalid shadow is silently no shadow — not a fallback. The layout
       needs its own copy because its inline block styles the navbar and the
       Quick Links strip; PlanningManager needs one because it is `Layout = null`
       and never loads this file at all. The three copies are asserted
       byte-identical by .claude/tmp/qlcss/check.js. */
    --neu-hi:      rgba(255, 255, 255, 0.92);
    --neu-lo:      rgba(11, 47, 94, 0.15);
    --neu-lo-deep: rgba(11, 47, 94, 0.20);
    --neu-raised:  -2px -2px 4px var(--neu-hi), 2px 2px 5px var(--neu-lo);
    --neu-raised-hi: -3px -3px 6px var(--neu-hi), 3px 3px 8px var(--neu-lo);
    --neu-raised-xs: -1px -1px 2px var(--neu-hi), 1px 1px 3px var(--neu-lo);
    --neu-pressed: inset -2px -2px 4px var(--neu-hi), inset 2px 2px 5px var(--neu-lo-deep);
    --r-sm:      8px;
    --r-md:      12px;
    --r-lg:      18px;
    --r-xl:      24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    background:
        radial-gradient(ellipse 1200px 600px at 10% -10%, rgba(245,130,32,.10), transparent 60%),
        radial-gradient(ellipse 1000px 500px at 110% 20%, rgba(245,130,32,.06), transparent 60%),
        var(--bg) !important;
    font-family: var(--font-b); color: var(--text-1) !important;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout shell ─────────────────────────────────────────── */
.dash-shell { display: grid; grid-template-columns: 72px 1fr; min-height: 100vh; }
/* overflow-x: clip, not hidden — `hidden` makes .dash-main a scroll container
   and silently kills position: sticky on the .side-nav rail inside it (the
   rail's height:100vh then leaves its lower links unreachable). `clip`
   contains the overflow without creating a scroll container. The `hidden`
   declaration stays first as the fallback for browsers without `clip`. */
.dash-main { padding: 28px 40px 64px; max-width: 1640px; margin: 0 auto; width: 100%; overflow-x: hidden; overflow-x: clip; }

/* ── Panels (cards) ─────────────────────────────────────────── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 22px;
    overflow: hidden;
    box-shadow: var(--sh-md);
    transition: box-shadow .25s var(--ease);
}
.panel:hover { box-shadow: var(--sh-lg); }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    flex-wrap: wrap; gap: 10px;
    cursor: pointer;
    user-select: none;
}
.panel-head:hover { background: linear-gradient(135deg, var(--surface-2) 0%, var(--bg-2) 100%); }
.panel-head-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.panel-toggle {
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(11,47,94,.08); color: var(--text-2);
    font-size: .78rem; transition: transform .25s var(--ease), background .2s;
    margin-left: auto; flex-shrink: 0;
}
.panel-head:hover .panel-toggle { background: rgba(11,47,94,.14); }
.panel.collapsed .panel-toggle { transform: rotate(-90deg); }
.panel.collapsed .panel-body { display: none; }
.panel-body { padding: 22px; }
.p-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem; flex-shrink: 0; position: relative;
}
.p-icon::after {
    content: ""; position: absolute; inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,.35), transparent 50%);
    pointer-events: none;
}
.p-icon.teal   { background: linear-gradient(135deg, rgba(245,130,32,.16), rgba(245,130,32,.10)); color: var(--teal); }
.p-icon.amber  { background: linear-gradient(135deg, rgba(217,119,6,.16), rgba(245,158,11,.10)); color: var(--amber); }
.p-icon.green  { background: linear-gradient(135deg, rgba(245,130,32,.16), rgba(16,185,129,.10)); color: var(--green); }
.p-icon.blue   { background: linear-gradient(135deg, rgba(37,99,235,.16), rgba(59,130,246,.10)); color: var(--blue); }
.p-icon.purple { background: linear-gradient(135deg, rgba(245,130,32,.16), rgba(255,159,77,.10)); color: var(--orange); }
.p-icon.red    { background: linear-gradient(135deg, rgba(220,38,38,.16), rgba(239,68,68,.10)); color: var(--red); }
.p-icon.pink   { background: linear-gradient(135deg, rgba(228,3,46,.16), rgba(245,130,32,.10)); color: var(--pink); }
.p-title { font-family: var(--font-h); font-size: .98rem; font-weight: 700; color: var(--text-1); }
.p-sub   { font-size: .72rem; color: var(--text-mute); margin-top: 1px; display: flex; align-items: center; gap: 6px; }
.p-sub i { color: var(--teal); }
.panel-body { padding: 22px; }
.panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Section number badge ───────────────────────────────────── */
.step-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 7px;
    background: var(--bg-2); color: var(--teal);
    border-radius: 100px;
    font-family: var(--font-h); font-size: .68rem; font-weight: 700;
    letter-spacing: .5px; margin-right: 2px;
}

/* ── Form fields ────────────────────────────────────────────── */
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg label {
    font-size: .68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--teal);
    display: flex; align-items: center; gap: 6px;
}
.fi, .fs {
    padding: 10px 13px; font-family: var(--font-b);
    font-size: .85rem; font-weight: 500;
    background: var(--surface-2); color: var(--text-1);
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm); outline: none;
    transition: all .2s var(--ease); width: 100%;
}
.fi:hover, .fs:hover { border-color: var(--border-2); }
.fi:focus, .fs:focus {
    border-color: var(--teal); background: var(--surface);
    box-shadow: 0 0 0 4px rgba(245,130,32,.12);
}
.fi[readonly], .fi:disabled { background: var(--bg-2); color: var(--text-3); cursor: default; }
.fs { cursor: pointer; appearance: none;
      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 fill='%234a9e95' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.fi { min-height: 72px; resize: vertical; line-height: 1.5; }
.field-hint { font-size: .7rem; color: var(--text-mute); margin-top: 2px; }

.fgrid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; margin-bottom: 14px; }
.fgrid-2 { grid-template-columns: repeat(2,1fr); }
.fgrid-3 { grid-template-columns: repeat(3,1fr); }
.fgrid-4 { grid-template-columns: repeat(4,1fr); }
.fgrid-5 { grid-template-columns: repeat(5,1fr); }

/* ── Buttons ────────────────────────────────────────────────── */
/* Carved, not filled. The whole family is now one surface treatment — no fill,
   a soft navy shade low-right, a white highlight up-left — and the variants
   differ only in the colour of the LABEL. The gradient fills, the per-variant
   colour shadows and the `::after` gloss overlay are gone: they were the last
   glossy controls on a portal whose cards, navbar and Quick Links strip had all
   moved to this language, so a saturated pill beside them read as a different
   design system.

   The variant colours could not simply move from `background` to `color`,
   because as text they were unreadable. Measured against this page's own ground
   (#eef5f3), the old white-on-fill labels were already failing AA at 2.54
   (success), 3.19 (warning), 3.68 (info), 2.15 (gold) and 3.76 (coral) — so
   those buttons had illegible labels *before* this change, not after it. Each
   hue is taken down to a step that clears 4.5:1 on the darkest ground the
   family sits on, and the steps are kept apart from one another because with no
   fill left the colour is the only thing distinguishing one variant from
   another. `--teal` is deliberately not reused: it is #F58220, a fill value at
   2.35:1, where #c2410c is that same orange at a readable weight. */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 18px;
    font-family: var(--font-b); font-size: .82rem; font-weight: 700;
    border-radius: var(--r-sm); border: none; cursor: pointer;
    text-decoration: none; transition: all .2s var(--ease);
    white-space: nowrap; letter-spacing: .01em;
    position: relative; overflow: hidden;
    background: transparent; color: var(--text-1);
    box-shadow: var(--neu-raised);
}
/* Hover deepens the raise rather than lifting the button. A `translateY` on a
   carved control reads as the whole surface sliding rather than as the depth
   changing, which is the one thing this treatment is supposed to convey. */
.btn:hover { box-shadow: var(--neu-raised-hi); }
.btn:active { box-shadow: var(--neu-pressed); }
.btn-sm { padding: 7px 13px; font-size: .76rem; }
.btn-xs { padding: 5px 10px; font-size: .72rem; }
.btn-lg { padding: 13px 26px; font-size: .9rem; }
.btn-primary   { color: #c2410c; }
.btn-success   { color: #047857; }
.btn-danger    { color: #b91c1c; }
.btn-info      { color: #1d4ed8; }
.btn-warning   { color: #92400e; }
.btn-purple    { color: #9a4a00; }
/* Ghost is the one recessed member — it is the cancel/secondary action, so it
   reads as a socket rather than a key. Without that it would be
   indistinguishable from a bare `.btn`, now that the orange hairline and the
   wash that used to separate them are gone. */
.btn-ghost { color: var(--text-2); box-shadow: var(--neu-pressed); }
.btn-ghost:hover { color: var(--teal-d); }
/* Disabled keeps the recessed shadow rather than dropping the shadow entirely:
   with no fill to fall back on, `box-shadow: none` left a disabled button as
   bare text with no shape at all. Pressed-in and faded still says "button",
   which bare text does not.

   The background has to be declared here and not merely inherited from `.btn`,
   because Bootstrap is loaded ahead of this sheet by the layout and its own
   `.btn.disabled,.btn:disabled,fieldset:disabled .btn` sets `background-color:
   var(--bs-btn-disabled-bg)` — for `.btn-primary` that is #0d6efd. That rule is
   also where `color: var(--bs-btn-disabled-color)` comes from, which is #fff for
   every filled variant: once the fill is gone that white is a label painted on
   the page's own near-white ground, so the colour has to be declared here too
   rather than left to the framework. `.btn.disabled` (the class form) is unused
   in this codebase today and is listed for the same reason — it is the other half
   of Bootstrap's selector.

   `!important` on the four properties Bootstrap sets — colour, background,
   opacity and the shadow — because Bootstrap also ships `fieldset:disabled
   .btn`, whose specificity is one class higher and would otherwise win inside a
   disabled fieldset. `cursor` needs no marker: nothing competes for it. */
.btn:disabled, .btn.disabled {
    opacity: .45 !important; cursor: not-allowed; transform: none !important;
    color: var(--text-1) !important;
    background: transparent !important; box-shadow: var(--neu-pressed) !important;
}
.btn-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ── KPI strip ──────────────────────────────────────────────── */
.kpi-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-top: 18px; }
.stat {
    position: relative; padding: 18px 18px;
    border-radius: var(--r-md); color: #fff;
    overflow: hidden; box-shadow: var(--sh-md);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); }
.stat::before {
    content: ""; position: absolute; right: -20px; top: -20px;
    width: 120px; height: 120px; border-radius: 50%;
    background: rgba(255,255,255,.08);
}
.stat::after {
    content: ""; position: absolute; right: 20px; bottom: -30px;
    width: 70px; height: 70px; border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.stat.teal   { background: linear-gradient(135deg, #F58220 0%, #FF9F4D 100%); }
.stat.green  { background: linear-gradient(135deg, #059669 0%, #10b981 100%); }
.stat.amber  { background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%); }
.stat.blue   { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.stat.purple { background: linear-gradient(135deg, #F58220 0%, #FF9F4D 100%); }
.stat.red    { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); }
.stat-label  { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; opacity: .9; margin-bottom: 6px; position: relative; z-index: 1; }
.stat-value  { font-family: var(--font-h); font-size: 1.7rem; font-weight: 700; position: relative; z-index: 1; line-height: 1.05; }
.stat-value .unit { font-size: .72rem; opacity: .75; font-weight: 600; margin-left: 4px; }
.stat-sub    { font-size: .7rem; opacity: .8; margin-top: 6px; position: relative; z-index: 1; display: flex; align-items: center; gap: 4px; }
.stat-icon   { position: absolute; right: 14px; top: 14px; font-size: 1.4rem; opacity: .25; z-index: 0; }

/* ── Tables ─────────────────────────────────────────────────── */
.tbl-wrap   { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; margin: 12px 0; background: var(--surface); }
.tbl-scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; max-height: 400px; }
.tbl-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.tbl-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
.dtbl { width: 100%; border-collapse: collapse; }
.dtbl th {
    padding: 11px 14px; font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .9px; color: var(--teal); background: var(--surface-2);
    text-align: left; border-bottom: 1px solid var(--border);
    white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.dtbl td { padding: 10px 14px; font-size: .82rem; color: var(--text-2); border-bottom: 1px solid var(--border); vertical-align: middle; }
.dtbl tbody tr { transition: background .15s var(--ease); }
.dtbl tbody tr:nth-child(even) td { background: rgba(248,251,251,.5); }
.dtbl tbody tr:last-child td { border-bottom: none; }
.dtbl tbody tr:hover td { background: var(--teal-dim); }
.tbl-empty { text-align: center; padding: 36px 24px; color: var(--text-mute); }
.tbl-empty i { display: block; font-size: 1.6rem; margin-bottom: 8px; color: var(--text-3); opacity: .6; }
.tbl-empty .empty-title { font-weight: 600; color: var(--text-2); margin-bottom: 2px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 100px;
    font-size: .7rem; font-weight: 700;
    letter-spacing: .01em;
}
.badge-green  { background: rgba(5,150,105,.10);   color: var(--green);  border: 1px solid rgba(5,150,105,.22); }
.badge-amber  { background: rgba(217,119,6,.10);  color: var(--amber);  border: 1px solid rgba(217,119,6,.22); }
.badge-red    { background: rgba(220,38,38,.10);  color: var(--red);    border: 1px solid rgba(220,38,38,.22); }
.badge-blue   { background: rgba(37,99,235,.10);  color: var(--blue);   border: 1px solid rgba(37,99,235,.22); }
.badge-teal   { background: var(--teal-dim);      color: var(--teal);   border: 1px solid rgba(245,130,32,.24); }
.badge-gray   { background: rgba(100,116,139,.10);color: #64748b;       border: 1px solid rgba(100,116,139,.22); }
.badge-purple { background: rgba(11,47,94,.10);    color: #0B2F5E;       border: 1px solid rgba(11,47,94,.22); }
.badge-pink   { background: rgba(228,3,46,.10); color: var(--pink);   border: 1px solid rgba(228,3,46,.22); }

/* ── Modal overlay (generic) ────────────────────────────────── */
/* The OVERLAY is the scroll container, not the box. A form taller than the
   viewport had no way to reach its own footer: the overlay is fixed with
   inset: 0, so its height is the viewport's, and with the default
   overflow: visible the excess simply painted past the bottom edge and was
   clipped — no scrollbar anywhere could bring it back, since the document
   behind does not move a fixed element.
   Top-aligned rather than centred on purpose: a centred box that overflows
   spills equally above and below the fold, and overflow ABOVE the start of a
   scroll container is unreachable — so centring would trade a cut-off footer
   for a cut-off header. `.modal-box` carries `margin: auto`, and an auto
   margin absorbs the free space before alignment is consulted, so a SHORT
   modal stays centred and only a tall one is pushed to the top and scrolled.
   (Same pairing as `.modal-overlay` in ta-theme.css.) */
.modal-ov {
    position: fixed; inset: 0; background: rgba(8,41,37,.55);
    backdrop-filter: blur(6px); z-index: 999;
    display: none; align-items: flex-start; justify-items: center;
    padding: 30px 10px; overflow-y: auto;
    overscroll-behavior: contain;   /* the page behind must not scroll too */
    animation: fadeIn .2s var(--ease);
}
.modal-ov.active { display: grid; }
.modal-box {
    background: var(--surface); border-radius: var(--r-lg);
    box-shadow: var(--sh-lg); width: min(520px, 92vw);
    margin: auto;   /* pairs with align-items: flex-start above */
    overflow: hidden; animation: zoomIn .2s var(--ease);
}
.modal-head {
    padding: 18px 22px; border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--surface), var(--surface-2));
    display: flex; align-items: center; gap: 12px;
}
.modal-body { padding: 22px; }
.modal-foot {
    padding: 14px 22px; border-top: 1px solid var(--border);
    background: var(--surface-2); display: flex; gap: 8px; justify-content: flex-end;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Toast / loading overlay ────────────────────────────────── */
.toast {
    position: fixed; top: 24px; right: 24px; z-index: 999;
    min-width: 320px; max-width: 420px;
    padding: 14px 20px; border-radius: var(--r-md);
    font-size: .84rem; font-weight: 600;
    display: flex; align-items: center; gap: 11px;
    box-shadow: var(--sh-lg);
    animation: slideIn .3s var(--ease);
}
.toast-success { background: #ecfdf5; color: var(--green); border: 1px solid rgba(5,150,105,.25); }
.toast-danger  { background: #fef2f2; color: var(--red);   border: 1px solid rgba(220,38,38,.25); }
.toast-warning { background: #fffbeb; color: var(--amber);  border: 1px solid rgba(217,119,6,.25); }
.toast-info    { background: #eff6ff; color: var(--blue);   border: 1px solid rgba(37,99,235,.25); }
@keyframes slideIn  { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }
@keyframes slideOut { from { opacity:1; transform:translateX(0); }   to { opacity:0; transform:translateX(40px); } }

.loading-ov {
    position: fixed; inset: 0; background: rgba(8,41,37,.55);
    backdrop-filter: blur(6px); z-index: 1000; display: none; place-items: center;
}
.loading-ov.active { display: grid; }
.spin { width: 44px; height: 44px; border: 3px solid rgba(255,255,255,.2); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.loading-txt { color: #fff; font-size: .82rem; font-weight: 700; margin-top: 12px; text-align: center; letter-spacing: .02em; }
.loading-txt small { display: block; font-size: .7rem; opacity: .7; margin-top: 3px; font-weight: 500; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Pager ──────────────────────────────────────────────────── */
.pager {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 14px; border-top: 1px solid var(--border);
    background: var(--surface-2);
}
.pager a, .pager span {
    padding: 6px 11px; border-radius: 7px;
    font-size: .76rem; font-weight: 600; text-decoration: none;
    transition: all .2s var(--ease);
    display: inline-flex; align-items: center; gap: 4px;
}
.pager a { color: var(--teal); border: 1px solid var(--border); background: var(--surface); }
.pager a:hover { background: var(--teal); color: #0B2F5E; border-color: var(--teal); }
.pager span { background: var(--teal); color: #0B2F5E; border: 1px solid var(--teal); }
.pager span.pager-ellipsis { background: none; border: none; color: var(--text-3); padding: 6px 4px; cursor: default; }
.pager span.pager-summary { background: none; border: none; color: var(--text-3); font-weight: 500; margin-left: 6px; }

/* ── Info box ───────────────────────────────────────────────── */
.info-box {
    background: linear-gradient(135deg, rgba(37,99,235,.06), rgba(59,130,246,.02));
    border: 1px solid rgba(37,99,235,.18);
    border-left: 3px solid var(--blue);
    border-radius: var(--r-md);
    padding: 14px 18px; font-size: .84rem; color: var(--text-2);
    display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px;
}
.info-box i { color: var(--blue); font-size: 1rem; margin-top: 2px; }
.row-assigned td { background: rgba(245,130,32,.06) !important; }

/* ── Assignment summary (sticky info bar above CTA) ─────────── */
.assign-summary {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr));
    gap: 12px; padding: 16px;
    background: linear-gradient(135deg, var(--surface-2), var(--teal-dim));
    border: 1px dashed var(--border-2);
    border-radius: var(--r-md); margin-bottom: 18px;
}
.assign-summary .item { display: flex; flex-direction: column; gap: 3px; }
.assign-summary .item-lbl { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-3); }
.assign-summary .item-val { font-family: var(--font-h); font-size: .95rem; font-weight: 700; color: var(--text-1); }
.assign-summary .item-val.is-empty { color: var(--text-mute); font-style: italic; font-weight: 500; }
.assign-summary .item-val i { color: var(--teal); margin-right: 4px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .kpi-strip { grid-template-columns: repeat(2, 1fr); }
    .fgrid-5 { grid-template-columns: repeat(2, 1fr); }
    .panel-head { padding: 14px 18px; }
}
/* Collapse at 991px, not 900px, so this boundary meets mobile.css's >=992px
   desktop block exactly. In the 901-991px band the shell was ALREADY stacked
   (mobile.css's base .dash-shell is flex/column below 992px) while this file's
   desktop padding of 28px 40px 64px was still in force — a mobile-shaped shell
   with 40px desktop side gutters, which is what "the page looks off" describes.
   The two boundaries now meet at 991/992 with no dead band between them. */
@media (max-width: 991px) {
    .dash-shell { grid-template-columns: 1fr; min-height: auto; }
    .dash-main { padding: 16px; overflow-x: hidden; overflow-x: clip; }
    .panel { border-radius: var(--r-md); margin-bottom: 16px; }
    .panel-head { padding: 12px 16px; gap: 10px; }
    .panel-body { padding: 16px; }
    .p-icon { width: 36px; height: 36px; font-size: .84rem; }
    .p-title { font-size: .88rem; }
    .fgrid, .fgrid-2, .fgrid-3, .fgrid-4, .fgrid-5 { grid-template-columns: 1fr; gap: 14px; }
    .kpi-strip { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 14px 16px; }
    .stat-value { font-size: 1.35rem; }
    .stat-icon { display: none; }
    .btn { padding: 9px 14px; font-size: .8rem; }
    .btn-row { gap: 8px; }
    .tbl-wrap { margin: 8px 0; }
    .dtbl th, .dtbl td { padding: 9px 11px; font-size: .78rem; }
    .modal-box { width: min(480px, 94vw); }
    .modal-body, .modal-foot { padding: 16px; }
    .toast { min-width: auto; max-width: 92vw; right: 16px; top: 16px; }
    .assign-summary { grid-template-columns: 1fr 1fr; padding: 12px; }
    .pager { flex-wrap: wrap; gap: 4px; padding: 10px; }
}
@media (max-width: 576px) {
    .dash-shell { display: flex; flex-direction: column; }
    .dash-main { padding: 12px; }
    .kpi-strip { grid-template-columns: 1fr; }
    .stat { text-align: left; display: flex; align-items: center; gap: 12px; }
    .stat-icon { display: block; position: static; font-size: 1.2rem; opacity: .35; }
    .panel-head { flex-direction: column; align-items: flex-start; }
    .panel-actions { width: 100%; }
    .btn { width: 100%; justify-content: center; }
    .btn-row { flex-direction: column; }
    .btn-row .btn { width: auto; }
    .assign-summary { grid-template-columns: 1fr; }
    .pager a, .pager span { padding: 7px 10px; }
    .dtbl { min-width: 520px; }
    /* A .dtbl forced to 520px needs something that scrolls it. .tbl-scroll does
       (see line 285), but a .tbl-wrap holding the table as a DIRECT child does
       not — its overflow:hidden (line 284) would clip the right-hand columns off
       screen with no way to reach them, which is the "doesn't fit" symptom.
       Scrolling wins over the rounded corners that overflow:hidden exists for. */
    .tbl-wrap { overflow-x: auto; }
    .tbl-scroll { -webkit-overflow-scrolling: touch; }
}
