:root {
  --green: #47b949;
  --ink: #071c25;
  --muted: #5d727c;
  --line: #d5e2e6;
  --bg: #edf4f5;
  --panel: #ffffff;
  --cyan: #08aeca;
  --red: #e35454;
  --soft: #eef3f4;
  --active: #e1f1e3;
  --button: #47b949;
  --button-ink: #ffffff;
  --success-bg: #e8f7e9;
  --success-ink: #115a18;
  --success-line: #b7e5b9;
  --warning-bg: #fff4da;
  --warning-ink: #795300;
  --warning-line: #ddc080;
  --danger-bg: #fff1f1;
  --danger-ink: #982b2b;
  --danger-line: #e6bcbc;
  --info-bg: #e3f6fb;
  --info-ink: #057086;
  --info-line: #a6d9e4;
  --shadow: 0 18px 40px rgba(24,56,66,.08);
}
/* The private application shares the approved B palette; public outputs keep their original tokens. */
@media screen {
:root[data-appearance-scope="private"] {
  --green: #247a36;
  --ink: #183029;
  --muted: #5c7067;
  --line: #dce5df;
  --bg: #f3f6f5;
  --panel: #ffffff;
  --soft: #eaf1ec;
  --active: #e1f1e3;
  --button: #2e873d;
  --cyan: #087e91;
  --red: #ad4545;
  --shadow: 0 8px 24px #1830290a;
}
:root[data-appearance-scope="private"][data-theme="dark"] {
  --green: #8bdd94;
  --ink: #e7eee9;
  --muted: #9fb3a7;
  --line: #314138;
  --bg: #101715;
  --panel: #17211d;
  --soft: #223129;
  --active: #263f2c;
  --button: #8bdd94;
  --button-ink: #122018;
  --cyan: #7dcede;
  --red: #ed9898;
  --success-bg: #203b28;
  --success-ink: #a0e0a9;
  --success-line: #406749;
  --warning-bg: #3a3020;
  --warning-ink: #f0ce88;
  --warning-line: #76603a;
  --danger-bg: #3c2528;
  --danger-ink: #f2a5a5;
  --danger-line: #754448;
  --info-bg: #20363a;
  --info-ink: #91dbe8;
  --info-line: #3c646d;
  --shadow: 0 8px 24px #0000001a;
}
}
* { box-sizing: border-box; }
/* Native hidden must win over component display:grid/flex rules (live filters). */
[hidden] { display: none !important; }
input, select, textarea, fieldset { min-width: 0; max-width: 100%; }
.panel, .panel-head > *, .kpis > *, .form-grid > * { min-width: 0; }
.panel-head { flex-wrap: wrap; }
.panel-head h2, .panel-head h3, .panel-head span, .kpis strong { overflow-wrap: anywhere; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--bg); }
button, select { font: inherit; }
.client-view aside img { width: 180px; max-width: 100%; background: white; border-radius: 6px; padding: 8px; }
.ghost, .primary { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 12px 14px; cursor: pointer; text-decoration: none; }
.primary { background: var(--button); color: var(--button-ink); border-color: var(--button); font-weight: 700; }
.link { text-decoration: none; display: inline-block; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; box-shadow: var(--shadow); }
.events-home { max-width: 1280px; margin: 0 auto; padding: 28px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpis article { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.kpis span { display: block; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.kpis strong { font-size: 28px; }
.notice { background: var(--success-bg); border: 1px solid var(--success-line); color: var(--success-ink); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-weight: 700; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 8px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 800; }
.badge.mock { background: #ffe8b8; color: #8a5700; }
.badge.real { background: #dff7e0; color: #1b6e23; }
.badge.testing, .badge.confirmed { background: var(--info-bg); color: var(--info-ink); }
.badge.draft, .badge.borrador { background: var(--soft); }
.badge.finished { background: #e8f7e9; color: #1b6e23; }
.search, input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); color: var(--ink); }
textarea { min-height: 82px; resize: vertical; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Physical plans and client deliverables remain light, independent of the operator's preference. */
.client-view, .public-event-disabled, .client-report, .map-stage, .map-surface {
  --green: #47b949; --ink: #071c25; --muted: #5d727c; --line: #d5e2e6;
  --bg: #edf4f5; --panel: #ffffff; --cyan: #08aeca; --red: #e35454;
  --soft: #eef3f4; --active: #e1f1e3; --button: #47b949; --button-ink: #ffffff;
  --success-bg: #e8f7e9; --success-ink: #115a18; --success-line: #b7e5b9;
  --warning-bg: #fff4da; --warning-ink: #795300; --warning-line: #ddc080;
  --danger-bg: #fff1f1; --danger-ink: #982b2b; --danger-line: #e6bcbc;
  --info-bg: #e3f6fb; --info-ink: #057086; --info-line: #a6d9e4;
  --shadow: 0 18px 40px rgba(24,56,66,.08);
  color: var(--ink); color-scheme: light;
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  :root { color-scheme: light !important; }
  .notice { display: none !important; }
}

@media (max-width: 760px), (max-width: 1100px) and (pointer: coarse) {
  body { overflow-x: hidden; }
}
