/* ============================================================
   MELEMENT Invoice System — v4 chrome
   Brand: orange #FC8E00 · coral #F75C36 · maroon #6A031A
   Display: Pathway Extreme · Body: Inter
   Themes: dark (default) / light / auto · glass surfaces
   The invoice sheet is a white printed document in every theme.
   ============================================================ */

:root {
  --orange: #FC8E00;
  --coral:  #F75C36;
  --maroon: #6A031A;
  --radius: 14px;
  --display: 'Pathway Extreme', sans-serif;
  --body: 'Inter', -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- theme tokens ---------- */
body { /* dark — default */
  --bg: #0B0A09;
  --ink: #F2EFE9;
  --muted: #9F978D;
  --line: rgba(242,239,233,.10);
  --glass: rgba(26,22,18,.55);
  --glass-strong: rgba(22,18,15,.78);
  --field: rgba(255,255,255,.06);
  --glow-a: rgba(252,142,0,.13);
  --glow-b: rgba(106,3,26,.22);
  --shadow: 0 10px 34px rgba(0,0,0,.45);
  color-scheme: dark;
}
body.theme-light {
  --bg: #F1EDE6;
  --ink: #16130F;
  --muted: #6F6A62;
  --line: rgba(22,19,15,.10);
  --glass: rgba(255,255,255,.58);
  --glass-strong: rgba(255,255,255,.82);
  --field: rgba(255,255,255,.65);
  --glow-a: rgba(252,142,0,.16);
  --glow-b: rgba(247,92,54,.10);
  --shadow: 0 10px 30px rgba(60,40,10,.10);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  body.theme-auto {
    --bg: #F1EDE6;
    --ink: #16130F;
    --muted: #6F6A62;
    --line: rgba(22,19,15,.10);
    --glass: rgba(255,255,255,.58);
    --glass-strong: rgba(255,255,255,.82);
    --field: rgba(255,255,255,.65);
    --glow-a: rgba(252,142,0,.16);
    --glow-b: rgba(247,92,54,.10);
    --shadow: 0 10px 30px rgba(60,40,10,.10);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
/* ambient glow, the reference-image atmosphere */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(620px 420px at 12% -6%, var(--glow-a), transparent 70%),
    radial-gradient(720px 520px at 92% 108%, var(--glow-b), transparent 70%);
}

/* ---------- glass surface primitive ---------- */
.glass, .topbar, .drawer, .card, .stat, .tbl, .pay-panel, .chart, .gantt,
.kan-col, .cal-cell, .empty, .login-card, .item-row, .sec-row, .hidden-notes {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid var(--line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body { --glass: var(--bg); --glass-strong: var(--bg); }
}

/* ---------- floating pill topbar ---------- */
.topbar {
  position: sticky; top: 10px; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 1160px; margin: 10px auto 0; padding: 8px 10px 8px 16px;
  border-radius: 999px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-logo { height: 30px; width: 30px; object-fit: contain; border-radius: 50%; }
.brand-name { font-family: var(--display); font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.brand-name em { font-style: normal; color: var(--orange); font-weight: 600; }

.nav { display: flex; gap: 2px; flex-wrap: nowrap; overflow: hidden; }
.nav a {
  padding: 7px 12px; border-radius: 999px;
  text-decoration: none; color: var(--ink); font-weight: 500; font-size: 14px;
  white-space: nowrap;
}
.nav a:hover { background: var(--field); }
.nav a.on { background: var(--orange); color: #141414; font-weight: 600; }

.hamburger {
  display: none;
  width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--field); color: var(--ink);
  cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
}
.hamburger span { display: block; width: 17px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s, opacity .2s; }
body.nav-open .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .hamburger span:nth-child(2) { opacity: 0; }
body.nav-open .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- left drawer (mobile nav) ---------- */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 80;
  width: min(290px, 82vw);
  background: var(--glass-strong);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px 16px;
  transform: translateX(-103%);
  transition: transform .26s ease;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
  border-radius: 0 var(--radius) var(--radius) 0;
}
body.nav-open .drawer { transform: translateX(0); }
.drawer .brand { margin-bottom: 16px; }
.drawer a.dlink {
  display: block; padding: 11px 14px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.drawer a.dlink:hover { background: var(--field); }
.drawer a.dlink.on { background: var(--orange); color: #141414; font-weight: 700; }
.drawer-foot { margin-top: auto; font-size: 11.5px; color: var(--muted); padding: 14px 6px 2px; }
.scrim {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .26s;
}
body.nav-open .scrim { opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }

/* ---------- layout ---------- */
.wrap { max-width: 1020px; margin: 0 auto; padding: 26px 18px 60px; }
.appfoot { width: 100%; text-align: center; color: var(--muted); font-size: 12px; padding: 18px 12px 26px; }

.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 {
  font-family: var(--display); font-weight: 900; font-size: clamp(24px, 5vw, 30px);
  margin: 0; letter-spacing: .01em;
}
.page-head > div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.bar-head {
  font-family: var(--display); font-weight: 800; font-size: 15px;
  letter-spacing: .03em;
  background: var(--orange); color: #141414;
  padding: 7px 12px; border-radius: 9px;
  margin: 26px 0 12px;
}

.flash {
  background: var(--maroon); color: #fff;
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px;
}
.flash-error { background: var(--coral); }

/* ---------- stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-grid-tight { align-content: start; }
.stat { border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-warn { border-color: rgba(247,92,54,.55); }
.stat-warn .stat-value { color: var(--coral); }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat-value { font-family: var(--display); font-weight: 800; font-size: 25px; overflow-wrap: anywhere; }

/* ---------- tables ---------- */
.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border-radius: var(--radius); overflow: hidden;
}
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--orange);
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl .num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-tight th, .tbl-tight td { padding: 6px 10px; }
.muted { color: var(--muted); }
.owes { color: var(--coral); font-weight: 600; }
.empty { border-style: dashed; border-radius: var(--radius); padding: 22px; color: var(--muted); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; vertical-align: middle;
}
.st-paid      { background: rgba(70,160,70,.18);  color: #5fae5f; }
.st-sent      { background: rgba(252,142,0,.16);  color: var(--orange); }
.st-part      { background: rgba(252,142,0,.26);  color: var(--orange); }
.st-overdue   { background: rgba(247,92,54,.16);  color: var(--coral); }
.st-draft     { background: var(--field); color: var(--muted); }
.st-cancelled { background: var(--field); color: var(--muted); text-decoration: line-through; }
body.theme-light .st-paid { color: #2f7a2f; }

/* ---------- forms ---------- */
.lbl { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.inp {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink); background: var(--field);
}
.inp:focus { border-color: var(--orange); outline: none; }
.inp-inline { width: auto; min-width: 140px; }
select.inp option { background: var(--bg); color: var(--ink); }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.hint code { font-size: 11.5px; word-break: break-all; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .span2 { grid-column: span 2; }
.form-actions { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.row-gap { margin-top: 12px; }
.card { border-radius: var(--radius); padding: 6px 20px 20px; }
.card-narrow { max-width: 640px; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.logo-preview { max-height: 90px; margin-top: 10px; }

.btn {
  display: inline-block; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--field); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--orange); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #141414; }
.btn-primary:hover { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn-danger { border-color: rgba(247,92,54,.6); color: var(--coral); background: transparent; }
.btn-danger:hover { background: var(--coral); color: #fff; }
.btn-block { width: 100%; margin-top: 16px; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.lnk { color: var(--coral); font-weight: 600; text-decoration: none; }
.lnk:hover { text-decoration: underline; }
.lnk-btn { background: none; border: none; color: var(--coral); cursor: pointer; font: inherit; font-size: 13px; padding: 0; }
.inline-form { display: inline; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--field); color: var(--ink); text-decoration: none; font-size: 13.5px;
  white-space: nowrap;
}
.chip-on { background: var(--orange); color: #141414; border-color: var(--orange); font-weight: 600; }
.filter-lbl { font-size: 12.5px; color: var(--muted); }

.nav a:focus-visible, .btn:focus-visible, .lnk:focus-visible, .inp:focus-visible,
.chip:focus-visible, .hamburger:focus-visible, .drawer a:focus-visible {
  outline: 2px solid var(--coral); outline-offset: 2px;
}

/* ---------- dynamic editor blocks ---------- */
.item-row, .sec-row { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; position: relative; }
.item-row .grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.sec-row .grid { display: grid; grid-template-columns: 1.6fr .7fr .7fr; gap: 12px; }
.remove-row {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--coral); cursor: pointer;
  font-size: 13px; font-weight: 600;
}
.drag-note { font-size: 11.5px; color: var(--muted); }
.sec-row.sec-hidden { border-style: dashed; opacity: .8; }
.sec-row.sec-hidden::after {
  content: 'background note'; position: absolute; bottom: 10px; right: 14px;
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
}
.sec-vis-toggle { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.hidden-notes { margin-top: 12px; padding: 10px 14px; border-radius: 10px; border-style: dashed; border-color: rgba(252,142,0,.5); font-size: 13.5px; }
.hidden-notes p { margin: 4px 0 0; }

/* ---------- payments panel ---------- */
.pay-panel { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 26px; }
.pay-summary { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 10px; }
.pay-summary strong { font-family: var(--display); font-size: 18px; }
.pay-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; align-items: center; }

/* ---------- reports charts ---------- */
.chart { display: flex; gap: 6px; align-items: flex-end; border-radius: var(--radius); padding: 18px 14px 10px; overflow-x: auto; }
.chart-col { flex: 1; min-width: 44px; text-align: center; position: relative; }
.bars { display: flex; gap: 3px; align-items: flex-end; justify-content: center; height: 124px; }
.bar { width: 14px; border-radius: 3px 3px 0 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.bar-in  { background: var(--orange); }
.bar-fc  { background: var(--orange); opacity: .55; }
.bar-out { background: var(--maroon); }
body.theme-light .bar-out { box-shadow: none; }
.target-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--coral); z-index: 1; }
.chart-lbl { font-size: 11px; color: var(--muted); display: block; margin-top: 6px; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.key-in { background: var(--orange); }
.key-out { background: var(--maroon); }
.key-target { width: 16px; height: 0; border-top: 2px dashed var(--coral); vertical-align: 3px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; margin-bottom: 8px; }
.kan-col { border-radius: var(--radius); padding: 10px; min-height: 160px; }
.kan-col.drop-ok { border-color: var(--orange); }
.kan-head {
  font-family: var(--display); font-weight: 800; font-size: 12.5px;
  letter-spacing: .04em; text-transform: uppercase;
  margin: 2px 4px 10px; display: flex; justify-content: space-between; align-items: center;
}
.kan-count { background: var(--field); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; padding: 1px 8px; font-weight: 600; }
.kan-cards { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kan-card {
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; cursor: grab; display: flex; flex-direction: column; gap: 3px;
  font-size: 13.5px;
}
.kan-card.dragging { opacity: .45; cursor: grabbing; }
.kan-card strong { font-size: 14px; }
.kan-meta { color: var(--muted); font-size: 12px; }
.kan-tag { align-self: flex-start; background: var(--maroon); color: #fff; border-radius: 999px; font-size: 11px; padding: 2px 9px; }
.kan-edit { font-size: 12px; align-self: flex-end; }

/* ---------- calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-cell { border-radius: 10px; min-height: 86px; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cal-blank { background: transparent; border-style: dashed; opacity: .35; -webkit-backdrop-filter: none; backdrop-filter: none; }
.cal-today { border-color: var(--orange); }
.cal-day { font-size: 12px; color: var(--muted); }
.cal-today .cal-day { color: var(--orange); font-weight: 700; }
.cal-task {
  display: block; background: var(--orange); color: #141414;
  border-radius: 6px; font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-task.cal-done { background: var(--field); color: var(--muted); text-decoration: line-through; }

/* ---------- gantt ---------- */
.gantt { border-radius: var(--radius); padding: 16px 18px 12px; position: relative; overflow: hidden; }
.gantt-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.gantt-today { position: absolute; top: 38px; bottom: 10px; width: 0; border-left: 2px dashed var(--coral); z-index: 2; }
.gantt-row { display: grid; grid-template-columns: 240px 1fr; gap: 10px; align-items: center; margin-bottom: 7px; }
.gantt-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-taskrow .gantt-label { padding-left: 16px; font-size: 12.5px; }
.gantt-track { position: relative; height: 16px; background: var(--field); border-radius: 6px; }
.gantt-bar { position: absolute; top: 0; height: 100%; border-radius: 6px; }
.gantt-phase { background: var(--orange); }
.gantt-task { background: #B6AEA2; }
body.theme-light .gantt-task { background: #8C857B; }
.gantt-done { background: #4d7a4d; }
.gantt-slack { background: repeating-linear-gradient(45deg, transparent, transparent 3px, rgba(252,142,0,.55) 3px, rgba(252,142,0,.55) 6px); }

/* ---------- client info tables ---------- */
.info-grp {
  font-family: var(--display); font-weight: 800; font-size: 13px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--orange);
  margin: 16px 0 6px;
}
.info-tbl .info-key { width: 32%; font-weight: 600; }
.info-tbl .info-del { width: 30px; text-align: right; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 18px; }
.login-card { border-radius: 18px; border-top: 3px solid var(--orange); padding: 36px 38px; width: min(380px, 94vw); box-shadow: var(--shadow); }
.login-title { font-family: var(--display); font-weight: 900; font-size: 34px; margin: 0; }
.login-sub { margin: 2px 0 18px; color: var(--muted); }
.login-hint { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ============================================================
   THE INVOICE SHEET — white printed document in every theme
   ============================================================ */
.sheet {
  --ink: #141414; --paper: #ffffff; --line: #e6e2dc; --muted: #7a7a7a;
  color: var(--ink); color-scheme: light;
  background: #fff; max-width: 760px; margin: 0 auto;
  padding: 56px 64px; box-shadow: 0 2px 22px rgba(0,0,0,.35);
  font-size: 14.5px; line-height: 1.55;
  border-radius: 4px;
}
body.theme-light .sheet { box-shadow: 0 2px 18px rgba(0,0,0,.10); }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; }
.inv-title { font-family: var(--display); font-weight: 900; font-size: 44px; margin: 0; letter-spacing: .01em; }
.inv-logo { width: 96px; height: 96px; object-fit: contain; }
.inv-meta { margin: 18px 0 8px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 8px 0 16px; }
.inv-parties h2 { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 0 0 8px; }
.inv-parties p { margin: 0; }
.u { text-decoration: underline; }
.inv-project { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.25; margin: 26px 0 18px; }
.inv-block { margin: 0 0 14px; }
.inv-block h3 { font-size: 15px; margin: 0 0 2px; }
.inv-block p, .inv-block ul, .inv-block ol { margin: 0 0 8px 28px; }
.inv-block ul, .inv-block ol { padding-left: 18px; }
.inv-breakdown-title { font-family: var(--display); font-weight: 800; font-size: 24px; margin: 28px 0 14px; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table-head th { background: var(--orange); color: #141414; font-weight: 700; padding: 8px 12px; text-align: center; }
.inv-table td { padding: 6px 12px; text-align: center; }
.inv-item-head td { padding-top: 10px; font-size: 14.5px; }
.inv-item-detail td { color: #333; font-size: 13.5px; }
.inv-amount { white-space: nowrap; }
.inv-total td { font-weight: 800; padding-top: 16px; font-size: 15px; border-top: 2px solid #141414; }
.inv-section { margin-top: 26px; }
.inv-section h2 { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 0 0 10px; }
.inv-section p { margin: 0 0 8px; }
.inv-section ul, .inv-section ol { margin: 0 0 8px; padding-left: 22px; }
.inv-section li { margin-bottom: 5px; }
.inv-thanks { text-align: center; margin-top: 48px; }
.inv-thanks p { font-family: var(--display); font-weight: 800; font-size: 18px; }
.inv-thanks-logo { width: 260px; max-width: 60%; margin-top: 18px; }
.inv-foot { text-align: center; font-size: 11.5px; color: #444; margin-top: 56px; padding-top: 14px; }

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  body::before { display: none; }
  .topbar, .appfoot, .no-print, .pay-panel, .drawer, .scrim, .hamburger { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .sheet { box-shadow: none; max-width: none; padding: 0; border-radius: 0; }
  .inv-section, .inv-block { break-inside: avoid; }
  .inv-table-head th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 18mm 16mm; }
}

/* ---------- v5 components ---------- */
.share-head { font-family: var(--display); font-weight: 800; font-size: 15px; margin: 12px 0 8px; }
.share-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.share-url { flex: 1; min-width: 220px; font-size: 13px; color: var(--muted); }
.pay-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.public-strip { margin-top: 10px; }

.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }

.tpl-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; padding-top: 14px; }
.tpl-rename { display: flex; gap: 8px; align-items: center; }
.tpl-name { font-weight: 700; min-width: 220px; }
.tpl-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.cat-bar { height: 12px; min-width: 3px; border-radius: 4px; background: var(--orange); }

.reorder { position: absolute; top: 8px; right: 86px; display: inline-flex; gap: 4px; }
.reorder button {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--line); background: var(--field); color: var(--ink);
  cursor: pointer; font-size: 13px; line-height: 1;
}
.reorder button:hover { border-color: var(--orange); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .nav { display: none; }
  .hamburger { display: flex; }
  .topbar { top: 8px; margin: 8px 10px 0; max-width: none; }
}
@media (min-width: 981px) {
  .drawer, .scrim { display: none; }
}
@media (max-width: 900px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .gantt-row { grid-template-columns: 130px 1fr; }
}
@media (max-width: 760px) {
  .form-grid, .two-col, .inv-parties { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .item-row .grid, .sec-row .grid { grid-template-columns: 1fr; }
  .sheet { padding: 28px 20px; }
  .wrap { padding: 20px 12px 50px; }
  /* tables scroll inside themselves instead of stretching the page —
     this is also the footer-centring fix */
  .tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .pay-summary { gap: 16px; }
}
@media (max-width: 560px) {
  .kanban { grid-template-columns: 1fr; }
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 60px; padding: 4px; }
  .cal-task { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- v6 ---------- */
.sheet .inv-subtotal td { padding-top: 10px; color: #333; }
.sheet .inv-accepted { color: #2f7a2f; font-weight: 700; }
.sheet .inv-legal { display: block; margin-top: 5px; color: #777; font-size: 11px; }
@media print {
  .sheet .inv-legal { color: #666; }
}
