/* ==========================================================================
   CedarPro — Application Kit
   Shared design system for the CedarPro project workspaces.
   Extends the marketing-site brand (teal core, Sora/Inter) with a full
   product UI layer: app shell, agent timeline, consoles, data tables,
   HITL sign-off gates, toasts, modals.
   Brand owner: CedarPro  ·  Kit v1
   ========================================================================== */

/* ---------- Design tokens (aligned with cedarpro.co.uk) ---------- */
:root {
  --teal: #0A8F86;
  --teal-deep: #123F3A;
  --teal-dark: #062F2D;
  --teal-darker: #04211F;
  --cta-green: #11D38A;
  --success: #18C98B;
  --aqua: #E6F5F2;
  --mint: #F2FBF8;
  --slate: #3E625F;
  --amber: #F4B740;
  --coral: #E85D4F;
  --rose: #F0697B;
  --violet: #7C6CF0;
  --sky: #3DA6E8;
  --border: #D8E7E3;
  --border-soft: #E7F1EE;
  --ink: #1F2933;
  --ink-soft: #2C3A44;
  --muted: #5A6472;
  --muted-2: #8593A0;
  --white: #FFFFFF;
  --panel: #FFFFFF;
  --canvas: #F6FAF9;

  --font-head: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --radius-lg: 22px;
  --shadow-xs: 0 1px 2px rgba(6, 47, 45, 0.06);
  --shadow-sm: 0 2px 8px rgba(6, 47, 45, 0.06);
  --shadow-md: 0 10px 30px rgba(6, 47, 45, 0.10);
  --shadow-lg: 0 24px 60px rgba(6, 47, 45, 0.16);
  --ring: 0 0 0 3px rgba(17, 211, 138, 0.35);

  --sidebar-w: 268px;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: var(--teal); text-decoration: none; transition: color .18s; }
a:hover { color: var(--teal-deep); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5 { font-family: var(--font-head); line-height: 1.18; letter-spacing: -0.015em; font-weight: 700; color: var(--ink); }
::selection { background: var(--teal); color: #fff; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c3ddd6; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a8ccc3; background-clip: content-box; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ----- Sidebar (dark trust panel) ----- */
.sidebar {
  background: linear-gradient(180deg, var(--teal-dark) 0%, var(--teal-darker) 100%);
  color: rgba(255,255,255,.82);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand {
  display: flex; align-items: center; gap: .65rem;
  padding: 1.15rem 1.25rem; font-family: var(--font-head); font-weight: 700;
  font-size: 1.12rem; color: #fff; letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand .brand-mark { width: 30px; height: 30px; flex: none; }
.sidebar-brand .brand-pro { color: var(--cta-green); }
.sidebar-product {
  padding: 1rem 1.25rem .35rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(255,255,255,.42);
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem 1rem; }
.sidebar-nav a, .side-link {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  padding: .6rem .75rem; border-radius: 10px; color: rgba(255,255,255,.74);
  font-size: .92rem; font-weight: 500; margin-bottom: 2px; transition: all .16s var(--ease); text-align: left;
}
.sidebar-nav a svg, .side-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.sidebar-nav a:hover, .side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active, .side-link.active {
  background: linear-gradient(90deg, rgba(17,211,138,.18), rgba(17,211,138,.04));
  color: #fff; box-shadow: inset 2px 0 0 var(--cta-green);
}
.sidebar-foot { padding: .9rem 1.1rem; border-top: 1px solid rgba(255,255,255,.07); font-size: .8rem; }
.sidebar-user { display: flex; align-items: center; gap: .6rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; color: var(--teal-dark);
  background: linear-gradient(135deg, var(--cta-green), var(--success)); font-size: .82rem;
}
.sidebar-user .meta { line-height: 1.25; }
.sidebar-user .meta strong { color: #fff; font-weight: 600; display: block; font-size: .85rem; }
.sidebar-user .meta span { color: rgba(255,255,255,.5); font-size: .76rem; }

/* ----- Main column ----- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--header-h); display: flex; align-items: center; gap: 1rem;
  padding: 0 1.6rem; background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 1.06rem; font-weight: 700; letter-spacing: -0.01em; }
.topbar .sub { color: var(--muted); font-size: .85rem; font-weight: 500; }
.topbar-spacer { flex: 1; }
.topbar .nav-toggle { display: none; }
.content { padding: 1.6rem; max-width: 1320px; width: 100%; margin: 0 auto; }
.content.narrow { max-width: 980px; }

.breadcrumbs { display: flex; gap: .5rem; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--teal); }
.breadcrumbs li { display: flex; align-items: center; gap: .5rem; }
.breadcrumbs li + li::before { content: "/"; color: var(--border); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
  transition: all .16s var(--ease); white-space: nowrap; border: 1px solid transparent; line-height: 1;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--cta-green); color: #04221a; box-shadow: 0 6px 16px rgba(17,211,138,.28); }
.btn-primary:hover { background: #0fbe7c; color: #04221a; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(17,211,138,.34); }
.btn-dark { background: var(--teal-dark); color: #fff; }
.btn-dark:hover { background: var(--teal-deep); color: #fff; transform: translateY(-1px); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--ink); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); background: var(--mint); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--aqua); color: var(--teal-deep); }
.btn-sm { padding: .42rem .8rem; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: .82rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none; }
.btn-block { width: 100%; }

/* ==========================================================================
   Cards & surfaces
   ========================================================================== */
.card {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-pad { padding: 1.35rem; }
.card-head {
  display: flex; align-items: center; gap: .75rem; padding: 1.05rem 1.35rem;
  border-bottom: 1px solid var(--border-soft);
}
.card-head h3 { font-size: 1rem; }
.card-head .sub { font-size: .82rem; color: var(--muted); font-weight: 500; }
.card-head .spacer { flex: 1; }
.card-body { padding: 1.35rem; }
.card-dark { background: linear-gradient(155deg, var(--teal-dark), var(--teal-darker)); color: #fff; border: none; }
.card-dark h1,.card-dark h2,.card-dark h3,.card-dark h4 { color: #fff; }
.card-glow { position: relative; }
.card-glow::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(17,211,138,.6), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1.4fr .9fr; gap: 1.1rem; align-items: start; }

/* ----- KPI / stat tiles ----- */
.kpi { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1.15rem 1.25rem; box-shadow: var(--shadow-xs); position: relative; overflow: hidden; }
.kpi .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--aqua); color: var(--teal); margin-bottom: .85rem; }
.kpi .ico svg { width: 20px; height: 20px; }
.kpi .val { font-family: var(--font-head); font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.kpi .lbl { color: var(--muted); font-size: .82rem; margin-top: .35rem; font-weight: 500; }
.kpi .delta { font-size: .76rem; font-weight: 600; margin-top: .5rem; display: inline-flex; align-items: center; gap: .25rem; }
.kpi .delta.up { color: var(--success); } .kpi .delta.down { color: var(--coral); }

/* ==========================================================================
   Badges & pills
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem;
  border-radius: 99px; font-size: .73rem; font-weight: 600; letter-spacing: .01em; line-height: 1.3;
  background: var(--aqua); color: var(--teal-deep); border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: rgba(24,201,139,.13); color: #0a8f63; }
.badge-amber { background: rgba(244,183,64,.16); color: #9a7212; }
.badge-coral { background: rgba(232,93,79,.13); color: #c0392b; }
.badge-violet{ background: rgba(124,108,240,.14); color: #5a4bd1; }
.badge-sky   { background: rgba(61,166,232,.14); color: #1f7fc0; }
.badge-slate { background: #eef3f2; color: var(--slate); }
.badge-dark  { background: rgba(255,255,255,.12); color: #fff; }
.badge-pulse .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{ box-shadow: 0 0 0 0 rgba(17,211,138,.5);} 50%{ box-shadow: 0 0 0 5px rgba(17,211,138,0);} }

/* ==========================================================================
   Agent timeline / orchestration console
   ========================================================================== */
.agent-flow { display: flex; flex-direction: column; gap: 0; }
.agent-step { display: grid; grid-template-columns: 40px 1fr; gap: .9rem; position: relative; padding-bottom: 1.1rem; }
.agent-step:last-child { padding-bottom: 0; }
.agent-step .rail { display: flex; flex-direction: column; align-items: center; }
.agent-step .node {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--border); color: var(--muted-2); transition: all .3s var(--ease); z-index: 1;
}
.agent-step .node svg { width: 19px; height: 19px; }
.agent-step .line { width: 2px; flex: 1; background: var(--border); margin-top: 4px; transition: background .4s; }
.agent-step:last-child .line { display: none; }
.agent-step .body { padding-top: .35rem; min-width: 0; }
.agent-step .name { font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: .55rem; }
.agent-step .role { color: var(--muted); font-size: .82rem; margin-top: .1rem; }
.agent-step .out {
  margin-top: .7rem; background: var(--mint); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: .85rem 1rem; font-size: .88rem; color: var(--ink-soft); white-space: pre-wrap; line-height: 1.55;
  max-height: 0; opacity: 0; overflow: hidden; transition: all .35s var(--ease); padding-block: 0; border-width: 0;
}
.agent-step.show-out .out { max-height: 1600px; opacity: 1; padding-block: .85rem; border-width: 1px; }
/* states */
.agent-step[data-state="active"] .node { border-color: var(--cta-green); color: var(--cta-green); box-shadow: var(--ring); background: #fff; }
.agent-step[data-state="active"] .node svg { animation: spin 1s linear infinite; }
.agent-step[data-state="done"] .node { background: var(--cta-green); border-color: var(--cta-green); color: #04221a; }
.agent-step[data-state="done"] .line { background: var(--cta-green); }
.agent-step[data-state="error"] .node { background: var(--coral); border-color: var(--coral); color: #fff; }
.agent-step[data-state="blocked"] .node { background: var(--amber); border-color: var(--amber); color: #4a3608; }
@keyframes spin { to { transform: rotate(360deg); } }

/* mini status text */
.agent-status { font-size: .76rem; font-weight: 600; color: var(--muted-2); }
.agent-step[data-state="active"] .agent-status { color: var(--teal); }
.agent-step[data-state="done"] .agent-status { color: var(--success); }

/* ==========================================================================
   Console / log stream
   ========================================================================== */
.console {
  background: var(--teal-darker); border-radius: var(--radius-sm); color: #cfeee6;
  font-family: var(--font-mono); font-size: .8rem; line-height: 1.7; padding: 1rem 1.1rem;
  max-height: 320px; overflow-y: auto;
}
.console .ln { display: flex; gap: .7rem; }
.console .ts { color: #4f8f86; flex: none; }
.console .tag { color: var(--cta-green); flex: none; font-weight: 600; }
.console .tag.warn { color: var(--amber); } .console .tag.err { color: var(--rose); } .console .tag.info { color: var(--sky); }
.console .msg { color: #bfe6dc; }

/* ==========================================================================
   Forms
   ========================================================================== */
.field { margin-bottom: 1rem; }
.field > label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .4rem; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: .35rem; }
.input, .textarea, .select {
  width: 100%; padding: .62rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .16s, box-shadow .16s; font-size: .92rem;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--cta-green); box-shadow: var(--ring); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235A6472' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2rem; }
.input-group { display: flex; gap: .6rem; }
.input-group .input { flex: 1; }

/* segmented control */
.seg { display: inline-flex; background: #eef3f2; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { padding: .4rem .85rem; border-radius: 8px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.seg button.active { background: #fff; color: var(--teal-deep); box-shadow: var(--shadow-xs); }

/* file dropzone */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 1.6rem; text-align: center;
  background: var(--mint); transition: all .18s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--cta-green); background: #eafaf3; }
.dropzone .ico { width: 44px; height: 44px; margin: 0 auto .6rem; border-radius: 12px; background: #fff; display: grid; place-items: center; color: var(--teal); box-shadow: var(--shadow-xs); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; background: #fff; }
table.data th {
  text-align: left; padding: .7rem 1rem; font-size: .73rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); background: var(--mint); border-bottom: 1px solid var(--border-soft); white-space: nowrap;
}
table.data td { padding: .8rem 1rem; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--mint); }
table.data .mono { font-family: var(--font-mono); font-size: .82rem; color: var(--slate); }

/* progress bar */
.bar { height: 8px; border-radius: 99px; background: #e7f1ee; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--teal), var(--cta-green)); transition: width .8s var(--ease); }
.bar.amber > span { background: linear-gradient(90deg, var(--amber), #f7c95e); }
.bar.coral > span { background: linear-gradient(90deg, var(--coral), var(--rose)); }

/* meter ring */
.ring { --p: 0; --c: var(--cta-green); width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p)*1%), #e7f1ee 0); }
.ring::before { content: ""; position: absolute; width: 74px; height: 74px; border-radius: 50%; background: #fff; }
.ring .ring-val { position: relative; font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; }
.ring-wrap { position: relative; display: inline-grid; place-items: center; }

/* ==========================================================================
   HITL sign-off gate
   ========================================================================== */
.hitl {
  border: 1px solid rgba(244,183,64,.4); background: linear-gradient(180deg, #fffaf0, #fff);
  border-radius: var(--radius); padding: 1.35rem; position: relative;
}
.hitl::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 4px 0 0 4px; background: var(--amber); }
.hitl .hitl-head { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-family: var(--font-head); color: #8a6410; margin-bottom: .5rem; }
.hitl.locked { border-color: rgba(232,93,79,.4); background: linear-gradient(180deg, #fff5f3, #fff); }
.hitl.locked::before { background: var(--coral); }
.hitl.locked .hitl-head { color: #b23a2c; }
.hitl.cleared { border-color: rgba(24,201,139,.4); background: linear-gradient(180deg, #f0fbf6, #fff); }
.hitl.cleared::before { background: var(--success); }
.hitl.cleared .hitl-head { color: #0a8f63; }
.signoff { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.sig-chip { font-family: var(--font-mono); font-size: .78rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .45rem .7rem; color: var(--slate); }

/* ==========================================================================
   Toasts & modal
   ========================================================================== */
.toasts { position: fixed; bottom: 1.4rem; right: 1.4rem; z-index: 200; display: flex; flex-direction: column; gap: .6rem; max-width: 360px; }
.toast {
  background: var(--teal-dark); color: #fff; border-radius: var(--radius-sm); padding: .8rem 1rem;
  box-shadow: var(--shadow-lg); display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem;
  animation: toastIn .35s var(--ease-out); border-left: 3px solid var(--cta-green);
}
.toast.warn { border-left-color: var(--amber); } .toast.err { border-left-color: var(--coral); }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(6,33,31,.55); backdrop-filter: blur(4px); z-index: 150; display: grid; place-items: center; padding: 1.5rem; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 88vh; overflow: auto; animation: pop .3s var(--ease-out); }
@keyframes pop { from { transform: scale(.96) translateY(8px); opacity: 0; } }
.modal-head { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; gap: .75rem; }
.modal-body { padding: 1.5rem; }
.modal-foot { padding: 1.1rem 1.5rem; border-top: 1px solid var(--border-soft); display: flex; gap: .7rem; justify-content: flex-end; }

/* ==========================================================================
   Utilities
   ========================================================================== */
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .wrap { flex-wrap: wrap; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .xs { font-size: .75rem; }
.mono { font-family: var(--font-mono); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-top: 0; margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; } .strong { font-weight: 600; } .nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--border-soft); margin: 1.25rem 0; }
.hidden { display: none !important; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; font-size: .73rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--cta-green); border-radius: 2px; }
.pillrow { display: flex; gap: .5rem; flex-wrap: wrap; }

/* skeleton shimmer */
.skel { background: linear-gradient(90deg, #eef3f2 25%, #f7fbfa 50%, #eef3f2 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* typing caret */
.caret::after { content: "▍"; color: var(--cta-green); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* reveal on load */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: 280px; z-index: 120; transform: translateX(-100%);
    transition: transform .3s var(--ease); box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(6,33,31,.5); z-index: 110; }
  .topbar .nav-toggle { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); }
  .content { padding: 1.1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar { padding: 0 1rem; }
  .topbar h1 { font-size: .98rem; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   KIT v2 — product density layer
   Per-sector signature accents, metric cards with sparklines, activity feeds,
   timelines, heatmaps, quadrants and section panels. Added for the de-template
   redesign so each workspace reads like a distinct, real product.
   ========================================================================== */

/* ----- Per-sector accent themes (brand teal stays the core; accent = signature) ----- */
:root { --accent: #0A8F86; --accent-2: #11D38A; --accent-ink: #062F2D; --accent-soft: #E6F5F2; }
[data-theme="govt"]   { --accent: #0E7C8B; --accent-2: #19B7C8; --accent-ink: #06343B; --accent-soft: #E2F4F6; }
[data-theme="edu"]    { --accent: #2C7BE5; --accent-2: #5AA0F2; --accent-ink: #11315E; --accent-soft: #E8F1FE; }
[data-theme="enterprise"] { --accent: #5A57D6; --accent-2: #8A7BF0; --accent-ink: #221F5C; --accent-soft: #ECEBFB; }
[data-theme="sme"]    { --accent: #0FA678; --accent-2: #18C98B; --accent-ink: #08382A; --accent-soft: #E4F7EF; }
[data-theme="risk"]   { --accent: #C0563E; --accent-2: #E8794F; --accent-ink: #4A1E14; --accent-soft: #FBEDE8; }

/* accent-aware shells: active nav + primary stay on-brand, accents tint highlights */
.app[data-theme] .sidebar-nav a.active, .app[data-theme] .side-link.active { box-shadow: inset 2px 0 0 var(--accent-2); }
.accent-ico { background: var(--accent-soft) !important; color: var(--accent) !important; }
.accent-text { color: var(--accent); }
.accent-bar > span { background: linear-gradient(90deg, var(--accent), var(--accent-2)) !important; }

/* ----- Metric card with sparkline ----- */
.metric { background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1.05rem 1.15rem 0.6rem; box-shadow: var(--shadow-xs); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .15rem; }
.metric .m-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.metric .m-lbl { font-size: .76rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.metric .m-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.metric .m-ico svg { width: 16px; height: 16px; }
.metric .m-val { font-family: var(--font-head); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink); }
.metric .m-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .15rem; }
.metric .m-delta { font-size: .74rem; font-weight: 700; display: inline-flex; align-items: center; gap: .2rem; }
.metric .m-delta.up { color: var(--success); } .metric .m-delta.down { color: var(--coral); } .metric .m-delta.flat { color: var(--muted-2); }
.metric .m-spark { margin-top: .35rem; height: 34px; }
.metric .m-note { font-size: .72rem; color: var(--muted-2); }

/* ----- Section panel header (lighter than card-head) ----- */
.panel-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.panel-head h3 { font-size: 1rem; }
.panel-head .sub { font-size: .8rem; color: var(--muted); }
.panel-head .spacer { flex: 1; }

/* ----- Activity feed ----- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 26px 1fr auto; gap: .7rem; padding: .55rem 0; position: relative; }
.feed-item:not(:last-child)::before { content: ""; position: absolute; left: 12px; top: 28px; bottom: -6px; width: 1.5px; background: var(--border-soft); }
.feed-dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); z-index: 1; }
.feed-dot svg { width: 14px; height: 14px; }
.feed-dot.green { background: rgba(24,201,139,.14); color: #0a8f63; } .feed-dot.amber { background: rgba(244,183,64,.18); color: #9a7212; } .feed-dot.coral { background: rgba(232,93,79,.14); color: #c0392b; }
.feed-body { min-width: 0; } .feed-body .t { font-size: .86rem; line-height: 1.4; } .feed-body .m { font-size: .76rem; color: var(--muted); }
.feed-time { font-size: .72rem; color: var(--muted-2); white-space: nowrap; font-family: var(--font-mono); }

/* ----- Heatmap grid ----- */
.heat { display: grid; gap: 3px; }
.heat-cell { aspect-ratio: 1; border-radius: 4px; background: var(--accent-soft); position: relative; }
.heat-cell[data-l="0"] { background: #eef3f2; } .heat-cell[data-l="1"] { background: #cfeee4; }
.heat-cell[data-l="2"] { background: #8fdcc4; } .heat-cell[data-l="3"] { background: #36c699; } .heat-cell[data-l="4"] { background: #0a8f63; }

/* ----- Quadrant / scatter ----- */
.quad { position: relative; aspect-ratio: 16/10; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background:
  linear-gradient(0deg, transparent 49.6%, var(--border-soft) 49.6%, var(--border-soft) 50.4%, transparent 50.4%),
  linear-gradient(90deg, transparent 49.6%, var(--border-soft) 49.6%, var(--border-soft) 50.4%, transparent 50.4%),
  var(--mint); }
.quad .pt { position: absolute; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%,50%); box-shadow: 0 0 0 3px rgba(255,255,255,.7); cursor: pointer; }
.quad .qlbl { position: absolute; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }

/* ----- Legend ----- */
.legend { display: flex; flex-wrap: wrap; gap: .8rem; }
.legend .li { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; }

/* ----- Mini stat row (inside panels) ----- */
.ministat { display: flex; align-items: baseline; gap: .4rem; }
.ministat .v { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.ministat .l { font-size: .76rem; color: var(--muted); }

/* ----- Dense list rows ----- */
.lrow { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border-soft); }
.lrow:last-child { border-bottom: none; }
.lrow .lmain { flex: 1; min-width: 0; } .lrow .lmain .lt { font-size: .88rem; font-weight: 500; } .lrow .lmain .lm { font-size: .76rem; color: var(--muted); }

/* dashboard masonry-ish grid that avoids the rigid 4-col sameness */
.dash { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.1rem; align-items: start; }
.dash > .col-3 { grid-column: span 3; } .dash > .col-4 { grid-column: span 4; } .dash > .col-5 { grid-column: span 5; }
.dash > .col-6 { grid-column: span 6; } .dash > .col-7 { grid-column: span 7; } .dash > .col-8 { grid-column: span 8; } .dash > .col-12 { grid-column: span 12; }
@media (max-width: 1100px) { .dash > [class*="col-"] { grid-column: span 6; } }
@media (max-width: 720px) { .dash > [class*="col-"] { grid-column: span 12; } }

/* Distinct per-product accents (one signature per workspace) */
[data-theme="procurement"]   { --accent:#0E7C8B; --accent-2:#19B7C8; --accent-ink:#06343B; --accent-soft:#E2F4F6; }
[data-theme="planning"]      { --accent:#2F8F6B; --accent-2:#46B889; --accent-ink:#0E3A2A; --accent-soft:#E4F5EE; }
[data-theme="student"]       { --accent:#2C7BE5; --accent-2:#5AA0F2; --accent-ink:#11315E; --accent-soft:#E8F1FE; }
[data-theme="curriculum"]    { --accent:#7C5AE0; --accent-2:#9E84F0; --accent-ink:#2C1E5C; --accent-soft:#EFEBFB; }
[data-theme="assurance"]     { --accent:#C0563E; --accent-2:#E8794F; --accent-ink:#4A1E14; --accent-soft:#FBEDE8; }
[data-theme="transformation"]{ --accent:#5A57D6; --accent-2:#8A7BF0; --accent-ink:#221F5C; --accent-soft:#ECEBFB; }
[data-theme="legal"]         { --accent:#3551B5; --accent-2:#5E79D9; --accent-ink:#152552; --accent-soft:#E9EDF9; }
[data-theme="accounting"]    { --accent:#0FA678; --accent-2:#18C98B; --accent-ink:#08382A; --accent-soft:#E4F7EF; }

/* UX audit contrast fixes */
.eyebrow{color:#0a7d72}
.badge-green{color:#07724e}
