/* Braspenning Coatings Sweden - application styles.
   Professional admin-shell design. Flat, responsive, no external fonts/CDNs. */

:root {
  --sidebar-w: 252px;
  --topbar-h: 64px;

  --navy: #14532d;
  --navy-2: #0d3b20;
  --steel: #2e7d32;
  --steel-hover: #25652a;
  --steel-soft: #e8f3e9;

  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --border: #e4e9f0;
  --border-2: #d6deea;

  --text: #1a2433;
  --text-2: #5a6678;
  --text-3: #919cad;

  --green: #15824b; --green-bg: #e7f5ec;
  --amber: #98640f; --amber-bg: #fbf1da;
  --red: #c0271f; --red-bg: #fbe9e7;
  --info: #2563a8; --info-bg: #e9f1fb;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(18, 44, 70, 0.06);
  --shadow: 0 2px 10px rgba(18, 44, 70, 0.07);
  --shadow-lg: 0 8px 30px rgba(18, 44, 70, 0.14);
}

* { box-sizing: border-box; }

html, body { margin: 0; }
body {
  font-family: "Segoe UI", Roboto, -apple-system, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }

.ic { width: 18px; height: 18px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ============================ SIDEBAR ============================ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  display: flex; flex-direction: column; z-index: 40;
}
.sidebar-brand {
  height: var(--topbar-h); display: flex; align-items: center; padding: 0 18px;
  background: #ffffff; border-bottom: 1px solid var(--border);
}
.sidebar-brand img { height: 42px; width: auto; max-width: 100%; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-section {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #6e8298; padding: 16px 12px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm); color: #c4d2e2; font-weight: 500; font-size: 14px;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; text-decoration: none; }
.nav-item.muted { color: #8597ab; }
.nav-item.active { background: rgba(46, 125, 50, 0.30); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 6px; bottom: 6px; width: 3px;
  background: #6fd17a; border-radius: 0 3px 3px 0;
}
.nav-item .ic { width: 18px; height: 18px; }
.nav-soon {
  margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  background: rgba(255,255,255,0.1); color: #9fb0c4; padding: 1px 7px; border-radius: 20px;
}
.sidebar-foot {
  padding: 14px 20px; font-size: 12px; color: #6e8298;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ============================ TOPBAR ============================ */
.topbar {
  position: fixed; top: 0; right: 0; left: var(--sidebar-w); height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; z-index: 30;
}
.menu-toggle { display: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-2);
  background: transparent; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topbar .spacer { flex: 1; }

.search { position: relative; width: min(420px, 46vw); }
.search .search-ic {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3);
}
.search input {
  width: 100%; border: 1px solid var(--border-2); background: var(--surface-2);
  border-radius: 9px; padding: 9px 12px 9px 38px; font-size: 14px; color: var(--text);
}
.search input:focus { outline: none; border-color: var(--steel); background: #fff;
  box-shadow: 0 0 0 3px var(--steel-soft); }
.search-results {
  position: absolute; top: 116%; left: 0; right: 0; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  max-height: 340px; overflow-y: auto; z-index: 60; display: none; padding: 6px;
}
.search-results a { display: flex; align-items: center; padding: 9px 10px; border-radius: 7px; color: var(--text); }
.search-results a:hover { background: var(--steel-soft); text-decoration: none; }
.search-results .stype {
  font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px;
  border-radius: 20px; margin-right: 10px; min-width: 74px; text-align: center;
}
.sr-empty { padding: 12px; color: var(--text-3); }

.user-menu { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--steel); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
  text-transform: uppercase; flex: none;
}
.user-meta .uname { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.user-meta .urole { font-size: 11.5px; color: var(--text-3); text-transform: capitalize; }

/* ============================ CONTENT ============================ */
body.with-shell .content {
  margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 26px) 30px 60px;
  max-width: 1320px;
}
.scrim { display: none; }

/* ============================ HEADERS ============================ */
.crumbs { color: var(--text-3); font-size: 13px; margin-bottom: 12px; display: flex;
  align-items: center; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
.crumbs .sep { color: var(--text-3); }
.page-head { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.page-head .subtitle { color: var(--text-2); font-size: 14px; }
.page-head .spacer { flex: 1; }
.page-head select { height: 38px; }

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; background: var(--steel); color: #fff;
  border: 1px solid var(--steel); padding: 9px 16px; border-radius: 9px; font-size: 14px;
  font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1;
}
.btn:hover { background: var(--steel-hover); border-color: var(--steel-hover); color: #fff; text-decoration: none; }
.btn .ic { width: 16px; height: 16px; }
.btn.secondary { background: #fff; color: var(--text); border-color: var(--border-2); }
.btn.secondary:hover { background: var(--surface-2); color: var(--text); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; border-color: var(--red); }

select, input[type=text], input[type=date], input[type=number], input[type=password], textarea {
  font-family: inherit; color: var(--text);
}
select {
  border: 1px solid var(--border-2); border-radius: 9px; padding: 8px 12px; font-size: 14px;
  background: #fff;
}
select:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px var(--steel-soft); }

/* ============================ CARDS ============================ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 20px; overflow: hidden;
}
.card > h2, .card-head {
  font-size: 15px; margin: 0; padding: 15px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; font-weight: 650;
}
.card > h2 .count { color: var(--text-3); font-weight: 400; font-size: 13px; }
.card-body { padding: 18px 20px; }
.card.pad { padding: 18px 20px; }
.card.pad > h2 { padding: 0 0 12px; border: none; }

/* ============================ DASHBOARD ============================ */
.hero {
  background: linear-gradient(110deg, var(--navy) 0%, #1f6a39 55%, #2e7d32 120%);
  color: #fff; border-radius: var(--radius); padding: 26px 28px; margin-bottom: 22px;
  display: flex; align-items: center; gap: 24px; box-shadow: var(--shadow);
}
.hero .hero-text h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.hero .hero-text p { margin: 0; color: #b9cbde; font-size: 14.5px; }
.hero .photos { display: flex; gap: 12px; margin-left: auto; }
.hero .photos img {
  width: 132px; height: 84px; object-fit: cover; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 6px 16px rgba(0,0,0,0.22);
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  color: var(--text);
}
.stat:hover { text-decoration: none; box-shadow: var(--shadow); }
.stat .stat-ic {
  width: 46px; height: 46px; border-radius: 11px; display: flex; align-items: center;
  justify-content: center; flex: none; background: var(--steel-soft); color: var(--steel);
}
.stat .stat-ic .ic { width: 22px; height: 22px; }
.stat.warn .stat-ic { background: var(--red-bg); color: var(--red); }
.stat .stat-num { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat .stat-label { color: var(--text-2); font-size: 13px; }

.dash-cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }

/* ============================ MODULE TILES ============================ */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1150px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px; display: block; color: var(--text);
  transition: transform .1s ease, box-shadow .1s ease;
}
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
.tile .tile-ic {
  width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center;
  justify-content: center; background: var(--steel-soft); color: var(--steel); margin-bottom: 12px;
}
.tile .tile-ic .ic { width: 22px; height: 22px; }
.tile .tname { font-weight: 650; font-size: 16px; }
.tile .tdesc { color: var(--text-2); font-size: 13px; margin-top: 3px; }
.tile .tfoot { margin-top: 12px; font-size: 12px; color: var(--steel); font-weight: 600; }
.tile.disabled { background: var(--surface-2); }
.tile.disabled .tile-ic { background: #eaeef4; color: var(--text-3); }
.tile.disabled .tfoot { color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }

/* ============================ REMINDERS ============================ */
.reminder { display: flex; gap: 12px; align-items: flex-start; padding: 13px 20px;
  border-bottom: 1px solid var(--border); border-left: 3px solid transparent; }
.reminder:last-child { border-bottom: none; }
.reminder.overdue { border-left-color: var(--red); }
.reminder.due_soon { border-left-color: var(--amber); }
.reminder.info { border-left-color: var(--info); }
.reminder .r-ic { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; flex: none; }
.reminder.overdue .r-ic { background: var(--red-bg); color: var(--red); }
.reminder.due_soon .r-ic { background: var(--amber-bg); color: var(--amber); }
.reminder.info .r-ic { background: var(--info-bg); color: var(--info); }
.reminder .r-ic .ic { width: 16px; height: 16px; }
.reminder .rcat { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.reminder .rtitle { font-weight: 600; font-size: 14px; }
.reminder .rdetail { color: var(--text-2); font-size: 13px; }

/* ============================ BADGES ============================ */
.badge {
  display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.badge.green { background: var(--green-bg); color: var(--green); border-color: transparent; }
.badge.amber { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.badge.red { background: var(--red-bg); color: var(--red); border-color: transparent; }
.badge.info, .badge.steel { background: var(--steel-soft); color: var(--steel); border-color: transparent; }
.pill { background: var(--steel-soft); color: var(--steel); padding: 3px 10px; border-radius: 7px;
  font-size: 12px; font-weight: 600; display: inline-block; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* ============================ TABLES ============================ */
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
table.data thead th {
  font-size: 11px; text-transform: uppercase; color: var(--text-3); letter-spacing: .05em;
  font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td .muted { font-size: 12.5px; }
table.data tr.totals td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--border-2); }
table.data input[type=number] { width: 104px; border: 1px solid var(--border-2); border-radius: 6px;
  padding: 5px 7px; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data input[type=number]:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px var(--steel-soft); }
.table-scroll { overflow-x: auto; }
.table-scroll table.data { min-width: 980px; }
/* Cost-update item tables (offered / misc / T&M) fit the page width without a
   horizontal scrollbar: no forced min-width, tighter cells, compact buttons. */
.table-scroll table.data[data-sec] { min-width: 0; }
table.data[data-sec] th, table.data[data-sec] td { padding: 9px 9px; }
table.data[data-sec] .btn.small { padding: 5px 8px; font-size: 12px; }
table.data[data-sec="off"] td[style*="nowrap"] { padding-left: 4px; padding-right: 4px; }
.neg { color: var(--red); }

/* ============================ FORMS ============================ */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 22px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.full { grid-column: 1 / -1; }
.form-row label { font-size: 13px; font-weight: 600; color: var(--text); }
.form-row input[type=text], .form-row input[type=date], .form-row input[type=number],
.form-row input[type=password], .form-row select, .form-row textarea {
  border: 1px solid var(--border-2); border-radius: 9px; padding: 9px 11px; font-size: 14px; background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px var(--steel-soft);
}
.form-row input:disabled { background: var(--surface-2); color: var(--text-2); }
.form-row .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ============================ FLASH ============================ */
.flashes { margin-bottom: 18px; }
.flash { padding: 11px 16px; border-radius: 9px; margin-bottom: 8px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; }
.flash.success { background: var(--green-bg); color: var(--green); }
.flash.error { background: var(--red-bg); color: var(--red); }
.flash.info { background: var(--info-bg); color: var(--info); }

/* ============================ LOGIN ============================ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(125deg, var(--navy-2) 0%, var(--navy) 45%, #2e7d32 130%); padding: 20px;
}
.login-card { background: #fff; border-radius: 16px; padding: 38px 34px; width: 380px; box-shadow: var(--shadow-lg); }
.login-card img { height: 50px; display: block; margin: 0 auto 18px; }
.login-card h1 { font-size: 19px; text-align: center; margin: 0 0 4px; font-weight: 700; }
.login-card p.sub { text-align: center; color: var(--text-3); margin: 0 0 24px; font-size: 14px; }
.login-card .form-row { margin-bottom: 16px; }
.login-card .form-row label { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; }
.login-card .form-row input { width: 100%; border: 1px solid var(--border-2); border-radius: 9px;
  padding: 11px 12px; font-size: 14px; }
.login-card .form-row input:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px var(--steel-soft); }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; margin-top: 4px; }
.login-card .flash { margin-bottom: 16px; }

/* ============================ MISC ============================ */
.muted { color: var(--text-2); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ---------- KPI cards + tabs (commercial overview) ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 15px 18px; }
/* Heat KPI: a coloured top edge whose colour tracks the profit/loss scale. */
.kpi.heat { border-top: 3px solid var(--accent); }
.kpi .label { font-size: 13px; color: var(--text-2); }
.kpi .value { font-size: 25px; font-weight: 700; line-height: 1.15; margin-top: 3px; }
.kpi .value.pos { color: var(--green); }
.kpi .value.neg { color: var(--red); }
.kpi .sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.kpi .sub.pos { color: var(--green); }
.kpi .sub.neg { color: var(--red); }

.tabbar { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab-btn { padding: 9px 16px; border: none; background: none; cursor: pointer; font-size: 14px;
  font-weight: 600; color: var(--text-2); border-bottom: 2px solid transparent; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--steel); border-bottom-color: var(--steel); }
a.tab-btn { text-decoration: none; display: inline-block; }

.disc-split .row { font-size: 13px; margin-bottom: 4px; display: flex; justify-content: space-between; }
.disc-split .bar { height: 8px; background: var(--surface-2); border-radius: 4px; margin-bottom: 14px; }
.disc-split .bar > span { display: block; height: 8px; border-radius: 4px; background: var(--steel); }
table.data tr.month-head td { background: var(--surface-2); font-weight: 700; color: var(--text);
  border-top: 2px solid var(--border-2); }
table.data tr.subtotal td { font-weight: 700; }

/* Profit heat pill: greener = more profit, redder = more loss (colours set inline). */
.mpill { display: inline-block; min-width: 52px; text-align: center; padding: 2px 9px;
  border-radius: 999px; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }

/* Mini turnover bar inside the Projects table. */
td.tcell .tbar { display: block; height: 4px; margin-top: 3px; border-radius: 3px;
  background: var(--surface-2); overflow: hidden; }
td.tcell .tbar > span { display: block; height: 4px; border-radius: 3px; background: var(--steel); }
tr.projrow:hover td { background: var(--surface-2); }

/* Cost-update Overview: the Excel-style summary. */
table.cu-summary td { font-variant-numeric: tabular-nums; }
table.cu-summary tr.ov-group td { background: var(--navy); color: #fff; font-weight: 700;
  letter-spacing: .02em; font-size: 12px; text-transform: uppercase; padding: 7px 12px; }
table.cu-summary tr.ov-item td { border-bottom: 1px solid var(--border); }
table.cu-summary tr.ov-off td { color: var(--text-3); }
table.cu-summary tr.ov-sub td { font-weight: 700; background: var(--surface-2);
  border-top: 1px solid var(--border-2); }
table.cu-summary tr.ov-pending td { color: var(--text-3); font-style: italic; }
table.cu-summary tr.ov-subtotal td { font-weight: 700; border-top: 2px solid var(--border-2); }
table.cu-summary tr.ov-total td { font-weight: 800; font-size: 16px; color: var(--steel);
  border-top: 2px solid var(--steel); background: var(--surface-2); }

/* Clean P&L waterfall in the Year overview. */
table.pnl td { padding: 6px 6px; border: none; }
table.pnl tr td:last-child { width: 45%; }
table.pnl tr.subtotal td { border-top: 1px solid var(--border-2); background: var(--surface-2); }
table.pnl tr.totals td { border-top: 2px solid var(--steel); font-size: 16px; font-weight: 700; }

/* Thumbnail cell in list tables (e.g. equipment). */
td.thumb-cell { width: 56px; padding: 6px 10px; }
.thumb { display: block; width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--border); background: var(--surface-2); }
.thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.thumb-empty .ic { width: 20px; height: 20px; }

/* Equipment photo tiles with per-photo actions (cover / remove). */
.eq-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.eq-photo { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.eq-photo.is-cover { border-color: var(--steel); box-shadow: 0 0 0 2px var(--steel) inset; }
.eq-photo img { display: block; width: 100%; height: 110px; object-fit: cover; }
.eq-photo figcaption { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 6px 8px; }
.eq-photo figcaption form { margin: 0; }

/* "Inspections this machine needs" picker on the equipment form. */
.insp-picker { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 10px; margin-top: 6px; }
.insp-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: var(--surface-2); }
.insp-opt.on { border-color: var(--steel); background: var(--surface); }
.insp-opt .chk { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0; cursor: pointer; }
.insp-opt input[type=date] { max-width: 160px; }
@media (max-width: 700px) { .insp-picker { grid-template-columns: 1fr; } }

/* Cost-update builder: auto-growing description + grand total. */
textarea.desc-grow { width: 100%; min-height: 34px; resize: vertical; overflow: hidden;
  font: inherit; line-height: 1.35; padding: 6px 8px; }
.grand-total { text-align: right; font-size: 16px; margin: 10px 0 4px; }
.grand-total strong { font-size: 19px; color: var(--steel); margin-left: 8px; }
.area-block { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.area-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface-2); }
.area-bar input.area-m2 { max-width: 110px; }
.area-block table.data { margin: 0; }
tr.orow.pending .ostatus { color: var(--amber); }
/* Offered items: each item reads as one block. The fields are the header (with a
   strong divider above), and the description + notes sit below in a distinct,
   labelled body box so they don't blend into the fields. */
table[data-sec="off"] tbody > tr.orow > td {
  border-top: 3px solid var(--border-2);
  border-bottom: none;
  padding-top: 16px; padding-bottom: 6px;
  background: var(--steel-soft);          /* highlight each item's header row (item no / title / status / qty / price / amount) in green */
}
table[data-sec="off"] tbody > tr.orow:first-child > td { border-top: none; }
table[data-sec="off"] tbody > tr.orow-desc > td { border-bottom: none; padding: 0 16px 14px; }
table[data-sec="off"] tbody > tr.subtotal > td { border-top: 3px solid var(--border-2); }
.orow-body {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 9px 13px 11px;
}
.orow-body label {
  display: block; font-size: 11px; font-weight: 700; color: var(--text-2);
  text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 3px;
}
.orow-body label:first-child { margin-top: 0; }
.orow-body .lbl-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-3); }
.orow-body textarea { width: 100%; }
/* Offered-item paint supply: a small inset table under the item (like tank paint). */
table[data-sec="off"] tbody > tr.orow-paint > td { border-bottom: none; padding: 0 16px 12px; }
.offpaint { background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--steel);
  border-radius: var(--radius-sm); padding: 6px 12px 8px; }
.offpaint-h { font-size: 11px; font-weight: 700; color: var(--text-2); letter-spacing: .04em;
  text-transform: uppercase; margin: 2px 0; }
.offpaint table.data { background: var(--surface); margin-top: 4px; }
.subtotal-bar { text-align: right; font-weight: 600; padding-top: 6px; }
.subtotal-bar strong { color: var(--steel); margin-left: 6px; }
.hidden { display: none !important; }
/* Supplied-paint sub-table sits inside a tank block, slightly inset. */
.tankpaint { padding: 0 12px 10px; background: var(--surface-2); }
.tankpaint table.data { background: var(--surface); }
/* Collapsible tank: when collapsed only the bar shows (with a summary). */
.tank-block.collapsed > table.data,
.tank-block.collapsed > .tankpaint { display: none; }

/* ---------- Equipment overview: photo card grid ---------- */
.eq-group { margin-bottom: 26px; }
.eq-group-head {
  font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-2); margin: 0 0 10px 2px;
}
.eq-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.eq-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  color: var(--text); transition: box-shadow .12s, transform .12s;
}
.eq-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.eq-card.attn-overdue { border-color: var(--red); }
.eq-card.attn-due_soon { border-color: var(--amber); }
.eq-photo {
  position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden;
}
.eq-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.eq-nophoto {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.eq-nophoto .ic { width: 34px; height: 34px; }
.eq-flag {
  position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 20px; color: #fff;
}
.eq-flag.red { background: var(--red); }
.eq-flag.amber { background: var(--amber); }
.eq-body { padding: 10px 12px 12px; }
.eq-bra { font-weight: 700; font-size: 13px; color: var(--steel); }
.eq-name { font-weight: 600; font-size: 14px; margin: 1px 0 2px; }
.eq-serial { font-size: 12px; }
.eq-pills { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px; }
.eq-pills .badge { font-size: 11px; padding: 2px 8px; }

/* ---------- Purchase list: category chips, best price, selection bar ---------- */
.chipbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 18px; }
.chip {
  padding: 5px 13px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2);
}
.chip:hover { border-color: var(--steel); color: var(--steel); text-decoration: none; }
.chip.active { background: var(--steel); border-color: var(--steel); color: #fff; }
.chip.warn { color: var(--amber); border-color: var(--amber); }
.chip.warn.active { background: var(--amber); color: #fff; }
.pl-table td { vertical-align: middle; }
.bestprice { font-weight: 700; font-size: 15px; color: var(--text); margin-right: 8px; }
.selbar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(90px);
  display: flex; gap: 12px; align-items: center; z-index: 60;
  background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .18s;
}
.selbar.show { transform: translateX(-50%) translateY(0); }
.selbar span { font-weight: 600; font-size: 14px; }
.tank-block .tcollapse .ic { transition: transform .15s ease; transform: rotate(90deg); }
.tank-block.collapsed .tcollapse .ic { transform: rotate(0deg); }
.tank-block:not(.collapsed) .tsummary { display: none; }
.tsummary { margin-left: 6px; white-space: nowrap; }
/* Collapsible description textareas: a short preview until clicked (focused). */
textarea.desc-grow.collapsible { overflow: hidden; cursor: pointer; }
textarea.desc-grow.collapsible:not(.expanded) { height: auto; max-height: 3.2em; }
textarea.desc-grow.collapsible.expanded { cursor: auto; }

@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Photo gallery ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.photo-grid a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .12s ease; }
.photo-grid a:hover img { transform: scale(1.06); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 18px; }
.kv dt { color: var(--text-3); font-size: 13px; }
.kv dd { margin: 0; }
.empty { color: var(--text-3); font-style: italic; padding: 16px 20px; }
.section-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; align-items: start; }
.tag-list { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-cols, .section-cols { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; }
  body.with-shell .content { margin-left: 0; padding: calc(var(--topbar-h) + 20px) 18px 50px; }
  .menu-toggle { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(13,34,56,0.45); z-index: 35; }
  .scrim.show { display: block; }
  .hero .photos { display: none; }
  .user-meta { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .search input { padding-right: 10px; }
}
