/* ====================================================================
   RFQ Enquiry Tracker — 2026 design system
   ==================================================================== */
:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f7;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e6e9f0;
  --line-soft: #eef1f6;

  --brand: #2563eb;          /* professional blue */
  --brand-strong: #1d4ed8;
  --brand-ink: #ffffff;
  --brand-tint: #eff6ff;

  --good: #15803d;
  --good-bg: #dcfce7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 4px 16px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 18px 40px -12px rgba(15, 23, 42, .18);
  --ring: 0 0 0 4px rgba(37, 99, 235, .18);

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 74px;
}

.ico { width: 18px; height: 18px; flex: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
  background:
    radial-gradient(1100px 480px at 100% -10%, rgba(37, 99, 235, .10), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(56, 189, 248, .08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-strong); text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3 { letter-spacing: -0.02em; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 22px; height: 62px;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: -0.03em;
}
.brand:hover { color: var(--ink); }
.brand-text > span { color: var(--brand-strong); }
.brand-mark {
  display: grid; place-items: center; width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff; border-radius: 9px; font-weight: 800; font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.brand-logo { height: 36px; width: auto; max-width: 140px; object-fit: contain; display: block; }
html.sidebar-collapsed .brand-logo { max-width: 48px; }
.auth-logo { text-align: center; margin: 8px 0 22px; }
.auth-logo img { height: 96px; width: auto; max-width: 220px; object-fit: contain; }
.topbar nav { display: flex; align-items: center; gap: 6px; }
.topbar nav > a:not(.btn):not(.btn-ghost) {
  color: var(--ink-soft); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 9px; transition: background .15s, color .15s;
}
.topbar nav > a:not(.btn):not(.btn-ghost):hover { background: var(--bg-soft); color: var(--ink); }
.who { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 500; padding-left: 6px; }
.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-tint); color: var(--brand-strong); font-weight: 700; font-size: 13px;
}

.container { max-width: 1080px; margin: 30px auto; padding: 0 22px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 36px 0; }

/* ---------- Sidebar layout (logged in) ---------- */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 20px 16px; gap: 6px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-right: 1px solid var(--line);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 14px; }
.sidebar .brand { padding: 0; }
.sidebar-toggle {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  background: transparent; border: 1px solid var(--line); border-radius: 9px;
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.sidebar-toggle:hover { background: var(--bg-soft); color: var(--ink); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.sidebar-toggle svg { width: 18px; height: 18px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; flex: 1; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  color: var(--ink-soft); font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.side-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.side-nav a.active { background: var(--brand-tint); color: var(--brand-strong); font-weight: 600; }
.side-nav .ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.side-foot { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-foot .who { padding-left: 2px; }
.side-foot .btn-ghost { justify-content: center; }
.content-area { min-width: 0; display: flex; flex-direction: column; }
.content-area .container { width: 100%; }
.content-area .foot { padding: 22px 0; }

/* Collapsed icon-rail (desktop only) */
@media (min-width: 861px) {
  html.sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
  html.sidebar-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
  html.sidebar-collapsed .sidebar-head { flex-direction: column; gap: 12px; padding: 6px 0 14px; }
  html.sidebar-collapsed .brand { justify-content: center; }
  html.sidebar-collapsed .brand-text,
  html.sidebar-collapsed .side-nav .label,
  html.sidebar-collapsed .side-foot .who,
  html.sidebar-collapsed .side-foot .btn-ghost .label { display: none; }
  html.sidebar-collapsed .side-nav a { justify-content: center; padding-left: 0; padding-right: 0; }
  html.sidebar-collapsed .side-foot .btn-ghost { justify-content: center; padding-left: 0; padding-right: 0; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; height: auto; flex-direction: row; align-items: center;
    gap: 4px; padding: 8px 12px; border-right: none; border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .sidebar-head { padding: 0 8px 0 0; }
  .sidebar-toggle { display: none; }
  .side-nav { flex-direction: row; margin-top: 0; flex: 1; }
  .side-nav a { white-space: nowrap; padding: 8px 11px; }
  .side-foot { flex-direction: row; align-items: center; padding-top: 0; border-top: none; gap: 8px; }
  .side-foot .who { display: none; }
}

.flash {
  max-width: 1080px; margin: 16px auto 0; padding: 12px 16px;
  background: color-mix(in srgb, var(--brand-tint) 70%, var(--card));
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: var(--radius-sm); color: var(--ink-soft); font-size: 14px;
  box-shadow: var(--shadow-sm);
}

/* ---------- Buttons ---------- */
.btn, .btn-sm, .btn-tiny {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: var(--brand-ink); border: none; cursor: pointer; font-family: inherit;
  font-weight: 600; padding: 10px 18px; border-radius: 10px; font-size: 14.5px;
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .15s, filter .15s;
}
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 9px; }
.btn-tiny { padding: 3px 9px; font-size: 12px; border-radius: 8px; }
.btn:hover, .btn-sm:hover, .btn-tiny:hover { color: #fff; filter: brightness(1.05); box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active, .btn-sm:active { transform: translateY(0); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); color: var(--ink-soft); border: 1px solid var(--line);
  padding: 9px 15px; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-weight: 500; font-size: 14px; transition: border-color .15s, background .15s, transform .12s;
}
.btn-ghost:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--bg-soft); color: var(--ink); transform: translateY(-1px); }

/* ---------- Hero / home ---------- */
.hero { text-align: center; padding: 56px 0 18px; }
.hero h1 {
  font-size: clamp(34px, 5vw, 48px); margin: 0 0 12px; font-weight: 800;
  background: linear-gradient(120deg, var(--ink), var(--brand-strong));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lead { color: var(--muted); font-size: 18px; max-width: 600px; margin: 0 auto 26px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; max-width: 460px; margin: 0 auto; box-shadow: var(--shadow);
}
.form-card.wide { max-width: 980px; }
.form-card h2 { margin-top: 0; }
form label { display: block; margin: 15px 0; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }
input, textarea, select {
  width: 100%; margin-top: 6px; padding: 10px 13px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; font-family: inherit;
  background: var(--card); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input[type=radio] { width: auto; margin: 0 6px 0 0; }
input[type=file] { padding: 8px; background: var(--bg-soft); }
.roles { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.roles legend { font-size: 13px; color: var(--muted); }
.radio { font-weight: 400; display: block; margin: 6px 0; }
.actions { display: flex; gap: 10px; margin-top: 20px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- Page head ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 24px; }

/* ---------- Tables ---------- */
.grid, .compare, .items {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.grid th, .grid td, .compare th, .compare td, .items th, .items td {
  padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: 14px;
}
.grid th, .compare th, .items th {
  background: var(--bg-soft); font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
}
.grid tbody tr { transition: background .12s; }
.grid tbody tr:hover { background: color-mix(in srgb, var(--brand-tint) 45%, var(--card)); }
.grid tr:last-child td, .compare tr:last-child td { border-bottom: none; }
.grid thead th { position: sticky; top: 0; z-index: 2; }

/* Enquiry list table */
.enquiry-table td, .enquiry-table th { white-space: nowrap; }
.enquiry-table tbody tr.clickable-row { cursor: pointer; }
.enquiry-table .cell-item {
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft);
}
.enquiry-table .cell-company { max-width: 260px; }
.enquiry-table .cell-company { display: flex; align-items: center; gap: 4px; }
.enquiry-table .cell-company-link {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-weight: 600;
}
.enquiry-table .cell-company-link:hover { color: var(--brand-strong); }
.enquiry-table .chk { width: 34px; text-align: center; padding-left: 12px; padding-right: 6px; }
.enquiry-table .chk input { width: auto; margin: 0; cursor: pointer; }
.bulk-bar { margin-bottom: 10px; }
.inline-edit {
  width: auto; max-width: 150px; margin: 0; padding: 4px 8px; font-size: 13px;
  border-radius: 8px; background: var(--card); color: var(--ink-soft); cursor: pointer;
}
.inline-edit.saved { border-color: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }
.inline-status { font-weight: 600; }
.inline-status.s-open, .status-pill.s-open { color: var(--brand-strong); }
.inline-status.s-submitted, .status-pill.s-submitted { color: var(--warn); }
.inline-status.s-closed, .status-pill.s-closed { color: var(--muted); }
.inline-status.s-accepted, .status-pill.s-accepted { color: var(--good); }
.inline-status.s-rejected, .status-pill.s-rejected { color: var(--bad); }
.status-pill { font-weight: 600; }
.src-tag { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--brand-strong); background: var(--brand-tint); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.enquiry-table .cell-opt { max-width: 180px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-soft); }

/* Sortable headers */
.grid th.sortable { padding: 0; }
.grid th.sortable a {
  display: block; padding: 13px 16px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600; font-size: 11.5px;
}
.grid th.sortable a:hover { color: var(--ink); background: color-mix(in srgb, var(--brand-tint) 50%, transparent); }
.grid th.sorted a { color: var(--brand-strong); }
.sort-arrow { display: inline-block; width: 0; margin-left: 4px; }
.grid th.sorted .sort-arrow { width: auto; }

/* Column chooser */
.col-chooser { position: relative; }
.col-chooser > summary { list-style: none; user-select: none; }
.col-chooser > summary::-webkit-details-marker { display: none; }
.col-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 12px; min-width: 180px; display: grid; gap: 4px;
}
.col-opt { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; font-size: 14px; color: var(--ink-soft); }
.col-opt input { width: auto; margin: 0; }
.col-menu .btn-sm { margin-top: 8px; width: 100%; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 14px 2px 0; font-size: 13px; }
.pager-controls { display: flex; align-items: center; gap: 10px; }
.is-disabled { opacity: .45; pointer-events: none; }
.right { text-align: right; }
.items .qty, .items .unit { width: 120px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; border: 1px solid transparent; }
.badge-open { background: var(--brand-tint); color: var(--brand-strong); }
.badge-closed { background: var(--bg-soft); color: var(--muted); }
.badge-awarded, .badge-accepted { background: var(--good-bg); color: var(--good); }
.badge-submitted { background: var(--warn-bg); color: var(--warn); }
.badge-rejected { background: var(--bad-bg); color: var(--bad); }

/* ---------- Compare ---------- */
.compare-wrap { overflow-x: auto; border-radius: var(--radius); }
.compare .rowhead { font-weight: 600; }
.compare .rowhead small { display: block; color: var(--muted); font-weight: 400; }
.compare .num { text-align: right; }
.compare .best { background: var(--good-bg); color: var(--good); font-weight: 700; }
.compare .total-row td { border-top: 2px solid var(--line); }
.compare .notes { font-size: 13px; color: var(--muted); max-width: 200px; }

.awarded-box { background: var(--good-bg); border: 1px solid color-mix(in srgb, var(--good) 35%, var(--line)); color: var(--good); padding: 14px 18px; border-radius: var(--radius-sm); margin: 18px 0; }
.desc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .btn { margin-top: 14px; }

/* ---------- Summary cards ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; min-width: 98px; display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-num { font-size: 26px; font-weight: 800; line-height: 1.05; letter-spacing: -0.03em; }
.stat-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat-alert { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad-bg) 60%, var(--card)); }
.stat-alert .stat-num { color: var(--bad); }
.stat-wide { flex: 1; min-width: 230px; }
.assignee-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.chip { background: var(--brand-tint); color: var(--brand-strong); border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 500; }
.chip a { color: inherit; }

/* ---------- Aging / follow-up ---------- */
.age { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.age-green { background: var(--good-bg); color: var(--good); }
.age-amber { background: var(--warn-bg); color: var(--warn); }
.age-red { background: var(--bad-bg); color: var(--bad); }
.due-flag { background: var(--bad-bg); color: var(--bad); font-weight: 600; padding: 3px 9px; border-radius: 8px; }

/* ---------- Enquiry detail (read-only) ---------- */
.detail-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.detail-item { margin: 0 0 16px; font-size: 17px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 28px; }
.detail-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.detail-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.detail-value { font-size: 14.5px; color: var(--ink); word-break: break-word; }
.detail-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.detail-block p { margin: 4px 0 0; white-space: pre-wrap; color: var(--ink-soft); }
@media (max-width: 720px) { .detail-grid { grid-template-columns: 1fr; } }

/* ---------- Original email preview ---------- */
.email-preview {
  margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); padding: 4px 16px 14px;
}
.email-preview > summary {
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-soft);
  padding: 12px 0; list-style: none;
}
.email-preview > summary::-webkit-details-marker { display: none; }
.email-preview > summary::before { content: "▸ "; color: var(--muted); }
.email-preview[open] > summary::before { content: "▾ "; }
.email-meta { font-size: 13px; color: var(--muted); }
.email-subject { font-weight: 600; margin: 4px 0 8px; }
.email-body {
  white-space: pre-wrap; word-wrap: break-word; font-family: inherit; font-size: 14px;
  color: var(--ink-soft); margin: 0; max-height: 360px; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px;
}

/* ---------- Mark-for-costing flag ---------- */
.costing-flag {
  display: flex; align-items: center; gap: 9px; margin: 18px 0 0; font-weight: 500;
  font-size: 14px; color: var(--ink-soft); padding: 12px 14px;
  background: var(--brand-tint); border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  border-radius: var(--radius-sm);
}
.costing-flag input { width: auto; margin: 0; }

/* ---------- Attachments ---------- */
.attach-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.attach-section h3 { margin: 0 0 12px; font-size: 15px; }
.attach-list { list-style: none; padding: 0; margin: 0 0 14px; }
.attach-list li { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.attach-list li a { font-weight: 600; flex: 1 1 100%; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.attach-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attach-upload input[type=file] { width: auto; margin: 0; }

/* ---------- Form split: left panel (costing/offer) + form ---------- */
.form-split { display: flex; gap: 24px; align-items: flex-start; }
.form-main { flex: 1; min-width: 0; }
.side-panel {
  flex: 0 0 300px; max-width: 300px; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-soft); padding: 16px 18px;
}
.side-panel a { overflow-wrap: anywhere; word-break: break-word; }
.side-panel h3 { margin: 0 0 4px; font-size: 15px; }
.side-panel h4 { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.small { font-size: 12px; }
.upload-slot { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.upload-slot:first-of-type { border-top: none; padding-top: 6px; }
.upload-slot .attach-list { margin-bottom: 10px; }
.upload-box { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 6px; }
.upload-box input[type=file] { width: 100%; margin: 0; font-size: 12.5px; }

/* ---------- Charts ---------- */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.chart-card h3 { margin: 0 0 14px; font-size: 15px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.bar-label { width: 132px; font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; background: var(--bg-soft); border-radius: 999px; height: 16px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-strong)); border-radius: 999px; transition: width .5s ease; }
.bar-count { width: 32px; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ---------- Filters / misc ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.filters input[name=q] { flex: 1; min-width: 220px; margin: 0; }
.filters select { width: auto; margin: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field-grid label { margin: 0; }
.field-grid .span2 { grid-column: 1 / -1; }
.readonly-field { margin-top: 6px; padding: 10px 13px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--muted); }
.field-hint { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 400; }

@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .form-split { flex-direction: column; }
  .side-panel { flex-basis: auto; max-width: none; width: 100%; }
  .topbar { padding: 0 14px; }
  .topbar nav > a:not(.btn):not(.btn-ghost) { padding: 8px 9px; }
  .who { display: none; }
}
