:root {
  /* Brand palette — warm neutrals + Claude orange accent.
     The legacy --navy / --red / --pink names are kept as aliases so any
     remaining inline references keep working until they're cleaned up. */
  --ink:         #1F1E1B;   /* primary text + dark surfaces */
  --ink-soft:    #2A2926;
  --cream:       #F4F3EE;   /* page background */
  --warm-gray:   #B1ADA1;   /* borders, soft separators */
  --accent:      #D97757;   /* Claude orange — primary CTA */
  --accent-dark: #BE5C3F;
  --accent-soft: #FCE4D6;

  --navy:        var(--accent);       /* alias — primary action color */
  --navy-dark:   var(--accent-dark);
  --red:         #B91C1C;
  --pink:        var(--accent-soft);
  --bg:          var(--cream);
  --card:        #ffffff;
  --text:        var(--ink);
  --muted:       #6B6862;
  --border:      #DEDAD0;
  --ok:          #15803D;
  --ok-bg:       #E8F3EC;
  --warn:        #B45309;
  --warn-bg:     #FFF6E6;
  --shadow-sm:   0 1px 2px rgba(31,30,27,.04);
  --shadow-md:   0 4px 14px rgba(31,30,27,.07);
  --shadow-lg:   0 12px 40px rgba(31,30,27,.16);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* Skip-to-content link — visible only when focused via keyboard. */
.skip-link {
  position: absolute;
  top: -100px; left: 12px;
  background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-weight: 600; font-size: 14px;
  z-index: 1000;
  transition: top .15s;
}
.skip-link:focus { top: 12px; outline: 3px solid #fff; }
html[dir="rtl"] .skip-link { left: auto; right: 12px; }
html, body { height: 100%; }
body {
  /* Inter — closest free web equivalent to Claude's Styrene B. */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Helvetica Neue', sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.5;
  letter-spacing: -0.005em;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

/* RTL niceties — Inter has no Arabic glyphs; let the browser fall back
   to the system Arabic face (Tahoma / Geeza Pro / Noto Naskh). */
html[dir="rtl"] body { font-family: 'Tahoma', 'Geeza Pro', 'Noto Naskh Arabic', system-ui, sans-serif; }
html[dir="rtl"] header nav a { font-size: 14px; }

/* ── Header / nav ─────────────────────────────────────────── */
header#topbar {
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; box-shadow: 0 2px 8px rgba(31,30,27,.18);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; min-height: 44px; }
.brand em { font-style: normal; font-weight: 400; opacity: .8; }

header nav { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
header nav a {
  color: #fff; text-decoration: none; padding: 9px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; min-height: 44px;
}
header nav a:hover, header nav a.active { background: rgba(255,255,255,.14); }
button.ghost {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4);
  padding: 9px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
  min-height: 44px;
}
button.ghost:hover { background: rgba(255,255,255,.14); }

/* Hamburger button — hidden on desktop, visible on mobile */
.hamburger {
  display: none;
  background: transparent; border: 0; color: #fff; cursor: pointer;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  padding: 0;
}
.hamburger svg { width: 26px; height: 26px; }

/* Slide-out mobile menu — always present in the DOM, slid off-screen by
   default with a transform; .open slides it in. (display:none breaks
   the transition and the .open toggle.) */
.mobile-menu {
  display: flex;
  flex-direction: column;
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(280px, 75vw);
  background: #fff;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: 70px 0 20px;
  transform: translateX(100%);
  transition: transform .25s ease;
  overflow-y: auto;
}
html[dir="rtl"] .mobile-menu { right: auto; left: 0; transform: translateX(-100%); }
.mobile-menu.open,
html[dir="rtl"] .mobile-menu.open { transform: translateX(0); }
.mobile-menu a, .mobile-menu button {
  display: flex; align-items: center;
  padding: 16px 22px;
  font-size: 16px; font-weight: 500;
  color: var(--text); text-decoration: none;
  background: transparent; border: 0; width: 100%; text-align: left;
  cursor: pointer; min-height: 56px;
  border-bottom: 1px solid var(--border);
}
html[dir="rtl"] .mobile-menu a, html[dir="rtl"] .mobile-menu button { text-align: right; }
.mobile-menu a:hover, .mobile-menu button:hover { background: var(--bg); }
.mobile-menu a.active {
  color: var(--accent-dark); font-weight: 700; background: rgba(217,119,87,.08);
  border-left: 3px solid var(--accent);
  padding-left: 19px;            /* 22 − 3px border so text doesn't shift */
}
html[dir="rtl"] .mobile-menu a.active {
  border-left: 0;
  border-right: 3px solid var(--accent);
  padding-left: 22px;
  padding-right: 19px;
}
.mobile-menu .menu-section { padding: 16px 22px 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.menu-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 199;
}
.menu-backdrop.open { display: block; }

/* ── Layout ───────────────────────────────────────────────── */
main#view { flex: 1; padding: 22px 16px 80px; max-width: 1100px; margin: 0 auto; width: 100%; }

h1 { font-size: 24px; margin-bottom: 14px; color: var(--ink); letter-spacing: -.02em; font-weight: 600; }
h2 { font-size: 17px; margin: 22px 0 10px; color: var(--ink); letter-spacing: -.01em; font-weight: 600; }

/* ── Cards ────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }
.spacer { height: 12px; }

/* ── Forms ────────────────────────────────────────────────── */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 16px;            /* >=16px: prevents iOS auto-zoom on focus */
  font-family: inherit; background: #fff;
  min-height: 48px;
}
textarea { min-height: 140px; font-family: ui-monospace, 'SF Mono', monospace; font-size: 14px; }
input:focus, textarea:focus, select:focus {
  outline: 3px solid rgba(217,119,87,.22);
  border-color: var(--accent);
}

/* ── Buttons ──────────────────────────────────────────────── */
button.primary, .btn-primary {
  background: var(--accent); color: #fff; border: 0;
  padding: 13px 22px; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button.primary:hover, .btn-primary:hover { background: var(--accent-dark); }
button.primary:disabled { opacity: .5; cursor: not-allowed; }
button.danger {
  background: var(--red); color: #fff; border: 0;
  padding: 13px 22px; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer; min-height: 48px;
}
button.secondary {
  background: #fff; color: var(--ink); border: 1px solid var(--border);
  padding: 12px 20px; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer; min-height: 48px;
}
button.secondary:hover { background: var(--cream); border-color: var(--warm-gray); }
a.btn-link { color: var(--accent-dark); text-decoration: none; font-weight: 600; padding: 8px 0; display: inline-block; }
a.btn-link:hover { text-decoration: underline; }

/* ── Tables (desktop default) ────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: var(--cream); }
tr:hover { background: var(--cream); }
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }

/* ── Status badge ─────────────────────────────────────────── */
.status { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.status.pending { background: var(--warn-bg); color: var(--warn); }
.status.paid    { background: var(--ok-bg);   color: var(--ok); }
.status.rejected{ background: #fbe8e8;        color: #b91c1c; }

/* ── Card-style list (mobile-first replacement for noisy tables) ── */
.card-list { padding: 8px; }
.card-list .list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.card-list .list-item:last-child { border-bottom: 0; }
.card-list .list-main { flex: 1; min-width: 0; }
.card-list .list-title {
  font-size: 15px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card-list .list-sub {
  font-size: 12px; color: var(--muted); margin-top: 4px;
  word-break: break-word;
}
.card-list .list-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  flex-shrink: 0;
}
.card-list .list-amount { font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; }
@media (max-width: 640px) {
  .card-list .list-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .card-list .list-right {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .card-list .list-right .btn-link,
  .card-list .list-right .icon-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex; align-items: center; justify-content: center;
  }
}

/* ── Batch approval status banner ─────────────────────────── */
.batch-status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.batch-status-banner .banner-title {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.batch-status-banner .banner-detail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.batch-status-banner.banner-draft            { border-left: 4px solid var(--warn); }
.batch-status-banner.banner-pending_approval { border-left: 4px solid var(--accent); background: var(--accent-soft); }
.batch-status-banner.banner-approved         { border-left: 4px solid var(--ok); background: var(--ok-bg); }
.batch-status-banner.banner-rejected         { border-left: 4px solid #b91c1c; background: #fbe8e8; }
.batch-status-banner.banner-completed        { border-left: 4px solid var(--ok); background: var(--ok-bg); }
html[dir="rtl"] .batch-status-banner.banner-draft,
html[dir="rtl"] .batch-status-banner.banner-pending_approval,
html[dir="rtl"] .batch-status-banner.banner-approved,
html[dir="rtl"] .batch-status-banner.banner-rejected,
html[dir="rtl"] .batch-status-banner.banner-completed {
  border-left: none;
  border-right: 4px solid;
  border-right-color: inherit;
}

/* ── Data-entry grid (new-batch + similar) ────────────────── */
.entries-grid { width: 100%; overflow-x: auto; }
.entries-grid .table-grid { width: 100%; min-width: 760px; border-collapse: collapse; }
.entries-grid .table-grid th,
.entries-grid .table-grid td { padding: 6px 8px; vertical-align: middle; }
.entries-grid .table-grid thead th {
  background: var(--ink); color: #fff; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em; text-align: left; font-weight: 600;
}
.entries-grid .table-grid tbody td { border-bottom: 1px solid var(--border); }
.entries-grid .table-grid input,
.entries-grid .table-grid select { width: 100%; padding: 8px 10px; font-size: 13px; }
.entries-grid .icon-btn.danger {
  background: transparent; border: 1px solid var(--border); color: #b91c1c;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1;
}
.entries-grid .icon-btn.danger:hover { background: #fbe8e8; }

.muted { color: var(--muted); font-size: 13px; }
.right { text-align: right; }
html[dir="rtl"] .right { text-align: left; }
.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty svg.empty-icon { width: 56px; height: 56px; color: var(--border); }
.empty p { font-size: 14px; line-height: 1.5; max-width: 360px; }

/* Top-of-page loading bar — shown 200ms after a route starts so fast
   navigations don't flash. */
.loading-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  z-index: 999;
  animation: loading-slide 1.1s linear infinite;
  pointer-events: none;
}
@keyframes loading-slide {
  0%   { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}

/* Busy state for any button — adds a small inline spinner. */
.is-busy { opacity: .7; cursor: not-allowed; pointer-events: none; }
.is-busy::after {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin-inline-start: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -3px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabular figures for amount cells — keeps digits aligned. */
table td, table th, .num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* Selectable list row (e.g. unassigned vouchers picker on new batch) */
.include-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; background: #fff;
}
.include-row:hover { background: var(--cream); }
.include-row input[type=checkbox] { width: 22px; height: 22px; flex-shrink: 0; cursor: pointer; }

/* Compact icon-only buttons (edit, delete, etc.) */
button.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  width: 42px; height: 42px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer;
  padding: 0;          /* must beat button.danger { padding:13px 22px } */
  min-height: 0;       /* and its min-height:48px */
  font-size: inherit;
  font-weight: normal;
  flex-shrink: 0;
}
button.icon-btn:hover { background: var(--bg); }
/* Selector is intentionally specific (button.icon-btn.danger) so it
   wins over the base button.danger { background:var(--red); } rule. */
button.icon-btn.danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(211,46,61,.35);
  padding: 0;
  min-height: 0;
}
button.icon-btn.danger:hover {
  background: rgba(211,46,61,.08);
  border-color: var(--red);
}
button.icon-btn svg { width: 18px; height: 18px; }

/* Wrapper that contains a full-width table — uses .card chrome on
   desktop and dissolves into a transparent container on mobile so the
   row-cards (rendered by the responsive table CSS) can sit edge-to-edge
   inside the page padding. */
.card.card-table { padding: 0; overflow: hidden; }

/* Live calculation grid (used on contract payment slider). */
.calc-grid {
  display: grid; grid-template-columns: 1fr auto;
  gap: 6px 18px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
}
.calc-grid > div { display: contents; }
.calc-grid > div > .lbl { color: var(--muted); }
.calc-grid > div > span:not(.lbl) { font-variant-numeric: tabular-nums; font-weight: 600; }
.calc-grid > div.payable { padding-top: 6px; border-top: 1px solid var(--border); }
.calc-grid > div.payable > .lbl { color: var(--text); font-weight: 700; }
.calc-grid > div.payable > span:not(.lbl) { font-size: 18px; }
html[dir="rtl"] .calc-grid { grid-template-columns: auto 1fr; }

/* Range slider — accent the thumb in brand orange */
input[type="range"] { accent-color: var(--accent); }

/* ── Login ───────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;          /* fallback */
  min-height: 100dvh;         /* dvh handles iOS Safari toolbar correctly */
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); padding: 20px;
}
.form-error {
  margin-top: 12px;
  padding: 10px 12px;
  background: #FBE8E8;
  color: var(--red);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
}
.login-card { background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 20px; }
.login-logo svg { width: 64px; height: 64px; }
.login-logo h1 { color: var(--ink); font-size: 18px; margin: 0; text-align: center; }
.login-logo p  { color: var(--muted); font-size: 13px; }

/* ── Signature pad ───────────────────────────────────────── */
.sig-pad-wrap {
  border: 2px dashed var(--accent); border-radius: 12px; background: #fff; position: relative; touch-action: none;
}
.sig-pad-wrap canvas { display: block; width: 100%; height: 220px; border-radius: 10px; cursor: crosshair; touch-action: none; }
.sig-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); pointer-events: none; font-size: 14px; font-style: italic; }

/* Sticky bottom action bar — used on the voucher signing page */
.sticky-actions {
  position: sticky; bottom: 0; left: 0; right: 0;
  background: var(--card);
  margin: 16px -16px 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex; gap: 10px;
  box-shadow: 0 -4px 14px rgba(0,0,0,.06);
  z-index: 50;
}
.sticky-actions > * { flex: 1; }

/* ── Toast ───────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 14px; z-index: 1000;
  max-width: 90vw;
}
#toast.error { background: var(--red); }
#toast.success { background: var(--ok); }

/* ════════════════════════════════════════════════════════════
   MOBILE  (≤ 640px)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 15px; }
  header#topbar { padding: 8px 12px; }
  .brand span { display: none; }

  /* Hide inline nav, show hamburger */
  header nav { display: none; }
  .hamburger { display: inline-flex; }

  main#view { padding: 14px 12px 100px; }
  h1 { font-size: 22px; }
  h2 { font-size: 16px; }

  .card { padding: 16px; border-radius: 12px; margin-bottom: 12px; }

  /* Form rows: stack everything. !important is needed because many
     inline `style="flex:0 0 140px"` children would otherwise win
     specificity and break the mobile layout (especially the advances
     and labour grids). */
  .row { gap: 10px; flex-direction: column; align-items: stretch; }
  .row > * { flex: 1 1 100% !important; min-width: 0 !important; max-width: 100% !important; width: 100% !important; }
  .row > input, .row > select, .row > textarea { width: 100%; }

  /* Primary buttons full-width on mobile */
  .card > button.primary,
  .card > button.secondary,
  .card > button.danger { width: 100%; }

  /* ── Tables → mobile cards ───────────────────────────── */
  /* Hide thead, render each row as a stacked card.       */
  /* Each <td> needs data-label for context (added in JS).*/

  /* The wrapping .card.card-table dissolves on mobile so each row
     becomes its own card sitting flush against the page padding. */
  .card.card-table {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .card table thead { display: none; }
  .card table,
  .card table tbody,
  .card table tr,
  .card table td { display: block; }
  .card table tr {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 0 0 10px 0;            /* no horizontal margin — fills parent cleanly */
    box-shadow: var(--shadow-sm);
  }
  .card table tr:hover { background: var(--card); }
  .card table td {
    padding: 6px 0; border: 0; font-size: 15px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    overflow-wrap: anywhere;
  }
  .card table td::before {
    content: attr(data-label);
    font-size: 11px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .04em;
    font-weight: 600;
    flex-shrink: 0;
  }
  .card table td:empty { display: none; }
  /* "Action" cell (last child) — its own row */
  .card table td:last-child {
    padding-top: 12px; margin-top: 8px;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
  }
  .card table td:last-child::before { display: none; }
  .card table td:last-child a.btn-link {
    flex: 1;
    display: block;
    text-align: center;
    padding: 12px;
    background: rgba(217,119,87,.08);
    border-radius: 8px;
  }
  .card table td:last-child .icon-btn { flex: 0 0 auto; }
  /* When the <tr> itself is clickable, show a faint chevron hint */
  .card table tr[onclick] { cursor: pointer; }
  .card table tr[onclick]:active { background: rgba(217,119,87,.06); }

  /* ── Login ───────────────────────────────────────────── */
  .login-card { padding: 22px; border-radius: 14px; }

  /* ── Signature pad ───────────────────────────────────── */
  .sig-pad-wrap canvas { height: 180px; }

  /* Voucher detail: large tap targets */
  a.btn-link { font-size: 15px; padding: 10px 0; }

  /* Touch-target floor (WCAG 2.5.5 / Apple HIG) */
  button, .btn-primary, .btn-link, .icon-btn { min-height: 44px; }

  /* Labour day-grid: max-width on inputs makes them cramped on phones.
     Override so they fill the cell. */
  table input[type="number"], table input[type="text"], table select {
    max-width: 100% !important;
    width: 100%;
  }

  /* New-batch entries grid: scroll horizontally instead of stacking
     each tiny cell as its own card row (the per-row card layout
     loses the table's "row of inputs" model entirely). */
  .entries-grid .table-grid thead { display: table-header-group; }
  .entries-grid .table-grid,
  .entries-grid .table-grid tbody,
  .entries-grid .table-grid tr,
  .entries-grid .table-grid td { display: revert; }
  .entries-grid .table-grid tr {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
  }
  .entries-grid .table-grid td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
  .entries-grid .table-grid td::before { display: none; }
  .entries-grid .table-grid td:last-child {
    padding: 6px 8px; margin: 0; border-top: 0; justify-content: center;
  }
}

/* Slightly larger tablet (641-900px) — let table wrappers scroll
   horizontally instead of squishing the columns. */
@media (min-width: 641px) and (max-width: 900px) {
  .card.card-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card.card-table table { min-width: 720px; font-size: 13px; }
  .card.card-table th, .card.card-table td { padding: 10px 8px; }
}
