/* Hostel Management styles. Same visual language as the Flight Manager dashboard
   (App_Themes\Default\dashboard.css there): warm plane, white cards, maroon brand.
   DevExpress controls use the Office365 theme tinted with --brand (see Web.config). */

:root {
    --plane: #f6f5f2;
    --card: #ffffff;
    --border: rgba(11, 11, 11, 0.08);
    --border-strong: #dcdbd4;
    --ink: #1d1c1a;
    --ink-2: #52514e;
    --muted: #898781;
    --grid: #e1e0d9;
    --axis: #c3c2b7;
    --hover: #faf9f6;
    --brand: #6e1b1b;
    --brand-hover: #5a1515;
    --brand-soft: #f6eaea;
    --track: #eeede8;
    --good: #0ca30c;
    --warning: #fab219;
    --critical: #d03b3b;
    --ok-ink: #1e6b3a;
    --ok-bg: #e7f4ec;
    --error-ink: #a21d24;
    --error-bg: #fbeaea;
    --notice-bg: #fff7e0;
    --notice-border: #f0dca0;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--plane);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 13px;
    line-height: 1.45;
}
a { color: var(--brand); }
h1 { margin: 2px 0 0; font-size: 24px; font-weight: 600; line-height: 1.25; }
h2 { margin: 0; font-size: 15px; font-weight: 600; }
h3 { margin: 16px 0 6px; font-size: 13px; font-weight: 600; }

/* ---- Top bar ---- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--card); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.nav a:hover { background: var(--plane); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.userbox { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); }
.user-avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--track); color: var(--ink); font-weight: 700; text-transform: uppercase; }
.user-role { color: var(--muted); }
.user-role::before { content: "\00b7  "; }
.userbox a { color: var(--brand); font-weight: 600; text-decoration: none; }
.userbox a:hover { text-decoration: underline; }
.userbox a.user-link { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; color: var(--ink-2); font-weight: 400; }
.userbox a.user-link:hover { background: var(--plane); text-decoration: none; }
.userbox a.user-link.active { background: var(--brand-soft); }

/* ---- Page ---- */
.page { max-width: 1280px; margin: 0 auto; padding: 20px 18px 40px; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--brand); }
.sub { margin-top: 2px; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.subtle { color: var(--muted); }

/* ---- Cards ---- */
.card { min-width: 0; margin-bottom: 14px; padding: 14px 16px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.card-sub { color: var(--muted); }
.card-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--grid); }
.card.narrow { max-width: 420px; margin: 10vh auto; padding: 24px; }

.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
.two-col > .card { margin-bottom: 0; }
.stack { display: grid; gap: 14px; }

/* ---- KPI tiles ---- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { padding: 14px 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.kpi-label { color: var(--ink-2); font-weight: 600; }
.kpi-value { margin: 4px 0 2px; font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-unit { margin-left: 4px; color: var(--ink-2); font-size: 16px; }
.kpi-note { color: var(--muted); }

/* ---- Occupancy meters ---- */
.meter-row { padding: 8px 0 9px; border-bottom: 1px solid var(--grid); }
.meter-row:last-child { border-bottom: none; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.meter-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.meter-name a { color: var(--ink); text-decoration: none; }
.meter-name a:hover { color: var(--brand); }
.meter-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--track); }
.meter-fill { display: block; height: 100%; max-width: 100%; border-radius: 4px; background: var(--brand); }
.meter-fill.full { background: var(--critical); }
.meter-fill.high { background: var(--warning); }
.meter-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }

/* ---- Simple lists and tables (dashboard) ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--axis); color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.table td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--hover); }
.table a, .meter-meta a { text-decoration: none; }
.table a:hover, .meter-meta a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.empty { padding: 18px 0; color: var(--muted); text-align: center; }

/* ---- Tags, badges and status ---- */
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 6px; background: var(--track); color: var(--ink-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.badge-current { background: #e6f4e6; color: #1b6b1b; }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status-Active .dot, .dot-good { background: var(--good); }
.status-Suspended .dot, .dot-warning { background: var(--warning); }
.status-Left .dot { background: var(--critical); }
.status-Graduated .dot { background: #2a78d6; }

/* ---- Forms ---- */
label, .field-label { display: block; margin: 12px 0 4px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.required::after { content: " *"; color: var(--critical); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 2px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; align-items: end; margin-bottom: 12px; }
.filters .actions { margin-top: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; color: var(--muted); }

/* Plain inputs (sign-in and setup pages) */
.input { width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; }
.input:focus { border-color: var(--brand); outline: 2px solid var(--brand-soft); }

/* ---- Buttons (ASPxButton with Native="true", links and plain buttons) ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--plane); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--error-ink); border-color: #e3b5b7; }
.btn-danger:hover { background: var(--error-bg); }
.btn-block { width: 100%; min-height: 40px; font-size: 14px; }
.link-action { color: var(--brand); font-weight: 600; text-decoration: none; }
.link-action:hover { text-decoration: underline; }
.link-danger { color: var(--error-ink); }
.row-actions { white-space: nowrap; }
.row-actions > * + * { margin-left: 12px; }

/* ---- Messages ---- */
.msg { display: block; margin: 12px 0; padding: 10px 12px; border-radius: 8px; }
.msg:empty { display: none; }
.msg-error { background: var(--error-bg); color: var(--error-ink); }
.msg-ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice { display: block; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--notice-border); border-radius: 8px; background: var(--notice-bg); }

/* ---- DevExpress controls: blend the Office365 theme into the page ---- */
.dx-full { width: 100% !important; }
.dxgvControl_Office365 { border: none !important; background: transparent !important; font: inherit !important; }
.dxgvControl_Office365 .dxgvTable_Office365 { border: none !important; background: transparent !important; }
.dxgvControl_Office365 .dxgvHeader_Office365 { padding: 7px 10px !important; border: none !important; border-bottom: 1px solid var(--axis) !important; background: var(--card) !important; color: var(--muted) !important; font-size: 11.5px !important; font-weight: 600 !important; letter-spacing: 0.03em; text-transform: uppercase; }
.dxgvControl_Office365 .dxgvDataRow_Office365 td.dxgv { padding: 8px 10px !important; border-bottom: 1px solid var(--grid) !important; border-right: none !important; border-left: none !important; color: var(--ink); }
.dxgvControl_Office365 .dxgvDataRowHover_Office365 td.dxgv { background: var(--hover) !important; }
.dxgvControl_Office365 .row-selected td.dxgv { background: var(--brand-soft) !important; }
.dxgvControl_Office365 td.dxgv .meter { width: 100%; min-width: 120px; }
.clickable-rows .dxgvDataRow_Office365 { cursor: pointer; }
.dxgvControl_Office365 .dxgvEmptyDataRow_Office365 td { padding: 18px 0 !important; color: var(--muted); text-align: center; }
.dxgvControl_Office365 .dxgvPagerBottomPanel_Office365 { padding-top: 10px !important; border: none !important; background: transparent !important; }
.dxgvControl_Office365 a { color: var(--brand); font-weight: 600; text-decoration: none; }
.dxgvControl_Office365 a:hover { text-decoration: underline; }
.dxgvControl_Office365 .num, .dxgvControl_Office365 td.num { text-align: right; }
.dxeBase_Office365, .dxeEditArea_Office365 { font: inherit !important; }
.dxeTextBox_Office365, .dxeButtonEdit_Office365, .dxeMemo_Office365 { border-radius: 8px !important; }
/* Student search boxes with suggestions: a magnifier at the left of the input. */
.search-suggest input.dxeEditArea_Office365 { padding-left: 26px !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 4px 50% / 16px 16px; }

/* Tabs (ASPxPageControl) sitting flush inside a card */
.card-tabs { padding: 8px 16px 16px; }
.card-tabs .dxtcLite_Office365 > .dxtc-content { padding: 16px 0 0 !important; border: none !important; background: transparent !important; }
.card-tabs .dxtcLite_Office365 > .dxtc-stripContainer .dxtc-tab,
.card-tabs .dxtcLite_Office365 > .dxtc-stripContainer .dxtc-activeTab { padding: 10px 16px !important; font-weight: 600; }

/* Hostel switcher in the page header */
.switcher { display: flex; align-items: center; gap: 10px; }
.switcher label { margin: 0; }

/* Compact figures above a tab's content */
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; background: var(--plane); }
.stat { display: flex; align-items: baseline; gap: 6px; }
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--ink-2); }
.stat-meter { flex: 1 1 200px; align-items: center; gap: 10px; }
.stat-meter .meter { flex: 1; }

/* A form set beside a grid */
.subpanel { padding: 4px 16px 16px; border: 1px solid var(--grid); border-radius: 10px; background: var(--hover); }
.subpanel h3 { margin-top: 12px; }
.narrow-form { max-width: 620px; }
.is-collapsed { display: none; }
/* When a form scrolls into view, keep its title clear of the sticky top bar. */
.card, .subpanel, .card-section { scroll-margin-top: 72px; }
/* While a side form is folded away, the list beside it takes the full width. */
.two-col:has(> .is-collapsed) { grid-template-columns: minmax(0, 1fr); }
.subpanel .meter { margin-bottom: 8px; }
.plain-list { margin: 8px 0 0; padding: 0; list-style: none; }
.plain-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.plain-list li:last-child { border-bottom: none; }
.plain-list a { text-decoration: none; }

/* ---- Avatars ---- */
.avatar { display: inline-grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; vertical-align: middle; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 88px; height: 88px; font-size: 30px; box-shadow: 0 0 0 4px var(--card), 0 2px 10px rgba(0, 0, 0, 0.08); }
.avatar-c0 { background: #f6eaea; color: #6e1b1b; }
.avatar-c1 { background: #e6eef9; color: #1d4f91; }
.avatar-c2 { background: #e6f4ea; color: #1b6b32; }
.avatar-c3 { background: #fdf0de; color: #8a4b08; }
.avatar-c4 { background: #efe9f8; color: #5a3591; }
.avatar-c5 { background: #e3f3f3; color: #11605f; }
.person { display: inline-flex; align-items: center; gap: 10px; }
.profile { display: flex; align-items: center; gap: 18px; }
.photo-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px; margin-bottom: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--grid); }
.photo-controls { flex: 1 1 280px; max-width: 520px; }
.photo-controls .field-label { margin-top: 0; }
.photo-controls .actions { margin-top: 10px; }

/* ---- Documents ---- */
.doc { display: inline-flex; align-items: center; gap: 10px; }
.doc-icon { display: inline-grid; flex: none; place-items: center; width: 36px; height: 40px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; }
.doc-pdf { background: #fbeaea; color: #a21d24; }
.doc-doc { background: #e6eef9; color: #1d4f91; }
.doc-xls { background: #e6f4ea; color: #1b6b32; }
.doc-img { background: #efe9f8; color: #5a3591; }
.doc-txt { background: var(--track); color: var(--ink-2); }

/* Picture viewer (Content/viewer.js) */
.viewer { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: #141210; }
.viewer[hidden] { display: none; }
.viewer-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-top, 0px)); color: #fff; }
.viewer-title { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.viewer .btn { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.12); color: #fff; }
.viewer .btn:hover { background: rgba(255, 255, 255, 0.22); }
.viewer-stage { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); }
.viewer-stage img { max-width: 100%; max-height: 100%; border-radius: 6px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); object-fit: contain; }
html.viewer-open { overflow: hidden; }

/* ---- Dashboard ---- */
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; padding: 22px 24px; border-radius: 14px;
        background: linear-gradient(120deg, #6e1b1b 0%, #8d2a2a 55%, #a2453a 100%); color: #fff; box-shadow: 0 8px 24px rgba(110, 27, 27, 0.18); }
.hero .eyebrow { color: rgba(255, 255, 255, 0.72); }
.hero h1 { font-size: 26px; }
.hero .sub { color: rgba(255, 255, 255, 0.85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero .btn { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.12); color: #fff; }
.hero .btn:hover { background: rgba(255, 255, 255, 0.22); }
.hero .btn-primary { border-color: #fff; background: #fff; color: var(--brand); }
.hero .btn-primary:hover { background: #f6eaea; }
.kpi-icon-row { display: flex; align-items: flex-start; gap: 14px; }
.kpi-icon { display: inline-grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); }
.kpi-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.occupancy-hero { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.occupancy-value { font-size: 34px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.feed { margin: 0; padding: 0; list-style: none; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--grid); }
.feed li:last-child { border-bottom: none; }
.feed a { text-decoration: none; }
.feed a:hover { text-decoration: underline; }
.feed-body { flex: 1; min-width: 0; }
.feed-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.move { margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.move-in { background: #e6f4e6; color: #1b6b1b; }
.move-out { background: var(--track); color: var(--ink-2); }
.empty-good { padding: 18px 0; }

/* Column chart (Content/dashboard.js) */
.colchart { position: relative; min-height: 240px; }
.colchart svg { display: block; overflow: visible; }
.colchart .cc-grid { stroke: var(--grid); stroke-width: 1; }
.colchart .cc-base { stroke: var(--axis); stroke-width: 1; }
.colchart .cc-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.colchart .cc-end { fill: var(--ink); font-size: 12px; font-weight: 600; }
.colchart .cc-col { fill: #c99a9a; }
.colchart .cc-col-now { fill: var(--brand); }
.colchart .cc-hit { fill: transparent; outline: none; cursor: default; }
.colchart .cc-hit.is-active { fill: rgba(110, 27, 27, 0.05); }
.chart-tip { position: absolute; z-index: 5; padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); pointer-events: none; white-space: nowrap; }
.chart-tip b { display: block; font-size: 15px; }
.chart-tip span { color: var(--ink-2); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Sign-in ---- */
.auth { display: grid; min-height: 100vh; place-items: center; padding: 24px 16px; }
/* Sign-in, setup and error pages: a faded grey hostel silhouette centred behind the card. */
.auth-hostel { position: relative; overflow: hidden; background: var(--plane); }
.auth-hostel::before { content: ""; position: absolute; inset: 0; pointer-events: none;
                       background: url("login-hostel.svg") no-repeat center center / auto min(78vh, 720px);
                       filter: grayscale(1); opacity: 0.08; }
.auth-hostel .auth-card { position: relative; z-index: 1; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.10); }
.auth-card { width: 100%; max-width: 380px; padding: 28px 26px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); }
.auth-card .brand { margin-bottom: 18px; }
.auth-card h1 { font-size: 20px; }

/* ---- Narrower windows ---- */
@media (max-width: 1000px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-col { grid-template-columns: minmax(0, 1fr); }
}
/* Bottom navigation: phones only (see Site.Master). */
.bottom-nav { display: none; }

/* ---- Phones ---- */
@media (max-width: 760px) {
    body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
    .page { padding: 14px 12px 24px; }
    .card { padding: 14px 14px 16px; }
    .card-tabs { padding: 4px 12px 14px; }

    /* Top bar keeps the brand and user; the sections move to the bottom bar. */
    .topbar-inner { min-height: 52px; padding: 0 12px; }
    .nav { display: none; }
    .userbox { margin-left: auto; }
    .userbox .user-name { display: none; }
    .userbox a { display: inline-block; padding: 10px 0; }
    .userbox a.user-link { padding: 6px; }
    .bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 60; display: grid; grid-template-columns: repeat(4, 1fr);
                  grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr;
                  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: rgba(255, 255, 255, 0.97);
                  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05); }
    .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding: 6px 2px; border-radius: 10px;
                    color: var(--muted); font-size: 11.5px; font-weight: 600; text-decoration: none; }
    .bottom-nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .bottom-nav a.active { background: var(--brand-soft); color: var(--brand); }

    h1 { font-size: 22px; }
    .page-header { align-items: flex-start; }
    .page-header > .btn { width: 100%; }
    .profile { gap: 14px; }
    .avatar-lg { width: 64px; height: 64px; font-size: 22px; }

    /* 16px text stops iPhones zooming in when a field is tapped. */
    input, select, textarea, .input,
    .dxeEditArea_Office365, .dxeMemoEditArea_Office365, .dxeTextBox_Office365 input, .dxeButtonEdit_Office365 input { font-size: 16px !important; }
    .dxeTextBox_Office365 .dxeEditArea_Office365, .dxeButtonEdit_Office365 .dxeEditArea_Office365 { min-height: 30px; }

    /* Thumb-sized targets: full-width form buttons, padded row links. */
    .btn { min-height: 44px; padding: 10px 16px; }
    .actions > .btn, .actions > a.btn, .actions > input.btn { flex: 1 1 auto; }
    .row-actions a { display: inline-block; padding: 10px 4px; }
    /* Suggestion and pick-list rows big enough for a thumb. */
    .dxeListBoxItem_Office365 { padding-top: 12px !important; padding-bottom: 12px !important; font-size: 15px !important; }
    .card-link { display: inline-block; padding: 8px 0; }
    .dxgvControl_Office365 .dxgvDataRow_Office365 td.dxgv { padding-top: 10px !important; padding-bottom: 10px !important; }

    .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters > .span-mobile { grid-column: 1 / -1; }
    .filters .actions { grid-column: 1 / -1; margin-top: 12px; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }

    /* Two compact figures per row. */
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 12px; }
    .kpi-icon { display: none; }
    .kpi-value { font-size: 26px; }
    .hero { padding: 18px; }
    .hero h1 { font-size: 22px; }
    .hero-actions { width: 100%; }
    .hero-actions .btn { flex: 1 1 auto; }
    .stats { gap: 8px 18px; padding: 10px 12px; }

    /* Tabs as chips that wrap onto a second row, so every tab is visible at once. */
    .card-tabs .dxtc-strip { display: flex !important; flex-wrap: wrap; gap: 8px; height: auto !important; margin: 4px 0 2px !important;
                             padding: 4px 0 12px !important; border-bottom: 1px solid var(--grid) !important; white-space: normal !important; }
    .card-tabs .dxtc-strip > .dxtc-leftIndent, .card-tabs .dxtc-strip > .dxtc-rightIndent, .card-tabs .dxtc-strip > .dxtc-spacer { display: none !important; }
    .card-tabs .dxtc-strip > .dxtc-tab, .card-tabs .dxtc-strip > .dxtc-activeTab {
        float: none !important; height: auto !important; margin: 0 !important; padding: 0 !important;
        border: 1px solid var(--border-strong) !important; border-radius: 999px !important; background: #fff !important; box-shadow: none !important; }
    .card-tabs .dxtc-strip > .dxtc-tab > a, .card-tabs .dxtc-strip > .dxtc-activeTab > a {
        display: block !important; height: auto !important; padding: 9px 15px !important; line-height: 1.25 !important;
        color: var(--ink-2) !important; font-size: 14px; font-weight: 600; }
    .card-tabs .dxtc-strip > li a * { padding: 0 !important; margin: 0 !important; line-height: 1.25 !important; }
    /* Same selector as the desktop tab padding rule above, so this one wins on phones. */
    .card-tabs .dxtcLite_Office365 > .dxtc-stripContainer .dxtc-tab,
    .card-tabs .dxtcLite_Office365 > .dxtc-stripContainer .dxtc-activeTab { padding: 0 !important; }
    .card-tabs .dxtc-strip > .dxtc-activeTab { border-color: var(--brand) !important; background: var(--brand-soft) !important; }
    .card-tabs .dxtc-strip > .dxtc-activeTab > a { color: var(--brand) !important; }
    .card-tabs .dxtc-strip > .dxtc-activeTab::after, .card-tabs .dxtc-strip > .dxtc-activeTab::before { display: none !important; }
    .feed-date { font-size: 11.5px; }
}
