/* ═══════════════════════════════════════════════════════════════════
   MYTHOS DESIGN LANGUAGE — Components (extended)
   Every remaining surface found across the live modules — Artemis, Atlas,
   Plutus, Demeter and the Apex hub — rebuilt ONCE in canonical tokens.
   Each variant here replaces a per-app dialect (Atlas --ink/--line cream,
   Artemis ad-hoc greys, Plutus bespoke modal) with the shared system.
   No !important: canonical layer.
   ═══════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════
   TABLES — the six archetypes
   ════════════════════════════════════════════════════════════════════ */

/* shared head-row helpers reused by every table archetype */
.m-table td.mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-secondary); }
.m-table .sub { font-size: 10.5px; color: var(--text-tertiary); font-weight: var(--fw-regular); }
.m-table tfoot td { padding: 10px 12px; border-top: 0.5px solid var(--border-medium); font-weight: var(--fw-semibold); background: var(--bg-tinted); }
.m-table tfoot td.num { font-variant-numeric: tabular-nums; }

/* ── 2 · drill / expandable ──────────────────────────────────────── */
.m-table tr.row-parent { cursor: pointer; }
.row-toggle {
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  display: inline-grid; place-items: center; color: var(--text-tertiary);
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.row-toggle svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-table tr.is-open .row-toggle { transform: rotate(90deg); color: var(--brand-orange); }
.m-table tr.is-open > td { background: var(--bg-tinted); }
.drill-row > td { padding: 0; border-bottom: 0.5px solid var(--border-light); }
.drill-sub { padding: 14px 16px; background: var(--bg-page); animation: drillIn 0.22s var(--ease-out); }
@keyframes drillIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.drill-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.drill-kpi {
  background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.drill-kpi .lab { font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-tertiary); }
.drill-kpi .val { font-size: 17px; font-weight: var(--fw-bold); letter-spacing: -0.4px; font-variant-numeric: tabular-nums; margin-top: 4px; }

/* mini horizontal bar used in cells (mix / share) */
.cell-bar { position: relative; display: inline-block; vertical-align: middle; height: 5px; border-radius: 3px; background: var(--track-bg); width: 72px; overflow: hidden; }
.cell-bar > span { position: absolute; inset: 0; width: var(--v, 0%); border-radius: 3px; background: var(--accent); }
.cell-bar.is-parts > span { background: var(--class-parts); }
.cell-bar.is-garments > span { background: var(--class-garments); }
.cell-bar.is-cons > span { background: var(--class-consummables); }

/* ── 3 · pivot (row + column matrix) ─────────────────────────────── */
.m-table--pivot th, .m-table--pivot td { text-align: right; }
.m-table--pivot th:first-child, .m-table--pivot td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-card); z-index: 1; }
.m-table--pivot thead th:first-child { background: var(--bg-tinted); }
.m-table--pivot .col-group { border-left: 0.5px solid var(--border-light); }
.m-table--pivot tbody tr:hover td:first-child { background: var(--bg-tinted); }
.heat-cell { font-variant-numeric: tabular-nums; }
.heat-0 { background: rgba(0,122,255,0.04); }
.heat-1 { background: rgba(0,122,255,0.09); }
.heat-2 { background: rgba(0,122,255,0.16); }
.heat-3 { background: rgba(0,122,255,0.24); color: var(--accent-dark); font-weight: var(--fw-semibold); }

/* ── 4 · permission matrix (RBAC) ────────────────────────────────── */
.matrix-wrap { border: 0.5px solid var(--border-light); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-card); box-shadow: var(--shadow-card); }
table.m-matrix { width: 100%; border-collapse: collapse; font-size: 12px; }
.m-matrix thead th {
  font-size: 10px; font-weight: var(--fw-semibold); letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--text-secondary); padding: 9px 8px; text-align: center; border-bottom: 0.5px solid var(--border-medium);
  background: var(--bg-tinted); white-space: nowrap;
}
.m-matrix thead th:first-child { text-align: left; padding-left: 16px; width: 38%; }
.m-matrix .cat-row td {
  font-size: 10px; font-weight: var(--fw-bold); letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-tertiary); background: var(--bg-page); padding: 7px 16px; border-bottom: 0.5px solid var(--border-light);
}
.m-matrix tbody td { padding: 8px; text-align: center; border-bottom: 0.5px solid var(--border-light); }
.m-matrix tbody td:first-child { text-align: left; padding-left: 28px; font-weight: var(--fw-medium); color: var(--text-primary); }
.m-matrix tbody tr:hover td { background: var(--bg-tinted); }
.m-matrix tbody tr:last-child td { border-bottom: none; }
.tick { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; }
.tick.on { background: var(--success-bg); color: var(--success-dark); }
.tick.off { background: var(--bg-tinted); color: var(--text-tertiary); border: 0.5px solid var(--border-light); }
.tick.inherit { background: var(--accent-bg); color: var(--accent-dark); }
.tick svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tick.inherit svg { stroke-width: 2; }

/* ── 5 · audit / diff ────────────────────────────────────────────── */
.m-table--audit { table-layout: fixed; }
.m-table--audit td { vertical-align: top; }
.audit-actor { display: inline-flex; align-items: center; gap: 7px; }
.audit-avatar { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg,#4A4A4F,#1A1A1A); color: #fff; font: var(--fw-bold) 9px/1 var(--font-sans); display: grid; place-items: center; }
.diff { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; }
.diff .from { color: var(--error-dark); background: var(--error-bg); padding: 1px 6px; border-radius: 4px; text-decoration: line-through; }
.diff .to { color: var(--success-dark); background: var(--success-bg); padding: 1px 6px; border-radius: 4px; }
.diff .arr { color: var(--text-tertiary); }

/* ── 6 · compact log ─────────────────────────────────────────────── */
table.m-table--log { font-size: 11.5px; }
.m-table--log td { padding: 7px 12px; }
.m-table--log .mono { font-family: var(--font-mono); }
.m-table--log .lvl { font-size: 9.5px; font-weight: var(--fw-bold); letter-spacing: 0.4px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; }
.m-table--log .lvl.info { background: var(--accent-bg); color: var(--accent-dark); }
.m-table--log .lvl.ok { background: var(--success-bg); color: var(--success-dark); }
.m-table--log .lvl.warn { background: var(--warning-bg); color: var(--warning-dark); }
.m-table--log .lvl.err { background: var(--error-bg); color: var(--error-dark); }

/* ── catalog table behaviours (resize / toggle / sticky) ─────────── */
.cat-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 0.5px solid var(--border-light); background: var(--bg-card); }
.cat-toolbar .spacer { flex: 1; }
.col-handle { display: inline-block; width: 5px; cursor: col-resize; }
.m-table--cat thead th { position: sticky; top: 0; z-index: 2; }
.m-table--cat thead th { position: relative; }
.m-table--cat .resize-grip { position: absolute; right: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 2px; background: var(--border-medium); opacity: 0; cursor: col-resize; transition: opacity var(--dur-fast); }
.m-table--cat thead th:hover .resize-grip { opacity: 1; }
.colmenu {
  width: 200px; padding: 6px; background: var(--bg-card); border: 0.5px solid var(--border-medium);
  border-radius: var(--radius-md); box-shadow: var(--shadow-popover);
}
.colmenu .row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; }
.colmenu .row:hover { background: var(--bg-tinted); }
.colmenu .row .gr { color: var(--text-tertiary); display: inline-flex; }

/* ════════════════════════════════════════════════════════════════════
   CARDS — the full set
   ════════════════════════════════════════════════════════════════════ */
.card-grid { display: grid; gap: 14px; }
.card-grid.c2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.c4 { grid-template-columns: repeat(4, 1fr); }

/* compact stat / metric card (smaller than KPI) */
.stat-card { background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 13px 15px; }
.stat-card .lab { font-size: 10.5px; font-weight: var(--fw-semibold); letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-secondary); }
.stat-card .val { font-size: 21px; font-weight: var(--fw-bold); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; margin-top: 5px; }
.stat-card .foot { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* momentum card — who's rising / falling */
.mom-card { background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 14px 16px; }
.mom-card .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mom-card .hd .t { font-size: 12.5px; font-weight: var(--fw-semibold); }
.mom-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 0.5px solid var(--border-light); }
.mom-row:last-child { border-bottom: none; }
.mom-row .nm { font-size: 12.5px; font-weight: var(--fw-medium); flex: 1; }
.mom-spark { width: 56px; height: 18px; flex-shrink: 0; }
.mom-spark path { fill: none; stroke-width: 1.6; }
.mom-spark.up path { stroke: var(--success); }
.mom-spark.down path { stroke: var(--error); }

/* connection / source-status card */
.conn-card { background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; }
.conn-card .gl { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-bg); color: var(--accent); }
.conn-card .gl svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.conn-card.is-warn .gl { background: var(--warning-bg); color: var(--warning-dark); }
.conn-card.is-err .gl { background: var(--error-bg); color: var(--error-dark); }
.conn-card .bd { flex: 1; min-width: 0; }
.conn-card .nm { font-size: 13px; font-weight: var(--fw-semibold); }
.conn-card .mt { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; font-family: var(--font-mono); }

/* role card (RBAC) */
.role-card { background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; transition: border-color var(--dur-fast) var(--ease-out); }
.role-card:hover { border-color: var(--border-medium); }
.role-card .hd { display: flex; align-items: center; gap: 9px; }
.role-card .swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.role-card .nm { font-size: 14px; font-weight: var(--fw-semibold); letter-spacing: -0.2px; }
.role-card .tag { margin-left: auto; font-size: 9.5px; font-weight: var(--fw-bold); letter-spacing: 0.4px; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; background: var(--bg-tinted); color: var(--text-secondary); border: 0.5px solid var(--border-light); }
.role-card .tag.system { background: var(--accent-bg); color: var(--accent-dark); border-color: transparent; }
.role-card .desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.role-card .ft { display: flex; gap: 18px; padding-top: 11px; border-top: 0.5px solid var(--border-light); }
.role-card .ft .st { display: flex; flex-direction: column; gap: 2px; }
.role-card .ft .k { font-size: 18px; font-weight: var(--fw-bold); letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.role-card .ft .l { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.4px; }

/* approval card (Plutus) */
.approval-card { background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.approval-card .lead { flex: 1; min-width: 0; }
.approval-card .nm { font-size: 13px; font-weight: var(--fw-semibold); }
.approval-card .mt { font-size: 11.5px; color: var(--text-secondary); margin-top: 3px; }
.approval-card .amt { font-size: 18px; font-weight: var(--fw-bold); letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.approval-card .acts { display: flex; gap: 6px; }
.approval-card.is-flagged { border-left: 2px solid var(--brand-orange); }

/* ── applied card iterations: C1 conn breathing dot · R1 role meter · A2 approval confirm ── */
.conn-card .pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--success); position: relative; flex-shrink: 0; }
.conn-card .pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: connPulse 2.4s var(--ease-out) infinite; }
.conn-card.is-warn .pulse { background: var(--warning); }
.conn-card.is-err .pulse { background: var(--error); }
.conn-card.is-err .pulse::after { animation: none; }
@keyframes connPulse { 0% { transform: scale(1); opacity: .5; } 70% { transform: scale(2.4); opacity: 0; } 100% { opacity: 0; } }

.role-card .meter .lab { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px; }
.role-card .meter .lab b { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.role-card .meter .track { height: 6px; border-radius: 3px; background: var(--track-bg); overflow: hidden; }
.role-card .meter .track > span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width 0.9s var(--ease-out); }
.role-card .ppl { display: flex; align-items: center; gap: 10px; }
.role-card .ppl .mt { font-size: 11.5px; color: var(--text-tertiary); }
.role-card .stack { display: flex; }
.role-card .stack .av { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--bg-card); margin-left: -8px; display: grid; place-items: center; font-size: 10px; font-weight: var(--fw-bold); color: #fff; }
.role-card .stack .av:first-child { margin-left: 0; }
.role-card.go .stack .av { animation: roleAv 0.42s var(--ease-spring) both; }
.role-card.go .stack .av:nth-child(1){animation-delay:.05s}.role-card.go .stack .av:nth-child(2){animation-delay:.11s}.role-card.go .stack .av:nth-child(3){animation-delay:.17s}.role-card.go .stack .av:nth-child(4){animation-delay:.23s}
@keyframes roleAv { from { transform: translateX(-6px) scale(.7); } to { transform: none; } }

.approval-card .confirm { display: none; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.approval-card .confirm .ck { width: 28px; height: 28px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.approval-card .confirm .ck svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 28; stroke-dashoffset: 28; }
.approval-card .confirm .info { flex: 1; min-width: 0; }
.approval-card .confirm .t { font-size: 13px; font-weight: var(--fw-bold); color: var(--success-dark); }
.approval-card .confirm .s { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; font-family: var(--font-mono); }
.approval-card .confirm .amt2 { font-size: 18px; font-weight: var(--fw-bold); letter-spacing: -0.4px; font-variant-numeric: tabular-nums; color: var(--success-dark); }
.approval-card.done { border-left-color: var(--success); }
.approval-card.done .lead, .approval-card.done > .amt, .approval-card.done .acts { display: none; }
.approval-card.done .confirm { display: flex; animation: apprRise 0.34s var(--ease-out) both; }
.approval-card.done .confirm .ck svg { animation: apprCheck 0.4s var(--ease-out) 0.12s forwards; }
.approval-card.done.no { border-left-color: var(--error); }
.approval-card.done.no .confirm .ck { background: var(--error); }
.approval-card.done.no .confirm .t, .approval-card.done.no .confirm .amt2 { color: var(--error-dark); }
@keyframes apprRise { from { transform: translateY(6px); } to { transform: none; } }
@keyframes apprCheck { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .conn-card .pulse::after, .role-card.go .stack .av, .approval-card.done .confirm, .approval-card.done .confirm .ck svg { animation: none !important; }
}

/* calendar / month card */
.cal-card { background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 12px 14px; }
.cal-card.is-current { background: var(--bg-current); border-color: rgba(232,97,26,0.30); }
.cal-card .mo { font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: 0.3px; text-transform: uppercase; color: var(--text-secondary); display: flex; align-items: center; justify-content: space-between; }
.cal-card.is-current .mo { color: var(--brand-orange-hover); }
.cal-card .v { font-size: 19px; font-weight: var(--fw-bold); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; margin-top: 6px; }
.cal-card .track { height: 4px; border-radius: 2px; background: var(--track-bg); margin-top: 8px; overflow: hidden; position: relative; }
.cal-card .track > span { position: absolute; inset: 0; width: var(--v,0%); background: var(--success); border-radius: 2px; }
.cal-card .track.under > span { background: var(--warning); }

/* class / segment card */
.class-card { background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 13px 15px; cursor: pointer; transition: border-color var(--dur-fast); }
.class-card:hover { border-color: var(--border-medium); }
.class-card .hd { display: flex; align-items: center; gap: 7px; }
.class-card .dot { width: 8px; height: 8px; border-radius: 50%; }
.class-card .nm { font-size: 12px; font-weight: var(--fw-semibold); }
.class-card .v { font-size: 22px; font-weight: var(--fw-bold); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; margin-top: 8px; }
.class-card .sub { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }

/* hub app-launcher card */
.app-card {
  background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 20px; display: flex; flex-direction: column; gap: 14px;
  text-decoration: none; color: inherit; transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.app-card:hover { border-color: var(--border-medium); transform: translateY(-2px); box-shadow: var(--shadow-elev); }
.app-card .hd { display: flex; align-items: center; justify-content: space-between; }
.app-card .wm { font-family: var(--font-wordmark); font-weight: 800; font-size: 24px; letter-spacing: -0.03em; }
.app-card .wm .dot { color: var(--brand-orange); }
.app-card .arr { color: var(--text-tertiary); transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.app-card:hover .arr { color: var(--accent); transform: translate(2px,-2px); }
.app-card .arr svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-card .role { font-size: 12px; color: var(--text-secondary); }
.app-card .desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; flex: 1; }
.app-card .mt { font-size: 10.5px; font-family: var(--font-mono); color: var(--text-tertiary); display: flex; align-items: center; gap: 6px; }
.app-card.is-soon { opacity: 0.6; }
.app-card.is-soon .wm .dot { color: var(--text-tertiary); }
.app-card .soon { font-size: 9.5px; font-weight: var(--fw-bold); letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-tertiary); padding: 2px 7px; border-radius: 5px; background: var(--bg-tinted); border: 0.5px solid var(--border-light); }

/* settings section card */
.section-card { background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 20px 22px; }
.section-card .hd { margin-bottom: 16px; }
.section-card .t { font-size: 15px; font-weight: var(--fw-semibold); letter-spacing: -0.2px; display: flex; align-items: center; gap: 9px; }
.section-card .d { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }

/* ════════════════════════════════════════════════════════════════════
   FORMS — full set
   ════════════════════════════════════════════════════════════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.m-field { display: flex; flex-direction: column; gap: 6px; }
.m-field > .field-label { margin-bottom: 0; }
.m-field__msg { font-size: 11px; color: var(--text-tertiary); }
.m-field.is-error .m-input, .m-field.is-error .m-select { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-bg); }
.m-field.is-error .m-field__msg { color: var(--error-dark); }
.m-field.is-error .m-field__msg::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -2px;
  background: var(--error); border-radius: 50%; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M11 7h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M11 7h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E") center/contain no-repeat; }
.m-field.is-ok .m-input { border-color: var(--success); }

.m-textarea {
  width: 100%; min-height: 76px; padding: 10px 11px; resize: vertical;
  font-family: inherit; font-size: 12.5px; line-height: 1.5; color: var(--text-primary);
  background: var(--bg-card); border: 0.5px solid var(--border-medium); border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.m-textarea::placeholder { color: var(--text-tertiary); }
.m-textarea:focus { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 3px rgba(232,97,26,0.10); }

/* search input */
.m-search { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; background: var(--bg-card); border: 0.5px solid var(--border-medium); border-radius: var(--radius-sm); color: var(--text-tertiary); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.m-search:focus-within { border-color: var(--brand-orange); box-shadow: 0 0 0 3px rgba(232,97,26,0.10); }
.m-search svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.m-search input { border: none; background: none; outline: none; font: inherit; font-size: 12.5px; color: var(--text-primary); width: 100%; }
.m-search input::placeholder { color: var(--text-tertiary); }

/* multi-select trigger + panel */
.m-multiselect { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 11px; background: var(--bg-card); border: 0.5px solid var(--border-medium); border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; color: var(--text-primary); }
.m-multiselect:hover { border-color: var(--border-heavy); }
.m-multiselect .ct { font-size: 10.5px; font-weight: var(--fw-bold); background: var(--accent-bg); color: var(--accent-dark); border-radius: 9px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
.m-multiselect .chev { color: var(--text-tertiary); display: inline-flex; margin-left: 2px; }
.ms-panel { width: 220px; padding: 5px; background: var(--bg-card); border: 0.5px solid var(--border-medium); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); }
.ms-panel .opt { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer; }
.ms-panel .opt:hover { background: var(--bg-tinted); }
.ms-check { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-heavy); display: inline-grid; place-items: center; color: #fff; flex-shrink: 0; }
.ms-check svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.ms-panel .opt.on .ms-check { background: var(--accent); border-color: var(--accent); }
.ms-panel .opt.on .ms-check svg { opacity: 1; }
.ms-panel .div { height: 0.5px; background: var(--border-light); margin: 4px 0; }
.ms-panel .all { font-size: 11px; color: var(--text-secondary); padding: 6px 9px; cursor: pointer; }

/* switch row (settings) */
.switch-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 0.5px solid var(--border-light); }
.switch-row:last-child { border-bottom: none; }
.switch-row .info { flex: 1; min-width: 0; }
.switch-row .ti { font-size: 13px; font-weight: var(--fw-semibold); }
.switch-row .de { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.45; }

/* master switch (segment of an app on/off) */
.master-switch { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-tinted); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); }
.master-switch .ti { font-size: 13px; font-weight: var(--fw-semibold); flex: 1; }
.master-switch.is-on { background: var(--brand-orange-tint); border-color: transparent; }

/* login form */
.login-form { display: flex; flex-direction: column; gap: 14px; max-width: 320px; }

/* ════════════════════════════════════════════════════════════════════
   SWITCHES & SEGMENTED  — firm / context / view (distinct from pill-group)
   ════════════════════════════════════════════════════════════════════ */
.seg-switch { display: inline-flex; align-items: center; padding: 2px; gap: 2px; background: var(--bg-tinted); border: 0.5px solid var(--border-light); border-radius: var(--radius-sm); }
.seg-switch button { height: 26px; padding: 0 12px; border: none; background: transparent; border-radius: 6px; font: var(--fw-medium) 12px/1 var(--font-sans); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all var(--dur-fast) var(--ease-out); }
.seg-switch button:hover:not(.on) { color: var(--text-primary); }
.seg-switch button.on { background: var(--bg-card); color: var(--text-primary); font-weight: var(--fw-semibold); box-shadow: 0 0.5px 1.5px rgba(0,0,0,0.07), 0 0 0 0.5px var(--border-medium); }
.seg-switch button .src-dot { width: 7px; height: 7px; border-radius: 2px; }
/* icon-only view switch */
.seg-switch.icons button { width: 30px; padding: 0; justify-content: center; }
.seg-switch.icons svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ════════════════════════════════════════════════════════════════════
   TABS — variants beyond nav / sub
   ════════════════════════════════════════════════════════════════════ */
/* segment/source tabs — card-pill group */
.source-tabs { display: inline-flex; gap: 6px; padding: 5px; background: var(--bg-tinted); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); }
.source-tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: none; background: transparent; border-radius: var(--radius-sm); font: var(--fw-semibold) 13px/1 var(--font-sans); color: var(--text-secondary); cursor: pointer; transition: all var(--dur-fast) var(--ease-out); }
.source-tab:hover:not(.on) { color: var(--text-primary); }
.source-tab.on { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-card); }
.source-tab .ic { width: 22px; height: 22px; border-radius: 6px; background: var(--bg-page); color: var(--text-secondary); display: grid; place-items: center; font: var(--fw-bold) 10px/1 var(--font-sans); }
.source-tab.on .ic.cmc { background: rgba(31,78,156,0.12); color: var(--src-cmc-1); }
.source-tab.on .ic.ams { background: rgba(107,79,143,0.12); color: var(--src-ams-1); }
.source-tab.on .ic.feed { background: var(--success-bg); color: var(--success-dark); }
.source-tab .ct { font-size: 10.5px; font-weight: var(--fw-bold); background: var(--bg-page); color: var(--text-tertiary); border-radius: 9px; padding: 1px 7px; font-variant-numeric: tabular-nums; }

/* underline detail tabs (drawer / segment level) — count + live dot */
.detail-tabs { display: flex; gap: 4px; border-bottom: 0.5px solid var(--border-light); }
.detail-tab { position: relative; padding: 9px 12px; border: none; background: none; font: var(--fw-medium) 12.5px/1 var(--font-sans); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: color var(--dur-fast); }
.detail-tab:hover { color: var(--text-primary); }
.detail-tab.on { color: var(--text-primary); font-weight: var(--fw-semibold); }
.detail-tab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -0.5px; height: 2px; background: var(--brand-orange); border-radius: 2px 2px 0 0; }
.detail-tab .ct { font-size: 10px; font-weight: var(--fw-bold); background: var(--bg-tinted); color: var(--text-secondary); border: 0.5px solid var(--border-light); border-radius: 8px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.detail-tab .live { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(52,199,89,0.5); animation: livePulse 1.8s var(--ease-out) infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(52,199,89,0.45); } 70% { box-shadow: 0 0 0 6px rgba(52,199,89,0); } 100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); } }

/* ════════════════════════════════════════════════════════════════════
   MODALS · DRAWERS · OVERLAYS
   ════════════════════════════════════════════════════════════════════ */
/* a contained stage so specimens don't cover the page */
.overlay-stage { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 0.5px solid var(--border-light); }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,0.30); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); display: grid; place-items: center; }

/* centered modal (util / t / exc) */
.modal { width: min(440px, 92%); background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); display: flex; flex-direction: column; max-height: 90%; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 14px; border-bottom: 0.5px solid var(--border-light); }
.modal-head .ti { font-size: 15px; font-weight: var(--fw-semibold); letter-spacing: -0.2px; }
.modal-head .su { font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 16px 20px; overflow: auto; }
.modal-body .row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-body .row > label { font-size: 12px; color: var(--text-secondary); width: 110px; flex-shrink: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 0.5px solid var(--border-light); background: var(--bg-tinted); }
.modal-foot .spacer { flex: 1; }

/* wizard modal + stepper */
.wizard { width: min(540px, 94%); }
.wizard-steps { display: flex; align-items: center; gap: 0; padding: 16px 20px 4px; }
.wstep { display: flex; align-items: center; gap: 9px; flex: 1; }
.wstep .num { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font: var(--fw-bold) 11px/1 var(--font-sans); background: var(--bg-tinted); color: var(--text-tertiary); border: 0.5px solid var(--border-light); }
.wstep .tx { font-size: 12px; font-weight: var(--fw-medium); color: var(--text-tertiary); white-space: nowrap; }
.wstep .bar { flex: 1; height: 1px; background: var(--border-medium); margin: 0 10px; }
.wstep.done .num { background: var(--success); color: #fff; border-color: transparent; }
.wstep.done .tx { color: var(--text-secondary); }
.wstep.active .num { background: var(--brand-orange); color: #fff; border-color: transparent; box-shadow: var(--shadow-brand); }
.wstep.active .tx { color: var(--text-primary); font-weight: var(--fw-semibold); }

/* right slide-in drawer (settings / article-360) */
.drawer-stage { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 0.5px solid var(--border-light); }
.drawer-stage .scrim { justify-items: end; }
.drawer { width: min(420px, 86%); height: 100%; margin-left: auto; background: var(--bg-card); box-shadow: -4px 0 24px rgba(0,0,0,0.12); display: flex; flex-direction: column; animation: drawerIn 0.28s var(--ease-out); }
@keyframes drawerIn { from { transform: translateX(24px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 0.5px solid var(--border-light); }
.drawer-head .ti { font-size: 15px; font-weight: var(--fw-semibold); letter-spacing: -0.2px; flex: 1; }
.drawer-body { padding: 16px 18px; overflow: auto; flex: 1; }
.drawer-foot { padding: 12px 18px; border-top: 0.5px solid var(--border-light); display: flex; gap: 8px; justify-content: flex-end; background: var(--bg-tinted); }

/* generic popover / dropdown panel + filter panel */
.popover { padding: 6px; background: var(--bg-card); border: 0.5px solid var(--border-medium); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); }
.popover .row { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer; color: var(--text-primary); }
.popover .row:hover { background: var(--bg-tinted); }
.popover .row.danger { color: var(--error-dark); }
.popover .row svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--text-tertiary); }
.popover .div { height: 0.5px; background: var(--border-light); margin: 4px 0; }

/* run-panel (Atlas execute) — a tall task console */
.run-panel { width: 320px; padding: 14px; background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); }
.run-panel .hd { font-size: 9.5px; font-weight: var(--fw-bold); letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 8px; }
.run-task { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 0.5px solid var(--border-light); }
.run-task:last-child { border-bottom: none; }
.run-task .nm { font-size: 12.5px; font-weight: var(--fw-medium); flex: 1; }
.run-task .pct { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }
.run-task .bar { width: 70px; height: 4px; border-radius: 2px; background: var(--track-bg); overflow: hidden; position: relative; }
.run-task .bar > span { position: absolute; inset: 0; width: var(--v,0%); border-radius: 2px; background: var(--brand-orange); }

/* ════════════════════════════════════════════════════════════════════
   DATA-VIZ EXTRAS — heatmap grid · tree-picker
   ════════════════════════════════════════════════════════════════════ */
.heatmap { display: grid; gap: 3px; font-size: 11px; font-family: var(--font-mono); }
.heat-axis { color: var(--text-secondary); font-weight: var(--fw-semibold); display: flex; align-items: center; }
.heat-axis.col { justify-content: center; padding-bottom: 2px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.hc { height: 30px; border-radius: 5px; display: grid; place-items: center; background: var(--bg-page); color: var(--text-primary); }
.hc.ok        { background: rgba(52,199,89,0.18);  color: var(--success-dark); }
.hc.low       { background: rgba(255,149,0,0.22);  color: var(--warning-dark); }
.hc.critical  { background: rgba(255,59,48,0.22);   color: var(--error-dark); }
.hc.overstock { background: rgba(0,122,255,0.18);   color: var(--accent-dark); }
.hc.dead      { background: rgba(142,142,147,0.20); color: var(--text-secondary); }

.heat-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.heat-legend .it { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.heat-legend .sw { width: 12px; height: 12px; border-radius: 3px; }

/* tree-picker (RBAC scope selector) */
.tree-picker { width: 320px; border: 0.5px solid var(--border-light); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-card); overflow: hidden; }
.tree-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12.5px; cursor: pointer; border-bottom: 0.5px solid var(--border-light); }
.tree-row:last-child { border-bottom: none; }
.tree-row:hover { background: var(--bg-tinted); }
.tree-row .tw { color: var(--text-tertiary); display: inline-flex; transition: transform var(--dur-fast); }
.tree-row.open .tw { transform: rotate(90deg); }
.tree-row .tw svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tree-row.child { padding-left: 34px; }
.tree-row.grandchild { padding-left: 56px; }
.tree-row .tlbl { flex: 1; }
.tree-row.sel { background: var(--accent-bg); }
.tree-row.sel .tlbl { color: var(--accent-dark); font-weight: var(--fw-semibold); }
.tree-row .tcheck { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-heavy); display: inline-grid; place-items: center; color: #fff; }
.tree-row.sel .tcheck { background: var(--accent); border-color: var(--accent); }
.tree-row .tcheck svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tree-row.sel .tcheck svg { opacity: 1; }
.tree-row.partial .tcheck { background: var(--accent-bg); border-color: var(--accent); }
.tree-row.partial .tcheck::after { content: ""; width: 8px; height: 2px; background: var(--accent); border-radius: 1px; }

@media (max-width: 720px) {
  .form-grid, .card-grid.c2, .card-grid.c3, .card-grid.c4 { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════
   HUB APP-LAUNCHER LIST  — the dark hub's app rows (canonical entry)
   Shown in its real dark context. Round orange dot, grouped Active / Soon.
   ════════════════════════════════════════════════════════════════════ */
.hub-frame { background: var(--brand-black); border-radius: var(--radius-lg); padding: 22px 26px 26px; position: relative; overflow: hidden; }
.hub-frame::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 240px at 30% -10%, rgba(232,97,26,0.16), transparent 70%); pointer-events: none; }
.hub-grouplbl { display: flex; align-items: center; gap: 9px; margin: 4px 0 4px; font-size: 10.5px; font-weight: var(--fw-semibold); letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.42); }
.hub-grouplbl + .hub-grouplbl, .hub-row + .hub-grouplbl { margin-top: 22px; }
.hub-grouplbl .gd { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-orange); }
.hub-grouplbl.soon .gd { background: #48484E; }
.hub-grouplbl .ct { letter-spacing: 0.04em; }
.hub-row { display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 4px; border-bottom: 1px solid rgba(255,255,255,0.06); text-decoration: none; color: #fff; border-radius: 12px; cursor: pointer; transition: background var(--dur-fast) var(--ease-out), padding var(--dur-fast) var(--ease-out); }
.hub-row:hover { background: rgba(255,255,255,0.04); padding-left: 14px; }
.hub-wm { font-family: var(--font-wordmark); font-size: 23px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; display: inline-block; }
.hub-wm .dot { display: inline-block; width: 0.2em; height: 0.2em; margin-left: 0.06em; border-radius: 50%; background: var(--brand-orange); vertical-align: baseline; box-shadow: 0 0 12px rgba(232,97,26,0.5); }
.hub-role { flex: 1; min-width: 0; color: rgba(255,255,255,0.62); font-size: 12.5px; line-height: 1.45; }
.hub-role b { color: #fff; font-weight: var(--fw-semibold); }
.hub-status { font-size: 12px; font-weight: var(--fw-semibold); color: #3FD06A; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.hub-status .d { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.hub-arrow { color: rgba(255,255,255,0.4); display: inline-flex; }
.hub-arrow svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hub-row:hover .hub-arrow { color: var(--brand-orange); }
.hub-row.soon { cursor: default; }
.hub-row.soon:hover { background: transparent; padding-left: 4px; }
.hub-row.soon .hub-wm { color: rgba(255,255,255,0.40); }
.hub-row.soon .hub-wm .dot { background: #48484E; box-shadow: none; }
.hub-row.soon .hub-role, .hub-row.soon .hub-status { color: rgba(255,255,255,0.40); }
.hub-row.soon .hub-status .d { background: #48484E; }
.hub-row.soon .hub-arrow { display: none; }

/* ════════════════════════════════════════════════════════════════════
   ENABLE CONTROL — the "lights-up" button (replaces the iOS toggle)
   Agenți → Setări enable/disable now reads like every other control in the
   system: a pill that lights up brand-orange when engaged, instead of a
   green iOS switch. Same active-state language as chips, tabs and segments.
   ════════════════════════════════════════════════════════════════════ */
.m-enable {
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 13px; border-radius: var(--radius-pill);
  border: 0.5px solid var(--border-medium); background: var(--bg-card);
  font: var(--fw-semibold) 12px/1 var(--font-sans); color: var(--text-secondary);
  cursor: pointer; white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.m-enable .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary); transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.m-enable:hover { color: var(--text-primary); border-color: var(--border-heavy); }
.m-enable:active { transform: scale(0.96); }
.m-enable.on { background: var(--brand-orange-tint); border-color: var(--brand-orange); color: var(--brand-orange-hover); }
.m-enable.on .dot { background: var(--brand-orange); box-shadow: 0 0 0 3px rgba(232,97,26,0.16); }
.m-enable:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(232,97,26,0.12); }
/* compact icon-confirm variant: shows a check when on */
.m-enable .ck { width: 12px; height: 12px; display: none; }
.m-enable .ck svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.m-enable.on .ck { display: block; }
.m-enable.on .dot.hide-on-check { display: none; }

/* ════════════════════════════════════════════════════════════════════
   MOTION SECTION — demo helpers (durations, easings, patterns)
   ════════════════════════════════════════════════════════════════════ */
.btn-sm { height: 26px; padding: 0 11px; font-size: 11.5px; }
.mo-tok { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 0.5px solid var(--border-light); }
.mo-tok:last-child { border-bottom: none; }
.mo-bar { position: relative; height: 6px; border-radius: 3px; background: var(--track-bg); overflow: hidden; }
.mo-bar > span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--brand-orange); animation: moBar var(--d, 300ms) var(--ease-out) infinite alternate; }
@keyframes moBar { from { width: 4%; } to { width: 100%; } }
.mo-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mo-meta b { font-size: 12.5px; font-weight: var(--fw-semibold); color: var(--text-primary); }
.mo-use { font-size: 11px; color: var(--text-tertiary); text-align: right; white-space: nowrap; }
.mo-ease { display: grid; grid-template-columns: 132px 1fr auto; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 0.5px solid var(--border-light); }
.mo-ease:last-of-type { border-bottom: none; }
.mo-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand-orange); transition-property: transform; transition-duration: 0.9s; }
.mo-ease:hover .mo-dot { transform: translateX(112px); }
.mo-pat { display: flex; flex-direction: column; gap: 12px; }
.mo-pat-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mo-pat-nm { font-size: 14px; font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
.mo-pat-de { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.mo-link { border: none; background: none; color: var(--accent); font: var(--fw-semibold) 12.5px/1 var(--font-sans); cursor: pointer; padding: 0; }
.mo-roll-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mo-roll-row .v { font-size: 26px; font-weight: 700; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.mo-roll-row .l { font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-secondary); margin-top: 6px; }
.mo-bloom-demo { display: flex; flex-direction: column; gap: 6px; }
.mo-brow { padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bg-tinted); font-size: 12.5px; color: var(--text-primary); border: 0.5px solid var(--border-light); transform-origin: left center; }
.mo-bloom-demo.go .mo-brow { animation: segBloom 0.4s var(--ease-spring) both; }
.mo-bloom-demo.go .mo-brow:nth-child(1) { animation-delay: 0ms; }
.mo-bloom-demo.go .mo-brow:nth-child(2) { animation-delay: 45ms; }
.mo-bloom-demo.go .mo-brow:nth-child(3) { animation-delay: 90ms; }
@media (prefers-reduced-motion: reduce) {
  .mo-bar > span, .mo-dot, .mo-bloom-demo.go .mo-brow { animation: none !important; transition: none !important; }
}

/* ════════════════════════════════════════════════════════════════════
   SEGMENTE & BRANDURI — hierarchical drill tree (Artemis → Unități)
   The real CATEGORIE → SEGMENT → MODEL/BRAND tree. Each row: name-cell ·
   proportional bar (value inside) · marjă pill · metric · Δ. Expands with
   the Subtle Bloom stagger. Canonical tokens replace the per-app hexes.
   ════════════════════════════════════════════════════════════════════ */
.seg-tree { display: flex; flex-direction: column; gap: 10px; }
.seg-row {
  display: grid;
  grid-template-columns: minmax(0,1.7fr) minmax(0,1fr) 58px 74px 60px;
  gap: 10px; align-items: center;
  padding: 11px 16px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--dur-fast) var(--ease-out);
}
.seg-row:hover { background: var(--bg-tinted); }
.seg-L0 { background: var(--bg-card); border: 0.5px solid var(--border-light); border-radius: var(--radius-md); transition: border-color var(--dur-fast) var(--ease-out); }
.seg-L0:hover { border-color: var(--border-medium); background: var(--bg-card); }
.seg-L0.seg-open { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.seg-children-wrap { border: 0.5px solid var(--border-light); border-top: none; border-radius: 0 0 var(--radius-md) var(--radius-md); padding: 4px 0; background: var(--bg-card); overflow: hidden; }
.seg-L0.seg-open { border-radius: var(--radius-md) var(--radius-md) 0 0; transition: border-radius var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.seg-L1 { padding-left: 36px; }
.seg-L1.seg-open { background: var(--bg-tinted); }
.seg-L2 { padding-left: 56px; cursor: default; }
.seg-models { overflow: hidden; }
.seg-sep { height: 0.5px; background: var(--border-light); margin: 2px 16px; }
.seg-nc { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.seg-chev { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-tertiary); transition: transform var(--dur) var(--ease-out); }
.seg-chev svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.seg-row.seg-open > .seg-nc > .seg-chev { transform: rotate(90deg); color: var(--brand-orange); }
.seg-chev-ph { width: 16px; flex-shrink: 0; }
.seg-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.seg-nm { font-size: 14px; font-weight: var(--fw-medium); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.seg-L1 .seg-nm { font-weight: var(--fw-regular); font-size: 13px; }
.seg-L2 .seg-nm { font-weight: var(--fw-regular); font-size: 12px; color: var(--text-secondary); }
.seg-badge { font-size: 10px; font-weight: var(--fw-medium); padding: 2px 8px; border-radius: 6px; flex-shrink: 0; white-space: nowrap; letter-spacing: .2px; margin-left: auto; }
.seg-badge-ep { background: rgba(52,199,89,0.14); color: var(--success-dark); }
.seg-badge-tr { background: rgba(255,149,0,0.14); color: var(--warning-dark); }
.seg-badge-e5 { background: rgba(0,122,255,0.12); color: var(--accent); }
.seg-badge-in { background: var(--bg-tinted); color: var(--text-secondary); }
.seg-bar-w { height: 22px; background: var(--track-bg); border-radius: 4px; position: relative; overflow: hidden; }
.seg-bar-fill { height: 100%; border-radius: 4px; min-width: 2px; transition: width var(--dur-slow) var(--ease-out); }
.seg-bar-val { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: var(--fw-medium); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.seg-marja-pill { font-size: 11px; font-weight: var(--fw-medium); padding: 3px 8px; border-radius: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.seg-marja-good { background: rgba(52,199,89,0.12); color: var(--success-dark); }
.seg-marja-ok   { background: rgba(255,149,0,0.12); color: var(--warning-dark); }
.seg-marja-low  { background: rgba(255,59,48,0.12); color: var(--error-dark); }
.seg-metric-val { font-size: 13px; color: var(--text-secondary); text-align: right; font-variant-numeric: tabular-nums; }
.seg-L0 .seg-metric-val { font-weight: var(--fw-medium); color: var(--text-primary); }
.seg-delta-cell { font-size: 12px; font-weight: var(--fw-medium); text-align: right; font-variant-numeric: tabular-nums; }
.seg-v-up { color: var(--success-dark); }
.seg-v-down { color: var(--error-dark); }
.seg-v-na { color: var(--text-tertiary); }
.seg-pills { display: inline-flex; gap: 4px; }
.seg-mpill { padding: 4px 12px; background: transparent; border: 0.5px solid var(--border-medium); border-radius: var(--radius-pill); font: var(--fw-medium) 11px/1 var(--font-sans); color: var(--text-secondary); cursor: pointer; transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.seg-mpill:hover { color: var(--text-primary); border-color: var(--border-heavy); }
.seg-mpill.act { background: rgba(0,122,255,0.08); color: var(--accent); border-color: var(--accent); font-weight: var(--fw-semibold); }
/* keep segBloom for the Motion-section demo */
@keyframes segBloom { from { opacity: 0; transform: scale(0.93); } to { opacity: 1; transform: scale(1); } }
/* refined drill open/close: container height eases in JS (accordion); rows
   rise + fade with a gentle stagger (top→bottom open, bottom→top close). */
@keyframes segRowIn  { from { transform: translateY(9px); } to { transform: none; } }
@keyframes segRowOut { from { transform: none; } to { transform: translateY(5px); } }
.s-opening > .seg-row, .s-opening > .seg-sep, .s-opening > .seg-models { animation: segRowIn 0.40s var(--ease-out) both; }
.s-closing > .seg-row, .s-closing > .seg-sep, .s-closing > .seg-models { animation: segRowOut 0.22s var(--ease-out) both; }
.s-opening > *:nth-child(1){ animation-delay: 22ms; }
.s-opening > *:nth-child(2){ animation-delay: 58ms; }
.s-opening > *:nth-child(3){ animation-delay: 94ms; }
.s-opening > *:nth-child(4){ animation-delay: 130ms; }
.s-opening > *:nth-child(5){ animation-delay: 166ms; }
.s-opening > *:nth-child(6){ animation-delay: 202ms; }
.s-opening > *:nth-child(n+7){ animation-delay: 238ms; }
.s-closing > *:nth-last-child(1){ animation-delay: 0ms; }
.s-closing > *:nth-last-child(2){ animation-delay: 26ms; }
.s-closing > *:nth-last-child(3){ animation-delay: 52ms; }
.s-closing > *:nth-last-child(n+4){ animation-delay: 78ms; }
@media (prefers-reduced-motion: reduce) {
  .s-opening > *, .s-closing > *, .seg-chev, .seg-bar-fill,
  .seg-children-wrap, .seg-models { animation: none !important; transition: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   NOTIFICATION CENTER v2 — bell trigger + inbox panel (DL design 2026-06)
   ═══════════════════════════════════════════════════════════════════════ */

.bell-root { position: relative; display: inline-flex; align-items: center; }

/* ── bell trigger ─────────────────────────────────────────────────────── */
.bell-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px;
  border: 0.5px solid var(--border-light); background: var(--bg-card);
  display: grid; place-items: center; cursor: pointer; color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.bell-btn:hover { background: var(--bg-tinted); color: var(--text-primary); }
.bell-btn.is-open { background: var(--brand-orange-tint); border-color: rgba(232,97,26,.3); color: var(--brand-orange-hover); }
.bell-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--brand-orange); color: #fff; font-size: 10.5px; font-weight: var(--fw-bold);
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-card);
  font-variant-numeric: tabular-nums; pointer-events: none;
}

/* ── inbox panel ──────────────────────────────────────────────────────── */
.notif-inbox {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 200;
  width: 440px; max-height: 600px; display: flex; flex-direction: column;
  background: var(--bg-card); border: 0.5px solid var(--border-light);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-modal);
  overflow: hidden; color: var(--text-primary);
}
.ib-head { padding: 16px 18px 12px; border-bottom: 0.5px solid var(--border-light); }
.ib-head .row1 { display: flex; align-items: center; gap: 10px; }
.ib-head .t { font-size: 16px; font-weight: var(--fw-bold); letter-spacing: -.3px; }
.ib-head .mark {
  margin-left: auto; font-size: 12px; color: var(--brand-orange-hover);
  font-weight: var(--fw-semibold); cursor: pointer;
  background: none; border: none; font-family: inherit; padding: 0;
}
.ib-head .mark:hover { text-decoration: underline; }
.ib-seg { display: flex; gap: 6px; margin-top: 12px; }
/* scoped so it doesn't clash with other .seg-switch instances on the page */
.notif-inbox .seg-switch button { height: 28px; }
.ib-scroll { overflow-y: auto; flex: 1; padding: 6px 0; }

/* ── app group header ─────────────────────────────────────────────────── */
.ib-app { padding: 14px 18px 5px; display: flex; align-items: center; gap: 9px; }
.ib-app .glyph { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: var(--fw-bold); color: #fff; flex-shrink: 0; }
.ib-app .glyph.g-atlas      { background: var(--accent); }
.ib-app .glyph.g-plutus     { background: var(--success-dark); }
.ib-app .glyph.g-artemis    { background: #6B4F8F; }
.ib-app .glyph.g-hermes     { background: #1F4E9C; }
.ib-app .glyph.g-demeter    { background: #1B7F37; }
.ib-app .glyph.g-hephaestus { background: #8B5200; }
.ib-app .glyph.g-plat       { background: var(--text-secondary); }
.ib-app .nm { font-size: 11px; font-weight: var(--fw-bold); letter-spacing: .5px; text-transform: uppercase; color: var(--text-secondary); }
.ib-app .ct { margin-left: auto; font-size: 10.5px; font-weight: var(--fw-bold); color: var(--brand-orange-hover); background: var(--brand-orange-tint); padding: 1px 7px; border-radius: var(--radius-pill); }

/* ── notification row ─────────────────────────────────────────────────── */
.ic-row { display: flex; gap: 13px; padding: 12px 18px; position: relative; cursor: pointer; }
.ic-row:hover { background: var(--bg-tinted); }
.ic-row.unread { background: rgba(232,97,26,.04); }
.ic-row.unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand-orange); }
.ic-sev { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.ic-sev.sev-err  { background: var(--error); }
.ic-sev.sev-warn { background: var(--warning); }
.ic-sev.sev-ok   { background: var(--success); }
.ic-sev.sev-info { background: var(--accent); }
.ic-main { flex: 1; min-width: 0; }
.ic-title { font-size: 13px; line-height: 1.45; color: var(--text-primary); }
.ic-title b { font-weight: var(--fw-semibold); }
.ic-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.ic-actions { display: flex; gap: 7px; margin-top: 9px; }
.ic-actions .btn { height: 26px; padding: 0 11px; font-size: 11.5px; }

/* ── footer ───────────────────────────────────────────────────────────── */
.ib-foot { padding: 11px 16px; border-top: 0.5px solid var(--border-light); display: flex; align-items: center; }
.ib-foot .lnk { font-size: 12.5px; color: var(--text-secondary); cursor: pointer; background: none; border: none; font-family: inherit; padding: 0; }
.ib-foot .lnk:hover { color: var(--text-primary); }

.notif-empty { display: flex; align-items: center; justify-content: center; padding: 32px 18px; font-size: 13px; color: var(--text-tertiary); text-align: center; }

@media (max-width: 520px) { .notif-inbox { width: calc(100vw - 24px); } }
