/* ============================================================
   CRM — light-blue design system (responsive)
   Palette: sky/blue accents on a soft blue-tinted light surface.
   ============================================================ */
:root {
    --bg:        #eef4fb;   /* page background            */
    --bg-grad-1: #e6f1fc;
    --bg-grad-2: #f4f9ff;
    --surface:   #ffffff;   /* cards, tables, nav         */
    --surface-2: #f1f7fd;   /* table headers, subtle fill */
    --border:    #dbe7f3;   /* light blue-gray border     */
    --border-2:  #eaf1f8;
    --primary:   #1e88e5;   /* light-blue primary         */
    --primary-d: #1668b8;   /* hover / pressed            */
    --primary-soft: #e3f1fd;
    --accent:    #0ea5e9;
    --text:      #1e293b;   /* main text                  */
    --heading:   #0f2748;
    --muted:     #64748b;
    --ring:      rgba(30,136,229,.28);
    --shadow:    0 1px 2px rgba(15,39,72,.06), 0 8px 24px rgba(15,39,72,.06);
    --shadow-sm: 0 1px 2px rgba(15,39,72,.08);
    --radius:    12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

/* inline icons */
.ico { width: 1.05em; height: 1.05em; vertical-align: -.16em; flex-shrink: 0; }
.btn .ico, button .ico { vertical-align: -.16em; }
.btn.icon-only { display: inline-flex; align-items: center; justify-content: center; padding: .4rem .5rem; }
.btn .ico + span, button .ico + span { margin-left: .4rem; }
a.btn, .btn { display: inline-flex; align-items: center; gap: .4rem; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(160deg, var(--bg-grad-1), var(--bg-grad-2));
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    line-height: 1.55;
}

/* ---- Card (auth pages centre a card) ---- */
.card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.4rem;
    box-shadow: var(--shadow);
}
.card.wide { max-width: 820px; }
.login-logo { display: block; height: 48px; margin: 0 auto 1.25rem; }

h1 { font-size: 1.6rem; color: var(--heading); margin-bottom: .35rem; letter-spacing: -.01em; }
.accent { color: var(--primary); }
.subtitle { color: var(--muted); margin-bottom: 1.75rem; font-size: .95rem; }

/* ---- Form controls ---- */
label { display: block; font-size: .8rem; font-weight: 600; color: #475569; margin: 1rem 0 .35rem; }
input, select, textarea {
    width: 100%;
    padding: .65rem .8rem;
    background: var(--surface);
    border: 1px solid #cdddec;
    border-radius: 9px;
    color: var(--text);
    font-size: .95rem;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring);
}
input::placeholder, textarea::placeholder { color: #9fb2c6; }

button {
    width: 100%;
    margin-top: 1.5rem;
    padding: .72rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}
button:hover { background: var(--primary-d); }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }

.links { margin-top: 1.25rem; font-size: .85rem; color: var(--muted); text-align: center; }
.links a { color: var(--primary); text-decoration: none; font-weight: 600; }
.links a:hover { text-decoration: underline; }

/* ---- Banners ---- */
.banner { padding: .7rem .9rem; border-radius: 9px; font-size: .87rem; margin-bottom: 1rem; font-weight: 500; }
.banner.error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.banner.ok    { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.divider { text-align: center; color: #94a3b8; font-size: .78rem; margin: 1rem 0 .25rem; }

.logout { display: inline; }
.logout button { width: auto; margin-top: 1.5rem; padding: .55rem 1.15rem; }

/* ============================================================
   App shell (authenticated pages)
   ============================================================ */
body.app { display: block; padding: 0; align-items: stretch; }

.topnav {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: .8rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky; top: 0; z-index: 20;
    flex-wrap: wrap;
}
.topnav .brand { display: flex; align-items: center; }
.topnav .brand-logo { height: 30px; display: block; }
.topnav a { color: #51617a; text-decoration: none; font-size: .9rem; font-weight: 500; padding: .2rem 0; }
.topnav a:hover { color: var(--primary); }
.topnav a.active { color: var(--primary); font-weight: 700; box-shadow: inset 0 -2px 0 var(--primary); }
.topnav .spacer { margin-left: auto; }
.topnav .who { color: var(--muted); font-size: .82rem; }
.topnav .who strong { color: var(--text); }
.topnav form.logout { display: inline; }
.topnav form.logout button {
    width: auto; margin: 0; padding: .4rem .85rem; font-size: .82rem;
    background: transparent; color: #51617a; border: 1px solid var(--border);
}
.topnav form.logout button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* full-page-width content on all app pages */
.content { max-width: none; margin: 1.75rem auto; padding: 0 2rem; }
.content h1 { font-size: 1.5rem; margin-bottom: 1.25rem; }
.pagehead { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.pagehead h1 { margin: 0; }
.pagehead .spacer { margin-left: auto; }

/* ---- Buttons (links / inline) ---- */
.btn {
    display: inline-block; padding: .5rem 1rem; border-radius: 9px;
    background: var(--primary); color: #fff; font-size: .85rem; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer; width: auto;
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--primary-d); }
.btn.secondary { background: var(--surface); color: #45566e; border: 1px solid var(--border); }
.btn.secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn.danger { background: #ef4444; color: #fff; }
.btn.danger:hover { background: #dc2626; }
.btn.small { padding: .35rem .7rem; font-size: .78rem; margin: 0; }
.btn.disabled { opacity: .45; pointer-events: none; }

/* ---- Data table ---- */
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap.scroll { max-height: 360px; overflow-y: auto; }
.table-wrap.scroll table.data thead th { position: sticky; top: 0; z-index: 1; }
.timeline-scroll { max-height: 360px; overflow-y: auto; padding-right: .25rem; }
table.data {
    width: 100%; border-collapse: collapse; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow-sm);
}
table.data th, table.data td { text-align: left; padding: .78rem 1rem; }
table.data thead th {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.data tbody tr { border-bottom: 1px solid var(--border-2); }
table.data tbody tr:last-child { border-bottom: none; }
table.data tbody tr:hover { background: #f6fafe; }
/* Indents a Sales Person row directly under its Team Lead's row (org-chart style). */
table.data tbody tr.report td:first-child { padding-left: 2.1rem; position: relative; }
table.data tbody tr.report td:first-child::before {
    content: ""; position: absolute; left: .9rem; top: 0; bottom: 50%; width: .8rem;
    border-left: 2px solid var(--border); border-bottom: 2px solid var(--border);
    border-radius: 0 0 0 6px;
}
table.data .actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
table.data .actions.nowrap { flex-wrap: nowrap; white-space: nowrap; }
.btn.small.icon-only { padding: .32rem .42rem; }
.btn.small.icon-only .ico { width: 1rem; height: 1rem; vertical-align: middle; }
table.data thead th a.sort { color: var(--muted); text-decoration: none; }
table.data thead th a.sort:hover { color: var(--primary); }
table.data td a:not(.btn) { color: var(--primary); text-decoration: none; font-weight: 600; }
table.data td a:not(.btn):hover { text-decoration: underline; }

/* ---- Tags / pills ---- */
.tag {
    display: inline-block; padding: .18rem .62rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700; background: var(--primary-soft); color: #1668b8;
    white-space: nowrap;
}
.tag.muted { background: #eef2f7; color: #64748b; }
.tag.role-super_admin { background: #f3e8ff; color: #7e22ce; }
.tag.role-manager     { background: #dcfce7; color: #15803d; }
.tag.role-accountant  { background: #fef3c7; color: #b45309; }
.tag.role-sales_person{ background: #e0f2fe; color: #0369a1; }
.tag.role-sales_person_tl { background: #ede9fe; color: #6d28d9; }
.tag.role-user        { background: #dbeafe; color: #1d4ed8; }

/* status tags */
.tag.status-lead     { background: #eef2f7; color: #475569; }
.tag.status-prospect { background: #dbeafe; color: #1d4ed8; }
.tag.status-active   { background: #dcfce7; color: #15803d; }
.tag.status-inactive { background: #fee2e2; color: #b91c1c; }

/* ---- Branch Manager dashboard: KPI cards ---- */
.kpi-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem; margin: .25rem 0 1.5rem;
}
.kpi-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 1.1rem 1.3rem; display: flex; flex-direction: column; gap: .3rem;
}
.kpi-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.kpi-value { font-size: 1.65rem; font-weight: 800; color: var(--heading); line-height: 1.15; }
.kpi-sub { font-size: .78rem; color: var(--muted); }

/* ---- Dashboard panels (client pipeline, team performance, recent BOQs) ---- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.dash-panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); padding: 1.3rem 1.4rem;
}
.dash-panel h2 { font-size: 1.05rem; color: var(--heading); margin: 0 0 1rem; }
.panel-head { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel-head .spacer { margin-left: auto; }

/* client pipeline funnel */
.funnel-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .65rem; }
.funnel-row:last-child { margin-bottom: 0; }
.funnel-label { flex: 0 0 90px; font-size: .82rem; color: var(--text); font-weight: 600; }
.funnel-track { flex: 1; background: var(--surface-2); border-radius: 999px; height: .6rem; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 999px; min-width: 3px; }
.funnel-bar.status-lead     { background: #94a3b8; }
.funnel-bar.status-prospect { background: #3b82f6; }
.funnel-bar.status-active   { background: #22c55e; }
.funnel-bar.status-inactive { background: #ef4444; }
.funnel-count { flex: 0 0 auto; min-width: 1.5rem; text-align: right; font-weight: 700; color: var(--heading); font-size: .85rem; }

.inline-form { display: inline; }
.card.form { max-width: 560px; }
.card.form label { margin-top: 1rem; }

/* inline radio group (e.g. increase / decrease toggle) */
.radio-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .2rem; }
.radio-row label.radio {
    display: flex; align-items: center; gap: .45rem; margin: 0;
    flex: 1; min-width: 180px; padding: .6rem .8rem;
    border: 1px solid #cdddec; border-radius: 9px; cursor: pointer;
    font-size: .9rem; font-weight: 500; color: var(--text);
    transition: border-color .15s, background .15s;
}
.radio-row label.radio:hover { border-color: var(--primary); }
.radio-row input[type="radio"] { width: auto; margin: 0; accent-color: var(--primary); }
.radio-row label.radio:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.muted-note { color: var(--muted); font-size: .82rem; margin-top: .5rem; }

/* ============================================================
   Record form — industry-standard sectioned layout
   ============================================================ */
.form-shell { width: 100%; max-width: 920px; margin: 0 auto; }

/* Context strip: who/what this record is about */
.form-context {
    display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .7rem 1.1rem; margin-bottom: .85rem;
    box-shadow: var(--shadow-sm);
}
.form-context .ctx { display: flex; flex-direction: column; gap: .1rem; }
.form-context .ctx-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.form-context .ctx-value { font-weight: 700; color: var(--heading); font-size: .88rem; }
.form-context .ctx-amount { font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.form-context .spacer { margin-left: auto; }

/* Card that holds the sectioned form (edge-to-edge sections) */
.card.record-form { max-width: none; padding: 0; overflow: hidden; }
.form-section { padding: .9rem 1.75rem; border-top: 1px solid var(--border-2); }
.form-section:first-child { border-top: none; }
.record-form.seamless .form-section { border-top: none; padding-top: .6rem; padding-bottom: .6rem; }
.form-section > header { margin-bottom: .15rem; }
.form-section > header .row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.form-section h2 {
    font-size: .88rem; color: var(--heading); margin: 0; font-weight: 700;
    display: flex; align-items: center; gap: .4rem;
}
.form-section h2 .ico { width: .95rem; height: .95rem; color: var(--primary); }
.form-section .section-hint { font-size: .76rem; color: var(--muted); margin: .1rem 0 0; }

/* Two fields per row (add .cols-3 for a denser three-up row on wide sections) */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.field-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field-grid .field { display: flex; flex-direction: column; min-width: 0; }
.field-grid .field.full { grid-column: 1 / -1; }
.field-grid .field label { margin: .55rem 0 .25rem; font-size: .78rem; }
.field-grid .field input,
.field-grid .field select,
.field-grid .field textarea { width: 100%; padding: .5rem .7rem; }
.field-hint { font-size: .74rem; color: var(--muted); margin-top: .35rem; }
.req { color: #ef4444; font-weight: 700; }

/* Sticky action bar */
.form-footer {
    display: flex; justify-content: flex-end; align-items: center; gap: .6rem;
    padding: .75rem 1.75rem; background: var(--surface-2); border-top: 1px solid var(--border);
}
.form-footer button, .form-footer .btn { width: auto; margin: 0; }
.form-footer button[type="submit"] { padding: .55rem 1.3rem; font-size: .88rem; border-radius: 9px; }

@media (max-width: 640px) {
    .field-grid, .field-grid.cols-3 { grid-template-columns: 1fr; }
    .form-section { padding: 1rem 1.15rem; }
    .form-footer { padding: .85rem 1.15rem; flex-direction: column-reverse; }
    .form-footer button, .form-footer .btn { width: 100%; text-align: center; justify-content: center; }
}

/* ---- Import CSV dropzone ---- */
.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: .5rem;
    text-align: center; padding: 2.2rem 1.5rem; margin-top: .6rem;
    border: 2px dashed #cdddec; border-radius: var(--radius);
    background: var(--surface-2); cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .ico { width: 2rem; height: 2rem; color: var(--primary); }
.dropzone .dz-title { font-weight: 700; color: var(--heading); font-size: .95rem; }
.dropzone .dz-sub { color: var(--muted); font-size: .82rem; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* ---- Filter bar ---- */
.filters {
    display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-end;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.15rem; margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.filters .field { display: flex; flex-direction: column; }
.filters label { margin: 0 0 .3rem; }
.filters input, .filters select { margin: 0; min-width: 180px; }
.filters .grow { flex: 1; min-width: 220px; }
.filters input.grow { width: 100%; }
.filters .actions { display: flex; gap: .5rem; margin-left: auto; }

/* Advanced filters (collapsible, inside the filter bar form) */
.adv-filters { flex: 1 1 100%; border-top: 1px solid var(--border-2); margin-top: .3rem; }
.adv-filters > summary {
    cursor: pointer; padding: .6rem 0; font-size: .82rem; font-weight: 700;
    color: var(--primary-d); list-style: revert; user-select: none;
}
.adv-filters .body { padding: .4rem 0 .2rem; }
.adv-filters .field-grid input, .adv-filters .field-grid select { min-width: 0; }

/* collections money */
.due    { color: #dc2626; }
.credit { color: #16a34a; }

/* ---- Section head (table title + record count) ---- */
.section-head { display: flex; align-items: baseline; gap: .6rem; margin: 1.9rem 0 .6rem; }
.section-head h2 { margin: 0; font-size: 1.1rem; color: var(--heading); font-weight: 700; }
.section-head .count { font-size: .74rem; font-weight: 700; color: var(--muted); background: var(--surface-2);
    border: 1px solid var(--border); padding: .1rem .55rem; border-radius: 999px; }

/* outcome tags (follow-ups) */
.tag.outcome-contacted  { background: #dbeafe; color: #1d4ed8; }
.tag.outcome-no_answer  { background: #eef2f7; color: #64748b; }
.tag.outcome-promised   { background: #dcfce7; color: #15803d; }
.tag.outcome-partial    { background: #fef3c7; color: #b45309; }
.tag.outcome-disputed   { background: #fee2e2; color: #b91c1c; }
.tag.outcome-refused    { background: #fee2e2; color: #991b1b; }

.mono { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--heading); }
.cell-truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
table.data td.amount-cell { font-weight: 700; white-space: nowrap; }

/* repeatable contacts on the client form */
.contact-row {
    display: grid; grid-template-columns: 1.3fr 1fr .9fr 1.3fr 1fr auto; gap: .5rem;
    align-items: center; margin-top: .6rem;
}
.contact-row input, .contact-row select { margin: 0; padding: .5rem .6rem; font-size: .88rem; }
.contact-row .rm { padding: .35rem .6rem; font-size: 1rem; line-height: 1; }
@media (max-width: 720px) { .contact-row { grid-template-columns: 1fr 1fr; } .contact-row .rm { grid-column: 2; justify-self: end; } }

/* inline status dropdown in list rows */
select.statusselect {
    width: auto; min-width: 132px; padding: .32rem .6rem; font-size: .78rem;
    font-weight: 700; border-radius: 999px; cursor: pointer;
}
select.statusselect.status-lead     { background: #eef2f7; color: #475569; border-color: #d5dde6; }
select.statusselect.status-prospect { background: #dbeafe; color: #1d4ed8; border-color: #bfd6fb; }
select.statusselect.status-active   { background: #dcfce7; color: #15803d; border-color: #b6ebc6; }
select.statusselect.status-inactive { background: #fee2e2; color: #b91c1c; border-color: #f7c9c9; }

/* pagination */
.pager { display: flex; align-items: center; gap: 1rem; margin-top: 1.25rem; justify-content: center; flex-wrap: wrap; }
.pager .pageinfo { color: #45566e; font-size: .9rem; }

/* key-value table (detail) */
table.kv { width: 100%; border-collapse: collapse; }
table.kv th { text-align: left; width: 170px; color: var(--muted); font-weight: 600;
    vertical-align: top; padding: .6rem 1rem .6rem 0; font-size: .85rem; }
table.kv td { padding: .6rem 0; border-bottom: 1px solid var(--border-2); }
table.kv tr:last-child td, table.kv tr:last-child th { border-bottom: none; }

/* ---- Profile-style detail page header (e.g. client detail) ---- */
.profile-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.avatar-circle {
    width: 54px; height: 54px; border-radius: 14px; flex-shrink: 0;
    background: linear-gradient(155deg, var(--primary-soft), #d6ebfd);
    color: var(--primary-d); display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800;
}
.profile-head h1 { margin: 0; }
.profile-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.profile-head .spacer { margin-left: auto; }
.profile-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.record-meta { color: var(--muted); font-size: .82rem; margin-top: 1rem; }

/* BOQ masters — subnav tabs + repeatable master rows */
.subnav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.subnav a { padding: .45rem 1rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
    color: #45566e; text-decoration: none; border: 1px solid var(--border); background: var(--surface); }
.subnav a:hover { border-color: var(--primary); color: var(--primary); }
.subnav a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.master-row-form { display: flex; gap: .5rem; align-items: center; }
.master-row-form input[type=text] { flex: 1; margin: 0; min-width: 0; }
.master-row-form input[type=number] { width: 110px; margin: 0; flex: none; }
.master-row-form label.active { display: flex; align-items: center; gap: .3rem; font-size: .78rem;
    white-space: nowrap; color: var(--muted); flex: none; }
.master-row-form label.active input { width: auto; margin: 0; }
.master-row-form button { margin: 0; flex: none; }
.add-row-form { display: flex; gap: .5rem; align-items: center; padding: .8rem 1rem; background: var(--surface-2); }
.add-row-form input { margin: 0; }

/* activity timeline */
ul.timeline { list-style: none; margin: .5rem 0 0; padding: 0; }
ul.timeline li { display: flex; gap: .85rem; padding: 0 0 1rem .25rem; position: relative; }
ul.timeline li .dot { width: 11px; height: 11px; border-radius: 50%;
    background: var(--primary); margin-top: .35rem; flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--primary-soft); }
ul.timeline li:not(:last-child)::before { content: ''; position: absolute;
    left: .58rem; top: 1.1rem; bottom: -.25rem; width: 2px; background: var(--border); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
    .content { margin: 1.25rem auto; padding: 0 1rem; }
    .topnav { gap: .75rem 1rem; padding: .7rem 1rem; }
    .topnav .who { display: none; }              /* keep the bar compact on phones */
    .card { padding: 1.6rem; }
    /* let wide tables scroll instead of squashing */
    table.data { display: block; overflow-x: auto; white-space: nowrap; }
    .filters .actions { margin-left: 0; width: 100%; }
    .filters input, .filters select, .filters .grow { min-width: 0; width: 100%; flex: 1 1 100%; }
    .pagehead .spacer { display: none; }
}
@media (max-width: 480px) {
    h1 { font-size: 1.35rem; }
    .btn.small { padding: .3rem .55rem; }
    table.kv th { width: 120px; }
}
