/* ========================================================================
   CGR Paraguay · Plataforma de Compromisos Internacionales
   Sistema de Diseño · v0.1
   ======================================================================== */

:root {
  /* Paleta institucional */
  --cgr-primary:        #1a2e5c;
  --cgr-primary-dark:   #0f1d3d;
  --cgr-primary-light:  #2d4a8a;
  --cgr-primary-50:     #eef2f9;
  --cgr-primary-100:    #dbe3f1;
  --cgr-accent:         #c9a961;
  --cgr-accent-soft:    #f3ecd6;

  /* Superficie */
  --cgr-surface:        #ffffff;
  --cgr-surface-2:      #fbfbfc;
  --cgr-background:     #f5f6f8;
  --cgr-border:         #e5e7eb;
  --cgr-border-strong:  #d1d5db;
  --cgr-divider:        #eef0f3;

  /* Texto */
  --cgr-text-primary:   #1f2937;
  --cgr-text-secondary: #525c6b;
  --cgr-text-muted:     #8a93a1;
  --cgr-text-inverse:   #ffffff;

  /* Semáforo */
  --sem-success:        #16a34a;
  --sem-success-soft:   #dcfce7;
  --sem-warning:        #b45309;     /* AA on white */
  --sem-warning-bg:     #eab308;
  --sem-warning-soft:   #fef3c7;
  --sem-danger:         #dc2626;
  --sem-danger-soft:    #fee2e2;
  --sem-danger-dark:    #7c2d12;

  /* Sombras */
  --shadow-1: 0 1px 2px rgba(15, 29, 61, 0.04), 0 1px 3px rgba(15, 29, 61, 0.06);
  --shadow-2: 0 4px 12px rgba(15, 29, 61, 0.08);
  --shadow-3: 0 12px 32px rgba(15, 29, 61, 0.12);

  /* Radios */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 12px;

  /* Tipografía */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Densidad */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Layout */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 84px;

  /* Glass */
  --glass-bg:        rgba(255, 255, 255, 0.62);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border:    rgba(26, 46, 92, 0.10);
  --glass-blur:      saturate(180%) blur(18px);
}

/* App-wide ambient gradient blobs — power the liquid/glass feel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 700px at 78% -10%, rgba(45, 74, 138, 0.10) 0, transparent 60%),
    radial-gradient(700px 600px at -5% 110%, rgba(201, 169, 97, 0.08) 0, transparent 55%),
    radial-gradient(500px 400px at 35% 40%, rgba(45, 74, 138, 0.04) 0, transparent 70%);
}
body > * { position: relative; z-index: 1; }

/* Tipografía alterna por tweak */
[data-font="jakarta"] {
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
}
[data-font="ibm"] {
  --font-display: 'IBM Plex Sans', system-ui, sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--cgr-text-primary);
  background: var(--cgr-background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--cgr-primary-light);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0;
  color: var(--cgr-text-primary);
}
h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; font-weight: 500; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- App scaffold ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
  background: transparent;
}
.app__topbar  { grid-column: 1 / span 2; }
.app__sidebar { grid-column: 1; grid-row: 2; }
.app__main    { grid-column: 2; grid-row: 2; padding: var(--space-6) var(--space-7); max-width: 1320px; }

/* ---------- Sidebar (light) ---------- */
.sidebar {
  background: var(--cgr-surface);
  border-right: 1px solid var(--cgr-border);
  color: var(--cgr-text-primary);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

.sidebar__section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cgr-text-muted);
  padding: 22px 22px 10px;
}

.sidebar__nav {
  padding: 4px 12px;
  display: flex; flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--cgr-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  position: relative;
  transition: background 120ms ease, color 120ms ease;
}
.nav-item:hover { background: var(--cgr-background); color: var(--cgr-text-primary); }
.nav-item.is-active {
  background: var(--cgr-primary-50);
  color: var(--cgr-primary);
  font-weight: 600;
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--cgr-primary);
}
.nav-item__icon { display: grid; place-items: center; flex-shrink: 0; color: var(--cgr-text-muted); }
.nav-item:hover .nav-item__icon,
.nav-item.is-active .nav-item__icon { color: inherit; }
.nav-item__badge {
  margin-left: auto;
  background: var(--sem-danger);
  color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}
.nav-item__badge.is-info {
  background: var(--cgr-primary-50);
  color: var(--cgr-primary);
  border: 1px solid var(--cgr-primary-100);
}

.sidebar__footer {
  border-top: 1px solid var(--cgr-border);
  padding: 14px 22px;
  font-size: 11.5px;
  color: var(--cgr-text-muted);
  display: flex; align-items: center; gap: 8px;
}

/* ---------- Topbar (glass) ---------- */
.topbar {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  height: var(--topbar-h);
  display: flex; align-items: center;
  padding: 0 var(--space-6) 0 0;
  gap: var(--space-5);
  position: sticky; top: 0; z-index: 20;
}
.topbar__brand {
  display: flex; align-items: center;
  height: 100%;
  width: var(--sidebar-w);
  flex-shrink: 0;
  padding: 0 var(--space-5);
  border-right: 1px solid var(--cgr-border);
  box-sizing: border-box;
}
.topbar__brand img {
  height: 58px;
  width: auto;
  display: block;
  object-fit: contain;
  max-width: 100%;
}
.topbar__breadcrumb {
  font-size: 13px;
  color: var(--cgr-text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.topbar__breadcrumb strong { color: var(--cgr-text-primary); font-weight: 600; }
.topbar__breadcrumb .sep { color: var(--cgr-text-muted); }

.topbar__search {
  margin-left: auto;
  position: relative;
  width: 360px;
}
.topbar__search input {
  width: 100%;
  height: 38px;
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--cgr-border);
  border-radius: 999px;
  padding: 0 12px 0 38px;
  font-size: 13px;
  font-family: inherit;
  color: var(--cgr-text-primary);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.topbar__search input::placeholder { color: var(--cgr-text-muted); }
.topbar__search input:focus {
  background: #fff;
  border-color: var(--cgr-primary-light);
  outline: none;
  box-shadow: 0 0 0 4px rgba(45, 74, 138, 0.12);
}
.topbar__search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--cgr-text-muted);
}
.topbar__search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 10.5px;
  background: #fff; border: 1px solid var(--cgr-border);
  border-radius: 4px; padding: 1px 5px;
  color: var(--cgr-text-muted);
}

.topbar__icon-btn {
  width: 38px; height: 38px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--cgr-border);
  border-radius: 999px;
  display: grid; place-items: center;
  color: var(--cgr-text-secondary);
  position: relative;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}
.topbar__icon-btn:hover {
  background: #fff;
  color: var(--cgr-primary);
  transform: translateY(-1px);
}
.topbar__icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--sem-danger); border-radius: 50%;
  border: 2px solid #fff;
}

.topbar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--cgr-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.topbar__user:hover { background: #fff; border-color: var(--cgr-text-muted); }
.topbar__user-info { display: flex; flex-direction: column; line-height: 1.15; text-align: right; white-space: nowrap; }
.topbar__user-info strong { font-size: 12.5px; font-weight: 600; color: var(--cgr-text-primary); white-space: nowrap; }
.topbar__user-info small { font-size: 11px; color: var(--cgr-text-muted); white-space: nowrap; }
.topbar__user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--cgr-primary);
  color: #fff;
  font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
  letter-spacing: 0.02em;
}

/* ---------- Welcome strip ---------- */
.welcome {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--cgr-border);
  margin-bottom: var(--space-6);
}
.welcome__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cgr-text-muted);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.welcome__eyebrow .role-pill {
  background: var(--cgr-primary-50);
  color: var(--cgr-primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  padding: 2px 8px;
  border-radius: 4px;
}
.welcome h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.welcome__sub {
  margin-top: 6px;
  font-size: 14px;
  color: var(--cgr-text-secondary);
  max-width: 640px;
}
.welcome__chips {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.welcome-chip {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  min-width: 160px;
}
.welcome-chip__icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--cgr-primary-50), rgba(255,255,255,0.7));
  color: var(--cgr-primary);
  border: 1px solid var(--cgr-primary-100);
  border-radius: var(--r-md);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.welcome-chip.is-warn .welcome-chip__icon { background: var(--sem-warning-soft); color: var(--sem-warning); }
.welcome-chip.is-danger .welcome-chip__icon { background: var(--sem-danger-soft); color: var(--sem-danger); }
.welcome-chip__num {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--cgr-text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.welcome-chip__label {
  font-size: 11.5px;
  color: var(--cgr-text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

/* ---------- Section header ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--space-4);
}
.section-head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--cgr-text-primary);
}
.section-head__hint {
  font-size: 12px;
  color: var(--cgr-text-muted);
}
.section-head__link {
  font-size: 12.5px;
  color: var(--cgr-primary);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.section-head__link:hover { color: var(--cgr-primary-light); }

/* ---------- Module grid (bento) ---------- */
.modules {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-bottom: var(--space-7);
}
.module {
  grid-column: span 4;
  background: var(--cgr-surface);
  border: 1px solid var(--cgr-border);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex; flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  text-align: left;
  width: 100%;
  cursor: pointer;
  border-width: 1px;
  min-height: 160px;
  overflow: hidden;
}
.module::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0)) padding-box;
  border-radius: inherit;
  pointer-events: none;
}
.module > * { position: relative; z-index: 1; }
.module:hover {
  border-color: var(--cgr-primary-light);
  box-shadow: 0 8px 24px rgba(15, 29, 61, 0.08);
  transform: translateY(-2px);
}
.module:hover .module__cta { color: var(--cgr-primary); }
.module--wide { grid-column: span 8; }
.module--feature {
  grid-column: span 8;
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(45, 74, 138, 0.10) 0, transparent 60%),
    radial-gradient(400px 300px at 0% 100%, rgba(201, 169, 97, 0.10) 0, transparent 60%),
    var(--cgr-surface);
  border-color: var(--cgr-primary-100);
}
.module--accent {
  background:
    radial-gradient(500px 350px at 100% 0%, rgba(201, 169, 97, 0.18) 0, transparent 60%),
    linear-gradient(135deg, #1a2e5c 0%, #243d72 100%);
  color: rgba(255,255,255,0.92);
  border-color: transparent;
  position: relative;
}
.module--accent::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 110%, rgba(201,169,97,0.2), transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}
.module--accent .module__title { color: #fff; }
.module--accent .module__desc { color: rgba(255,255,255,0.78); }
.module--accent .module__icon {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.module--accent .module__cta { color: var(--cgr-accent); }
.module--accent:hover { box-shadow: 0 10px 28px rgba(15, 29, 61, 0.25); transform: translateY(-2px); }

.module__top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.module__icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--cgr-primary-50), rgba(255,255,255,0.6));
  color: var(--cgr-primary);
  border: 1px solid var(--cgr-primary-100);
  border-radius: var(--r-md);
  display: grid; place-items: center;
  flex-shrink: 0;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.module__badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--sem-danger);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 4px;
}
.module__badge.is-info { background: var(--cgr-primary-light); }
.module__badge.is-warn { background: var(--sem-warning); }
.module__title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--cgr-text-primary);
  letter-spacing: -0.005em;
}
.module__desc {
  font-size: 13px;
  color: var(--cgr-text-secondary);
  line-height: 1.5;
  text-wrap: pretty;
}
.module__cta {
  margin-top: auto;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--cgr-text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 140ms ease;
}

/* Feature module (Tablero) inner stats */
.module-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.module-stats__cell {
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--cgr-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.module-stats__cell .label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--cgr-text-secondary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 5px;
}
.module-stats__cell .num {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.015em;
}
.module-stats__cell.is-ok    .label { color: var(--sem-success); }
.module-stats__cell.is-ok    .num   { color: var(--sem-success); }
.module-stats__cell.is-warn  .label { color: var(--sem-warning); }
.module-stats__cell.is-warn  .num   { color: var(--sem-warning); }
.module-stats__cell.is-danger .label { color: var(--sem-danger); }
.module-stats__cell.is-danger .num   { color: var(--sem-danger); }

.dot-status {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.dot-status.is-ok     { background: var(--sem-success); }
.dot-status.is-warn   { background: var(--sem-warning-bg); }
.dot-status.is-danger { background: var(--sem-danger); }
.dot-status.is-dark   { background: var(--sem-danger-dark); }

/* ---------- Activity / Alerts split ---------- */
.split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-bottom: var(--space-7);
}
/* ---------- Card / split / lists ---------- */
.card {
  background: var(--cgr-surface);
  border: 1px solid var(--cgr-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 29, 61, 0.03);
}
.card__head {
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--cgr-divider);
}
.card__head h3 { font-size: 14.5px; font-weight: 600; }
.card__head .meta { font-size: 12px; color: var(--cgr-text-muted); }

/* Timeline */
.timeline { padding: 8px 0; }
.timeline__item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--cgr-divider);
}
.timeline__item:last-child { border-bottom: 0; }
.timeline__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--cgr-primary-50);
  color: var(--cgr-primary);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}
.timeline__avatar.is-warn { background: var(--sem-warning-soft); color: var(--sem-warning); }
.timeline__avatar.is-ok   { background: var(--sem-success-soft); color: var(--sem-success); }
.timeline__avatar.is-danger { background: var(--sem-danger-soft); color: var(--sem-danger); }
.timeline__body {
  font-size: 13px;
  color: var(--cgr-text-primary);
  line-height: 1.45;
}
.timeline__body .ref {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--cgr-background);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--cgr-text-secondary);
}
.timeline__body small {
  display: block;
  margin-top: 3px;
  color: var(--cgr-text-muted);
  font-size: 11.5px;
}
.timeline__time {
  font-size: 11.5px;
  color: var(--cgr-text-muted);
  white-space: nowrap;
}

/* Deadlines list */
.deadlines { padding: 4px 0; }
.deadline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--cgr-divider);
}
.deadline:last-child { border-bottom: 0; }
.deadline__count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  background: var(--cgr-background);
  color: var(--cgr-text-primary);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  border: 1px solid var(--cgr-border);
  font-variant-numeric: tabular-nums;
}
.deadline.is-now .deadline__count { background: var(--sem-danger-soft); color: var(--sem-danger); border-color: transparent; }
.deadline.is-soon .deadline__count { background: var(--sem-warning-soft); color: var(--sem-warning); border-color: transparent; }
.deadline.is-overdue .deadline__count { background: var(--sem-danger); color: #fff; border-color: transparent; }
.deadline__body .title {
  font-size: 13px;
  color: var(--cgr-text-primary);
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.deadline__body .title .id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--cgr-text-muted);
  font-weight: 500;
}
.deadline__body .meta {
  font-size: 11.5px;
  color: var(--cgr-text-muted);
  margin-top: 2px;
}
.deadline__cta {
  font-size: 12px;
  color: var(--cgr-primary);
  font-weight: 500;
  white-space: nowrap;
  border: 0; background: transparent; padding: 4px 0;
}

/* Status pill */
.status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.status.is-ok      { background: var(--sem-success-soft); color: var(--sem-success); }
.status.is-warn    { background: var(--sem-warning-soft); color: var(--sem-warning); }
.status.is-danger  { background: var(--sem-danger-soft); color: var(--sem-danger); }
.status.is-dark    { background: #f3e4dc; color: var(--sem-danger-dark); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
  font-family: inherit;
}
.btn--primary {
  background: linear-gradient(180deg, var(--cgr-primary-light), var(--cgr-primary));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 1px 2px rgba(15,29,61,0.16);
}
.btn--primary:hover { background: linear-gradient(180deg, var(--cgr-primary), var(--cgr-primary-dark)); transform: translateY(-1px); }
.btn--secondary {
  background: rgba(255,255,255,0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--cgr-text-primary);
  border-color: var(--cgr-border-strong);
}
.btn--secondary:hover { background: #fff; border-color: var(--cgr-text-muted); }
.btn--ghost {
  background: transparent;
  color: var(--cgr-text-secondary);
}
.btn--ghost:hover { background: var(--cgr-background); color: var(--cgr-text-primary); }

/* ---------- Stub screen ---------- */
.stub {
  background: var(--cgr-surface);
  border: 1px dashed var(--cgr-border-strong);
  border-radius: var(--r-lg);
  padding: var(--space-7);
  text-align: center;
}
.stub__icon {
  width: 64px; height: 64px;
  background: var(--cgr-primary-50);
  color: var(--cgr-primary);
  border-radius: var(--r-lg);
  display: grid; place-items: center;
  margin: 0 auto var(--space-4);
}
.stub h2 { margin-bottom: 6px; }
.stub p { color: var(--cgr-text-secondary); max-width: 480px; margin: 0 auto var(--space-5); }

/* ---------- Mobile preview frame ---------- */
.mobile-stage {
  min-height: 100vh;
  background: var(--cgr-primary-dark);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(45,74,138,0.4) 0, transparent 50%),
    radial-gradient(circle at 80% 90%, rgba(201,169,97,0.08) 0, transparent 50%);
  display: grid; place-items: center;
  padding: 32px 16px;
}
.mobile-frame {
  width: 390px;
  height: 800px;
  background: #fff;
  border-radius: 36px;
  border: 10px solid #0a0c10;
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
}
.mobile-frame::before {
  content: "";
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 28px;
  background: #0a0c10;
  border-radius: 0 0 16px 16px;
  z-index: 5;
}
.mobile-statusbar {
  height: 44px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cgr-text-primary);
  font-family: var(--font-display);
  background: var(--cgr-surface);
}
.mobile-statusbar__icons { display: flex; gap: 5px; align-items: center; }
.mobile-content {
  flex: 1;
  overflow-y: auto;
  background: var(--cgr-background);
}
.mobile-topbar {
  background: var(--cgr-primary-dark);
  color: #fff;
  padding: 16px 20px 18px;
  display: flex; align-items: center; gap: 12px;
}
.mobile-topbar__logo {
  width: 32px; height: 32px;
  background: #fff;
  border-radius: 6px;
  padding: 3px;
}
.mobile-topbar__logo img { width: 100%; height: 100%; object-fit: contain; }
.mobile-topbar__text small {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  display: block;
}
.mobile-topbar__text strong {
  font-size: 13px;
  font-weight: 600;
}
.mobile-topbar__actions { margin-left: auto; display: flex; gap: 6px; color: rgba(255,255,255,0.85); }
.mobile-topbar__btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: transparent; border: 0;
  color: inherit;
  border-radius: var(--r-md);
  position: relative;
}
.mobile-topbar__btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--sem-danger); border-radius: 50%;
  border: 2px solid var(--cgr-primary-dark);
}

.mobile-welcome {
  padding: 20px 20px 4px;
}
.mobile-welcome h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mobile-welcome p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--cgr-text-secondary);
}
.mobile-chips {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 16px 20px;
}
.mobile-chip {
  background: #fff;
  border: 1px solid var(--cgr-border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex; gap: 10px; align-items: center;
}
.mobile-chip__icon { width: 32px; height: 32px; border-radius: 6px; background: var(--cgr-primary-50); color: var(--cgr-primary); display: grid; place-items: center; flex-shrink: 0; }
.mobile-chip.is-warn .mobile-chip__icon { background: var(--sem-warning-soft); color: var(--sem-warning); }
.mobile-chip.is-danger .mobile-chip__icon { background: var(--sem-danger-soft); color: var(--sem-danger); }
.mobile-chip__num { font-size: 16px; font-weight: 700; font-family: var(--font-display); line-height: 1; }
.mobile-chip__label { font-size: 10.5px; color: var(--cgr-text-secondary); margin-top: 2px; line-height: 1.2; }

.mobile-section-head {
  padding: 8px 20px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cgr-text-muted);
}
.mobile-modules { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.mobile-module {
  background: #fff;
  border: 1px solid var(--cgr-border);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
}
.mobile-module__icon {
  width: 38px; height: 38px;
  background: var(--cgr-primary-50);
  color: var(--cgr-primary);
  border-radius: 6px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.mobile-module__title { font-size: 14px; font-weight: 600; color: var(--cgr-text-primary); }
.mobile-module__desc { font-size: 12px; color: var(--cgr-text-secondary); margin-top: 2px; line-height: 1.4; }
.mobile-module__badge {
  margin-left: auto;
  font-size: 11px; font-weight: 600;
  background: var(--sem-danger); color: #fff;
  padding: 1px 7px; border-radius: 999px;
  min-width: 22px; text-align: center;
}
.mobile-module__badge.is-info { background: var(--cgr-primary-light); }

.mobile-tabbar {
  background: #fff;
  border-top: 1px solid var(--cgr-border);
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: 64px;
  padding-bottom: 6px;
}
.mobile-tab {
  background: transparent; border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--cgr-text-muted);
  font-size: 10px;
  font-weight: 500;
}
.mobile-tab.is-active { color: var(--cgr-primary); }

/* ---------- Print-style helpers / responsive ---------- */
@media (max-width: 1100px) {
  .topbar__search { width: 220px; }
}
@media (max-width: 900px) {
  .topbar__search { display: none; }
  .topbar__breadcrumb { margin-right: auto; }
}
@media (max-width: 760px) {
  .module, .module--wide, .module--feature { grid-column: span 12; }
  .split { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  .app__sidebar { display: none; }
  .app__topbar, .app__main { grid-column: 1; }
  .app__main { padding: var(--space-5) var(--space-4); }
  .topbar { padding: 0 var(--space-4); }
  .topbar__brand { min-width: 0; padding-right: var(--space-3); margin-right: 0; }
  .topbar__brand img { height: 34px; }
  .topbar__breadcrumb { display: none; }
}

/* ---------- Misc ---------- */
.scroll-hide::-webkit-scrollbar { width: 8px; }
.scroll-hide::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.kbd-hint { font-family: var(--font-mono); font-size: 11px; color: var(--cgr-text-muted); }
