/* SGApps Studio · UI mock v0.1.0 — shared styles for every page in pages/.
 * Canon: CONVENTIONS.md §1 (tokens = Entity Manager v1.2.1 / entity-manager/style.css) + §3 (Studio components).
 * Light theme only (the v1.2.1 canon has no dark theme). Icons: assets/icons.css (`.i.i-<feather>`). */

:root {
	--ink: #0B0B0B; --text-2: #383835; --text-3: #52514E; --muted: #6D6B67; --muted-2: #898781;
	--page: #FAF9F5; --surface: #FFFFFF; --fill: #F6F6F4; --fill-2: #F0EFEC; --fill-3: #EDECE8;
	--line: rgba(11,11,11,.12); --line-input: rgba(11,11,11,.25); --line-soft: rgba(11,11,11,.08);
	--accent: #256ABF; --accent-dark: #184F95; --accent-bg: #E2EEFA;
	--success: #005400; --success-bg: #E0F2DE; --success-dot: #0CA30C;
	--warning: #623900; --warning-bg: #FAEBCE; --warning-accent: #C98500;
	--danger: #A32C2C; --danger-dark: #8E2626; --danger-bg: #FAD6D6; --danger-bg-2: #FEF3F3; --danger-line: rgba(163,44,44,.45);
	--teal: #065F49; --teal-bg: #DCF2EA;
	--annotation: #5645BE; --propus: #8B80DA; --violet: #4A3AA7; --violet-bg: #EBEAFE;
	--switch-off: #898781;
	--font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
	--mono: 'SF Mono', ui-monospace, Menlo, monospace;
}
html { background: var(--page); }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); } .t3 { color: var(--text-3); } .t2 { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h-scroll { scrollbar-width: none; } .h-scroll::-webkit-scrollbar { display: none; }

/* ---- annotations (canon v1.2.1 §3: identical everywhere, never inline style on .ann) ---- */
.ann { font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 10px; line-height: 1.35; color: #5645BE; overflow-wrap: anywhere; word-break: normal; }
.annc { display: flex; flex-direction: column; gap: 3px; }
.annbox { display: flex; flex-direction: column; gap: 3px; padding: 8px 12px; border-radius: 10px; background: var(--violet-bg); }

/* ---- shell: desktop header (Entity Manager model 02: sticky white, badge, outlined actions) ---- */
.root { position: relative; min-height: 100%; display: flex; flex-direction: column; background: var(--page); }
.st-hdr { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: .5px solid var(--line); }
.st-hdr-in { display: flex; align-items: center; gap: 10px 14px; padding: 10px 20px; }
.st-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; white-space: nowrap; color: var(--ink); text-decoration: none; }
.st-badge { width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; display: flex; align-items: center; justify-content: center; }
.st-inst { font-weight: 400; color: var(--muted); font-size: 13px; }
.st-nav { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.st-nav::-webkit-scrollbar { display: none; }
/* longer labels (ru / en, D22): the pill row scrolls; the fade shows there is more */
.st-nav.fade-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.st-nav-m { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 10px; }
.pill { flex: none; height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border-radius: 8px; background: var(--fill); color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; border: none; cursor: pointer; }
.pill:hover { color: var(--ink); background: var(--fill-2); }
.pill[aria-current="page"], .pill.on { background: var(--ink); color: #fff; }
.pill .cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warning-bg); color: var(--warning); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
.st-hdr-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.st-user { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px 0 6px; border: .5px solid var(--line-input); border-radius: 9px; background: var(--surface); font-size: 13px; cursor: pointer; white-space: nowrap; }
.st-ava { width: 24px; height: 24px; border-radius: 12px; background: var(--fill-3); color: var(--text-2); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.hdr-ann { padding: 6px 20px 8px; background: var(--surface); border-bottom: .5px solid var(--line-soft); }
.main { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ptitle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ptitle h1 { margin: 0; font-size: 22px; font-weight: 600; }
.ptitle .sub { color: var(--text-3); font-size: 13px; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--text-3); }
.crumb a { color: var(--text-3); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.crumb a:hover { color: var(--ink); }
.crumb .sep { color: var(--muted-2); }
.crumb .cur { color: var(--ink); font-weight: 500; }

/* ---- mobile shell (390) ---- */
.m-root { width: 390px; min-height: 844px; position: relative; display: flex; flex-direction: column; background: var(--page); font-size: 15px; }
.m-top { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: .5px solid var(--line); }
.m-top-in { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; min-height: 56px; box-sizing: border-box; }
.m-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icbtn { width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; border-radius: 10px; color: var(--ink); cursor: pointer; padding: 0; text-decoration: none; }
.icbtn:hover { background: var(--fill); }
.fade-x { position: relative; }
.fade-x::after { content: ''; position: absolute; top: 0; right: 0; bottom: 10px; width: 28px; background: linear-gradient(90deg, rgba(255,255,255,0), #fff); pointer-events: none; }
.m-main { flex: 1; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ---- cards, captions, rows ---- */
.card { background: var(--surface); border: .5px solid var(--line); border-radius: 14px; box-sizing: border-box; min-width: 0; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 16px; border-bottom: .5px solid var(--line); }
.card-h h2, .card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-b { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.cap { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.th { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: .5px solid var(--line-soft); }
.row:first-child { border-top: none; }
.grow { flex: 1; min-width: 0; }
.tile { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--fill); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .v { font-size: 26px; font-weight: 600; line-height: 1.1; }
.kpi .l { font-size: 13px; color: var(--text-3); }
.box { background: var(--fill); border-radius: 12px; padding: 12px 14px; }
.hr { height: .5px; background: var(--line); border: none; margin: 0; }
.dot { width: 7px; height: 7px; flex: none; border-radius: 4px; display: inline-block; }
.kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; background: var(--fill-3); color: var(--text-2); }

/* ---- buttons (canon §9: outlined h36 r9 · primary black r10 · blue · danger outlined) ---- */
.btn { height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border: .5px solid var(--line-input); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; box-sizing: border-box; }
.btn:hover { background: var(--fill); color: var(--ink); }
.btn-pri { height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: none; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; box-sizing: border-box; }
.btn-pri:hover { color: #fff; background: #2a2a28; }
.btn-acc { background: var(--accent); } .btn-acc:hover { background: var(--accent-dark); }
.btn-ok { background: var(--success); } .btn-ok:hover { background: #003d00; }
.btn-red { background: var(--danger); } .btn-red:hover { background: var(--danger-dark); }
.btn-danger { border: .5px solid var(--danger-line); color: var(--danger); }
.btn-danger:hover { color: var(--danger-dark); background: var(--danger-bg-2); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-m { height: 44px; font-size: 15px; }
.btn[aria-disabled="true"], .btn-pri[aria-disabled="true"] { opacity: .45; cursor: default; }
.lnk { padding: 0; border: none; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* ---- chips (r6) · filter facets (r999) ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; box-sizing: border-box; background: var(--fill-3); color: var(--text-2); }
.chip-s { height: 20px; padding: 0 6px; font-size: 11px; }
.chip-mono { font-family: var(--mono); font-weight: 500; font-size: 11px; background: var(--surface); color: var(--ink); border: 1px solid rgba(11,11,11,.2); }
.chip-ok { background: var(--success-bg); color: var(--success); }
.chip-warn { background: var(--warning-bg); color: var(--warning); }
.chip-bad { background: var(--danger-bg); color: var(--danger); }
.chip-acc { background: var(--accent-bg); color: var(--accent-dark); }
.chip-teal { background: var(--teal-bg); color: var(--teal); }
.tag-new { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--surface); color: var(--violet); border: 1px dashed var(--propus); box-sizing: border-box; }
.tag-ex { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; background: var(--success-bg); color: var(--success); box-sizing: border-box; }
.facet { flex: none; height: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 999px; border: none; background: var(--fill); color: var(--text-2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.facet.on, .facet[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 600; }
.facet .n { font-size: 11px; opacity: .75; }
.facet-m { height: 36px; }

/* ---- flow state chips (Studio, CONVENTIONS §3.3) — docs_db.py STATES ---- */
.fs { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; box-sizing: border-box; }
.fs-planificat { background: var(--surface); color: var(--text-3); border: 1px solid rgba(11,11,11,.2); }
.fs-in-lucru { background: var(--accent-bg); color: var(--accent-dark); }
.fs-livrat { background: var(--warning-bg); color: var(--warning); }
.fs-acceptat { background: var(--success-bg); color: var(--success); }
.fs-publicat { background: var(--teal-bg); color: var(--teal); }
.fs-respins { background: var(--danger-bg); color: var(--danger); }
.fs-sarit { background: var(--fill-3); color: var(--text-3); }
.fs .i { width: 12px; height: 12px; vertical-align: -1px; }
.fbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--fill-3); }
.fbar > span { display: block; height: 100%; }

/* ---- inputs, switch, segmented ---- */
.inp { box-sizing: border-box; width: 100%; height: 38px; padding: 0 10px; border: .5px solid var(--line-input); border-radius: 8px; font-size: 14px; background: var(--surface); color: var(--ink); }
textarea.inp { height: auto; padding: 8px 10px; line-height: 1.45; resize: vertical; }
.inp:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.inp-m { height: 44px; font-size: 16px; }
.inpw { display: flex; align-items: center; gap: 0; height: 38px; border: .5px solid var(--line-input); border-radius: 8px; background: var(--surface); box-sizing: border-box; overflow: hidden; }
.inpw input { flex: 1; min-width: 0; height: 100%; padding: 0 10px; border: none; background: transparent; font-size: 14px; outline: none; }
.inpw .suf { padding: 0 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.inpw:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; }
.lbl { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.hint { font-size: 12px; line-height: 1.45; color: var(--text-3); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.masked { font-family: var(--mono); letter-spacing: .08em; color: var(--text-2); }
.sw { box-sizing: border-box; width: 44px; height: 26px; border: none; border-radius: 13px; padding: 3px; display: flex; align-items: center; flex-shrink: 0; cursor: pointer; background: var(--switch-off); }
.sw > span { width: 20px; height: 20px; border-radius: 10px; background: #fff; box-shadow: 0 1px 3px rgba(11,11,11,.25); transition: transform .15s; }
.sw[aria-checked="true"] { background: var(--accent); }
.sw[aria-checked="true"] > span { transform: translateX(18px); }
.swrow { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 8px 0; border: none; background: transparent; text-align: left; cursor: pointer; }
.swrow .trk { width: 52px; height: 32px; flex: none; border-radius: 16px; padding: 3px; box-sizing: border-box; background: var(--switch-off); display: flex; align-items: center; }
.swrow .trk > span { width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(11,11,11,.25); transition: transform .15s; }
.swrow[aria-checked="true"] .trk { background: var(--accent); }
.swrow[aria-checked="true"] .trk > span { transform: translateX(20px); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--fill-3); box-sizing: border-box; }
.segb { height: 30px; padding: 0 12px; border: none; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.segb[aria-checked="true"], .segb[aria-pressed="true"] { background: var(--surface); font-weight: 600; box-shadow: 0 1px 2px rgba(11,11,11,.12), 0 0 0 .5px rgba(11,11,11,.08); }
.seg-m .segb { height: 38px; font-size: 14px; }
input[type="range"] { accent-color: var(--accent); }

/* ---- mock-only controls (canon §9 „Elemente doar de mock”) ---- */
.demo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 8px 6px 10px; border: 1px dashed var(--muted-2); border-radius: 10px; background: var(--surface); }
.demo-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--fill-3); color: var(--text-2); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.demo .segb { height: 28px; font-size: 12px; }
.demo-note { display: flex; align-items: flex-start; gap: 6px; padding: 7px 10px; border-radius: 8px; background: var(--warning-bg); color: var(--warning); font-size: 12px; line-height: 1.4; }

/* ---- notices ---- */
.note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.note .i { margin-top: 1px; }
.note-info { background: var(--accent-bg); color: var(--accent-dark); }
.note-warn { background: var(--warning-bg); color: var(--warning); }
.note-bad { background: var(--danger-bg-2); color: var(--danger-dark); border: .5px solid var(--danger-line); }
.note-ok { background: var(--success-bg); color: var(--success); }
.note-neutral { background: var(--fill); color: var(--text-2); }

/* ---- toast (canon §9: black r12, 7 px status dot, auto-dismiss) ---- */
.toast { position: absolute; top: calc(100% + 8px); right: 20px; z-index: 20; max-width: 760px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4; box-shadow: 0 8px 24px rgba(11,11,11,.18); }
.toast-dock { position: sticky; bottom: 0; height: 0; z-index: 25; }
.toast-dock .toast { top: auto; left: 16px; right: 16px; bottom: 16px; }

/* ---- dialog (desktop) / sheet (mobile) ---- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(11,11,11,.32); display: flex; align-items: center; justify-content: center; padding: 20px; }
.dlg { width: 100%; max-width: 480px; background: var(--surface); border-radius: 14px; box-shadow: 0 16px 48px rgba(11,11,11,.24); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; }
.dlg h3 { margin: 0; font-size: 17px; font-weight: 600; }
.dlg-acts { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.sheet-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(11,11,11,.32); display: flex; align-items: flex-end; }
.sheet { width: 100%; max-height: 90%; overflow: auto; background: var(--surface); border-radius: 16px 16px 0 0; padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; }
.sheet > * { flex-shrink: 0; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--muted-2); align-self: center; }

/* ---- skeleton + spinner ---- */
@keyframes st-spin { to { transform: rotate(360deg); } }
@keyframes st-shim { 0% { background-position: -300px 0; } 100% { background-position: 300px 0; } }
@keyframes st-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.spin { animation: st-spin .9s linear infinite; }
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, #EDECE8 0, #F6F6F4 50%, #EDECE8 100%); background-size: 600px 100%; animation: st-shim 1.4s infinite linear; }
.live { animation: st-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .spin, .sk, .live { animation: none; } }

/* ==== Studio components (CONVENTIONS §3) ==================================== */

/* §3.1 video player 16:9 / 9:16 — mock: simulated playback, no media file */
.player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #0B0B0B; color: #fff; box-sizing: border-box; user-select: none; }
.player.v { aspect-ratio: 9 / 16; }
.player .scr { position: absolute; inset: 0; background: radial-gradient(120% 90% at 30% 20%, #2b3a52 0%, #141a24 55%, #0B0B0B 100%); }
.player .scr-ui { position: absolute; left: 7%; right: 7%; top: 10%; bottom: 24%; border-radius: 6px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 6%; padding: 4%; box-sizing: border-box; }
.player .scr-ui > i { display: block; height: 7%; border-radius: 3px; background: rgba(255,255,255,.14); }
.player .ttl { position: absolute; left: 12px; right: 12px; top: 10px; font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .big { position: absolute; left: 50%; top: 46%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border: none; border-radius: 28px; background: rgba(255,255,255,.92); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.player.v .big { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
.player .bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 18px 10px 8px; background: linear-gradient(0deg, rgba(0,0,0,.72), rgba(0,0,0,0)); font-size: 12px; }
.player .pbtn { width: 28px; height: 28px; flex: none; border: none; border-radius: 6px; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.player .trk { flex: 1; min-width: 20px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.28); position: relative; cursor: pointer; }
.player .trk > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: #fff; }
.player .tm { font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.player .fmt { position: absolute; right: 10px; top: 10px; height: 18px; padding: 0 6px; border-radius: 4px; background: rgba(255,255,255,.18); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; }
.player.v .ttl { right: 52px; }
.pcap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 12px; color: var(--text-3); margin-top: 6px; }
.pcap b { color: var(--ink); font-weight: 600; font-size: 13px; }

/* §3.2 audio row — play, waveform, time, meta */
.arow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.aplay { width: 36px; height: 36px; flex: none; border: .5px solid var(--line-input); border-radius: 18px; background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.aplay.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.aplay-m { width: 44px; height: 44px; border-radius: 22px; }
.wave { display: flex; align-items: center; gap: 2px; height: 26px; flex: none; }
.wave > i { display: block; width: 2px; border-radius: 1px; background: #C9C7C0; }
.wave > i.p { background: var(--ink); }
.atime { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.rev { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.rev-ok { background: var(--success-bg); color: var(--success); }
.rev-no { background: var(--danger-bg); color: var(--danger); }
.rev-def { background: var(--warning-bg); color: var(--warning); }
.rev-use { background: var(--fill-3); color: var(--text-2); }

/* §3.4 credit counter */
.cred { height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 9px; background: var(--fill); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.cred .i { color: var(--warning-accent); }
.cred small { font-weight: 500; color: var(--text-3); font-size: 12px; }
.meter { height: 10px; border-radius: 5px; background: var(--fill-3); overflow: hidden; display: flex; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter > span.w { background: var(--warning-accent); }
.meter > span.b { background: var(--danger); }
.meter > span.g { background: var(--muted-2); }
.meter-s { height: 6px; border-radius: 3px; }

/* §3.5 live Claude Code run log */
.log { background: var(--fill); border: .5px solid var(--line); border-radius: 12px; font-family: var(--mono); font-size: 12px; line-height: 1.5; overflow: auto; }
.log-row { display: grid; grid-template-columns: 62px 92px minmax(0, 1fr); gap: 10px; padding: 5px 12px; border-top: .5px solid var(--line-soft); align-items: start; }
.log-row:first-child { border-top: none; }
.log-t { color: var(--muted); }
.log-k { font-weight: 600; white-space: nowrap; }
.log-k.k-sys { color: var(--muted); } .log-k.k-say { color: var(--ink); } .log-k.k-tool { color: var(--accent-dark); }
.log-k.k-res { color: var(--success); } .log-k.k-perm { color: var(--warning); } .log-k.k-err { color: var(--danger); }
.log-x { color: var(--text-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.log-x b { color: var(--ink); font-weight: 600; }
.perm { border: 1px solid var(--warning-accent); background: var(--warning-bg); color: var(--warning); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.perm code { font-family: var(--mono); font-size: 12px; background: rgba(255,255,255,.6); padding: 2px 6px; border-radius: 5px; color: var(--ink); overflow-wrap: anywhere; }

/* remote browser view (D9: CDP screencast + input) */
.rb { border: .5px solid var(--line-input); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 4px 14px rgba(11,11,11,.08); }
.rb-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--fill); border-bottom: .5px solid var(--line); }
.rb-url { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 8px; background: var(--surface); border: .5px solid var(--line-input); font-size: 13px; }
.rb-url input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 13px; }
.rb-view { position: relative; aspect-ratio: 16 / 10; background: #fff; overflow: hidden; cursor: crosshair; }
.rb-click { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 11px; border: 2px solid var(--accent); background: rgba(37,106,191,.18); pointer-events: none; }

/* ==== v0.2.0 · reports (D21) — taken from the system's report module „Rapoarte fiscale”
 * (cnc-invoices/…/stats-logger/template/reports/style.css: .rp-bar, .rp-kpi, .rp-chip, .rp-delta, .rp-card, .rp-check)
 * and kept with the same names, so the two read alike. CONVENTIONS.md §3.8. */
.rp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 20px; background: var(--page); border-bottom: .5px solid var(--line); }
.rp-period { height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: .5px solid var(--line-input); border-radius: 10px; background: var(--surface); font-size: 14px; cursor: pointer; white-space: nowrap; }
.rp-period[aria-expanded="true"] { background: var(--accent-bg); border-color: #8DB6E6; }
.rp-period b { font-weight: 650; }
.rp-period .rg { color: var(--text-3); }
.rp-arrow { width: 36px; height: 40px; border: .5px solid var(--line-input); border-radius: 10px; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.rp-arrow[aria-disabled="true"] { opacity: .4; cursor: default; }
.rp-types { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--fill-2); }
.rp-types button { height: 34px; padding: 0 12px; border: none; border-radius: 8px; background: transparent; font-size: 14px; color: var(--text-2); cursor: pointer; }
.rp-types button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: 0 1px 2px rgba(11,11,11,.12), 0 0 0 .5px rgba(11,11,11,.08); }
.rp-compare { height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: .5px solid var(--line-input); border-radius: 10px; background: var(--surface); font-size: 14px; cursor: pointer; white-space: nowrap; }
.rp-compare b { font-weight: 650; }
.rp-src { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.rp-pick { position: absolute; z-index: 30; width: 340px; background: var(--surface); border: .5px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(11,11,11,.16); display: flex; flex-direction: column; }
.rp-pick__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; font-weight: 650; }
.rp-pick__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 16px 14px; }
.rp-pick__grid button { height: 40px; border: none; border-radius: 8px; background: transparent; font-size: 14px; cursor: pointer; }
.rp-pick__grid button[aria-pressed="true"] { background: var(--accent); color: #fff; font-weight: 650; }
.rp-pick__grid button.now { box-shadow: inset 0 0 0 1.5px #8DB6E6; }
.rp-pick__grid button[aria-disabled="true"] { color: #C9C7C0; cursor: default; }
.rp-pick__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: .5px solid var(--line); font-size: 13px; color: var(--text-3); }
.rp-title { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.rp-sub { margin: 2px 0 0; color: var(--text-3); font-size: 14px; }
.rp-kpis { display: flex; flex-wrap: wrap; gap: 12px; }
.rp-kpi { flex: 1 1 170px; min-width: 0; box-sizing: border-box; padding: 16px 18px; border-radius: 14px; border: .5px solid var(--line); background: var(--surface); }
.rp-kpi--hero { flex: 2 1 380px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.rp-kpi__label { font-size: 13px; color: var(--text-3); }
.rp-kpi__value { margin-top: 6px; font-size: 28px; line-height: 1.2; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-kpi__value--hero { font-size: 44px; line-height: 1.1; letter-spacing: -0.02em; }
.rp-kpi__unit { font-size: 15px; color: var(--text-3); letter-spacing: 0; font-weight: 500; }
.rp-kpi__against { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.rp-kpi__was { color: #6B6A65; }
.rp-chip { padding: 2px 8px; border-radius: 6px; font-weight: 600; background: var(--fill); color: var(--text-3); white-space: nowrap; }
.rp-chip--up { background: var(--success-bg); color: var(--success); }
.rp-chip--down { background: var(--danger-bg); color: var(--danger); }
.rp-delta { font-weight: 600; color: var(--text-3); white-space: nowrap; }
.rp-delta--up { color: var(--success); } .rp-delta--down { color: var(--danger); } .rp-delta--new { color: var(--accent); }
.rp-spark { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.rp-spark > i { display: block; width: 8px; border-radius: 2px; background: #C9C7C0; }
.rp-spark > i.cur { background: var(--accent); }
.rp-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.rp-card { min-width: 0; box-sizing: border-box; padding: 16px 18px; border-radius: 14px; border: .5px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.rp-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px; }
.rp-card__title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.rp-card__sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.rp-chart { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 200px; padding: 0 0 22px; border-bottom: .5px solid var(--line); }
.rp-chart__col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.rp-chart__bar { width: 70%; max-width: 28px; border-radius: 4px 4px 0 0; background: var(--accent); }
.rp-chart__bar.alt { background: #C9C7C0; }
.rp-chart__x { position: absolute; bottom: -20px; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.rp-chart__v { font-size: 11px; font-weight: 700; margin-bottom: 3px; white-space: nowrap; }
.rp-chart__avg { position: absolute; left: 0; right: 0; border-top: 1px solid #52514E; pointer-events: none; }
.rp-chart__avg span { position: absolute; right: 0; top: -18px; font-size: 11px; color: var(--text-2); background: rgba(255,255,255,.8); padding: 0 4px; }
.rp-stack { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--fill-3); }
.rp-stack > span { display: block; height: 100%; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rp-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: .5px solid var(--line); }
.rp-table td { padding: 8px; border-bottom: .5px solid var(--line-soft); vertical-align: top; }
.rp-table td.n, .rp-table th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-checks { display: flex; flex-direction: column; gap: 10px; }
.rp-check { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 12px; }
.rp-check__icon { width: 34px; height: 34px; border-radius: 9px; background: #fff; display: inline-flex; align-items: center; justify-content: center; }
.rp-check__title { font-weight: 650; font-size: 14px; }
.rp-check__detail { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.rp-check--warn { background: var(--warning-bg); } .rp-check--warn .rp-check__icon, .rp-check--warn .rp-check__title { color: var(--warning); }
.rp-check--info { background: var(--accent-bg); } .rp-check--info .rp-check__icon { color: var(--accent); } .rp-check--info .rp-check__title { color: #1C4F8F; }
.rp-check--ok { background: var(--success-bg); } .rp-check--ok .rp-check__icon, .rp-check--ok .rp-check__title { color: var(--success); }

/* ==== v0.2.2 · D32 admin-only marks (CONVENTIONS §3.15) ==== */
.adm { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--fill-3); color: var(--text-2); font-size: 11px; font-weight: 600; white-space: nowrap; box-sizing: border-box; }
.adm .i { width: 11px; height: 11px; }
.role-locked { opacity: .45; cursor: default; }
.role-note { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--text-3); }

/* ==== v0.2.2 · D51 dangerous mode: the red band under the header on every page while it is on (CONVENTIONS §3.15) ==== */
.danger-band { position: relative; z-index: 21;  /* above a toast hanging under the header (z 20), so its buttons stay usable */
	display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 20px; background: var(--danger); color: #fff; font-size: 13px; font-weight: 600; }
.danger-band .i { flex: none; }
.danger-band .grow { flex: 1; min-width: 0; font-weight: 500; }
.danger-band button { height: 30px; padding: 0 12px; border: 1px solid rgba(255,255,255,.7); border-radius: 8px; background: transparent; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.m-root .danger-band { padding: 8px 14px; }
