/* The Hiller Store — site theme, layered over the local Bootstrap 5.1 build.
   One file for every page (Blazor and Razor Pages). Colors meet WCAG AA on white. */

:root {
  --brand: #0369a1;          /* buttons, links, active nav */
  --brand-hover: #075985;
  --brand-soft: #e0f2fe;     /* hover/selected backgrounds */
  --accent: #db2777;         /* brand mark */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --success: #15803d; --success-bg: #dcfce7;
  --warning: #92400e; --warning-bg: #fef3c7;
  --danger: #b91c1c;  --danger-bg: #fee2e2;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 60px;

  /* Bootstrap hooks */
  --bs-body-font-family: var(--font);
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-primary: var(--brand);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 650; line-height: 1.25; }
h1 { font-size: 1.6rem; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 1rem; color: var(--muted); font-weight: 500; }
h3 { font-size: 1.35rem; margin: 0 0 1rem; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1.05rem; }
:focus-visible { outline: 3px solid rgba(3, 105, 161, .35); outline-offset: 2px; }

/* ---- Header ------------------------------------------------------------------------------- */
.app-header { position: sticky; top: 0; z-index: 1000; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.app-header-inner { max-width: 1280px; margin: 0 auto; min-height: var(--header-h); padding: 8px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.app-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.app-brand:hover { color: var(--text); }
.app-brand-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #f59e0b 55%, var(--brand)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.app-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; flex: 1 1 auto; }
.app-nav > a, .app-dropdown > summary { display: inline-flex; align-items: center; padding: 7px 11px; border-radius: var(--radius-sm); color: #334155; font-weight: 550; font-size: .93rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.app-nav > a:hover, .app-dropdown > summary:hover { background: var(--surface-muted); color: var(--text); }
.app-nav > a.active, .app-dropdown > summary.active { background: var(--brand-soft); color: var(--brand); }
.app-nav-public { justify-content: flex-end; }
.app-nav-public .app-signin { background: var(--brand); color: #fff; }
.app-nav-public .app-signin:hover { background: var(--brand-hover); color: #fff; }

.app-dropdown { position: relative; }
.app-dropdown > summary { list-style: none; }
.app-dropdown > summary::-webkit-details-marker { display: none; }
.app-dropdown > summary::after { content: ""; width: 7px; height: 7px; margin-left: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: .6; }
.app-dropdown[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.app-dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 23, 42, .12); padding: 6px; z-index: 1100; }
.app-dropdown-menu.align-end { left: auto; right: 0; }
.app-dropdown-menu a, .app-dropdown-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: .93rem; text-decoration: none; cursor: pointer; }
.app-dropdown-menu a:hover, .app-dropdown-menu button:hover { background: var(--surface-muted); color: var(--text); }
.app-dropdown-menu a.active { color: var(--brand); background: var(--brand-soft); }
.app-dropdown-menu form { margin: 0; }
/* The grouped Admin menu: one column per section. */
.app-dropdown-menu.app-dropdown-grouped { display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 2px 10px; min-width: 640px; max-height: 80vh; }
.app-dropdown-heading { padding: 8px 10px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.app-user { margin-left: auto; }
.app-user > summary { border: 1px solid var(--border); }

/* Admin notice under the header (Shared/GoDaddyBanner.razor) */
.app-banner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--warning-bg); color: #78350f; border-bottom: 1px solid #fde68a; font-weight: 550; }

/* ---- Page area ---------------------------------------------------------------------------- */
.app-main { max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; }
.app-main > h1:first-child, .app-main > h3:first-child { margin-top: 4px; }

/* ---- Cards -------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card:not(:has(> .card-body)):not(:has(> .card-header)) { padding: 20px; }
.card-header { background: var(--surface-muted); border-bottom: 1px solid var(--border); font-weight: 600; }
.card-title { font-weight: 650; }

/* ---- Buttons ------------------------------------------------------------------------------ */
.btn { border-radius: 8px; font-weight: 600; padding: .45rem .9rem; }
.btn-sm { padding: .3rem .65rem; font-size: .85rem; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-muted); color: var(--text); border-color: #cbd5e1; }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn:disabled, button:disabled { opacity: .55; cursor: not-allowed; }

/* Pages written without Bootstrap classes use bare <button>s with "secondary"/"danger"/"success". */
.app-main button:not([class*="btn"]):not(.btn-close):not(.app-dropdown-menu button):not(.tab-btn) {
  display: inline-flex; align-items: center; gap: 6px; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--brand);
  background: var(--brand); color: #fff; font-weight: 600; font-size: .93rem; cursor: pointer; line-height: 1.4;
}
.app-main button:not([class*="btn"]):not(.btn-close):not(.tab-btn):hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.app-main button.secondary { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.app-main button.secondary:hover { background: var(--surface-muted) !important; }
.app-main button.danger { background: var(--danger) !important; border-color: var(--danger) !important; }
.app-main button.success, .app-main button.save { background: var(--success) !important; border-color: var(--success) !important; }

/* ---- Forms -------------------------------------------------------------------------------- */
.form-control, .form-select,
.app-main input[type="text"]:not(.form-control), .app-main input[type="email"]:not(.form-control), .app-main input[type="tel"]:not(.form-control),
.app-main input[type="number"]:not(.form-control), .app-main input[type="date"]:not(.form-control), .app-main input[type="month"]:not(.form-control),
.app-main input[type="password"]:not(.form-control), .app-main input[type="search"]:not(.form-control), .app-main input:not([type]):not(.form-control),
.app-main select:not(.form-select), .app-main textarea:not(.form-control) {
  display: block; width: 100%; padding: .5rem .7rem; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid #cbd5e1; border-radius: 8px; transition: border-color .15s, box-shadow .15s;
}
.app-main input[type="month"]:not(.form-control), .app-main input[type="date"]:not(.form-control) { width: auto; display: inline-block; }
.form-control:focus, .form-select:focus, .app-main input:focus, .app-main select:focus, .app-main textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(3, 105, 161, .15);
}
.form-control-sm { padding: .3rem .55rem; font-size: .88rem; }
.form-label, .app-main label { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.form-check-label { font-weight: 400; }
.form-text, .text-muted { color: var(--muted) !important; }
.validation-message, .field-validation-error { color: var(--danger); font-size: .85rem; }
.valid.modified:not([type=checkbox]) { outline: none; border-color: var(--success); }
.invalid { outline: none; border-color: var(--danger) !important; }

/* ---- Tables ------------------------------------------------------------------------------- */
.table, .table-compact { width: 100%; border-collapse: collapse; background: var(--surface); margin-bottom: 1rem; font-size: .93rem; }
.table > thead th, .table-compact thead th { background: var(--surface-muted); color: #475569; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 650; border-bottom: 1px solid var(--border); padding: .6rem .7rem; white-space: nowrap; }
.table td, .table-compact td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-sm td, .table-sm th { padding: .4rem .55rem !important; }
.table-hover tbody tr:hover, .table-compact tbody tr:hover { background: var(--surface-muted); }
.table-light, .table-light > th { background: var(--surface-muted) !important; }
.table-warning { --bs-table-bg: var(--warning-bg); background: var(--warning-bg); }
.thead-muted td { background: var(--surface-muted); }
.table-responsive, .table-wrap { overflow-x: auto; }

/* ---- Alerts & badges ---------------------------------------------------------------------- */
.alert { border-radius: var(--radius); border: 1px solid transparent; padding: .8rem 1rem; }
.alert-success { background: var(--success-bg); color: #14532d; border-color: #bbf7d0; }
div.success { background: var(--success-bg); color: #14532d; border: 1px solid #bbf7d0; border-radius: var(--radius); padding: .8rem 1rem; }
.alert-danger, .error { background: var(--danger-bg); color: #7f1d1d; border-color: #fecaca; border-radius: var(--radius); padding: .8rem 1rem; }
.alert-warning { background: var(--warning-bg); color: #78350f; border-color: #fde68a; }
.alert-info { background: var(--brand-soft); color: #0c4a6e; border-color: #bae6fd; }
.badge { font-weight: 600; border-radius: 999px; padding: .3em .65em; }
.bg-success { background: var(--success) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-warning { background: #fbbf24 !important; }

/* ---- Stats & misc components ------------------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.stat-value { font-size: 1.6rem; font-weight: 700; margin-top: 4px; }
.progress-bar { background: #e2e8f0; border-radius: 999px; overflow: hidden; height: 10px; margin-top: .5rem; }
.progress { background: linear-gradient(90deg, #16a34a, #4ade80); height: 100%; }
.lookup-container { max-width: 440px; margin: 48px auto; padding: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); text-align: center; }
.dropdown-popover { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(15, 23, 42, .1); max-width: 360px; border-radius: var(--radius); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1040; }
.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }

/* ---- Affiliate area (Shared/AffiliateLayout.razor, Pages/Affiliate) ---------------------- */
.aff-badge { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); background: #fce7f3; border-radius: 999px; padding: 2px 8px; }
.aff-signout { margin: 0 0 0 auto; }
.aff-main { max-width: 1100px; }
.aff-narrow { max-width: 440px; margin: 32px auto; }
.aff-medium { max-width: 900px; margin: 16px auto; }
.aff-auth { padding: 28px !important; }
.aff-title { font-size: 1.6rem; font-weight: 700; margin-bottom: .4rem; }
.aff-subtitle { font-size: 1.1rem; font-weight: 650; margin-bottom: .8rem; }
.aff-auth-links { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; font-size: .92rem; }
.aff-two-col, .aff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.aff-hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.aff-tier { display: inline-block; margin-right: 8px; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 650; font-size: .85rem; }
.aff-code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.aff-code-row:last-of-type { border-bottom: 0; }
.aff-code { font-size: 1.5rem; font-weight: 700; color: var(--brand); }
.aff-share { margin-top: 14px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-muted); border: 1px dashed var(--border); }
.aff-share-text { margin: 6px 0 10px; }
.aff-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.aff-methods { display: flex; gap: 8px; flex-wrap: wrap; }
.aff-method { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 550 !important; }
.aff-method.selected { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.aff-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 650; }
.aff-status-pending { background: var(--warning-bg); color: var(--warning); }
.aff-status-processed { background: var(--success-bg); color: var(--success); }
.aff-status-rejected { background: var(--danger-bg); color: var(--danger); }

/* ---- Vendor area (Shared/VendorLayout.razor, Pages/Vendor) and bulk order workflow -------- */
.vendor-panel { padding: 20px !important; }
.vendor-list { list-style: none; padding: 0; margin: 0; }
.vendor-list > li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.vendor-list > li:last-child { border-bottom: 0; }
.notice-body { white-space: pre-line; margin: 4px 0 0; }
.order-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.order-status-new { background: var(--brand-soft); color: var(--brand); }
.order-status-processing { background: var(--warning-bg); color: var(--warning); }
.order-status-completed { background: var(--success-bg); color: var(--success); }
.order-status-canceled { background: #f1f5f9; color: var(--muted); }
.queue-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.queue-tab-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 6px 14px; border-radius: 999px; font-weight: 600; cursor: pointer; }
.queue-tab-btn:hover { border-color: var(--brand); color: var(--brand); }
.queue-tab-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.queue-tab-btn .count { opacity: .8; margin-left: 4px; font-weight: 500; }
.order-card { padding: 14px 16px !important; margin-bottom: 12px; }
.order-card-head { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; justify-content: space-between; }
.order-meta { color: var(--muted); font-size: .9rem; }
.order-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.order-confirm { margin-top: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-muted); border: 1px solid var(--border); }
.order-detail { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.timeline { list-style: none; padding-left: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { padding: 2px 0 10px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.to-make td:last-child, .to-make th:last-child { text-align: right; }
/* ---- Owner dashboard (Pages/Admin/OwnerDashboard.razor) ----------------------------------- */
.owner-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.owner-section-title { font-size: 1.05rem; font-weight: 700; margin: 22px 0 10px; }
.owner-balance { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 14px; padding: 16px 20px; border-radius: var(--radius); background: var(--brand-soft); border: 1px solid #bae6fd; }
.owner-balance-label { font-size: .85rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #0c4a6e; }
.owner-balance-value { font-size: 2rem; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; line-height: 1.2; }
.owner-balance-sub { color: #0c4a6e; font-size: .9rem; }
.owner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.owner-tools { align-items: start; }
.owner-tools .card { margin-bottom: 0; }
.attention-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.attention-card:hover { border-color: var(--brand); color: var(--text); }
.attention-card.warn { border-left-color: #d97706; }
.attention-card.danger { border-left-color: var(--danger); }
.attention-count { font-size: 1.6rem; font-weight: 700; min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.attention-text { font-weight: 600; line-height: 1.3; }
.attention-text small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.all-clear { padding: 14px 16px; background: var(--success-bg); color: var(--success); border-radius: var(--radius); font-weight: 600; }
.owner-stat { display: block; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
a.owner-stat-link:hover { border-color: var(--brand); color: var(--text); }
.owner-stat .label { color: var(--muted); font-size: .85rem; font-weight: 600; }
.owner-stat .value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.owner-stat .sub { color: var(--muted); font-size: .85rem; }
.tool-group h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 0 0 6px; }
.tool-link { display: block; padding: 6px 8px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); font-weight: 600; }
.tool-link:hover { background: var(--surface-muted); color: var(--brand); }
.tool-link span { display: block; font-size: .82rem; font-weight: 400; color: var(--muted); }

.vendor-terms h2 { margin-top: 1.4rem; }
.vendor-terms li { margin-bottom: .35rem; }
.amount-due { font-weight: 700; }

/* Toasts (hillerShowToast) sit below the sticky header. */
#hiller-toasts { top: calc(var(--header-h) + 16px) !important; }

/* ---- Utilities kept from the previous theme (used by existing pages) -------------------- */
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .5px; }
.truncate { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.text-right { text-align: right; }
.muted-center { text-align: center; color: var(--muted); }
.flex-1 { flex: 1 1 0%; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.min-w-320 { min-width: 320px; }
.max-w-100 { max-width: 100px; } .max-w-150 { max-width: 150px; } .max-w-200 { max-width: 200px; } .max-w-280 { max-width: 280px; }
.max-w-300 { max-width: 300px; } .max-w-420 { max-width: 420px; } .max-w-520 { max-width: 520px; } .max-w-600 { max-width: 600px; }
.max-w-900 { max-width: 900px; } .max-w-1000 { max-width: 1000px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-20 { margin-bottom: 20px; }
.mt-8 { margin-top: 8px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-40 { margin-top: 40px; } .mt-60 { margin-top: 60px; }
.ms-8 { margin-left: 8px; } .ms-10 { margin-left: 10px; } .ms-15 { margin-left: 15px; } .me-10 { margin-right: 10px; }
.p-15 { padding: 15px; } .cell-pad { padding: 12px; }
.referral-input { width: 180px; flex: 0 0 180px; }
.qty-col { text-align: center; }
.visually-hidden { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.chart { width: 100%; height: 160px; }

/* Full-screen alarm overlay (Candy Timer). */
.alarm-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 9999; }

/* Blazor */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000; padding: .75rem 1.25rem; background: #fef3c7; color: #78350f; box-shadow: 0 -2px 8px rgba(0, 0, 0, .1); }
#blazor-error-ui .reload { font-weight: 600; margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
.blazor-error-boundary { background: var(--danger); color: #fff; padding: 1rem; border-radius: var(--radius); }
.blazor-error-boundary::after { content: "Something went wrong on this part of the page."; }

@media (max-width: 720px) {
  .app-header-inner { gap: 8px; }
  .app-nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: thin; }
  /* The nav row scrolls sideways, which would clip a menu positioned inside it: pin it to the screen edges. */
  .app-nav .app-dropdown-menu { position: fixed; top: auto; left: 12px; right: 12px; min-width: 0; margin-top: 6px; }
  .app-dropdown-menu.app-dropdown-grouped { grid-template-columns: 1fr 1fr; min-width: 0; }
  /* Wide tables scroll sideways on their own instead of widening the page. */
  .app-main table:not(.table-responsive > table, .table-wrap > table) { display: block; max-width: 100%; overflow-x: auto; }
  .app-main { padding: 16px 12px 40px; }
  .min-w-320 { min-width: 0; }
}

@media print {
  .app-header, #blazor-error-ui { display: none !important; }
  .app-main { padding: 0; max-width: none; }
  .card { box-shadow: none; }
}
