/* Garage system, v7: clean cards, dark side menu, phone-first touch sizes. Color only where it means something. */
:root {
  --ink: #17212B;
  --ink-soft: #5A6776;
  --ink-faint: #8B97A5;
  --paper: #F2F4F7;
  --card: #FFFFFF;
  --line: #E4E8EE;
  --line-strong: #CBD3DC;
  --accent: #1C64C8;
  --accent-dark: #154E9E;
  --accent-tint: #E9F1FC;
  --brand: #F2B705;            /* garage yellow, same as the PDF bill */
  --side-bg: #121C28;
  --side-ink: #B7C2CF;
  --danger: #B3362B;
  --danger-tint: #FCEDEB;
  --good: #1E7A52;
  --good-tint: #E5F4EC;
  --warn: #8A5A00;
  --warn-tint: #FFF4D6;
  --t-today: #1C64C8;
  --t-yday: #0F7A62;
  --t-month: #5B4FC4;
  --t-last: #56606B;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, 0.12);
  --tabbar-h: 0px;
  --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-border-color: var(--line);
}

body { font-size: 0.975rem; line-height: 1.5; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; }
h1 { font-size: 1.55rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: -0.015em; }
h2 { font-size: 1.08rem; font-weight: 650; margin: 1.75rem 0 0.75rem; }
h3 { font-weight: 600; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

/* ---------- Frame: side menu + main ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 228px; flex-shrink: 0; background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column; padding: 1.1rem 0.75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand {
  display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1rem; line-height: 1.25; color: #fff;
  padding: 0.25rem 0.5rem 1.2rem; margin-bottom: 0.6rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); text-decoration: none;
}
.side .brand::before, .mobilebar .brand::before {
  content: ""; flex: 0 0 auto; width: 10px; height: 26px; border-radius: 3px; background: var(--brand);
}
.sidenav { display: flex; flex-direction: column; gap: 3px; }
.sidenav a, .sidelink {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.7rem; border-radius: var(--radius);
  color: var(--side-ink); font-weight: 500; text-decoration: none; background: none; border: 0; width: 100%; text-align: left; font-size: 0.95rem;
  position: relative;
}
.sidenav a svg, .sidelink svg { opacity: 0.85; }
.sidenav a:hover, .sidelink:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.sidenav a.active { background: rgba(255, 255, 255, 0.1); color: #fff; }
.sidenav a.active::before { content: ""; position: absolute; left: -0.75rem; top: 0.45rem; bottom: 0.45rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.mainwrap { flex: 1; min-width: 0; }
.main { padding: 1.75rem clamp(1rem, 2.4vw, 2.75rem) 3rem; max-width: 1500px; }
.mobilebar, .tabbar { display: none; }

@media (max-width: 991px) {
  :root { --tabbar-h: 64px; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 0 0 0 100vmax rgba(18, 28, 40, 0); width: 260px; }
  body.menu-open { overflow: hidden; }
  body.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(18, 28, 40, 0.45); }
  .mobilebar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    background: var(--side-bg); padding: 0.55rem 0.9rem; position: sticky; top: 0; z-index: 40;
    padding-top: max(0.55rem, env(safe-area-inset-top));
  }
  .mobilebar .brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; color: #fff; text-decoration: none; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobilebar .brand::before { height: 20px; width: 8px; }
  .menubtn { background: rgba(255, 255, 255, 0.08); border: 0; border-radius: var(--radius); padding: 0.45rem 0.55rem; color: #fff; display: flex; }
  .main { padding: 1rem 0.9rem calc(var(--tabbar-h) + 2rem + env(safe-area-inset-bottom)); }

  /* Bottom tab bar on phones and tablets */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--ink-soft); font-size: 0.7rem; font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0;
  }
  .tabbar a.active { color: var(--accent); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .tab-new span.tab-plus {
    display: grid; place-items: center; width: 46px; height: 46px; margin-top: -18px; border-radius: 50%;
    background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(28, 100, 200, 0.35); border: 3px solid var(--card);
  }
  .tabbar .tab-new { color: var(--accent); }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ---------- Building blocks ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.35rem; max-width: 46rem; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 1rem; }
.panel h2:first-child { margin-top: 0; }
.panel-wide, .row > [class*="col"] > .panel { max-width: none; }
.panel-danger { border-left: 3px solid var(--danger); }
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 1.1rem; }
.pagehead h1 { margin: 0; }
.crumb { font-size: 0.88rem; margin-bottom: 0.25rem; }
.crumb a::before { content: "\2039  "; }
.alert { border-radius: var(--radius); border-width: 1px; }

.form-label { font-weight: 600; font-size: 0.88rem; margin-bottom: 0.3rem; }
.form-text { color: var(--ink-soft); }
.form-control, .form-select { border-color: var(--line-strong); border-radius: 8px; min-height: 42px; background-color: #fff; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(28, 100, 200, 0.18); }
.form-control.is-invalid { border-color: var(--danger); }

.btn { font-weight: 600; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; min-height: 40px; }
.btn-sm { min-height: 32px; border-radius: 7px; }
.btn-lg { min-height: 50px; padding-left: 1.6rem; padding-right: 1.6rem; }
.btn-link { min-height: 0; }
.btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-hover-bg: var(--accent-dark); --bs-btn-hover-border-color: var(--accent-dark); --bs-btn-active-bg: var(--accent-dark); --bs-btn-active-border-color: var(--accent-dark); box-shadow: 0 1px 2px rgba(28, 100, 200, 0.25); }
.btn-outline-primary { --bs-btn-color: var(--accent); --bs-btn-border-color: #B8CEEE; --bs-btn-hover-bg: var(--accent-tint); --bs-btn-hover-color: var(--accent-dark); --bs-btn-hover-border-color: #B8CEEE; --bs-btn-active-bg: var(--accent-tint); --bs-btn-active-color: var(--accent-dark); }
.btn-outline-secondary { --bs-btn-color: var(--ink); --bs-btn-bg: #fff; --bs-btn-border-color: var(--line-strong); --bs-btn-hover-bg: var(--paper); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line-strong); --bs-btn-active-bg: var(--line); --bs-btn-active-color: var(--ink); }
.btn-outline-danger { --bs-btn-bg: #fff; }
.btn svg { flex: 0 0 auto; width: 18px; height: 18px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn:focus-visible, a:focus-visible, .sidelink:focus-visible, .menubtn:focus-visible { outline: 3px solid rgba(28, 100, 200, 0.45); outline-offset: 2px; }

.searchbar { display: flex; gap: 0.5rem; max-width: 44rem; }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow); }
.table-wrap .table { --bs-table-bg: transparent; --bs-table-hover-bg: #F7F9FC; margin: 0; }
.table-wrap th { font-weight: 600; color: var(--ink-soft); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; background: #F8FAFC; }
.table-wrap td, .table-wrap th { padding: 0.7rem 0.95rem; border-color: var(--line); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap form { margin: 0; }
.rowlink { cursor: pointer; }
.rowbtns { display: inline-flex; gap: 0.35rem; align-items: center; white-space: nowrap; }
.rowedit summary { font-size: 0.9rem; }
.owed { color: var(--danger); font-weight: 650; }
.owed-total { font-weight: 700; font-size: 1.2rem; color: var(--good); }
.owed-total.owed { color: var(--danger); }
details summary { cursor: pointer; color: var(--ink-soft); font-size: 0.95rem; }

/* Number plate look: the one bold element on customer pages */
.plate { display: inline-block; font-weight: 700; font-size: 1.1rem; letter-spacing: 0.08em; padding: 0.05rem 0.6rem; border: 2px solid var(--ink); border-radius: 5px; background: #fff; }
.plate-sm { font-size: 0.9rem; padding: 0 0.4rem; border-width: 1.5px; }
.bike { border-top: 1px solid var(--line); padding: 0.75rem 0; }
.bike:first-of-type { border-top: 0; padding-top: 0; }
.logo-preview { max-height: 80px; max-width: 220px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(180deg, var(--side-bg) 0, var(--side-bg) 42vh, var(--paper) 42vh); }
.login-card { width: 100%; max-width: 24rem; background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--brand); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.login-card .sub { color: var(--ink-soft); margin-bottom: 1.5rem; }

/* Uploads */
.steps { margin: 0; padding-left: 1.25rem; }
.steps li + li { margin-top: 0.4rem; }
.row-bad td { background: var(--danger-tint); }
.row-error { color: var(--danger); font-size: 0.9rem; font-weight: 500; }

/* ---------- Bill form ---------- */
.line { display: grid; grid-template-columns: 1fr 5rem 8rem auto; gap: 0.6rem; align-items: end; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line .form-label.small { font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 0.15rem; }
@media (max-width: 575px) {
  .line { grid-template-columns: 1fr 1fr; background: #F8FAFC; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem; margin-bottom: 0.6rem; }
  .line:first-child { border-top: 1px solid var(--line); }
  .line-main { grid-column: 1 / -1; }
  .line-x { grid-column: 1 / -1; text-align: right; }
}
.totals { max-width: 22rem; margin-left: auto; }
.totals > div { display: flex; justify-content: space-between; padding: 0.22rem 0; }
.totals .grand { font-weight: 700; font-size: 1.3rem; border-top: 2px solid var(--ink); margin-top: 0.35rem; padding-top: 0.45rem; }
.paymodes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.paymode { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0.6rem 0.9rem; background: #fff; cursor: pointer; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; gap: 0.4rem; }
.paymode:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-tint); }
.plate-input { font-weight: 700; font-size: 1.2rem; letter-spacing: 0.08em; text-transform: uppercase; border: 2px solid var(--ink) !important; }
.who { margin-top: 0.25rem; min-height: 1.5rem; font-weight: 500; }
.who-known { color: var(--good); }
.who-owes { color: var(--danger); }
.who-new { color: var(--ink); }
.who-conflict, .who-error { color: var(--warn); }
.conflict { background: var(--warn-tint); border: 1px solid #F0C96B; border-radius: var(--radius); padding: 0.75rem 1rem; margin-top: 0.5rem; }

.combo { position: relative; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 18rem; overflow-y: auto; margin: 0; padding: 0.25rem 0; list-style: none; background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.combo-list li { padding: 0.55rem 0.8rem; cursor: pointer; display: flex; flex-direction: column; line-height: 1.25; }
.combo-list li.active, .combo-list li[role=option]:hover { background: var(--accent-tint); }
.combo-name { font-weight: 600; }
.combo-meta { font-size: 0.82rem; color: var(--ink-soft); }
.combo-list li.is-out { opacity: 0.45; cursor: not-allowed; }
.combo-list li.is-out:hover { background: none; }
.combo-empty { color: var(--ink-soft); font-size: 0.9rem; cursor: default !important; }

/* Bill page */
.state { font-weight: 650; font-size: 0.88rem; padding: 0.2rem 0.7rem; border-radius: 999px; white-space: nowrap; }
.state-paid { background: var(--good-tint); color: var(--good); }
.state-part { background: var(--warn-tint); color: var(--warn); }
.state-unpaid { background: var(--danger-tint); color: var(--danger); }
.state-cancel { background: #EDF0F3; color: var(--ink-soft); }
.payrow { border-top: 1px solid var(--line); padding: 0.6rem 0; }
.payrow:first-of-type { border-top: 0; padding-top: 0; }
.payrow.void { color: var(--ink-soft); }
.payrow.void > div:first-child { text-decoration: line-through; }

/* ---------- Dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.tile-head { color: var(--ink); font-size: 0.85rem; font-weight: 700; padding: 0.7rem 0.95rem 0.1rem; display: flex; justify-content: space-between; align-items: baseline; }
.tile-head small { font-weight: 500; color: var(--ink-faint); }
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; }
.tile-today::before { background: var(--t-today); }
.tile-yday::before { background: var(--t-yday); }
.tile-month::before { background: var(--t-month); }
.tile-last::before { background: var(--t-last); }
.tile-today .tile-head > span { color: var(--t-today); }
.tile-yday .tile-head > span { color: var(--t-yday); }
.tile-month .tile-head > span { color: var(--t-month); }
.tile-last .tile-head > span { color: var(--t-last); }
.tile-body { padding: 0.45rem 0.95rem 0.85rem; }
.tile-label { font-size: 0.78rem; color: var(--ink-soft); font-weight: 500; }
.tile-big { font-size: 1.75rem; font-weight: 750; line-height: 1.15; margin-bottom: 0.55rem; letter-spacing: -0.02em; }
.tile-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--ink-soft); padding: 0.12rem 0; }
.tile-row b { color: var(--ink); font-weight: 600; }
.tile-profit { border-top: 1px dashed var(--line-strong); margin-top: 0.45rem; padding-top: 0.5rem; font-size: 0.92rem; }
.tile-profit b { color: var(--good); font-size: 1.05rem; }
.tile-profit b.neg { color: var(--danger); }
@media (max-width: 1199px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) {
  .tiles { gap: 0.6rem; }
  .tile-head { padding: 0.6rem 0.7rem 0; font-size: 0.8rem; }
  .tile-head small { display: none; }
  .tile-body { padding: 0.35rem 0.7rem 0.7rem; }
  .tile-big { font-size: 1.35rem; }
  .tile-row { font-size: 0.8rem; }
}
@media (max-width: 300px) { .tiles { grid-template-columns: 1fr; } }

.card-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.card-box h2 { font-size: 0.98rem; margin: 0 0 0.6rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.9rem 1.1rem; display: block; color: inherit; box-shadow: var(--shadow); border-left: 4px solid var(--line-strong); transition: box-shadow 0.15s ease, transform 0.15s ease; }
a.stat:hover { box-shadow: var(--shadow-lg); text-decoration: none; color: inherit; transform: translateY(-1px); }
.stat .tile-big { margin: 0.1rem 0 0; font-size: 1.45rem; }
.stat small { color: var(--ink-faint); }
.stat-danger { border-left-color: var(--danger); }
.stat-danger .tile-big { color: var(--danger); }
.stat-zero { border-left-color: var(--good); }
.stat-zero .tile-big { color: var(--good); }
.stat-warn { border-left-color: #E0A100; }
.stat-warn .tile-big { color: var(--warn); }
@media (max-width: 767px) { .stats { grid-template-columns: 1fr; gap: 0.6rem; } .stat { padding: 0.75rem 1rem; } }

.chart { width: 100%; height: clamp(120px, 18vh, 220px); display: block; }
.chart-days { display: grid; gap: 0; margin-top: 0.25rem; font-size: 0.75rem; color: var(--ink-faint); text-align: center; }
@media (max-width: 575px) { .chart-days span:nth-child(even) { visibility: hidden; } }
.chart .bar-sales { fill: #A9CBEF; }
.chart .bar-profit { fill: var(--good); }
.chart .bar-loss { fill: var(--danger); }
.chart text { font-size: 10px; fill: var(--ink-faint); }
.legend { font-size: 0.8rem; color: var(--ink-soft); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 0.3rem 0 0.75rem; vertical-align: 0; }

.listrow { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 0.6rem; align-items: center; padding: 0.6rem 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.listrow:first-of-type { border-top: 0; }
.listrow .muted { color: var(--ink-soft); }
.minirow { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.minirow:first-of-type { border-top: 0; }
.minirow .owed { white-space: nowrap; }
.btn-wa { color: #128C4A; border-color: #9FD9B8; background: #fff; }
.btn-wa:hover { background: #EAF8F0; color: #0E6E3A; border-color: #9FD9B8; }
@media (max-width: 575px) {
  .listrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who amt" "info act"; row-gap: 0.25rem; }
  .listrow > :nth-child(1) { grid-area: who; font-weight: 600; }
  .listrow > :nth-child(2) { grid-area: info; font-size: 0.85rem; }
  .listrow > :nth-child(3) { grid-area: amt; text-align: right; }
  .listrow > :nth-child(4) { grid-area: act; justify-self: end; }
}

/* Receive payment */
.payline { display: grid; grid-template-columns: auto minmax(0, 1fr) 9rem; gap: 0.75rem; align-items: center; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.payline:first-of-type { border-top: 0; }

/* ---------- Phones ---------- */
@media (max-width: 575px) {
  body { font-size: 0.95rem; }
  h1 { font-size: 1.3rem; }
  .panel { padding: 1rem; border-radius: var(--radius); }
  .card-box { padding: 0.9rem; }
  /* 16px inputs stop iPhone from zooming in on tap */
  .form-control, .form-select { font-size: 16px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .pagehead > .d-flex, .pagehead > div:last-child { width: 100%; }
  .pagehead > .d-flex > .btn, .pagehead > div:last-child > .btn { flex: 1 1 auto; }
  .searchbar { flex-wrap: wrap; }
  .searchbar .form-control { min-width: 0 !important; flex: 1 1 100% !important; }
  .searchbar .form-select, .searchbar .btn { flex: 1 1 auto; width: auto !important; }
  .payline { grid-template-columns: auto minmax(0, 1fr); }
  .payline > :last-child { grid-column: 1 / -1; }
  .totals { max-width: none; }
  /* Big save button stays in reach above the tab bar */
  #billform > .btn-lg { position: sticky; bottom: calc(var(--tabbar-h) + 0.6rem + env(safe-area-inset-bottom)); width: 100%; z-index: 30; box-shadow: 0 8px 20px rgba(28, 100, 200, 0.35); }
  #billform > .btn-link { display: block; text-align: center; width: 100%; margin-top: 0.25rem; }

  /* Tables become a stack of cards (labels come from the table header) */
  .table-wrap.stack { background: none; border: 0; box-shadow: none; overflow: visible; }
  .table-wrap.stack thead { display: none; }
  .table-wrap.stack table, .table-wrap.stack tbody { display: block; }
  .table-wrap.stack tr {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 0.75rem; row-gap: 0.15rem;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 0.7rem 0.85rem; margin-bottom: 0.6rem;
  }
  .table-wrap.stack td { display: block; padding: 0.1rem 0; border: 0; text-align: left !important; min-width: 0; overflow-wrap: anywhere; }
  .table-wrap.stack td:empty { display: none; }
  .table-wrap.stack td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-faint); }
  .table-wrap.stack td:first-child { grid-column: 1 / -1; font-weight: 650; font-size: 1rem; padding-bottom: 0.3rem; margin-bottom: 0.2rem; border-bottom: 1px solid var(--line); }
  .table-wrap.stack td:first-child::before { display: none !important; }
  .table-wrap.stack td.td-actions { grid-column: 1 / -1; padding-top: 0.45rem; }
  .table-wrap.stack td.td-actions::before { display: none !important; }
  .table-wrap.stack .rowbtns { display: flex; width: 100%; }
  .table-wrap.stack .rowbtns > *, .table-wrap.stack .rowbtns form .btn { flex: 1 1 0; width: 100%; }
  .table-wrap.stack .rowbtns form { display: flex; }
}

@media (min-width: 1600px) {
  .tile-big { font-size: 1.95rem; }
  .stat .tile-big { font-size: 1.65rem; }
}

@media print {
  .side, .mobilebar, .tabbar { display: none !important; }
  .main { padding: 0; }
}
