/* =============================================================================
   Product Information System — demo stylesheet

   The colour tokens, radii, shadows and component anatomy below are lifted from
   the real application's stylesheet so the demo looks like the product rather
   than like a mock-up of it. The application builds these with Tailwind v4
   `@theme` tokens; here they are written out as plain CSS so the demo needs no
   build step and runs straight from the filesystem.

   Design pack: "Emerald" (jewel-clean SaaS — floating cards, light grouped
   sidebar, one brand colour used sparingly), reskinned to the client palette.
   ============================================================================= */

:root {
  --bg: #eef3f1;
  --panel: #ffffff;
  --panel-2: #eaf0ee;
  --border: #e2e8e5;
  --border-2: #d3ddd8;
  --ink: #232a27;
  --ink-2: #525a56;
  --ink-3: #5f665f;
  --accent: #009c88;          /* brand identity / expression */
  --accent-strong: #006e60;   /* action — AA on white and on soft fills */
  --accent-dk: #00564b;       /* hover */
  --accent-soft: #dcf0ec;
  --accent-ink: #ffffff;
  --sidebar: #ffffff;
  --sidebar-ink: #232a27;
  --sidebar-dim: #6d756f;
  --sidebar-hit: #eef3f1;
  --sidebar-active-bg: #dcf0ec;
  --sidebar-active-ink: #006e60;
  --blue: #0072a3;   --blue-soft: #e0f4fc;
  --green: #007a53;  --green-soft: #e0f6ee;
  --amber: #8a6100;  --amber-soft: #fff3d1;
  --danger: #b13a3a; --danger-soft: #fbe7e7;
  --pink: #ef6fbd;   --purple: #8a74d1;
  --shadow-card: 0 2px 10px -2px rgba(9, 63, 56, 0.13), 0 1px 2px rgba(9, 63, 56, 0.06);
  --shadow: 0 12px 34px rgba(9, 63, 56, 0.16);
  --radius-card: 16px;
}

[data-theme="dark"] {
  --bg: #101513;
  --panel: #1a201d;
  --panel-2: #232a26;
  --border: #2b332f;
  --border-2: #3a423d;
  --ink: #e9efec;
  --ink-2: #a7b1ac;
  --ink-3: #86928d;
  --accent: #17b6a2;
  --accent-strong: #17b6a2;
  --accent-dk: #3fcbb8;
  --accent-soft: #0f3a34;
  --accent-ink: #062824;
  --sidebar: #141a17;
  --sidebar-ink: #e9efec;
  --sidebar-dim: #86928d;
  --sidebar-hit: #232a26;
  --sidebar-active-bg: #0f3a34;
  --sidebar-active-ink: #4dd6c4;
  --blue: #3cc0f0;   --blue-soft: #0d3242;
  --green: #2ecd97;  --green-soft: #0e3527;
  --amber: #ffce53;  --amber-soft: #3c3113;
  --danger: #ef7d7d; --danger-soft: #3d1d1d;
  --pink: #f19ccf;   --purple: #a894e0;
  --shadow-card: 0 2px 10px -2px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

/* ── base ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  /* The application lists a licensed face first and falls back to DM Sans, the
     closest geometric grotesque available. The demo ships the fallback. */
  font-family: "TT Norms Pro", "DM Sans Variable", "Segoe UI", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }

:where(button, a, [tabindex], input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

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

/* ── reusable components (the application's own class vocabulary) ────────── */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8.5px 15px; border-radius: 10px;
  font-weight: 700; font-size: 13.5px; cursor: pointer;
  border: 1px solid var(--border-2); background: var(--panel); color: var(--ink);
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn-danger { color: var(--danger); border-color: var(--border-2); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 5.5px 11px; font-size: 12.5px; border-radius: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 2.5px 10px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.pill-plain::before { display: none; }
.st-open        { background: var(--panel-2);    color: var(--ink-2); }
.st-in_progress { background: var(--blue-soft);  color: var(--blue); }
.st-completed   { background: var(--green-soft); color: var(--green); }
.st-pending     { background: var(--amber-soft); color: var(--amber); }
/* Settled, but deliberately not celebratory — a step that didn't apply should
   read differently from one the team actually completed. */
.st-not_required{ background: var(--panel-2);    color: var(--ink-3); }
.st-overdue     { background: var(--danger-soft);color: var(--danger); }
.pill-brand     { background: var(--accent-soft); color: var(--accent-strong); }
.pill-gate      { background: var(--accent-strong); color: var(--accent-ink); }
.pill-soft      { background: var(--panel-2); color: var(--ink-3); }

.input {
  color: var(--ink); background: var(--panel);
  border: 1px solid var(--border-2); border-radius: 8px;
  padding: 7px 10px; width: 100%;
}
.input:focus {
  outline: none; border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
textarea.input { resize: vertical; min-height: 74px; }

/* Brand wordmarks sit on white plates in both themes, as they do in the app —
   there the marks are supplied artwork; here they are set as type. */
.brand-chip, .brand-plate {
  display: inline-flex; align-items: center; background: #fff;
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
  color: #3d4744; font-weight: 800; letter-spacing: -0.2px; white-space: nowrap;
}
.brand-chip  { border-radius: 7px;  padding: 3px 7px;  font-size: 10.5px; }
.brand-plate { border-radius: 12px; padding: 7px 13px; font-size: 13.5px; }
.brand-chip em, .brand-plate em { font-style: normal; font-weight: 500; opacity: .72; margin-left: 4px; }

/* ── layout primitives ──────────────────────────────────────────────────── */

.row  { display: flex; align-items: center; gap: 10px; }
.col  { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.mla  { margin-left: auto; }
.mta  { margin-top: auto; }
.tnum { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.muted  { color: var(--ink-3); }
.muted-2{ color: var(--ink-2); }
.t-bad  { color: var(--danger); }
.t-warn { color: var(--amber); }
.t-good { color: var(--green); }
.t-info { color: var(--blue); }
.t-brand{ color: var(--accent-strong); }
.fs-11 { font-size: 11px; }  .fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }  .fs-14 { font-size: 14px; }
.b7 { font-weight: 700; } .b8 { font-weight: 800; }
.hidden { display: none !important; }

/* ── application shell ──────────────────────────────────────────────────── */

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh; width: 248px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--border);
  background: var(--sidebar); color: var(--sidebar-ink);
  padding: 16px 14px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; }
.wordmark { font-size: 21px; font-weight: 800; letter-spacing: -0.6px; color: var(--accent-strong); }
.wordmark-sub {
  border-left: 1px solid var(--border); padding-left: 10px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: var(--ink-3);
}
.nav-group {
  padding: 14px 12px 6px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.1px; color: var(--ink-3);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9.5px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--sidebar-dim);
  cursor: pointer; transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--sidebar-hit); color: var(--sidebar-ink); }
.nav-item.is-active { background: var(--sidebar-active-bg); color: var(--sidebar-active-ink); font-weight: 700; }
.nav-item .ic { width: 19px; height: 19px; flex-shrink: 0; }
.nav-count {
  margin-left: auto; background: var(--accent-soft); color: var(--accent-strong);
  border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 700;
}
.sidebar-foot {
  margin-top: auto; border-top: 1px solid var(--border);
  padding: 10px 12px 0; font-size: 11.5px; color: var(--ink-3);
}
.sidebar-foot b { color: var(--ink-2); }

.shell { display: flex; min-width: 0; flex: 1; flex-direction: column; }

.topbar {
  position: sticky; top: 16px; z-index: 40;
  margin: 16px 22px 0;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--panel); padding: 11px 16px;
  box-shadow: var(--shadow-card);
}
.main { width: 100%; max-width: 1200px; margin: 0 auto; padding: 22px; }

/* min-width:0 lets the search field give way when the topbar runs out of
   room — a flex item's automatic minimum size would otherwise hold the
   whole row wider than the screen. */
.searchbox { position: relative; flex: 1; min-width: 0; max-width: 430px; }
.searchbox label {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel-2); padding: 7.5px 14px;
  font-size: 13.5px; color: var(--ink-3);
}
.searchbox input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); }
.searchbox input::placeholder { color: var(--ink-3); }

.dropdown {
  position: absolute; top: 100%; z-index: 50; margin-top: 6px;
  max-height: 70vh; overflow: auto;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow);
}
.dropdown-item {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.dropdown-item:last-child { border-bottom: 0; }
.dropdown-item:hover { background: var(--panel-2); }

.langswitch { display: flex; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.langswitch button {
  border: 0; background: transparent; cursor: pointer;
  padding: 5.5px 11px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3);
}
.langswitch button.is-on { background: var(--accent-strong); color: var(--accent-ink); }

.icon-btn {
  position: relative; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); padding: 8px; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--panel-2); }
.bell-dot {
  position: absolute; right: 3px; top: 3px;
  display: grid; place-items: center; min-width: 15px; padding: 0 4px;
  border-radius: 999px; background: #b13a3a; color: #fff;
  font-size: 9.5px; font-weight: 800;
}

.userchip {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); padding: 4px 11px 4px 4px;
}
.userchip:hover { background: var(--panel-2); }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.2px; }
.page-head .sub { margin-top: 2px; font-size: 13.5px; color: var(--ink-2); }

/* ── shared pieces ──────────────────────────────────────────────────────── */

.avatar {
  display: grid; place-items: center; flex-shrink: 0;
  border-radius: 999px; color: #fff; font-weight: 800;
}

.thumb {
  flex-shrink: 0; display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--border); border-radius: 10px;
  background: linear-gradient(150deg, #f5f8f7, #e3ebe8);
}
[data-theme="dark"] .thumb { background: linear-gradient(150deg, #232a26, #1a201d); }
/* A drawn silhouette stands in for the catalog photograph. In the product these
   are real pack shots synced from the accounting system; no real image, and no
   real product, appears anywhere in this demo. */
.thumb i { position: relative; display: block; border-radius: 2px 2px 3px 3px; }
.thumb i::before {
  content: ""; position: absolute; left: 50%; top: -22%;
  transform: translateX(-50%); width: 54%; height: 22%;
  border-radius: 2px 2px 0 0; background: inherit; filter: brightness(.78);
}

.ring { position: relative; display: grid; place-items: center; border-radius: 999px; flex-shrink: 0; }
.ring::after { content: ""; position: absolute; inset: 5px; border-radius: 999px; background: var(--panel); }
.ring b { position: relative; z-index: 1; font-size: 12px; font-weight: 700; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab {
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  background: transparent; padding: 6px 14px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-3);
}
.tab:hover { background: var(--panel-2); }
.tab.is-on { background: var(--accent-soft); color: var(--accent-strong); }
.tab .c { opacity: .65; margin-left: 5px; }

.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
.stat .l { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.stat .d { font-size: 11.5px; color: var(--ink-3); }

.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 14px; font-weight: 800; }
.card-head .end { margin-left: auto; font-size: 12px; color: var(--ink-3); }

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:hover { background: var(--panel-2); }
.list-row .title { display: block; font-size: 13.5px; font-weight: 700; }
.list-row .sub   { display: block; font-size: 12px; color: var(--ink-3); }

.empty { display: grid; place-items: center; padding: 64px 24px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* tables (Members, Settings) */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .c { text-align: center; }

.checkbox {
  display: grid; place-items: center; margin: 0 auto;
  width: 20px; height: 20px; border-radius: 6px; cursor: pointer;
  border: 1.5px solid var(--border-2); background: transparent; color: transparent;
}
.checkbox.is-on { border-color: var(--accent-strong); background: var(--accent-strong); color: var(--accent-ink); }

.seg { display: inline-flex; border: 1.5px solid var(--border-2); border-radius: 10px; padding: 2px; }
.seg button {
  border: 0; background: transparent; cursor: pointer; border-radius: 7px;
  padding: 2px 9px; font-size: 11px; font-weight: 700; color: var(--ink-3);
}
.seg button.is-on { background: var(--accent-strong); color: var(--accent-ink); }

/* ── version checklist ──────────────────────────────────────────────────── */

.gate {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--accent); border-radius: var(--radius-card);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 55%, var(--panel)), var(--panel));
  box-shadow: var(--shadow-card); padding: 14px 18px; margin-bottom: 14px;
}
.gate .t { font-size: 14px; font-weight: 800; color: var(--accent-strong); }
.gate .d { font-size: 12px; color: var(--ink-2); }

.sec-head {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 18px; border: 0; background: transparent; cursor: pointer;
  text-align: left; color: inherit;
}
.sec-head:hover { background: var(--panel-2); }
.sec-head .badge {
  display: grid; place-items: center; flex-shrink: 0;
  width: 30px; height: 30px; border-radius: 9px;
  font-size: 12.5px; font-weight: 800;
  background: var(--accent-soft); color: var(--accent-strong);
}
.sec-head h3 { flex: 1; font-size: 14.5px; font-weight: 800; }
.sec-head .frac { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sec-head .chev { width: 16px; height: 16px; color: var(--ink-3); transition: transform .15s; }
.sec-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.card.is-done { border-color: var(--green); }
.card.is-done .sec-head { background: var(--green-soft); }
.card.is-done .sec-head .badge { background: var(--green); color: #fff; }
.card.is-done .sec-head h3, .card.is-done .sec-head .frac { color: var(--green); }

.task-row {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 18px 10px 24px; border-top: 1px solid var(--border); cursor: pointer;
}
.task-row:hover { background: var(--panel-2); }
.task-row .name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--panel);
  padding: 2px 7px; font-size: 11px; color: var(--ink-2); max-width: 150px;
  white-space: nowrap;
}
/* A component document carries a date as well as a name, so it needs the room. */
.attach-chip.wide { max-width: 230px; }
.attach-chip:hover { background: var(--panel-2); }

.progress { height: 7px; border-radius: 999px; background: var(--panel-2); overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; }

.phases { display: flex; gap: 3px; }
.phases i { flex: 1; height: 7px; border-radius: 3px; background: var(--border-2); }
.phases i.ok  { background: var(--green); }
.phases i.now { background: var(--amber); }

/* ── certificates ───────────────────────────────────────────────────────── */

.cert-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.cert-row:last-child { border-bottom: 0; }
.certmark {
  display: grid; place-items: center; flex-shrink: 0;
  width: 44px; height: 30px; border-radius: 7px;
  border: 1px solid var(--border); background: #fff;
  font-size: 8px; font-weight: 800; letter-spacing: .2px; color: var(--ink-2);
  text-align: center; line-height: 1.1;
}
/* The real product shows the issuing authority's registered mark here. Official
   government emblems are not reproduced in a demo — the issuer is set as type. */
.certmark.bpom     { color: #0f5aa8; }
.certmark.kemenkes { color: #1a7a4a; }
.certmark.halal    { color: #0d7a5f; }

/* ── calendar ───────────────────────────────────────────────────────────── */

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow {
  padding: 6px 0; text-align: center; font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3);
}
.cal-day {
  display: flex; flex-direction: column; gap: 4px;
  min-height: 104px; padding: 6px;
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
}
.cal-grid.days > .cal-day:nth-child(7n) { border-right: 0; }
.cal-day.out { background: color-mix(in srgb, var(--panel-2) 40%, transparent); }
.cal-day .dn {
  align-self: flex-start; border-radius: 4px; padding: 0 4px;
  font-size: 11px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.cal-day.today .dn { background: var(--accent-strong); color: var(--accent-ink); }
.cal-ev {
  display: block; border-radius: 4px; padding: 1px 6px;
  font-size: 10px; font-weight: 700; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-filter {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--border-2); border-radius: 999px;
  background: var(--panel); padding: 6px 13px;
  font-size: 12px; font-weight: 700; color: var(--ink);
}
.cal-filter.is-off { background: var(--panel-2); color: var(--ink-3); opacity: .7; border-color: var(--border); }
.cal-filter .dot { width: 10px; height: 10px; border-radius: 999px; }

/* ── purchase orders ────────────────────────────────────────────────────── */

.po-grid {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) 48px 64px 118px 86px 86px 86px 56px;
  gap: 10px; align-items: center;
}
.doc-chip {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); padding: 9px 12px; font-size: 12.5px; font-weight: 600;
}
.doc-chip .tick {
  display: grid; place-items: center; flex-shrink: 0;
  width: 17px; height: 17px; border-radius: 999px;
  background: var(--green); color: #fff;
}
.doc-chip .tick.miss { background: var(--panel-2); color: var(--ink-3); border: 1px dashed var(--border-2); }

/* ── modal ──────────────────────────────────────────────────────────────── */

.modal-back {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px;
  background: rgba(15, 34, 30, .42); backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-height: 90vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-card); box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16.5px; font-weight: 800; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }

.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 200;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  border-radius: 12px; padding: 11px 18px;
  background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow); font-size: 13px; font-weight: 600;
  animation: toast-in .18s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ── mention autocomplete ───────────────────────────────────────────────── */

.mention-menu {
  position: absolute; z-index: 60; min-width: 210px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); box-shadow: var(--shadow); overflow: hidden;
}
.mention-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; cursor: pointer; text-align: left;
  padding: 8px 12px; font-size: 13px;
}
.mention-menu button:hover, .mention-menu button.is-on { background: var(--panel-2); }

/* ── responsive grids ───────────────────────────────────────────────────────
   These live in the stylesheet rather than in inline styles so the media
   queries below can actually reach them.
   ------------------------------------------------------------------------ */

.tiles   { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.two-col.wide-left { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.form-3  { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.doc-grid{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 18px; }

/* Wide tabular content keeps every column and scrolls sideways inside its own
   card, rather than squeezing columns until they are unreadable or pushing the
   whole page sideways. */
.scroll-x { overflow-x: auto; }
.scroll-x > .min-wide { min-width: 860px; }
.scroll-x > .min-cal  { min-width: 700px; }
.scroll-x > .table    { min-width: 640px; }

/* ── responsive ─────────────────────────────────────────────────────────── */

.drawer-btn { display: none; }

@media (max-width: 1023px) {
  .two-col, .two-col.wide-left { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-3, .doc-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .sidebar.is-open {
    display: flex; position: fixed; inset: 0 auto 0 0; z-index: 90;
    box-shadow: var(--shadow); height: 100vh;
  }
  .drawer-btn { display: grid; }
  .scrim { position: fixed; inset: 0; z-index: 80; background: rgba(15, 34, 30, .38); }
  .topbar { margin: 12px 14px 0; top: 12px; padding: 9px 12px; }
  .main { padding: 16px 14px; }
  .po-grid { grid-template-columns: 1fr; gap: 4px; }
  .cal-day { min-height: 78px; }
}

@media (max-width: 620px) {
  .page-head h1 { font-size: 19px; }
  .searchbox { max-width: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { gap: 8px; }
  /* The identity stays as an avatar; the name and role would push the row wide. */
  .userchip .who { display: none; }
  .userchip { padding: 4px; }
  .modal-body, .modal-head, .modal-foot { padding-inline: 16px; }
}
