/* GEARS Members Portal — hand-rolled stylesheet, no build step. */

:root {
    --ink: #16181d;
    --ink-soft: #4b5261;
    --ink-faint: #8a91a0;
    --paper: #f4f5f7;
    --card: #ffffff;
    --line: #e3e5ea;
    --brand: #16181d;        /* GEARS black */
    --accent: #e87722;       /* gear orange */
    --accent-soft: #fdf1e7;
    --good: #1a7f4b;
    --good-soft: #e7f5ee;
    --warn: #b45309;
    --warn-soft: #fef3e2;
    --bad: #b91c1c;
    --bad-soft: #fdecec;
    --info-soft: #e8f0fd;
    --info: #1d4ed8;
    --radius: 10px;

    /* LEGO brick colors — DECORATIVE ONLY. Never use these for pills, flash
       banners, table cells, or anything that currently conveys status —
       those stay on --good/--warn/--bad/--info exactly as today. */
    --brick-red: #DA291C;
    --brick-red-dark: #A11E14;
    --brick-yellow: #FFC72C;
    --brick-yellow-dark: #E6B800;
    --brick-blue: #0055BF;
    --brick-blue-dark: #003D8A;
    --brick-green: #2E8B4F;
    --brick-green-dark: #1F6538;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
}

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

/* ---- Header / nav ---- */
.site-header {
    background: var(--brand);
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 58px;
    flex-wrap: wrap;
}
/* Full-width color stripe, forced onto its own line via flex-basis so it
   takes up real space in the flow instead of overlapping page content. */
.site-header::after {
    content: "";
    order: 999;
    flex-basis: 100%;
    height: 10px;
    background: linear-gradient(90deg,
        var(--brick-red) 0 25%, var(--brick-yellow) 25% 50%,
        var(--brick-blue) 50% 75%, var(--brick-green) 75% 100%);
}
.site-header .logo img { height: 34px; display: block; }
.nav-toggle { display: none; margin-left: auto; background: none; border: none; color: #fff; font-size: 24px; line-height: 1; padding: 4px 8px; cursor: pointer; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.site-nav a {
    color: #c9cdd6;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.site-nav a.active { color: #fff; background: rgba(255,255,255,.14); }
.site-nav a .pill { margin-left: 6px; }
.nav-dropdown { position: relative; margin-top: 8px; }
.nav-dropdown > a .caret { font-size: 10px; opacity: .7; }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 190px;
    background: var(--brand);
    border-radius: 0 0 8px 8px;
    padding: 6px;
    z-index: 50;
    box-shadow: 0 10px 24px rgba(0,0,0,.35);
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; white-space: nowrap; }
.user-menu { display: flex; align-items: center; gap: 12px; color: #c9cdd6; font-size: 13px; }
/* The user-menu's own dropdown (Settings) sits at the right edge of the
   header — align its own margin/menu to that side instead of the main
   nav's left-aligned defaults, so it doesn't overflow off-screen. */
.user-menu .nav-dropdown { margin-top: 0; }
.user-menu .nav-dropdown-menu { left: auto; right: 0; }
.user-menu form { margin: 0; }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 24px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--ink-faint); }
.small { font-size: 13px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.cols-6 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
/* Seven stat tiles across (the admin dashboard). A smaller minimum so all
   seven still sit on one row on a normal laptop; auto-fit reflows them to
   four-and-three, then two-by-two, as the window narrows. */
.grid.cols-7 { grid-template-columns: repeat(auto-fit, minmax(122px, 1fr)); }
.grid.cols-7 .stat .stat-value { font-size: 28px; }
.grid.cols-7 .stat .label { font-size: 12px; }

/* ---- Cards ---- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; }
.card h2 .pill { vertical-align: 2px; }
.help-item { margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
.help-item summary { cursor: pointer; font-weight: 600; }
.help-item p { margin: 10px 0 2px; color: var(--muted); }
.stat { text-align: center; padding: 22px 12px; }
.stat .stat-value { font-size: 32px; font-weight: 700; display: block; text-align: center; }
.stat .label { color: var(--ink-soft); font-size: 13px; }

/* ---- Tables ---- */
table.data { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* Season Billing report: households behind on their monthly invoices. Uses the
   existing bookkeeping warn/bad tokens, never the decorative brick palette —
   this is a number an admin acts on, not ornament. Each row also carries the
   count in words, so the meaning survives anywhere the colour doesn't. */
table.data tr.behind-2 > td { background: var(--warn-soft); }
table.data tr.behind-3 > td { background: var(--bad-soft); }
table.data th { background: #fafbfc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
table.data tr:last-child td { border-bottom: 0; }
.register-table th.num, .register-table td.num { width: 160px; font-variant-numeric: tabular-nums; }
.register-table th:first-child, .register-table td:first-child { width: 110px; }
.register-table tbody tr:nth-child(even) td { background: #f6f7f9; }
.register-table tfoot td { background: #fafbfc; border-top: 2px solid var(--line); }
table.data tr:hover td { background: #fafbfd; }
.num { font-family: courier; text-align: right !important; }
.sortable-th { display: inline-flex; align-items: center; gap: 4px; color: inherit; white-space: nowrap; }
.sortable-th:hover { color: var(--accent); text-decoration: none; }
.sortable-th.active { color: var(--ink); }
.sort-arrow { font-size: 10px; color: var(--ink-faint); }
.sortable-th.active .sort-arrow { color: var(--accent); }

/* ---- Pills / badges ---- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.neutral { background: #eef0f3; color: var(--ink-soft); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #2c303a; text-decoration: none; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--paper); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #971717; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: #cf6314; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Forms ---- */
form.stacked .field { margin-bottom: 14px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=url], select, textarea {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea { min-height: 84px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.field-error { color: var(--bad); font-size: 13px; margin-top: 3px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row label { margin: 0; }
.inline-form { display: inline; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; font-size: 13px; color: var(--ink-faint); }
.breadcrumbs a { color: var(--ink-soft); font-weight: 600; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: none; }
.breadcrumbs span[aria-current] { color: var(--ink); font-weight: 600; }
.breadcrumbs .sep { color: var(--ink-faint); }

/* ---- Charts (reports) ---- */
.chart-legend { display: flex; gap: 16px; margin: 4px 0 10px; font-size: 13px; color: var(--ink-soft); flex-wrap: wrap; }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.bar-chart { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-height: 420px; overflow-y: auto; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 46px; align-items: center; gap: 10px; }
.bar-label { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: #eef0f3; border-radius: 4px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; }
.bar-fill.has-value { min-width: 3px; }
.bar-value { font-size: 13px; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.chart-table-toggle { margin-top: 10px; font-size: 13px; }
.chart-table-toggle summary { cursor: pointer; color: var(--accent); }
.chart-table-toggle table { margin-top: 8px; }

/* ---- Menu editor ---- */
.drag-handle { cursor: grab; color: var(--ink-faint); user-select: none; letter-spacing: -2px; }
.menu-child-label { padding-left: 32px; }
tr.dragging { opacity: .4; }

/* ---- Agenda ---- */
.agenda-compact { display: flex; flex-direction: column; }
.agenda-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); color: inherit; border-radius: 6px; }
.agenda-row:last-child { border-bottom: none; }
.agenda-row:hover { background: var(--paper); text-decoration: none; }
.agenda-badge { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 8px; background: var(--accent-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.agenda-badge-month { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.agenda-badge-day { font-size: 17px; font-weight: 700; color: var(--ink); }
.agenda-row-body { min-width: 0; }
.agenda-row-title { font-weight: 600; }
.agenda-row-meta { margin-top: 1px; }

/* ---- News feed ---- */
.news-item { padding: 10px 0; }
.news-item-divider { border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.news-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.news-item-body { font-size: 14px; color: var(--ink-soft); }
.news-item-body img { max-width: 100%; border-radius: 6px; padding: 5px; }
.news-item-body p:first-child { margin-top: 0; }
.news-item-body p:last-child { margin-bottom: 0; }

/* ---- Calendar ---- */
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.calendar-weekday { background: #fafbfc; padding: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); text-align: center; }
.calendar-cell { background: var(--card); min-height: 100px; padding: 6px; }
.calendar-cell.outside-month { background: #fafbfc; }
.calendar-cell.outside-month .calendar-date { color: var(--ink-faint); }
.calendar-date { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.calendar-date.is-today { background: var(--accent); color: #fff; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; }
.calendar-event { display: block; font-size: 12px; background: var(--accent-soft); color: var(--accent); text-decoration: none; border-radius: 4px; padding: 2px 5px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event:hover { text-decoration: underline; }
.calendar-event-time { font-variant-numeric: tabular-nums; margin-right: 3px; }

/* ---- Flash / alerts ---- */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; }
.flash.success { background: var(--good-soft); color: var(--good); border: 1px solid #bfe6d0; }
.flash.error { background: var(--bad-soft); color: var(--bad); border: 1px solid #f3c5c5; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0d9ab; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---- Login page ---- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255,255,255,.06) 2px, transparent 2.5px) 0 0/28px 28px,
                linear-gradient(160deg, #1a5c31, #0d2818);
    padding: 24px;
}
.auth-card {
    background: var(--card);
    border-radius: 14px;
    padding: 36px;
    width: 100%;
    max-width: 420px;
}
.auth-card .logo { text-align: center; margin-bottom: 20px; }
.auth-card .logo img { height: 84px; }
.auth-card h1 { font-size: 20px; text-align: center; margin: 0 0 6px; }
.auth-card .sub { text-align: center; color: var(--ink-soft); font-size: 14px; margin-bottom: 22px; }
.auth-card .btn { width: 100%; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- Role chooser (home) ---- */
.role-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 24px; }

/* Sub-heading above a group of cards, so a wall of tiles reads as sections:
   the report download cards (People & Teams / Money), and the public team
   directory's per-program groups (FIRST LEGO League / FIRST Tech Challenge). */
.group-heading,
.report-group-heading {
    margin: 28px 0 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ink-soft);
}
/* FTC team number, carried at the same weight as the team name — see the
   public team directory for why. */
.team-number { font-variant-numeric: tabular-nums; color: var(--accent); }

.role-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; color: inherit; }
.role-card:hover { border-color: var(--accent); text-decoration: none; }
.role-card h3 { margin: 0 0 6px; }

/* A card with nowhere to go: no hover lift and no pointer, so it doesn't
   invite a click that does nothing. */
.role-card.static { cursor: default; }
.role-card.static:hover { border-color: var(--line); transform: none; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.role-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ---- Detail lists ---- */
dl.detail { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.detail dt { font-weight: 600; color: var(--ink-soft); font-size: 13px; }
dl.detail dd { margin: 0; }

/* ---- Task queue ---- */
.task-row .desc { max-width: 640px; }
.task-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- Reconciliation notes ---- */
.recon-notes { white-space: pre-line; font-size: 13px; background: var(--warn-soft); border-radius: 7px; padding: 10px 12px; color: var(--warn); }

/* ---- Balance display (parent portal) ---- */
.balance-hero { text-align: center; padding: 28px 16px; }
.balance-hero .amount { font-size: 42px; font-weight: 800; }
.balance-hero .label { color: var(--ink-soft); }

/* ---- Charge ledger / statement (parent portal + admin) ----
   Deliberately plain: this is bookkeeping chrome, so per the rule at the top
   of this file it uses --ink/--good/--warn/--bad only and never the decorative
   --brick-* palette. Modeled on a credit-card statement: amount remaining is
   the headline, the meter shows progress toward paid-in-full. */
.ledger-summary { display: flex; flex-wrap: wrap; gap: 24px; align-items: baseline; }
.ledger-summary .primary { font-size: 34px; font-weight: 800; line-height: 1.1; }
.ledger-summary .secondary { color: var(--ink-soft); font-size: 14px; }
.ledger-summary .secondary strong { color: var(--ink); font-weight: 600; }

/* Progress meter. Uses a plain div rather than <progress> so the fill colour
   can follow paid/partial/unpaid state consistently across browsers. */
.meter { background: #eef0f3; border-radius: 999px; height: 10px; overflow: hidden; margin: 10px 0 6px; }
.meter > span { display: block; height: 100%; background: var(--good); border-radius: 999px; transition: width .2s; }
.meter.partial > span { background: var(--accent); }
.meter.none > span { background: transparent; }
.meter-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }

.charge-line { padding: 14px 0; border-bottom: 1px solid var(--line); }
.charge-line:last-child { border-bottom: 0; padding-bottom: 0; }
.charge-line:first-child { padding-top: 0; }
.charge-line .charge-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.charge-line .charge-title { font-weight: 600; }
.charge-line .charge-remaining { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.charge-line.is-paid .charge-remaining { color: var(--good); }
.charge-line.is-voided { opacity: .6; }
.charge-line.is-voided .charge-title { text-decoration: line-through; }
.charge-payments { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); }
.charge-payments li { margin: 2px 0; }
.charge-payments .amt { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--line); }
.tabs a { padding: 8px 16px; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }

/* A secondary filter row sitting directly under a primary .tabs bar — e.g. the
   teams index narrowing to FLL/FTC within Active/Inactive/Retired. Rendered as
   chips rather than a second underlined tab bar so the page still reads as
   having one set of tabs, with a filter applied to it. */
.tabs.subtle { border-bottom: 0; gap: 6px; margin-top: -4px; margin-bottom: 14px; }
.tabs.subtle a {
    padding: 4px 12px;
    font-size: 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    margin-bottom: 0;
}
.tabs.subtle a.active { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }

/* ---- Pagination (Laravel default markup) ---- */
nav[role=navigation] { margin-top: 16px; }

/* ---- Feature/hero cards (LEGO stud-row) ----
   Deliberately opt-in (card-feature, auth-card, role-card, card.stat) —
   plain .card (dense data/detail panels) never gets this treatment. */
.card-feature, .auth-card, .role-card, .card.stat {
    position: relative;
    overflow: hidden;
    padding-top: 28px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.card-feature::before, .auth-card::before, .role-card::before, .card.stat::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 8px;
    background-image: radial-gradient(circle at 10px 4px, var(--brick-red) 9px, transparent 0),
                       radial-gradient(circle at 26px 4px, var(--brick-yellow) 9px, transparent 0),
                       radial-gradient(circle at 42px 4px, var(--brick-blue) 9px, transparent 0),
                       radial-gradient(circle at 58px 4px, var(--brick-green) 9px, transparent 0);
    background-repeat: repeat-x;
    background-size: 64px 8px;
}
.card-feature, .role-card { transition: transform .12s, box-shadow .12s; }
.card-feature:hover, .role-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.1); }

/* ---- Tactile buttons — colored drop-shadow that presses down on click ---- */
.btn { box-shadow: 0 4px 0 rgba(0,0,0,.25); transition: transform .06s, box-shadow .06s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.accent { box-shadow: 0 4px 0 #a3520c; }
.btn.accent:active { box-shadow: 0 1px 0 #a3520c; }
.btn.danger { box-shadow: 0 4px 0 #7a1414; }
.btn.danger:active { box-shadow: 0 1px 0 #7a1414; }
.btn.secondary { box-shadow: 0 4px 0 var(--line); }
.btn.secondary:active { box-shadow: 0 1px 0 var(--line); }

/* ---- Home hero band ---- */
.home-hero {
    background: linear-gradient(90deg, var(--brick-red) 0 25%, var(--brick-yellow) 25% 50%,
        var(--brick-blue) 50% 75%, var(--brick-green) 75% 100%);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-bottom: 20px;
}
.home-hero h1 { color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.25); margin: 0; }

/* ---- Empty states ---- */
.empty-state { display: flex; flex-direction: column; align-items: center; }

/* ---- Modal dialogs ---- */
dialog.modal {
    border: none;
    border-radius: var(--radius);
    padding: 24px;
    max-width: 560px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
dialog.modal::backdrop { background: rgba(0,0,0,.5); }

@media (max-width: 720px) {
    .form-row { grid-template-columns: 1fr; }
    .container { padding: 16px 12px 48px; }
    .site-header { padding: 8px 12px; }

    .nav-toggle { display: block; }
    .site-nav, .user-menu { display: none; width: 100%; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 2px; }
    .site-header.nav-open .site-nav, .site-header.nav-open .user-menu { display: flex; }
    .user-menu { order: 4; margin-top: 4px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.15); }
    .nav-dropdown-menu { position: static; box-shadow: none; padding-left: 12px; }
}

/* ---- Public team pages ----
   The only unauthenticated screens in the app. Plain and neutral; the brick
   palette stays decorative-only here as everywhere else. */
.public-page .site-nav a { font-weight: 600; }
.public-footer {
    margin: 48px 0 0;
    padding: 24px;
    text-align: center;
    color: var(--ink-soft);
    border-top: 1px solid var(--line);
    background: var(--card);
}
.public-footer p { margin: 4px 0; }
.public-page code {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
}

/* Team directory cards: a fixed three across rather than .role-cards' default
   auto-fit. With only a handful of published teams per program, auto-fit
   stretched a two-team program's cards to half the page each, so each section
   came out a visibly different shape. A fixed track count keeps every program
   section on the same grid regardless of how many teams it has. */
.role-cards.team-cards { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
    .role-cards.team-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .role-cards.team-cards { grid-template-columns: 1fr; }
}

/* ---- Rich text (TinyMCE-authored descriptions and news bodies) ----
   Constrains author-supplied content so an oversized pasted image or a long
   URL can't break the page layout. Content itself is allowlist-sanitized
   server-side (Services\HtmlSanitizer). */
.rich-text { overflow-wrap: anywhere; }
.rich-text img { max-width: 100%; height: auto; border-radius: var(--radius); }
.rich-text > *:first-child { margin-top: 0; }
.rich-text > *:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { padding-left: 22px; }
.rich-text blockquote {
    margin: 12px 0;
    padding: 6px 14px;
    border-left: 3px solid var(--line);
    color: var(--ink-soft);
}
.rich-text table { border-collapse: collapse; max-width: 100%; }
.rich-text table td, .rich-text table th { border: 1px solid var(--line); padding: 6px 10px; }

/* ---- Contextual help links ---- */
.help-link { font-size: 12px; font-weight: 600; color: var(--info); white-space: nowrap; }
.help-link span { display: inline-block; width: 14px; height: 14px; line-height: 14px; text-align: center;
    border-radius: 999px; background: var(--info-soft); color: var(--info); font-size: 10px; }

/* ---- Print / Save-as-PDF ----------------------------------------------
   These pages get printed to PDF and handed to the Board of Directors, so
   printing has to produce a clean document rather than a screenshot of an
   app. Everything that is interface — navigation, buttons, tabs, flash
   banners — is dropped, and only the content survives.

   The "Previewing as ... (read-only)" banner and its Exit-preview button are
   the specific reason this exists: an admin viewing the portal as a parent or
   mentor shouldn't hand the Board a page that raises questions about what
   "previewing" means. Those banners also carry an explicit .no-print class in
   layouts/app.blade.php, so this keeps working even if .flash is restyled.

   Utilities: .no-print (screen only), .print-only (paper only),
   .screen-only (alias of .no-print, reads better on paired elements). */
.print-only { display: none; }

/* Page-size picker (<x-per-page>), sat beside the search box on index pages. */
form.per-page { display: inline-flex; align-items: center; gap: 6px; margin: -6px 0 14px; }
form.per-page select { width: auto; padding: 4px 8px; }

/* ---- Inline row editing (admin mentors table) ----
   Inputs that read as plain table text until you touch them, so the directory
   still looks like a directory. Scoped to .inline-* only — the brick-colour
   note above applies: bookkeeping tables keep their existing chrome. */
.inline-input {
    width: 100%;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    font: inherit;
    color: inherit;
}
.inline-input:hover { border-color: var(--line); }
.inline-input:focus { border-color: var(--accent); background: var(--card); outline: none; }
.inline-teams > summary { cursor: pointer; }
.inline-teams-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    max-height: 220px;
    overflow-y: auto;
}
.inline-teams-list label { display: flex; align-items: center; gap: 6px; font-weight: normal; }
/* Unsaved changes on a row, so a half-finished edit is obvious before leaving. */
tr.row-dirty { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ---- Danger zone (delete a record created in error) ----
   Deliberately quiet: a red left rule and nothing else, so it reads as the
   bottom of a form rather than a warning banner. Never applied to bookkeeping
   chrome — see the brick-colour note above. */
.card.danger-zone { border-left: 3px solid var(--bad); }
.card.danger-zone h2 { margin-top: 0; }

/* ---- Shopping cart (mentor team orders) ----
   Product-row cart + checkout summary, not a stack of edit forms. Brick
   colours stay off this — it's an operational screen, and the checkout
   button already has .btn.accent for the call to action. */
.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 16px;
    align-items: start;
}
.cart-summary { position: sticky; top: 16px; }
.cart-summary-count { margin: 0 0 8px; color: var(--ink-soft); font-size: 13px; }
.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin: 0 0 16px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.cart-summary .btn { width: 100%; text-align: center; }

.cart-head, .cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px 6.5rem 5.5rem 4.5rem;
    gap: 8px 16px;
    align-items: center;
}
.cart-head {
    padding: 0 0 8px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-soft);
}
.cart-head > :nth-child(3),
.cart-head > :nth-child(4),
.cart-head > :nth-child(5) { text-align: right; }

.cart-items { list-style: none; margin: 0; padding: 0; }
.cart-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    align-items: start;
}
.cart-item:last-child { border-bottom: 0; padding-bottom: 0; }
.cart-item-title { font-weight: 600; }
.cart-item-vendor { display: inline-block; font-size: 13px; }
.cart-item-unit, .cart-item-line {
    font-variant-numeric: tabular-nums;
    text-align: right;
    padding-top: 6px;
}
.cart-item-unit { color: var(--ink-soft); font-size: 13px; }
.cart-item-line { font-weight: 700; }
.cart-item-unit-mobile { display: none; color: var(--ink-soft); font-size: 13px; }
.cart-item-qty { margin: 0; }
.qty-readonly {
    display: inline-block;
    min-width: 2rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding-top: 6px;
}
.cart-item-remove { margin: 0; text-align: right; padding-top: 4px; }
.cart-remove {
    background: none;
    border: 0;
    color: var(--bad);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    box-shadow: none;
}
.cart-remove:hover { text-decoration: underline; }
.cart-remove:active { transform: none; }

.cart-item-edit { margin-top: 6px; }
.cart-item-edit summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}
.cart-item-edit[open] summary { margin-bottom: 10px; }
.cart-item-edit .stacked { max-width: 420px; }

.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
}
.qty-stepper button {
    width: 32px;
    height: 36px;
    border: 0;
    background: #fafbfc;
    color: var(--ink);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}
.qty-stepper button:hover { background: var(--paper); }
.qty-stepper button:active { transform: none; box-shadow: none; }
.qty-stepper input[type=number] {
    width: 3.2rem;
    border: 0;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-radius: 0;
    text-align: center;
    padding: 6px 2px;
    -moz-appearance: textfield;
}
.qty-stepper input[type=number]::-webkit-inner-spin-button,
.qty-stepper input[type=number]::-webkit-outer-spin-button { appearance: none; }

.cart-add-grid {
    display: grid;
    grid-template-columns: minmax(8rem, 2fr) minmax(8rem, 2fr) 5.5rem 8rem auto;
    gap: 12px;
    align-items: end;
}
.cart-add-grid .btn { white-space: nowrap; }

@media (max-width: 720px) {
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .cart-head { display: none; }
    .cart-item { grid-template-columns: 1fr auto; }
    .cart-item-info { grid-column: 1 / -1; }
    .cart-item-unit { display: none; }
    .cart-item-unit-mobile { display: block; margin-top: 2px; }
    .cart-item-line { padding-top: 10px; }
    .cart-item-remove { grid-column: 1 / -1; text-align: left; }
    .cart-add-grid { grid-template-columns: 1fr 1fr; }
    .cart-add-grid .field:nth-child(1),
    .cart-add-grid .field:nth-child(2),
    .cart-add-grid .btn { grid-column: 1 / -1; }
}

@page { margin: 1.5cm; }

@media print {
    /* --- interface chrome: gone --- */
    .no-print,
    .screen-only,
    .site-nav,
    .user-menu,
    .nav-toggle,
    .breadcrumbs,
    .tabs,
    .flash,
    .btn,
    button,
    input[type="submit"],
    .page-head .actions,
    .task-actions,
    form.inline-form,
    dialog,
    nav[role="navigation"] {
        display: none !important;
    }

    .cart-layout { display: block; }
    .cart-summary { position: static; margin-top: 12px; }
    .cart-add-grid, .cart-item-edit { display: none !important; }

    .print-only { display: inline-block; }

    /* --- page furniture --- */
    body { background: #fff; color: #000; font-size: 11.5pt; }
    .container { max-width: none; padding: 0; }

    /* Keep GEARS branding at the top of the document, on white. The colour
       stripe is dropped — it's decoration and a lot of ink. */
    .site-header {
        background: #fff;
        color: #000;
        min-height: 0;
        padding: 0 0 10px;
        margin-bottom: 16px;
        border-bottom: 1px solid #999;
        display: block;
    }
    .site-header::after { display: none; }
    .site-header .logo img { height: 42px; }

    /* --- content --- */
    a { color: #000; text-decoration: none; }
    .muted, .small { color: #333; }

    .card {
        border: 1px solid #bbb;
        box-shadow: none;
        padding: 12px 14px;
        break-inside: avoid;
    }
    /* The decorative LEGO stud row is screen-only flourish. */
    .card-feature, .auth-card, .role-card, .card.stat { padding-top: 12px; }
    .card-feature::before, .auth-card::before, .role-card::before, .card.stat::before { display: none; }

    h1, h2, h3 { break-after: avoid; }

    /* Long tables should break across pages, but repeat their header row and
       never split a row down the middle. */
    table.data { break-inside: auto; border: 1px solid #bbb; }
    table.data thead { display: table-header-group; }
    table.data tr { break-inside: avoid; }
    table.data th { background: #eee; color: #000; }
    table.data tr:hover td { background: transparent; }
    .register-table tbody tr:nth-child(even) td { background: transparent; }

    /* Form fields read as values, not as empty-looking input boxes. */
    input, textarea, select {
        border: 0;
        border-bottom: 1px solid #ccc;
        background: transparent;
        padding-left: 0;
    }

    /* Progress meters are pure background colour, which browsers omit from
       print by default — force just these so a statement still shows how much
       is paid. Deliberately narrow: nothing else opts into background ink. */
    .meter, .meter > span,
    /* The Season Billing report is printed for the Board, and a page where the
       overdue rows lost their colour would read as "nobody is behind" — the
       opposite of what it says on screen. The row text says it too, so this is
       belt to that brace rather than the only signal. */
    table.data tr.behind-2 > td, table.data tr.behind-3 > td {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
