/* WUU UI — responsive, dark-first design */

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

:root {
  --bg:        #0f1117;
  --surface:   #161b27;
  --surface2:  #1d2335;
  --border:    rgba(255,255,255,.09);
  --text:      #e8eaf0;
  --muted:     #7c84a0;
  --primary:   #63b3ed;
  --primary-d: #4299d9;
  --success:   #68d391;
  --danger:    #fc8181;
  --warning:   #f6ad55;
  --radius:    14px;
  --pad:       20px;
  --shadow:    0 2px 12px rgba(0,0,0,.3);
  --sidebar-w: 230px;
  --topbar-h:  60px;
  --transition: 180ms ease;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* Light mode */
@media (prefers-color-scheme: light) {
  :root {
    --bg:       #f0f2f7;
    --surface:  #ffffff;
    --surface2: #f5f6fa;
    --border:   rgba(0,0,0,.1);
    --text:     #1a1d2e;
    --muted:    #6b7280;
    --shadow:   0 2px 12px rgba(0,0,0,.08);
  }
}

/* Base */
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: monospace; font-size: .88em; background: var(--surface2); padding: 2px 6px; border-radius: 6px; }

/* ─── App shell ─────────────────────────────────────────────────────────── */
.app { display: flex; flex-direction: column; min-height: 100vh; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.2);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; flex-shrink: 0;
}
.brand-logo-img {
  width: 38px; height: 38px; border-radius: 8px;
  object-fit: contain; background: var(--surface2);
  border: 1px solid var(--border); padding: 3px; flex-shrink: 0;
}
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub  { font-size: 11px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.public-nav {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  flex: 1; min-width: 0; padding: 0 18px; overflow: visible;
}
.public-nav-item { position: relative; display: flex; align-items: center; }
.public-nav a {
  color: var(--muted); font-size: 13px; font-weight: 650;
  padding: 7px 10px; border-radius: 9px; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.public-nav a:hover { color: var(--text); background: var(--surface2); text-decoration: none; }
.public-nav a.active { color: var(--primary); background: rgba(99,179,237,.14); }
.public-nav a.as-button {
  color: #fff; background: var(--cms-primary, var(--primary));
  border: 1px solid color-mix(in srgb, var(--cms-primary, var(--primary)) 55%, transparent);
}
.public-nav.style-underline a { border-radius: 0; border-bottom: 2px solid transparent; }
.public-nav.style-underline a.active { background: transparent; border-bottom-color: var(--cms-primary, var(--primary)); }
.public-nav.style-button a { border: 1px solid var(--border); background: var(--surface2); }
.public-subnav {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 190px;
  padding: 8px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow); z-index: 150;
}
.public-subnav a { display: block; width: 100%; }
.public-nav-item:hover .public-subnav, .public-nav-item:focus-within .public-subnav { display: block; }
.chip {
  padding: 5px 10px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 12px; color: var(--muted);
  white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}

/* Hamburger (mobile) */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px; border: none; background: transparent;
}
.hamburger span {
  display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px;
  transition: var(--transition);
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.body-wrap {
  display: flex; flex: 1;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  color: var(--muted); text-transform: uppercase;
  padding: 12px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--muted); font-size: 14px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-item.active { background: rgba(99,179,237,.14); color: var(--primary); border: 1px solid rgba(99,179,237,.22); }
.nav-group {
  border: 1px solid transparent;
  border-radius: 12px;
}
.nav-group + .nav-group { margin-top: 4px; }
.nav-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary span { display: grid; gap: 1px; min-width: 0; }
.nav-group summary strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-group summary small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-group summary em {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}
.nav-group summary:after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform var(--transition);
  flex: 0 0 auto;
}
.nav-group[open] summary:after { transform: rotate(225deg); }
.nav-group[open] {
  border-color: rgba(148,163,184,.18);
  background: rgba(255,255,255,.45);
}
.nav-group.active[open] {
  border-color: rgba(99,179,237,.3);
  background: rgba(99,179,237,.08);
}
.nav-group-items {
  display: grid;
  gap: 2px;
  padding: 0 6px 7px;
}
.nav-group-items .nav-item {
  padding-left: 8px;
  font-size: 13px;
}

/* Content */
.content {
  flex: 1; min-width: 0;
  padding: var(--pad);
  max-width: 1280px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 12px var(--pad);
  color: var(--muted); font-size: 12px;
  display: flex; gap: 10px; justify-content: center;
}

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
p  { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.muted  { color: var(--muted); }
.small  { font-size: 12px; }
.strong { font-weight: 700; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--pad);
  box-shadow: var(--shadow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ─── KPI stats ──────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi-val  { font-size: 32px; font-weight: 900; line-height: 1; }
.kpi-label { font-size: 12px; color: var(--muted); }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 12px; }
.form-section { font-size: 11px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--muted); padding-top: 6px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=search], input[type=url],
select, textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2); color: var(--text);
  font-family: var(--font); font-size: 14px;
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
input[type=color] {
  width: 100%;
  min-height: 42px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(99,179,237,.5);
  box-shadow: 0 0 0 3px rgba(99,179,237,.15);
}
textarea { resize: vertical; min-height: 90px; }
.input-hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background var(--transition), border-color var(--transition);
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }

.btn.pri   { background: rgba(99,179,237,.18); border-color: rgba(99,179,237,.4); color: var(--primary); }
.btn.pri:hover { background: rgba(99,179,237,.26); }
.btn.success { background: rgba(104,211,145,.15); border-color: rgba(104,211,145,.35); color: var(--success); }
.btn.danger  { background: rgba(252,129,129,.1);  border-color: rgba(252,129,129,.35); color: var(--danger); }
.btn.ghost   { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface2); }
.btn.sm    { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn.xs    { padding: 4px 9px;  font-size: 11px; border-radius: 7px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface2); font-size: 14px; margin-bottom: 12px;
}
.alert.ok      { border-color: rgba(104,211,145,.4); background: rgba(104,211,145,.08); color: var(--success); }
.alert.err     { border-color: rgba(252,129,129,.4); background: rgba(252,129,129,.08); color: var(--danger); }
.alert.warning { border-color: rgba(246,173,85,.4);  background: rgba(246,173,85,.08);  color: var(--warning); }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border); color: var(--muted); background: var(--surface2);
}
.badge.ok, .badge-green  { border-color: rgba(104,211,145,.4); color: var(--success); background: rgba(104,211,145,.1); }
.badge.danger, .badge-red { border-color: rgba(252,129,129,.4); color: var(--danger);  background: rgba(252,129,129,.1); }
.badge.warning            { border-color: rgba(246,173,85,.4);  color: var(--warning); background: rgba(246,173,85,.1); }
.badge.primary, .badge-blue { border-color: rgba(99,179,237,.4); color: var(--primary); background: rgba(99,179,237,.1); }
.badge-grey               { border-color: var(--border); color: var(--muted); background: var(--surface2); }

/* ─── Definition list grid ───────────────────────────────────────────────── */
.dl-grid { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; font-size: 14px; }
.dl-grid dt { color: var(--muted); font-weight: 500; padding-top: 2px; }
.dl-grid dd { margin: 0; }

/* ─── Table ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td {
  padding: 10px 14px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.table th { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255,255,255,.025); }
.nowrap { white-space: nowrap; }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.flex    { display: flex; }
.row     { display: flex; align-items: center; }
.row.gap { gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.gap-sm  { gap: 6px; }
.gap-md  { gap: 12px; }
.sep     { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.mt-sm   { margin-top: 8px; }
.mt-md   { margin-top: 14px; }
.mt-lg   { margin-top: 22px; }
.mb-sm   { margin-bottom: 8px; }
.w-full  { width: 100%; }
.center  { display: grid; place-items: center; min-height: calc(100vh - var(--topbar-h)); }
.inline  { display: inline; }
.inline-block { display: inline-block; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Page header ────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.page-title  { font-size: 20px; font-weight: 700; }

/* ─── Auth / centered form ───────────────────────────────────────────────── */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg); padding: 20px;
}
.auth-box {
  width: min(420px, 100%);
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
}
.auth-logo .logo-big {
  width: 52px; height: 52px; border-radius: 16px; background: var(--primary);
  color: #fff; font-size: 26px; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.auth-logo h1 { font-size: 22px; }
.auth-logo p  { margin: 0; }

/* ─── File manager ───────────────────────────────────────────────────────── */
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2); font-size: 13px;
}
.file-item svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .hamburger { display: flex; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
    z-index: 200; transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: 4px 0 20px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; z-index: 199;
    background: rgba(0,0,0,.45);
  }
  .sidebar-overlay.open { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .public-nav {
    order: 3; width: 100%; flex-basis: 100%; justify-content: flex-start;
    align-items: stretch; flex-wrap: wrap; gap: 6px; padding: 0; overflow: visible;
  }
  .public-nav-item { min-width: 0; flex: 1 1 140px; }
  .public-nav a { width: 100%; text-align: center; white-space: normal; line-height: 1.2; }
  .topbar { height: auto; min-height: var(--topbar-h); flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .sidebar { top: calc(var(--topbar-h) + 42px); height: calc(100vh - var(--topbar-h) - 42px); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .chip { display: none; }
  .table-wrap { border-radius: 10px; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  h1 { font-size: 18px; }
}

/* WUU 2.0 clean polish pass */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface2: #eef3f8;
  --surface3: #f8fafc;
  --border: rgba(20,31,48,.12);
  --text: #182033;
  --muted: #647084;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --success: #11845b;
  --danger: #c2413b;
  --warning: #b7791f;
  --accent: #0f766e;
  --radius: 8px;
  --pad: 20px;
  --shadow: 0 12px 32px rgba(20,31,48,.08);
  --sidebar-w: 252px;
}

body { background: var(--bg); }
html, body { max-width: 100%; overflow-x: hidden; }
body * { letter-spacing: 0 !important; }
a { color: var(--primary); }
.topbar { background: rgba(255,255,255,.92); backdrop-filter: blur(14px); box-shadow: none; }
.logo {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(37,99,235,.22);
}
.brand-logo-img { background: #fff; border-radius: 8px; }
.brand-name { letter-spacing: 0; }
.sidebar { background: #fbfcfe; }
.nav-item { border-radius: 8px; }
.nav-item.active { background: #e8f0ff; border-color: rgba(37,99,235,.22); color: var(--primary); }
.content { width: 100%; }
.card, .kpi, .table-wrap, .alert, input, select, textarea, .btn, .file-item { border-radius: 8px; }
.card { box-shadow: var(--shadow); }
.btn.pri {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.pri:hover { background: var(--primary-d); }
.btn.ghost { color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.badge { border-radius: 999px; }
.page-title { font-size: 24px; letter-spacing: 0; }
.page-header p { max-width: 760px; }

.eyebrow {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr);
  background: linear-gradient(135deg, #f8fafc, #eef3f8);
}
.auth-brand-panel,
.auth-form-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
}
.auth-brand-panel {
  background: #101827;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-brand-panel::after {
  content: "";
  position: absolute;
  inset: auto -18% -28% 18%;
  height: 360px;
  background: linear-gradient(135deg, rgba(37,99,235,.38), rgba(15,118,110,.28));
  transform: rotate(-9deg);
  border-radius: 38px;
}
.auth-brand-inner {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  display: grid;
  gap: 28px;
}
.auth-logo-slot {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
}
.auth-logo-slot img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border-radius: 12px;
}
.auth-logo-slot span {
  font-size: 42px;
  font-weight: 900;
}
.auth-brand-panel .eyebrow { color: #7dd3fc; }
.auth-brand-panel h1 {
  font-size: 44px;
  line-height: 1.05;
  margin: 0 0 12px;
}
.auth-lead {
  color: rgba(255,255,255,.74);
  font-size: 17px;
  max-width: 420px;
}
.auth-note {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.74);
}
.auth-note strong { color: #fff; }
.auth-card {
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(20,31,48,.14);
}
.auth-card-head { margin-bottom: 18px; }
.auth-card-head h2 { font-size: 26px; margin-bottom: 6px; }
.auth-card-foot {
  border-top: 1px solid var(--border);
  margin-top: 20px;
  padding-top: 16px;
  font-size: 13px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.dash-tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 148px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.dash-tile:hover { text-decoration: none; border-color: rgba(37,99,235,.35); transform: translateY(-1px); }
.tile-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f0ff;
  color: var(--primary);
  font-weight: 900;
}
.tile-value { font-size: 30px; font-weight: 900; line-height: 1; }
.tile-label { font-size: 13px; color: var(--muted); }
.tile-meta { margin-top: auto; color: var(--muted); font-size: 12px; }
.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 14px;
}
.timeline { display: grid; gap: 10px; }
.timeline-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  align-items: start;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  margin-top: 6px;
  background: var(--primary);
}
.mini-list { display: grid; gap: 8px; }
.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.mini-row:last-child { border-bottom: 0; }
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-pill {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.stat-pill strong { display: block; font-size: 22px; }
.details-card summary { cursor: pointer; font-weight: 700; }
.details-card pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.media-card-preview,
.file-card-icon {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface3);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 10px;
}
.media-card-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-card-icon { aspect-ratio: auto; min-height: 58px; width: 58px; margin: 0; font-weight: 900; color: var(--primary); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.profile-hero {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) minmax(180px, 260px);
  gap: 18px;
  align-items: center;
  padding: 22px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.profile-avatar-lg {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 42px;
  font-weight: 900;
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero-main h1 { font-size: 34px; margin: 0 0 6px; }
.profile-hero-main p { margin-bottom: 14px; }
.profile-completion {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.profile-completion strong { font-size: 30px; }
.progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe5f0;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--primary);
}
.profile-side { display: grid; gap: 14px; align-content: start; }
.profile-permissions { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface3);
  color: var(--text);
  margin: 0;
}
.toggle-row input { width: auto; }
.bulk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bulk-toolbar select { max-width: 340px; }
.users-table td { vertical-align: top; }
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.user-avatar-mini {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 900;
}
.user-cell span:last-child { min-width: 0; }
.user-cell .small { display: block; }
.user-details-row td {
  padding-top: 0;
  background: rgba(20,31,48,.015);
}
.user-details-row details[open] {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface3);
}
.user-edit-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.user-password-panel {
  max-width: 460px;
  margin-top: 10px;
}
.empty-state {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface3);
}
.module-standard {
  display: grid;
  gap: 10px;
}
.module-standard div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.module-standard div:last-child { border-bottom: 0; }
.module-standard span { color: var(--muted); }
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.module-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface3);
}
.module-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.module-card-head h3 { font-size: 18px; }
.module-card-head p { margin: 4px 0 0; }
.module-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.module-details {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

body.app-density-compact {
  --pad: 14px;
  font-size: 14px;
}
body.app-density-compact .card,
body.app-density-compact .kpi,
body.app-density-compact .dash-tile { padding: 14px; }
body.app-theme-dark {
  --bg: #0f172a;
  --surface: #111827;
  --surface2: #1f2937;
  --surface3: #172033;
  --border: rgba(255,255,255,.11);
  --text: #eef2ff;
  --muted: #9ca3af;
  --shadow: 0 18px 42px rgba(0,0,0,.25);
}
body.app-theme-dark .topbar,
body.app-theme-dark .sidebar,
body.app-theme-dark .card,
body.app-theme-dark .dash-tile,
body.app-theme-dark .profile-hero,
body.app-theme-dark .public-panel,
body.app-theme-dark .public-band { background: var(--surface); }
body.app-theme-dark .nav-item.active,
body.app-theme-dark .tile-icon,
body.app-theme-dark .public-feature span { background: rgba(37,99,235,.22); }
body.app-theme-dark input,
body.app-theme-dark select,
body.app-theme-dark textarea { background: #0f172a; }

.public-landing { background: #f8fafc; color: var(--text); min-height: 100vh; }
.land-title { font-size: 52px; }
.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.public-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.public-logo {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 900;
}
.public-logo img { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; }
.public-main {
  padding: clamp(54px, 8vw, 96px) clamp(18px, 5vw, 56px) 44px;
}
.public-hero {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}
.public-hero h1 {
  font-size: 64px;
  line-height: 1;
  max-width: 760px;
  margin-bottom: 20px;
}
.public-hero p { font-size: 18px; max-width: 680px; }
.public-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.public-feature-list { display: grid; gap: 12px; margin-top: 18px; }
.public-feature {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}
.public-feature span {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8f0ff;
  color: var(--primary);
  font-weight: 900;
}
.public-bands {
  max-width: 1120px;
  margin: 54px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.public-band {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 18px;
}
.public-hero {
  min-height: min(68vh, 720px);
  grid-template-columns: 1fr;
  align-items: end;
  border-radius: 8px;
  padding: clamp(28px, 6vw, 72px);
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.public-hero.has-image {
  background-image: linear-gradient(90deg, rgba(15,23,42,.82), rgba(15,23,42,.28)), var(--public-hero-image);
  background-size: cover;
  background-position: center;
  color: #fff;
}
.public-hero.has-image p,
.public-hero.has-image .eyebrow { color: rgba(255,255,255,.82); }
.public-hero-copy {
  max-width: 780px;
  position: relative;
  z-index: 1;
}
.public-band-num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f0ff;
  color: var(--primary);
  font-weight: 900;
  margin-bottom: 12px;
}
.public-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px clamp(18px, 5vw, 56px) 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 920px) {
  .auth-shell,
  .public-hero,
  .section-grid { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: auto; }
  .auth-brand-panel,
  .auth-form-panel { padding: 28px 18px; }
  .public-bands { grid-template-columns: 1fr; }
  .public-hero h1 { font-size: 42px; }
  .land-title { font-size: 42px; }
  .profile-hero { grid-template-columns: 1fr; }
  .profile-avatar-lg { width: 84px; height: 84px; }
  .bulk-toolbar { align-items: stretch; flex-direction: column; }
  .bulk-toolbar select { max-width: none; }
  .module-standard div { grid-template-columns: 1fr; }
  .module-card-head { flex-direction: column; }
}

@media (max-width: 520px) {
  .public-header { align-items: flex-start; flex-wrap: wrap; }
  .public-header .btn-group { width: 100%; justify-content: flex-start; }
  .public-brand { width: 100%; }
  .public-hero h1 { font-size: 38px; }
  .public-hero p { font-size: 16px; }
  .auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
  }
  .auth-brand-panel { display: none; }
  .auth-form-panel {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    padding: 20px;
    overflow: hidden;
  }
  .auth-card {
    width: 100%;
    max-width: 330px;
    min-width: 0;
    padding: 22px;
  }
  .auth-card-head p { max-width: 260px; }
  .auth-card p { overflow-wrap: anywhere; }
}

/* Unified assets library */
.file-manager {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.fm-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
  display: grid;
  gap: 12px;
}
.fm-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 12px;
}
.fm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.fm-tree {
  display: grid;
  gap: 2px;
  max-height: 420px;
  overflow: auto;
}
.fm-tree a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
}
.fm-tree a:hover,
.fm-tree a.active {
  background: #e8f0ff;
  color: var(--primary);
  text-decoration: none;
}
.fm-tree span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fm-tree em {
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
}
.fm-tree-icon {
  width: 30px;
  min-width: 30px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface3);
  color: var(--primary);
  font-size: 10px;
  font-weight: 900;
}
.fm-current {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface3);
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.fm-file-input {
  border: 1px dashed rgba(37,99,235,.35);
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}
.fm-main {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}
.fm-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.fm-toolbar h2 {
  font-size: 20px;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.fm-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.fm-search {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: min(520px, 100%);
}
.fm-search input { min-width: 180px; }
.fm-search select { max-width: 160px; }
.fm-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.fm-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.fm-folder-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface3);
  color: var(--text);
}
.fm-folder-card:hover {
  text-decoration: none;
  border-color: rgba(37,99,235,.35);
  background: #f8fbff;
}
.fm-folder-card span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #e8f0ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}
.fm-folder-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fm-folder-card em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}
.fm-folder-card.parent span {
  background: #eef2f7;
  color: var(--muted);
}
.fm-copy-url {
  width: 100%;
  font-size: 11px;
}
.asset-header .btn-group { align-self: flex-start; }
.asset-tools { align-items: stretch; }
.asset-actionbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface3);
}
.asset-actionbar input,
.asset-actionbar select { max-width: 190px; }
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}
.asset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.asset-select {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
}
.asset-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #f8fafc, #eaf0f7);
  color: var(--primary);
  font-weight: 900;
  overflow: hidden;
}
.asset-preview:hover { text-decoration: none; }
.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-preview span {
  min-width: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}
.asset-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.asset-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.asset-title-row h3 {
  font-size: 15px;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}
.asset-title-row p { margin: 4px 0 0; }
.asset-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.asset-meta span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface3);
  color: var(--muted);
  font-size: 11px;
}
.asset-share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}
.asset-share input {
  min-width: 0;
  font-size: 11px;
}
.asset-editor {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.asset-editor summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}
.asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.asset-view-list { grid-template-columns: 1fr; }
.asset-view-list .asset-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}
.asset-view-list .asset-preview {
  height: 100%;
  min-height: 180px;
  aspect-ratio: auto;
}
.assets-table td { vertical-align: top; }

@media (max-width: 800px) {
  .file-manager { grid-template-columns: 1fr; }
  .fm-sidebar { position: static; }
  .fm-toolbar,
  .fm-search { flex-direction: column; align-items: stretch; }
  .fm-search input,
  .fm-search select { max-width: none; width: 100%; }
  .asset-actionbar .btn-group { width: 100%; }
  .asset-actionbar input,
  .asset-actionbar select { max-width: none; flex: 1 1 180px; }
  .asset-view-list .asset-card { grid-template-columns: 1fr; }
  .asset-view-list .asset-preview { min-height: 0; aspect-ratio: 16 / 10; }
}

/* Notification center */
.notify-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}
.notify-main,
.notify-side {
  min-width: 0;
}
.notify-side {
  display: grid;
  gap: 14px;
}
.notify-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.notify-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px 160px 130px auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface3);
  margin-bottom: 12px;
}
.notify-feed {
  display: grid;
  gap: 10px;
}
.notify-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}
.notify-item.is-unread {
  background: #fbfdff;
}
.notify-item.priority-critical { border-left-color: var(--danger); }
.notify-item.priority-high { border-left-color: var(--warning); }
.notify-item.priority-low { border-left-color: var(--muted); }
.notify-item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.notify-item h2 {
  font-size: 17px;
  margin: 6px 0 6px;
  overflow-wrap: anywhere;
}
.notify-item p {
  margin: 0 0 10px;
  color: var(--text);
}
.notify-badges,
.notify-meta,
.notify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.notify-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}
.notify-actions form {
  display: inline-flex;
}

@media (max-width: 980px) {
  .notify-layout { grid-template-columns: 1fr; }
  .notify-filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .notify-filters,
  .notify-item-head { grid-template-columns: 1fr; display: grid; }
}

/* Audit journal */
.audit-header { align-items: flex-start; }
.audit-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.audit-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.audit-filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}
.audit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
  align-items: start;
}
.audit-feed {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.audit-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}
.audit-severity-warning,
.audit-severity-high { border-left-color: var(--warning); }
.audit-severity-critical,
.audit-severity-error { border-left-color: var(--danger); }
.audit-item-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.audit-mainline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}
.audit-id {
  min-width: 46px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.audit-mainline h2 {
  font-size: 17px;
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}
.audit-code code { overflow-wrap: anywhere; }
.audit-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.audit-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.audit-facts div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  padding: 8px 10px;
  min-width: 0;
}
.audit-facts span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.audit-facts strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.audit-details {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.audit-details > summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
}
.audit-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.audit-meta {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}
.audit-meta div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  padding: 7px 9px;
}
.audit-meta dt {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.audit-meta dd {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.audit-side {
  display: grid;
  gap: 14px;
}
.audit-bars {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.audit-bar-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.audit-bar {
  height: 9px;
  border-radius: 999px;
  background: var(--surface2);
  overflow: hidden;
}
.audit-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}
.audit-facet-list a {
  color: var(--text);
}
.audit-facet-list a:hover {
  text-decoration: none;
  background: var(--surface2);
}
.audit-streams {
  display: grid;
  gap: 8px;
}
.audit-stream {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  padding: 9px;
}
.audit-stream summary {
  cursor: pointer;
  display: grid;
  gap: 3px;
}
.audit-stream summary span {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.audit-stream summary strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.audit-stream summary em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}
.audit-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.audit-empty { text-align: center; }

@media (max-width: 1080px) {
  .audit-layout { grid-template-columns: 1fr; }
  .audit-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .audit-filters,
  .audit-item-head,
  .audit-detail-grid,
  .audit-meta div { grid-template-columns: 1fr; }
  .audit-item-head { display: grid; }
  .audit-badges { justify-content: flex-start; }
}

/* Settings and personalization */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}
.settings-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.settings-side {
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
}
.settings-card {
  display: grid;
  gap: 14px;
}
.settings-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.settings-upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: end;
}
.settings-preview-box {
  min-height: 94px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  display: grid;
  place-items: center;
  padding: 10px;
  overflow: hidden;
}
.settings-preview-box img {
  max-width: 100%;
  max-height: 84px;
  object-fit: contain;
}
.settings-preview-box span {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
}
.settings-preview-box.small-preview {
  min-height: 72px;
}
.settings-preview-box.small-preview img {
  max-height: 44px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
}
.check-row input { width: auto; }
.settings-preview-card {
  display: grid;
  gap: 14px;
}
.settings-brand-preview {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.settings-brand-logo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--settings-primary, var(--primary));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.settings-brand-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.settings-brand-logo span {
  color: #fff;
  font-weight: 900;
  font-size: 24px;
}
.settings-brand-preview p {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.settings-swatch-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.settings-swatch-row span {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.settings-mini-page {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface2);
  display: grid;
  gap: 8px;
}
.settings-mini-page img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}
.settings-mini-page em {
  color: var(--settings-primary, var(--primary));
  font-style: normal;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
}
.settings-mini-page h3 {
  font-size: 20px;
  margin: 0;
  overflow-wrap: anywhere;
}
.settings-mini-page button {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  background: var(--settings-primary, var(--primary));
  color: #fff;
  padding: 9px 12px;
  font-weight: 700;
}

@media (max-width: 1080px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-side { position: static; }
}

@media (max-width: 680px) {
  .settings-upload-grid,
  .settings-brand-preview { grid-template-columns: 1fr; }
}

/* Content CMS and public menu builder */
.content-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  align-items: start;
}
.content-admin-main,
.content-admin-side {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.content-admin-side {
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
}
.module-menu-picker .card-header {
  align-items: flex-start;
}
.module-menu-picker .card-header p {
  margin: 4px 0 0;
}
.module-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.module-menu-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}
.module-menu-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.module-menu-card-head,
.module-menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.module-menu-card-head code {
  display: block;
  width: fit-content;
  margin-top: 5px;
  font-size: 12px;
}
.module-menu-card .grid {
  gap: 10px;
}
.module-menu-foot {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.content-editor-card {
  display: grid;
  gap: 14px;
}
.visual-editor {
  display: grid;
  gap: 8px;
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.editor-toolbar button {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.editor-surface {
  min-height: 300px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  outline: none;
  overflow-wrap: anywhere;
}
.editor-surface:focus {
  border-color: rgba(99,179,237,.5);
  box-shadow: 0 0 0 3px rgba(99,179,237,.15);
}
.editor-surface h2,
.editor-surface h3 { margin: 14px 0 8px; }
.editor-surface p,
.editor-surface ul,
.editor-surface ol,
.content-body p,
.content-body ul,
.content-body ol { margin-bottom: 12px; }
.editor-surface ul,
.editor-surface ol,
.content-body ul,
.content-body ol { padding-left: 22px; }
.editor-source {
  font-family: ui-monospace, Consolas, monospace;
  min-height: 120px;
}
.editor-html {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface2);
}
.editor-html summary {
  cursor: pointer;
  font-weight: 800;
}
.editor-html textarea {
  margin-top: 8px;
}
.content-table td { vertical-align: top; }
.menu-builder-list {
  display: grid;
  gap: 8px;
}
.menu-builder-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.menu-builder-item.is-home {
  border-color: rgba(99,179,237,.45);
  background: rgba(99,179,237,.08);
}
.content-home-card .mini-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface2);
}
.public-content-page {
  max-width: 1120px;
  margin: 0 auto;
}
.content-hero {
  min-height: 320px;
  display: flex;
  align-items: end;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.content-hero.has-image {
  background-image: linear-gradient(90deg, rgba(15,23,42,.82), rgba(15,23,42,.24)), var(--content-hero-image);
  background-size: cover;
  background-position: center;
  color: #fff;
}
.content-hero h1 {
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1;
  margin-bottom: 14px;
}
.content-hero p {
  max-width: 760px;
  font-size: 18px;
}
.content-hero.has-image p,
.content-hero.has-image .eyebrow { color: rgba(255,255,255,.82); }
.content-body {
  max-width: 860px;
  margin: 28px auto 0;
  padding: 0 4px 46px;
  font-size: 17px;
  line-height: 1.75;
}
.content-body h2,
.content-body h3,
.content-body h4 { margin: 24px 0 10px; }
.content-body img {
  max-width: 100%;
  border-radius: 8px;
}
.content-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.content-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.content-card:hover {
  text-decoration: none;
  border-color: rgba(99,179,237,.45);
}
.content-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}
.content-card h2 {
  font-size: 18px;
  margin: 0;
}

@media (max-width: 1120px) {
  .content-admin-layout { grid-template-columns: 1fr; }
  .content-admin-side { position: static; }
}

@media (max-width: 680px) {
  .editor-toolbar { overflow-x: auto; flex-wrap: nowrap; }
  .content-hero { min-height: 260px; }
}

/* WUU invoicing and KSeF work surfaces */
.invoice-module-head,
.ksef-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.invoice-module-head strong,
.ksef-console-head strong { display: block; font-size: 18px; }
.module-kicker {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.invoice-quick-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.module-subnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}
.module-subnav a {
  display: grid;
  gap: 1px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.module-subnav a:hover { text-decoration: none; border-color: rgba(37,99,235,.35); }
.module-subnav a.active { border-color: rgba(37,99,235,.52); background: rgba(37,99,235,.08); }
.module-subnav span { font-weight: 800; }
.module-subnav small { color: var(--muted); font-size: 11px; }
.invoice-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 14px;
}
.invoice-hero > div,
.invoice-hero-side {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.invoice-hero > div { padding: 22px; }
.invoice-hero h1 {
  max-width: 760px;
  margin: 3px 0 8px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.08;
  letter-spacing: 0;
}
.invoice-hero p { max-width: 720px; color: var(--muted); margin-bottom: 18px; }
.invoice-hero-side {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border-left: 4px solid var(--primary);
}
.invoice-hero-side span,
.invoice-hero-side small { color: var(--muted); }
.invoice-hero-side strong { font-size: 30px; line-height: 1.1; }
.invoice-product-hero .invoice-hero-side {
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--surface)), color-mix(in srgb, var(--success) 8%, var(--surface)));
}
.invoice-readiness-bar,
.invoice-readiness-strip i {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success) var(--p, 0%), color-mix(in srgb, var(--border) 88%, transparent) 0);
}
.invoice-readiness-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.invoice-readiness-strip strong,
.invoice-readiness-strip small { display: block; }
.invoice-readiness-strip small { color: var(--muted); }
.invoice-start-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.invoice-start-step {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.invoice-start-step:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
}
.invoice-start-step span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-weight: 950;
}
.invoice-start-step.done {
  border-left: 4px solid var(--success);
}
.invoice-start-step.done span {
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
}
.invoice-start-step.todo {
  border-left: 4px solid var(--warning);
}
.invoice-start-step.todo span {
  background: color-mix(in srgb, var(--warning) 14%, transparent);
  color: var(--warning);
}
.invoice-start-step strong {
  font-size: 19px;
}
.invoice-start-step p {
  margin: 0;
  color: var(--muted);
}
.invoice-start-step em {
  align-self: end;
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-style: normal;
  font-weight: 850;
  font-size: 12px;
}
.invoice-flow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.invoice-flow-steps article {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface2) 72%, var(--surface));
}
.invoice-flow-steps b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}
.invoice-flow-steps span {
  color: var(--muted);
}
.invoice-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.invoice-metrics.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card {
  display: grid;
  gap: 4px;
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.metric-card:hover { text-decoration: none; border-color: rgba(37,99,235,.35); }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .03em; }
.metric-card strong { font-size: 24px; line-height: 1.1; }
.metric-card small { color: var(--muted); }
.invoice-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr);
  gap: 14px;
  align-items: start;
}
.empty-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.invoice-list { display: grid; gap: 8px; }
.invoice-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(110px, auto) minmax(180px, 240px) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.row-title { display: block; color: var(--text); font-weight: 850; }
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin: 2px 2px 2px 0;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.status-paid,
.status-ksef_accepted,
.status-accepted,
.status-ksef { color: #166534; background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.28); }
.status-draft { color: #6b7280; background: rgba(107,114,128,.1); }
.status-issued,
.status-sent,
.status-ksef_pending,
.status-ready,
.status-processing { color: #1d4ed8; background: rgba(37,99,235,.1); border-color: rgba(37,99,235,.25); }
.status-cancelled,
.status-rejected,
.status-ksef_rejected { color: #991b1b; background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.24); }
.status-overdue { color: #92400e; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.28); }
.money-cell { display: grid; gap: 4px; min-width: 170px; }
.money-cell strong { font-size: 13px; }
.money-cell span { color: var(--muted); font-size: 11px; }
.money-cell i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) var(--p, 0%), transparent 0), var(--border);
}
.check-list { display: grid; gap: 10px; }
.check-list div {
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  gap: 9px;
  align-items: start;
}
.check-list span {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface2);
}
.check-list .done span { background: var(--success); border-color: var(--success); }
.check-list strong { display: block; }
.check-list small { display: block; color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.registry-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(5, minmax(120px, .8fr)) auto auto;
  gap: 8px;
  align-items: end;
}
.invoice-table td { vertical-align: middle; }
.invoice-table td > span { display: block; }
.ksef-console { display: grid; gap: 14px; }
.ksef-setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 14px;
  align-items: start;
}
.ksef-stage-list { display: grid; gap: 8px; }
.ksef-stage {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.ksef-stage b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(37,99,235,.12);
  color: var(--primary);
}
.ksef-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ksef-method-grid button,
.ksef-resource-link {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
}
.ksef-method-grid button:hover,
.ksef-resource-link:hover { border-color: rgba(37,99,235,.35); text-decoration: none; }
.ksef-method-grid span,
.ksef-resource-link span { color: var(--muted); font-size: 12px; }
.ksef-resource-list { display: grid; gap: 8px; margin-top: 10px; }
.ksef-demo-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(245,158,11,.32);
  border-left: 4px solid var(--warning);
  border-radius: 8px;
  background: rgba(245,158,11,.08);
}
.ksef-demo-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.ksef-demo-facts div {
  padding: 10px;
  border: 1px solid rgba(245,158,11,.24);
  border-radius: 8px;
  background: var(--surface);
}
.ksef-demo-facts strong { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; }
.ksef-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.company-preview,
.entity-list,
.integration-list,
.invoice-builder {
  display: grid;
  gap: 10px;
}
.company-preview {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.company-preview strong { font-size: 18px; }
.company-preview span { color: var(--muted); }
.compact-toolbar {
  grid-template-columns: minmax(170px, 1.2fr) repeat(2, minmax(110px, .7fr)) auto auto;
  margin-bottom: 0;
}
.compact-form { gap: 11px; }
.entity-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, auto) minmax(160px, .7fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.entity-row strong,
.entity-row span { display: block; }
.entity-row span { color: var(--muted); }
.item-row { grid-template-columns: minmax(220px, 1fr) minmax(160px, auto) minmax(140px, .55fr) auto; }
.toggle-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
}
.toggle-line input { width: auto; }
.invoice-preview-sheet {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-top: 6px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}
.invoice-preview-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}
.invoice-preview-top small,
.invoice-preview-top span { display: block; color: var(--muted); }
.invoice-preview-band {
  padding: 9px 11px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
  font-weight: 750;
}
.mini-table {
  font-size: 12px;
}
.mini-table th,
.mini-table td { padding: 8px; }
.invoice-preview-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.invoice-preview-total span { color: var(--muted); }
.invoice-preview-total strong { font-size: 20px; }
.integration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.integration-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.integration-card.ready { border-left: 4px solid var(--success); }
.integration-card.planned { border-left: 4px solid var(--primary); }
.integration-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}
.invoice-builder .card { margin: 0; }
.invoice-lines-table input,
.invoice-lines-table select { min-width: 92px; }
@media (max-width: 1180px) {
  .invoice-metrics,
  .invoice-metrics.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .registry-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .compact-toolbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 940px) {
  .invoice-hero,
  .invoice-workspace,
  .ksef-setup-grid { grid-template-columns: 1fr; }
  .invoice-start-grid,
  .invoice-flow-steps,
  .invoice-readiness-strip { grid-template-columns: 1fr; }
  .invoice-row,
  .entity-row,
  .item-row { grid-template-columns: 1fr; }
  .ksef-method-grid,
  .ksef-demo-facts,
  .ksef-form-grid,
  .invoice-preview-top { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .invoice-module-head,
  .ksef-console-head { align-items: stretch; flex-direction: column; }
  .invoice-metrics,
  .invoice-metrics.compact,
  .registry-toolbar,
  .compact-toolbar,
  .integration-grid { grid-template-columns: 1fr; }
}

.finance-hero .invoice-hero-side {
  background: linear-gradient(135deg, rgba(37, 99, 235, .10), rgba(16, 185, 129, .08));
}
.invoice-queue-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.invoice-queue-grid.compact { grid-template-columns: repeat(6, minmax(120px, 1fr)); }
.invoice-queue-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.invoice-queue-card.active,
.invoice-queue-card:hover {
  border-color: rgba(37, 99, 235, .55);
  box-shadow: 0 14px 34px rgba(37, 99, 235, .14);
}
.invoice-queue-card span,
.invoice-queue-card small { color: var(--muted); }
.invoice-queue-card strong { font-size: 30px; line-height: 1; }
.invoice-queue-card.tone-primary { border-left: 4px solid #2563eb; }
.invoice-queue-card.tone-ok { border-left: 4px solid #059669; }
.invoice-queue-card.tone-warn { border-left: 4px solid #d97706; }
.invoice-queue-card.tone-danger { border-left: 4px solid #dc2626; }
.invoice-queue-card.tone-neutral { border-left: 4px solid #64748b; }
.invoice-next-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 9%, transparent), transparent 48%),
    var(--surface);
  box-shadow: var(--shadow);
}
.invoice-next-panel.compact { padding: 14px; }
.invoice-next-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.invoice-next-head h2 {
  margin: 3px 0 0;
  font-size: clamp(19px, 2vw, 26px);
}
.invoice-next-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.invoice-next-grid.compact { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.invoice-next-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface), #f8fafc 35%);
  color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.invoice-next-card:hover,
.invoice-next-card.active {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 52%, var(--border));
  box-shadow: 0 16px 34px rgba(37, 99, 235, .13);
}
.invoice-next-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}
.invoice-next-card b {
  font-size: 28px;
  line-height: 1;
}
.invoice-next-card em {
  grid-column: 2 / -1;
  justify-self: start;
  padding: 5px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}
.invoice-step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
}
.invoice-next-card.tone-primary { border-left: 4px solid #2563eb; }
.invoice-next-card.tone-ok { border-left: 4px solid #059669; }
.invoice-next-card.tone-warn { border-left: 4px solid #d97706; }
.invoice-next-card.tone-danger { border-left: 4px solid #dc2626; }
.invoice-next-card.tone-danger em { background: #fef2f2; color: #b91c1c; }
.invoice-next-card.tone-warn em { background: #fffbeb; color: #92400e; }
.invoice-source-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.invoice-source-map article {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface), #f8fafc 35%);
}
.invoice-source-map span,
.invoice-source-map p { color: var(--muted); }
.invoice-source-map strong { display: block; margin: 5px 0 8px; font-size: 18px; }
.finance-row { grid-template-columns: minmax(190px, 1.1fr) minmax(140px, .7fr) minmax(170px, .8fr) minmax(190px, 1fr) auto; }
.invoice-pill-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.source-badge { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.integration-snapshot {
  display: grid;
  gap: 8px;
}
.integration-snapshot a {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
}
.danger-text { color: #b91c1c; font-weight: 700; }
.finance-toolbar {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}
.finance-toolbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.finance-document-list { display: grid; gap: 10px; }
.finance-document-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(150px, .75fr) minmax(110px, .55fr) minmax(120px, .6fr) minmax(170px, .8fr) minmax(140px, .7fr) minmax(170px, .9fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.finance-document-row .doc-main {
  display: grid;
  gap: 3px;
}
.invoice-flow-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.invoice-flow-panel > div {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.invoice-flow-panel span,
.invoice-flow-panel small { color: var(--muted); }
.invoice-flow-panel strong { font-size: 17px; }
@media (max-width: 1200px) {
  .invoice-queue-grid,
  .invoice-queue-grid.compact,
  .invoice-next-grid,
  .invoice-next-grid.compact,
  .invoice-source-map,
  .invoice-flow-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-row,
  .finance-document-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .invoice-queue-grid,
  .invoice-queue-grid.compact,
  .invoice-next-grid,
  .invoice-next-grid.compact,
  .invoice-source-map,
  .invoice-flow-panel,
  .finance-toolbar { grid-template-columns: 1fr; }
  .invoice-next-head { align-items: stretch; flex-direction: column; }
  .invoice-next-card { grid-template-columns: auto 1fr; }
  .invoice-next-card b { grid-column: 1; grid-row: 2; }
  .invoice-next-card em { grid-column: 2; }
  .integration-snapshot a { grid-template-columns: 1fr; }
}

/* WUU visual system refresh */
:root {
  --text-strong: #081224;
  --surface-muted: #f2f5f9;
  --panel: var(--surface);
  --glass: rgba(255,255,255,.78);
  --focus-ring: color-mix(in srgb, var(--primary) 22%, transparent);
  --elevate: 0 18px 44px rgba(15,23,42,.12);
  --shadow-soft: 0 8px 24px rgba(15,23,42,.08);
  --shadow-tight: 0 1px 2px rgba(15,23,42,.08);
}

body.app-theme-graphite {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface2: #f3f6fa;
  --surface3: #f8fafc;
  --surface-muted: #e9eef5;
  --border: rgba(15,23,42,.13);
  --text: #111827;
  --text-strong: #020617;
  --muted: #5d6b7e;
  --success: #087f5b;
  --danger: #b42318;
  --warning: #a16207;
  --shadow: 0 12px 34px rgba(15,23,42,.085);
  --glass: rgba(255,255,255,.82);
}

body.app-theme-steel {
  --bg: #eef4f7;
  --surface: #ffffff;
  --surface2: #edf3f7;
  --surface3: #f8fbfd;
  --surface-muted: #e1eaf0;
  --border: rgba(30,41,59,.14);
  --text: #142032;
  --text-strong: #07111f;
  --muted: #617084;
  --accent: #0f766e;
  --shadow: 0 14px 36px rgba(15,45,72,.08);
}

body.app-theme-light {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface2: #f3f5f8;
  --surface3: #fafbfc;
  --surface-muted: #edf1f6;
  --border: rgba(17,24,39,.12);
  --text: #111827;
  --text-strong: #030712;
  --muted: #667085;
  --shadow: 0 10px 28px rgba(17,24,39,.07);
}

body.app-theme-dynamic {
  --bg: #f0f4fb;
  --surface: #ffffff;
  --surface2: #eef5ff;
  --surface3: #fbfdff;
  --surface-muted: #e7f0ff;
  --border: rgba(37,99,235,.18);
  --text: #111827;
  --text-strong: #020617;
  --muted: #59677a;
  --accent: #0f766e;
  --success: #047857;
  --danger: #c0262d;
  --warning: #b45309;
  --shadow: 0 14px 38px color-mix(in srgb, var(--primary) 11%, rgba(15,23,42,.07));
}

body.app-theme-carbon,
body.app-theme-dark {
  --bg: #12161d;
  --surface: #181d26;
  --surface2: #202736;
  --surface3: #151a22;
  --surface-muted: #242c3b;
  --border: rgba(226,232,240,.13);
  --text: #e8edf5;
  --text-strong: #ffffff;
  --muted: #a4afc0;
  --success: #58d39a;
  --danger: #ff8a8a;
  --warning: #f5bd66;
  --shadow: 0 18px 48px rgba(0,0,0,.32);
  --glass: rgba(24,29,38,.86);
}

body.app-theme-focus {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface2: #f4f4f5;
  --surface3: #ffffff;
  --surface-muted: #ededf0;
  --border: rgba(0,0,0,.24);
  --text: #050505;
  --text-strong: #000000;
  --muted: #3f3f46;
  --primary: #0047ff;
  --primary-d: #0036c7;
  --accent: #006b4f;
  --success: #006b4f;
  --danger: #b00020;
  --warning: #8a4b00;
  --shadow: none;
}

body {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 86%, #fff 14%), var(--bg) 260px),
    var(--bg);
  color: var(--text);
  accent-color: var(--primary);
  text-rendering: optimizeLegibility;
}

body.app-theme-carbon,
body.app-theme-dark {
  background: linear-gradient(180deg, #171c25, var(--bg) 320px), var(--bg);
}

.app { background: transparent; }
.content {
  width: 100%;
  max-width: min(1760px, 100%);
  margin: 0 auto;
}

.topbar {
  min-height: var(--topbar-h);
  background: var(--glass);
  border-bottom-color: color-mix(in srgb, var(--border) 82%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
}
.brand-name,
.page-title,
h1,
h2,
h3 { color: var(--text-strong); }
.brand-sub,
.muted,
p { color: var(--muted); }
.logo,
.settings-preview-box span,
.user-avatar-mini,
.profile-avatar-lg {
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--accent) 72%, var(--primary)));
}
.brand-logo-img,
.user-avatar {
  background: var(--surface);
  box-shadow: var(--shadow-tight);
}

.sidebar {
  background: color-mix(in srgb, var(--surface) 88%, var(--surface2));
  border-right-color: color-mix(in srgb, var(--border) 84%, transparent);
}
.nav-label {
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  font-weight: 850;
}
.nav-item,
.public-nav a,
.btn,
.chip {
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}
.nav-item {
  color: var(--muted);
  border: 1px solid transparent;
}
.nav-item:hover,
.public-nav a:hover {
  background: color-mix(in srgb, var(--surface2) 86%, var(--primary) 5%);
  color: var(--text-strong);
}
.nav-item.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 13%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 28%, transparent);
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav-group summary {
  color: var(--muted);
}
.nav-group summary strong {
  color: var(--text-strong);
}
.nav-group summary em {
  background: var(--surface-muted);
  color: var(--muted);
}
.nav-group[open] {
  background: color-mix(in srgb, var(--surface2) 74%, transparent);
  border-color: color-mix(in srgb, var(--border) 82%, transparent);
}
.nav-group.active[open] {
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 25%, var(--border));
}

.card,
.dash-tile,
.kpi,
.profile-hero,
.metric-card,
.settings-preview-card,
.integration-card,
.fm-panel,
.fm-main,
.asset-card,
.notify-item,
.audit-item,
.module-card {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  box-shadow: var(--shadow);
}
.card,
.dash-tile,
.kpi,
.profile-hero,
.metric-card,
.module-card,
.integration-card {
  position: relative;
}
.card::before,
.dash-tile::before,
.metric-card::before,
.profile-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--accent) 70%, var(--primary)));
  opacity: .28;
  pointer-events: none;
}
.card-header,
.settings-section-head,
.page-header {
  align-items: flex-start;
}
.page-header {
  padding-bottom: 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}
.page-title {
  font-weight: 900;
  line-height: 1.08;
}
.eyebrow {
  color: var(--primary);
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
input[type=time],
input[type=search],
input[type=url],
input[type=file],
select,
textarea {
  background: color-mix(in srgb, var(--surface2) 78%, var(--surface));
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}
input[type=file] {
  min-height: 42px;
}
input::placeholder,
textarea::placeholder { color: color-mix(in srgb, var(--muted) 78%, transparent); }
input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--primary) 54%, var(--border));
  box-shadow: 0 0 0 4px var(--focus-ring), inset 0 1px 0 rgba(255,255,255,.28);
  background: var(--surface);
}
label {
  color: color-mix(in srgb, var(--muted) 84%, var(--text));
  font-weight: 750;
}
.input-hint,
.small { color: var(--muted); }
.toggle-row,
.toggle-line,
.check-row {
  background: color-mix(in srgb, var(--surface2) 70%, var(--surface));
  border-color: color-mix(in srgb, var(--border) 86%, transparent);
}

.btn {
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  background: color-mix(in srgb, var(--surface2) 72%, var(--surface));
  color: var(--text-strong);
  font-weight: 800;
  box-shadow: var(--shadow-tight);
}
.btn:hover {
  background: color-mix(in srgb, var(--surface2) 88%, var(--primary) 6%);
  transform: translateY(-1px);
}
.btn.pri,
.btn.primary,
button.btn.pri {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 78%, var(--accent)));
  border-color: color-mix(in srgb, var(--primary) 80%, transparent);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--primary) 22%, transparent);
}
.btn.pri:hover,
.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-d), color-mix(in srgb, var(--primary-d) 72%, var(--accent)));
}
.btn.ghost {
  background: transparent;
  box-shadow: none;
}
.btn.ghost:hover {
  background: color-mix(in srgb, var(--surface2) 82%, var(--primary) 5%);
}
.btn.success {
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--success) 36%, var(--border));
  color: var(--success);
}
.btn.danger {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 36%, var(--border));
  color: var(--danger);
}

.badge,
.chip {
  background: color-mix(in srgb, var(--surface2) 70%, var(--surface));
  border-color: color-mix(in srgb, var(--border) 82%, transparent);
  color: var(--muted);
}
.badge.primary,
.badge-blue {
  background: color-mix(in srgb, var(--primary) 11%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  color: var(--primary);
}
.badge.ok,
.badge-green {
  background: color-mix(in srgb, var(--success) 11%, var(--surface));
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  color: var(--success);
}
.badge.danger,
.badge-red {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  color: var(--danger);
}
.badge.warning {
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--warning) 32%, var(--border));
  color: var(--warning);
}

.table-wrap {
  background: var(--surface);
  border-color: color-mix(in srgb, var(--border) 88%, transparent);
  box-shadow: var(--shadow-soft);
}
.table-wrap table,
table.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table-wrap th,
.table th {
  background: color-mix(in srgb, var(--surface2) 82%, var(--surface));
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  border-bottom: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
}
.table-wrap td,
.table td {
  border-bottom-color: color-mix(in srgb, var(--border) 72%, transparent);
}
.table-wrap tbody tr:hover,
.table tbody tr:hover {
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}
.table-wrap::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.fm-tree::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.table-wrap::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.fm-tree::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.metric-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, var(--primary) 4%), var(--surface));
  color: var(--text);
}
.metric-card strong,
.kpi-val,
.tile-value,
.profile-completion strong {
  color: var(--text-strong);
}
.progress,
.money-cell i,
.audit-bar {
  background: color-mix(in srgb, var(--surface-muted) 86%, var(--border));
}
.progress span,
.audit-bar i {
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--accent) 66%, var(--primary)));
}

.appearance-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.appearance-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}
.appearance-swatch::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 0 0 1px var(--border);
}
.appearance-swatch-graphite::before { background: linear-gradient(135deg,#111827,#d8dee7); }
.appearance-swatch-carbon::before { background: linear-gradient(135deg,#111827,#374151); }
.appearance-swatch-steel::before { background: linear-gradient(135deg,#334155,#d7e3ec); }
.appearance-swatch-focus::before { background: linear-gradient(135deg,#000,#fff); }
.appearance-swatch-dynamic::before { background: linear-gradient(135deg,#2563eb,#0f766e); }
.appearance-swatch-light::before { background: linear-gradient(135deg,#fff,#e5e7eb); }
.appearance-swatch-dark::before { background: linear-gradient(135deg,#0f172a,#1f2937); }

body.app-motion-full .card:hover,
body.app-motion-full .dash-tile:hover,
body.app-motion-full .metric-card:hover,
body.app-motion-full .module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevate);
}
body.app-motion-soft .dash-tile:hover,
body.app-motion-soft .metric-card:hover {
  transform: translateY(-1px);
}
body.app-motion-minimal *,
body.app-motion-none * {
  transition-duration: 0ms !important;
  animation-duration: 0ms !important;
}
body.app-motion-none .btn:hover,
body.app-motion-none .dash-tile:hover,
body.app-motion-none .metric-card:hover {
  transform: none !important;
}

body.app-density-compact {
  --pad: 14px;
  --shadow: 0 8px 22px rgba(15,23,42,.07);
}
body.app-density-compact input,
body.app-density-compact select,
body.app-density-compact textarea,
body.app-density-compact .btn {
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}
body.app-density-compact .table-wrap th,
body.app-density-compact .table-wrap td,
body.app-density-compact .table th,
body.app-density-compact .table td {
  padding-top: 8px;
  padding-bottom: 8px;
}

@media (max-width: 900px) {
  .content {
    padding: 14px;
  }
  .top-actions {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .top-actions::-webkit-scrollbar { display: none; }
  .page-header {
    gap: 14px;
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
  }
  .brand {
    min-width: 0;
  }
  .brand > div:last-child {
    min-width: 0;
  }
  .brand-name,
  .brand-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 48vw;
  }
  .public-nav {
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    border-top: 1px solid var(--border);
    padding-top: 8px;
  }
  .public-nav-item {
    flex: 0 0 auto;
  }
  .public-nav a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .card,
  .profile-hero,
  .table-wrap,
  .metric-card,
  .dash-tile,
  .kpi {
    box-shadow: var(--shadow-soft);
  }
  .btn-group {
    width: 100%;
  }
  .btn-group .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 520px) {
  .content {
    padding: 12px;
  }
  .page-title,
  h1 {
    font-size: 26px;
  }
  h2 {
    font-size: 18px;
  }
  .card,
  .metric-card,
  .dash-tile,
  .kpi {
    padding: 14px;
  }
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    gap: 10px;
  }
  input[type=text],
  input[type=email],
  input[type=password],
  input[type=number],
  input[type=date],
  input[type=time],
  input[type=search],
  input[type=url],
  select,
  textarea {
    font-size: 16px;
  }
}
