/* =====================================================================
   CIC Meal Ordering — application UI polish.
   Layers on top of the Velzon theme (app.min.css) to lift typography and
   components across every page. Aligned with the CIC.RequestManagement /
   ServicePackages look: larger Poppins type, soft buttons/badges, card
   shadows, uppercase small-caps table headers, comfortable spacing.
   Loaded LAST in _Layout so these rules win.
   ===================================================================== */

:root {
    --vz-primary: #405189;
    --vz-secondary: #3577f1;
    --vz-success: #0ab39c;
    --vz-info: #299cdb;
    --vz-warning: #f7b84b;
    --vz-danger: #f06548;
    --mo-border: #e9ebec;
    --mo-border-strong: #dfe3ee;   /* matches the schedule grid's --g-line */
    --mo-surface-2: #f7f8fc;
    --mo-heading: #343a40;
    --mo-text: #495057;
}

/* ---------- 1. Typography (application-level font size increase) ---------- */
body {
    font-family: 'Poppins', 'DM Sans', sans-serif;
    font-size: 0.95rem;            /* ~15.2px, up from Velzon's 13px */
    line-height: 1.55;
    color: var(--mo-text);
    background-color: #f3f3f9;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--mo-heading);
    font-weight: 600;
}

h3, .h3 { font-size: 1.4rem; }
h4, .h4 { font-size: 1.15rem; }
h5, .h5 { font-size: 1.02rem; }

.small, small { font-size: 0.82rem; }
label, .form-label { font-weight: 500; color: var(--mo-text); font-size: 0.9rem; }

/* ---------- 2. Page shell & site-name title box ---------- */
.page-content { padding-top: 0.75rem; }

.mo-page-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 0 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--mo-border);
}

.mo-page-title .mo-site-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--vz-primary);
    text-transform: uppercase;
    margin: 0;
}

.mo-page-title .ri-building-2-line { font-size: 1.5rem; color: var(--vz-primary); }

/* ---------- 3. Cards ----------
   Flat and bordered rather than borderless-with-shadow, so every surface in the
   app reads the same as the schedule grid (.mo-gridwrap). A card should enclose
   a group, not a page region — see §13 for how table surfaces are treated. */
.card {
    border: 1px solid var(--mo-border-strong);
    box-shadow: 0 1px 2px rgba(25, 30, 46, 0.05);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Section-title band. Sits one tonal step ABOVE the column header beneath it so
   "By resident" / "Detail" read as a titled section rather than dissolving into
   the table. Ladder: card-header 1.24:1 > thead 1.11:1 > rows white. */
.card-header {
    background-color: var(--g-band);
    border-bottom: 1px solid var(--mo-border-strong);
    padding: 0.8rem 1.1rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--g-ink);
}

.card-body { padding: 1.25rem; }
.card-footer { background-color: #fff; border-top: 1px solid var(--mo-border); padding: 0.9rem 1.25rem; }

/* ---------- 4. Tables ---------- */
.table {
    font-size: 0.9rem;
    color: var(--mo-text);
    margin-bottom: 0;
}

.table > thead > tr > th {
    background-color: var(--g-surface-2);
    text-transform: uppercase;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #495057;
    border-bottom: 1px solid var(--mo-border);
    padding: 0.7rem 1rem;
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 0.7rem 1rem;
    vertical-align: middle;
    border-color: #f1f2f4;
}

.table-sm > thead > tr > th,
.table-sm > tbody > tr > td { padding: 0.55rem 0.75rem; }

.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: #f9fafb; }
.table-hover > tbody > tr:hover > * { background-color: #f1f5ff; }

/* Action cells (Edit/Delete/Cancel …): keep buttons on one line with a small gap.
   Scoped to cells that actually contain buttons so wrapping text columns are untouched. */
.table td:has(.btn) { white-space: nowrap; }
.table td:has(.btn) .btn + .btn,
.table td:has(.btn) form { margin-left: 0.35rem; }
.table td:has(.btn) form { display: inline-block; }

/* ---------- 5. Buttons (soften the outline variants used across the app) ---------- */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn-lg { font-size: 1.02rem; }

.btn-primary { background-color: var(--vz-primary); border-color: var(--vz-primary); }
.btn-primary:hover { background-color: #364670; border-color: #364670; }

.btn-outline-primary {
    background-color: rgba(64, 81, 137, 0.1);
    border-color: transparent;
    color: var(--vz-primary);
}
.btn-outline-primary:hover { background-color: var(--vz-primary); border-color: var(--vz-primary); color: #fff; }

.btn-outline-danger {
    background-color: rgba(240, 101, 72, 0.1);
    border-color: transparent;
    color: var(--vz-danger);
}
.btn-outline-danger:hover { background-color: var(--vz-danger); border-color: var(--vz-danger); color: #fff; }

.btn-outline-secondary {
    background-color: rgba(135, 138, 153, 0.12);
    border-color: transparent;
    color: #5d6169;
}
.btn-outline-secondary:hover { background-color: #878a99; border-color: #878a99; color: #fff; }

/* Optional soft utility buttons (for future use) */
.btn-soft-primary { background-color: rgba(64, 81, 137, 0.1); color: var(--vz-primary); border: none; }
.btn-soft-primary:hover { background-color: var(--vz-primary); color: #fff; }
.btn-soft-danger { background-color: rgba(240, 101, 72, 0.1); color: var(--vz-danger); border: none; }
.btn-soft-danger:hover { background-color: var(--vz-danger); color: #fff; }

/* ---------- 6. Form controls ---------- */
.form-control, .form-select {
    border-color: #ced4da;
    color: var(--mo-text);
    font-size: 0.92rem;
}
.form-control:focus, .form-select:focus {
    border-color: #b7c0e0;
    box-shadow: 0 0 0 0.15rem rgba(64, 81, 137, 0.12);
}
.form-control-sm, .form-select-sm {
    font-size: 0.88rem;
    padding: 0.4rem 0.7rem;
    min-height: calc(1.5em + 0.8rem + 2px);
}
.form-check-input:checked { background-color: var(--vz-primary); border-color: var(--vz-primary); }

/* ---------- 7. Badges (soft, Velzon style) ---------- */
.badge { font-weight: 600; font-size: 0.72rem; padding: 0.35em 0.6em; letter-spacing: 0.02em; }
.badge.bg-success { background-color: rgba(10, 179, 156, 0.15) !important; color: #0a8a78 !important; }
.badge.bg-danger { background-color: rgba(240, 101, 72, 0.15) !important; color: #d84a2c !important; }
.badge.bg-warning { background-color: rgba(247, 184, 75, 0.18) !important; color: #b17b16 !important; }
.badge.bg-info { background-color: rgba(41, 156, 219, 0.15) !important; color: #1f7fb8 !important; }
.badge.bg-secondary { background-color: rgba(135, 138, 153, 0.15) !important; color: #6a6d78 !important; }
.badge.bg-primary { background-color: rgba(64, 81, 137, 0.12) !important; color: var(--vz-primary) !important; }

/* ---------- 8. Navbar ---------- */
.navbar.bg-primary { background-color: var(--vz-primary) !important; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); }
.navbar-brand { font-weight: 600; font-size: 1.18rem; }
.navbar .nav-link { font-size: 0.92rem; font-weight: 500; padding-top: 0.5rem; padding-bottom: 0.5rem; }
#site-picker .form-select { font-weight: 500; }

/* ---------- 9. Alerts ---------- */
.alert { border: none; border-radius: 0.5rem; font-size: 0.92rem; padding: 0.85rem 1.1rem; }
.alert-info { background-color: #eaf3fb; color: #2c5d86; }
.alert-warning { background-color: #fef4e4; color: #a9701a; }
.alert-success { background-color: #e6f6f3; color: #0a8a78; }
.alert-danger { background-color: #fdecea; color: #c0392b; }

/* ---------- 10. Misc ---------- */
a { color: var(--vz-primary); }
a:hover { color: #2f3e6b; }
.text-primary { color: var(--vz-primary) !important; }
hr { border-color: var(--mo-border); opacity: 1; }

/* ---------- 11. Contrast fixes (application-wide) ----------
   Measured on the running app: the defaults below failed or effectively
   disappeared. Fixing them here lifts every page, not just Schedule.
     .text-muted  #878a99 on #f3f3f9  = 3.1:1  -> fails WCAG AA (needs 4.5:1)
     zebra stripe #f9fafb on #ffffff  = 1.05:1 -> invisible, no row tracking
     .bg-secondary badge              = 4.4:1  -> reads as disabled          */
.text-muted { color: #5f657d !important; }                                  /* 5.2:1 on the page bg */
.badge.bg-secondary { background-color: rgba(90, 96, 120, 0.14) !important; color: #4e5468 !important; } /* 6.5:1 */

/* Zebra striping is deliberately NOT used. The original #f9fafb stripe was
   invisible (1.05:1); strengthening it to #edeff7 made tall multi-line rows read
   as muddy grey blocks AND left the header only 1.06:1 above the striped rows,
   so the header stopped reading as a header. The schedule grid never striped —
   hairline separators plus a hover row do the tracking — and that reads far
   cleaner, so every table now follows it. See §13. */
.table-striped > tbody > tr:nth-of-type(odd) > * { background-color: transparent; }

/* ---------- 12. Weekly schedule grid ----------
   Deliberately NOT built on .table / .card: a dense 7-column grid is already a
   rectangle, so a shadowed card around it groups nothing and costs horizontal
   room. One flat bordered surface, sticky header + sticky item column instead.
   Cards are kept only for the summary tiles, where values really are discrete. */
/* Defined on :root, NOT on .mo-sched. These were originally scoped to the
   schedule page; once .mo-tile started being used on the report pages too, every
   tile outside Schedule resolved var(--g-surface)/var(--g-line) to nothing and
   silently rendered transparent with no border. Tokens shared by more than one
   page belong at the root. */
:root {
    --g-line: #dfe3ee;
    --g-line-soft: #eaedf4;
    --g-surface: #fff;
    --g-surface-2: #f1f3f9;   /* column-header band — 1.11:1 on white, actually visible */
    --g-band: #e2e6f1;        /* section-title band (card headers) — 1.24:1, one step stronger */
    --g-ink: #1b2034;
    --g-ink-2: #545b73;
    --g-ink-3: #6e7590;
    --g-primary: #405189;
    --g-primary-soft: #e7eaf3;
    --g-primary-ink: #2c3a66;
    --g-on: #0e9f8c;
    --g-on-deep: #0a7d6f;
    --g-on-fill: #cdede6;
}

/* Summary tiles */
.mo-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; margin-bottom: 1.1rem; }
.mo-tile {
    background: var(--g-surface); border: 1px solid var(--g-line); border-radius: 0.5rem;
    padding: 0.85rem 1rem; box-shadow: 0 1px 2px rgba(25, 30, 46, .06); position: relative; overflow: hidden;
}
.mo-tile .lbl { font-size: 0.7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--g-ink-3); }
.mo-tile .val { font-size: 1.6rem; font-weight: 600; line-height: 1.15; margin-top: .3rem; font-variant-numeric: tabular-nums; color: var(--g-ink); }
.mo-tile .meta { font-size: 0.78rem; color: var(--g-ink-2); margin-top: .1rem; }
.mo-tile.accent::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--g-on); }

/* Scope toolbar: meal-period tabs + rotation-week pills */
.mo-scope { background: var(--g-surface); border: 1px solid var(--g-line); border-radius: 0.5rem; padding: 4px 4px 0; margin-bottom: 0.9rem; box-shadow: 0 1px 2px rgba(25,30,46,.06); }
.mo-scope .mo-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.mo-scope .mo-tab {
    padding: .65rem .95rem; border-radius: .5rem .5rem 0 0; text-decoration: none;
    color: var(--g-ink-2); font-size: .9rem; font-weight: 500;
    display: inline-flex; align-items: center; gap: .5rem; border-bottom: 2.5px solid transparent;
}
.mo-scope .mo-tab:hover { background: var(--g-surface-2); color: var(--g-ink); }
.mo-scope .mo-tab.active { color: var(--g-primary-ink); border-bottom-color: var(--g-primary); font-weight: 600; }
.mo-scope .mo-tab .cnt { font-size: .72rem; font-weight: 600; padding: .12rem .45rem; border-radius: 20px; background: var(--g-primary-soft); color: var(--g-primary-ink); font-variant-numeric: tabular-nums; }
.mo-scope .mo-tab.active .cnt { background: var(--g-primary); color: #fff; }
.mo-weeks { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; padding: .65rem .75rem; border-top: 1px solid var(--g-line-soft); }
.mo-weeks .lab { font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--g-ink-3); margin-right: .15rem; }
.mo-pill { font-size: .84rem; font-weight: 500; padding: .3rem .8rem; border-radius: 20px; border: 1px solid var(--g-line); background: var(--g-surface); color: var(--g-ink-2); text-decoration: none; }
.mo-pill:hover { border-color: var(--g-primary); color: var(--g-primary-ink); background: var(--g-primary-soft); }
.mo-pill.active { background: var(--g-primary); border-color: var(--g-primary); color: #fff; font-weight: 600; }

/* Bulk action bar */
.mo-bulk { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; background: var(--g-primary-soft); border: 1px solid var(--g-primary); border-radius: .5rem; padding: .6rem .85rem; margin-bottom: .75rem; }
.mo-bulk[hidden] { display: none; }
.mo-bulk .count { font-weight: 600; font-size: .9rem; color: var(--g-primary-ink); font-variant-numeric: tabular-nums; }
.mo-bulk .sep { width: 1px; height: 22px; background: var(--g-primary); opacity: .35; }
.mo-bulk .lab { font-size: .75rem; color: var(--g-primary-ink); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.mo-daybtn { width: 34px; height: 32px; border-radius: .45rem; border: 1px solid var(--g-primary); background: var(--g-surface); color: var(--g-primary-ink); font-size: .78rem; font-weight: 600; }
.mo-daybtn:hover { background: var(--g-primary); color: #fff; }
.mo-qbtn { font-size: .78rem; font-weight: 600; padding: .4rem .7rem; border-radius: .45rem; border: 1px solid var(--g-primary); background: var(--g-surface); color: var(--g-primary-ink); }
.mo-qbtn:hover { background: var(--g-primary); color: #fff; }
.mo-qbtn.ghost { border-color: var(--g-line); color: var(--g-ink-2); }
.mo-qbtn.ghost:hover { background: var(--g-ink-2); border-color: var(--g-ink-2); color: #fff; }

/* The grid surface */
.mo-gridwrap { background: var(--g-surface); border: 1px solid var(--g-line); border-radius: .5rem; overflow: hidden; }
.mo-scroller { overflow-x: auto; overflow-y: auto; max-height: 62vh; }
table.mo-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 720px; margin: 0; }

table.mo-grid thead th { position: sticky; top: 0; z-index: 3; background: var(--g-surface-2); border-bottom: 1px solid var(--g-line); padding: 0; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g-ink-2); }
table.mo-grid th.selcol { width: 44px; left: 0; z-index: 4; padding: .7rem 0 .7rem .85rem; }
table.mo-grid th.itemcol { text-align: left; padding: .7rem .85rem; min-width: 300px; left: 44px; z-index: 4; }

.mo-dayhead { border: 0; background: none; width: 100%; padding: .5rem .25rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; color: var(--g-ink-2); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mo-dayhead:hover { background: var(--g-primary-soft); color: var(--g-primary-ink); }
.mo-dayhead .dnum { font-size: .66rem; font-weight: 600; letter-spacing: 0; color: var(--g-ink-3); text-transform: none; }
.mo-dayhead .tally { font-size: .64rem; font-weight: 700; min-width: 19px; padding: .05rem .3rem; border-radius: 20px; background: var(--g-line-soft); color: var(--g-ink-2); font-variant-numeric: tabular-nums; }
.mo-dayhead[data-full="1"] .tally { background: var(--g-on); color: #fff; }
table.mo-grid th.weekend .mo-dayhead { background: rgba(0, 0, 0, .022); }
table.mo-grid th.weekend .mo-dayhead:hover { background: var(--g-primary-soft); }

table.mo-grid tbody td { border-bottom: 1px solid var(--g-line-soft); padding: 0; background: var(--g-surface); }
table.mo-grid tbody tr:last-child td { border-bottom: 0; }
table.mo-grid tbody tr:hover td { background: var(--g-surface-2); }
table.mo-grid tbody tr[data-sel="1"] td { background: var(--g-primary-soft); }
table.mo-grid td.selcell { position: sticky; left: 0; z-index: 2; width: 44px; padding: .6rem 0 .6rem .85rem; vertical-align: middle; }
table.mo-grid td.itemcell { position: sticky; left: 44px; z-index: 2; min-width: 300px; padding: .6rem .85rem; }
table.mo-grid td.weekend { background: rgba(0, 0, 0, .015); }
table.mo-grid tbody tr:hover td.weekend { background: var(--g-surface-2); }
table.mo-grid tbody tr[data-sel="1"] td.weekend { background: var(--g-primary-soft); }

.mo-iname { font-size: .9rem; font-weight: 500; color: var(--g-ink); line-height: 1.35; }
.mo-imeta { display: flex; align-items: center; gap: .45rem; margin-top: .25rem; flex-wrap: wrap; }
.mo-chip { font-size: .66rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .1rem .45rem; border-radius: .3rem; background: var(--g-line-soft); color: var(--g-ink-2); }
.mo-rowall { border: 1px solid var(--g-line); background: var(--g-surface); color: var(--g-ink-3); font-size: .66rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .1rem .5rem; border-radius: .3rem; }
.mo-rowall:hover { border-color: var(--g-primary); color: var(--g-primary-ink); background: var(--g-primary-soft); }

/* The cell: state in FILL + MARK, not a 1.05:1 background tint.
   26px target, up from the 15.8px checkbox it replaces. */
.mo-cell { border: 0; background: none; width: 100%; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; }
.mo-cell .box { width: 26px; height: 26px; border-radius: .45rem; border: 1.5px solid var(--g-line); background: var(--g-surface); display: flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s; }
.mo-cell:hover .box { border-color: var(--g-on); background: var(--g-on-fill); }
.mo-cell[aria-pressed="true"] .box { background: var(--g-on); border-color: var(--g-on); }
.mo-cell .box svg { width: 15px; height: 15px; opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; }
.mo-cell[aria-pressed="true"] .box svg { opacity: 1; transform: scale(1); }
.mo-cell .box svg path { stroke: #fff; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mo-grid input[type=checkbox].mo-rowcheck { width: 19px; height: 19px; accent-color: var(--g-primary); cursor: pointer; margin: 0; }

.mo-sched button:focus-visible, .mo-sched a:focus-visible, .mo-sched input:focus-visible { outline: 2.5px solid var(--g-primary); outline-offset: 2px; border-radius: .25rem; }

/* Sticky save bar */
.mo-savebar { position: sticky; bottom: 0; margin-top: .9rem; background: var(--g-surface); border: 1px solid var(--g-line); border-radius: .5rem; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .9rem; flex-wrap: wrap; box-shadow: 0 -4px 18px rgba(25, 30, 46, .09); z-index: 5; }
.mo-savebar .dirty { font-size: .85rem; color: var(--g-ink-2); }
.mo-savebar .dirty b { color: var(--g-on-deep); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { .mo-cell .box, .mo-cell .box svg { transition: none; } }
@media (max-width: 640px) {
    table.mo-grid th.itemcol, table.mo-grid td.itemcell { min-width: 210px; }
}

/* ---------- 13. Shared data-surface treatment (applies the schedule look app-wide) ----------
   Every list/report page already follows the same shape:
       .card > .table-responsive > table.table
   so the whole treatment lands in CSS with no markup churn. Scoped with :has()
   to cards that DIRECTLY wrap a table scroller, which deliberately leaves the
   per-record cards on Resident orders alone — there a card really does enclose
   a group (one order), which is exactly what a card is for. */

.card:has(> .table-responsive) { overflow: hidden; }        /* clip the table's corners to the radius */

/* Internal scroller + sticky header, matching .mo-scroller on the grid.
   max-height only engages once a table is long enough to need it, so short
   tables are completely unaffected. */
.card > .table-responsive {
    max-height: 62vh;
    overflow-y: auto;
}
.card > .table-responsive > .table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    /* border-collapse drops a sticky header's own border while it's pinned;
       paint it with an inset shadow so the seam survives scrolling. */
    box-shadow: inset 0 -1px 0 var(--mo-border-strong);
}

/* Table surfaces sit flush inside their card — no double border at the seam. */
.card > .table-responsive > .table { margin-bottom: 0; }
.card > .table-responsive > .table > tbody > tr:last-child > td { border-bottom: 0; }

/* Row treatment, copied from the schedule grid: white rows, hairline separators,
   and a hover band doing the row tracking. */
.card > .table-responsive > .table > tbody > tr > td { border-color: #eaedf4; }
.card > .table-responsive > .table > tbody > tr:hover > * { background-color: var(--mo-surface-2); }

/* Header tone matched to the grid's thead (§12) so all headers read alike. */
.card > .table-responsive > .table > thead > tr > th { background-color: var(--g-surface-2); }

/* Text hierarchy matched to the grid. The grid's item names sit at near-black
   (16:1) via .mo-iname, while ordinary table cells inherited the body grey
   (#495057, 7:1) — that gap was the main reason the schedule page looked
   crisper than everything else. Primary cell content now matches it; cells
   marked .small stay a step back so the hierarchy survives, and .text-muted
   sub-lines are untouched. */
.card > .table-responsive > .table > tbody > tr > td { color: #1b2034; }
.card > .table-responsive > .table > tbody > tr > td.small { color: #4a5169; }

/* Filter bars: the `<form method="get">` that sits beside every page heading. */
.mo-filterbar {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--mo-border-strong);
    border-radius: 0.5rem;
    padding: 0.7rem 0.85rem;
}

/* Some filter forms were built with Bootstrap grid columns; as flex children of
   the bar their gutter padding doubles up with the bar's own gap. */
.mo-filterbar > .col-auto { padding-left: 0; padding-right: 0; }

/* Page heading block, matching the schedule page's title + subtitle rhythm. */
.mo-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mo-head h3 { margin-bottom: 0.15rem; }
.mo-head .mo-sub { font-size: 0.84rem; color: #5f657d; }

/* Form pages (form.card on the Edit screens) — same surface, calmer footer. */
form.card > .card-footer { background-color: var(--mo-surface-2); }

/* Empty-state alerts read as a quiet surface rather than a coloured banner. */
.alert-info.mo-empty { background: #fff; border: 1px dashed var(--mo-border-strong); color: #5f657d; }

/* Landing-page quick links — same surface language as the tiles. */
.mo-navgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.85rem; }
.mo-navcard {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "ico title" "ico desc";
    gap: 0.1rem 0.85rem;
    align-items: center;
    background: #fff;
    border: 1px solid var(--mo-border-strong);
    border-radius: 0.5rem;
    padding: 1rem 1.1rem;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(25, 30, 46, 0.05);
    transition: border-color .12s, box-shadow .12s, transform .12s;
}
.mo-navcard:hover {
    border-color: var(--vz-primary);
    box-shadow: 0 4px 14px rgba(25, 30, 46, 0.10);
    transform: translateY(-1px);
}
.mo-navcard .ico {
    grid-area: ico;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 0.5rem;
    background: rgba(64, 81, 137, 0.10);
    color: var(--vz-primary);
    font-size: 1.25rem;
}
.mo-navcard .t { grid-area: title; font-weight: 600; font-size: 0.98rem; color: var(--mo-heading); }
.mo-navcard .d { grid-area: desc; font-size: 0.8rem; color: #5f657d; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) { .mo-navcard { transition: none; } }
