/* ── Exorta Backoffice — system tokens ──────────────────────────────── */
:root {
  /* palette */
  --ink:           #0B2545;
  --ink-2:         #1E3A5F;
  --ink-3:         #475569;
  --muted:         #64748B;
  --muted-2:       #94A3B8;
  --line:          #E2E8F0;
  --line-2:        #EEF2F7;
  --bg:            #F4F7FB;
  --surface:       #FFFFFF;
  --surface-2:     #F8FAFC;

  --primary:       #0F4C81;
  --primary-700:   #0B3D6B;
  --primary-100:   #E3EEF8;
  --primary-50:    #F1F6FB;
  --accent:        #0EA5B7;

  --success:       #15803D;
  --success-bg:    #DCFCE7;
  --warn:          #B45309;
  --warn-bg:       #FEF3C7;
  --danger:        #B91C1C;
  --danger-bg:     #FEE2E2;

  /* type */
  --font-sans:     "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-display:  "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono:     "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  /* radius / shadow */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --sh-1: 0 1px 2px rgba(15, 42, 80, .06);
  --sh-2: 0 1px 2px rgba(15, 42, 80, .04), 0 4px 16px rgba(15, 42, 80, .06);
  --sh-3: 0 8px 32px rgba(15, 42, 80, .10);

  /* density (overridden by tweaks) */
  --row-h:        52px;
  --pad-card:     24px;
  --gap:          14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: default; }
a { color: inherit; text-decoration: none; }

/* ── Layout shell ────────────────────────────────────────────────────── */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.shell {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}
.page {
  padding: 28px 0 80px;
}

/* ── Top nav ─────────────────────────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}
.nav-tabs { min-width: 0; }
.nav-icon-btn, .nav-avatar { flex-shrink: 0; }
@media (max-width: 1180px) {
  .nav-search { display: none; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--primary);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -.02em;
}
.brand-name { font-size: 15px; white-space: nowrap; }
.brand-name span { color: var(--muted); font-weight: 500; }
.nav-tab { white-space: nowrap; }
.btn { white-space: nowrap; }
.nav-search { flex-shrink: 0; }
.nav-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}
.nav-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13.5px;
  position: relative;
}
.nav-tab:hover { color: var(--ink); background: var(--surface-2); }
.nav-tab.active { color: var(--primary); }
.nav-tab.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  bottom: -19px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.nav-spacer { flex: 1; }
.nav-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  width: 220px;
  color: var(--muted);
  font-size: 13px;
}
.nav-search kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}
.nav-icon-btn {
  appearance: none;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.nav-icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}

/* ── Headers / titles ────────────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0;
}
.h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0;
}
.subtle { color: var(--muted); }

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs .sep { color: var(--muted-2); }
.breadcrumbs .current { color: var(--ink); font-weight: 500; white-space: nowrap; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .12s ease, border-color .12s ease, transform .04s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(.5px); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 1px 2px rgba(15,76,129,.25);
}
.btn.primary:hover { background: var(--primary-700); border-color: var(--primary-700); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { color: var(--danger); border-color: var(--line); }
.btn.danger:hover { background: var(--danger-bg); border-color: var(--danger-bg); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { padding: 11px 18px; font-size: 14.5px; border-radius: 9px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ── Cards / panels ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.card-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.card-body { padding: var(--pad-card); }
.card-row {
  display: flex;
  border-bottom: 1px solid var(--line-2);
}
.card-row:last-child { border-bottom: 0; }

/* ── Filter bar ──────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:hover { background: var(--surface-2); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip .count {
  font-size: 11.5px;
  background: var(--line-2);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 500;
}
.chip.active .count { background: rgba(255,255,255,.18); color: rgba(255,255,255,.85); }

/* ── Table ───────────────────────────────────────────────────────────── */
.tbl-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
}
table.tbl thead th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
  font-size: 13.5px;
  color: var(--ink-2);
  height: var(--row-h);
}
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background .1s ease; }
table.tbl tbody tr:hover { background: var(--primary-50); cursor: default; }
.evt-cell {
  display: flex; align-items: center; gap: 12px;
}
.evt-logo {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.evt-logo img { width: 100%; height: 100%; object-fit: cover; }
.evt-logo.placeholder { color: var(--muted-2); }
.evt-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.evt-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.id-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  white-space: nowrap;
}

/* ── Status pills ────────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .85;
}
.pill.publicado { background: var(--success-bg); color: var(--success); }
.pill.borrador { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.pill.en-curso { background: #DBEAFE; color: #1D4ED8; }
.pill.finalizado { background: #F1F5F9; color: var(--ink-3); }
.pill.cancelado { background: var(--danger-bg); color: var(--danger); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--primary-50);
  color: var(--primary);
  border: 1px solid var(--primary-100);
}
.tag.gray { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }

/* ── Forms ───────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  padding: 28px 28px;
  border-bottom: 1px solid var(--line-2);
}
.form-grid:last-child { border-bottom: 0; }
.form-grid .label-col h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.005em;
}
.form-grid .label-col p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.field label, .label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.field .hint { font-size: 12px; color: var(--muted); }
.field .hint.err { color: var(--danger); }

.input, .select, .textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
  width: 100%;
}
.input:hover, .select:hover, .textarea:hover { border-color: #CBD5E1; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,76,129,.12);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.textarea { resize: vertical; min-height: 88px; }
.input.with-prefix { padding-left: 38px; }
.input-wrap { position: relative; }
.input-wrap .prefix {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; display: flex;
}
.input.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em; }

.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 5px;
}
.seg button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-1);
}

/* ── Logo drop zone ──────────────────────────────────────────────────── */
.drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  transition: border-color .15s ease, background .15s ease;
}
.drop.dragging {
  border-color: var(--primary);
  background: var(--primary-50);
}
.drop.has-image { background: var(--surface); }
.drop-preview {
  width: 144px; height: 144px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--muted-2);
}
.drop-preview.has-image { border-color: var(--line); background: var(--surface-2); }
.drop-preview img { width: 100%; height: 100%; object-fit: cover; }
.drop-text { flex: 1; }
.drop-text h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.drop-text p { margin: 0 0 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.drop-actions { display: flex; gap: 8px; }

/* ── Event detail ────────────────────────────────────────────────────── */
.detail-hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.detail-banner {
  height: 180px;
  background: linear-gradient(135deg, var(--primary), #1E3A5F 90%);
  position: relative;
  display: grid; place-items: center;
}
.detail-banner.has-bg { background-size: cover; background-position: center; }
.detail-banner::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,37,69,.05) 0%, rgba(11,37,69,.4) 100%);
}
.detail-hero-body {
  display: grid;
  grid-template-columns: 124px 1fr auto;
  gap: 24px;
  padding: 22px 28px 24px;
  align-items: flex-end;
  margin-top: -52px;
  position: relative;
}
.detail-logo {
  width: 124px; height: 124px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow: var(--sh-2);
}
.detail-logo img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { padding-bottom: 6px; }
.detail-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-3);
}
.detail-meta .item { display: flex; align-items: center; gap: 7px; }
.detail-meta .item svg { color: var(--muted); }
.detail-actions { display: flex; gap: 8px; padding-bottom: 6px; }

.detail-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin: 26px 0 22px;
}
.detail-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  padding: 10px 14px;
  font-weight: 500;
  font-size: 13.5px;
  position: relative;
}
.detail-tab:hover { color: var(--ink); }
.detail-tab.active { color: var(--primary); }
.detail-tab.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
}

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: flex-start; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 12px 16px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--ink); font-weight: 500; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
}
.stat .lbl { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.stat .num { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--ink); margin-top: 4px; letter-spacing: -.01em; }
.stat .delta { font-size: 12px; color: var(--success); margin-top: 2px; }
.stat .delta.neg { color: var(--muted); }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty h3 { margin: 12px 0 4px; color: var(--ink); font-weight: 600; font-size: 16px; }
.empty p { margin: 0 0 16px; font-size: 13.5px; }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--sh-3);
  z-index: 200;
  animation: toast-in .25s ease-out;
}
.toast .ok {
  width: 18px; height: 18px;
  background: var(--success);
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Density modes (tweak) ───────────────────────────────────────────── */
.density-compact { --row-h: 44px; --pad-card: 18px; --gap: 10px; }
.density-comfy   { --row-h: 60px; --pad-card: 30px; --gap: 18px; }

/* ── Layout modes (tweak) ────────────────────────────────────────────── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.evt-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}
.evt-card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.evt-card .img {
  height: 132px;
  background: linear-gradient(135deg, var(--primary), #1E3A5F);
  position: relative;
  overflow: hidden;
}
.evt-card .img img { width: 100%; height: 100%; object-fit: cover; }
.evt-card .img .top {
  position: absolute; top: 10px; left: 10px; right: 10px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.evt-card .body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.evt-card .body .id { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.evt-card .body h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.evt-card .body .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.evt-card .foot {
  padding: 10px 18px;
  border-top: 1px solid var(--line-2);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--muted);
}

/* ── Misc ────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line-2); margin: 18px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.gap-sm { gap: 6px; }
.flex1 { flex: 1; }
.muted { color: var(--muted); }
.tabnums { font-variant-numeric: tabular-nums; }

.helpline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.helpline svg { color: var(--muted); }

.list-empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}

.avatar-row { display: flex; }
.avatar-row .av {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  margin-left: -6px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--ink-3);
  background: var(--surface-2);
}
.avatar-row .av:first-child { margin-left: 0; }
.avatar-row .av.more { background: var(--ink); color: #fff; font-size: 10.5px; }

/* Print/exposure overrides for screen-only — none for now */
