:root {
  --ink:      #0a0a0a;
  --ink-2:    #111111;
  --ink-3:    #161616;
  --line:     rgba(255,255,255,.08);
  --line-2:   rgba(255,255,255,.14);
  --text:     #f5f5f5;
  --text-2:   #a8a8a8;
  --muted:    #6b6b6b;
  --orange:   #ff7a1a;
  --orange-2: #ff9248;
  --green:    #3ee07f;
  --red:      #ff5e6c;
  --radius:   18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.bg-ink { background: radial-gradient(1200px 800px at 80% -10%, rgba(255,122,26,0.10), transparent 60%),
                       radial-gradient(900px 600px at -10% 40%, rgba(62,224,127,0.08), transparent 60%),
                       var(--ink); }

/* grain overlay */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px 28px;
  background: rgba(10,10,10,0.85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-text strong {
  display: block; font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600;
  letter-spacing: -.3px; line-height: 1.1; color: var(--text);
}
.brand-text small {
  display: block; font-size: 11px; color: var(--text-2);
  letter-spacing: 1.2px; text-transform: uppercase; margin-top: 3px; font-weight: 600;
}
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  border-radius: 10px; font-weight: 800; font-size: 14px;
  color: #1a0a00; letter-spacing: .5px;
  box-shadow: 0 6px 20px rgba(255,122,26,0.35);
}
.brand-logo {
  width: 40px; height: 40px; object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(255,122,26,0.30));
}
.brand-text strong { display: block; font-family: 'Fraunces', serif; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.brand-text small  { display: block; font-size: 11px; color: var(--text-2); letter-spacing: .5px; text-transform: uppercase; }

.nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.nav a {
  padding: 8px 14px; border-radius: 8px; text-decoration: none;
  color: var(--text-2); font-size: 14px; font-weight: 500;
  transition: all .15s;
}
.nav a:hover  { color: var(--text); background: rgba(255,255,255,0.04); }
.nav a.active { color: var(--text); background: rgba(255,122,26,0.12); }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  font-size: 13px; color: var(--text-2);
  padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px;
}

.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.lang-switch a {
  padding: 4px 10px; font-size: 11px; font-weight: 600; letter-spacing: .5px;
  text-decoration: none; color: var(--text-2); border-radius: 999px;
}
.lang-switch a.on { background: var(--text); color: var(--ink); }
.lang-switch-bottom { margin-top: 18px; justify-content: center; display: flex; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; font-size: 13px; font-weight: 600;
  border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: all .15s;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #1a0a00; border-color: rgba(0,0,0,0.2);
  box-shadow: 0 4px 16px rgba(255,122,26,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,122,26,0.35); }
.btn-ghost {
  background: transparent; color: var(--text); border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--text); background: rgba(255,255,255,0.04); }
.btn-block { display: flex; width: 100%; padding: 12px 18px; }

/* ---------- container ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 14px 28px 28px; }
.footer {
  padding: 32px 28px; text-align: center; color: var(--muted);
  border-top: 1px solid var(--line); margin-top: 80px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.footer-credit { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; opacity: .7; transition: opacity .2s; }
.footer-credit:hover { opacity: 1; }
.footer-credit a { display: inline-flex; align-items: center; }
.footer-ne-logo {
  height: 18px; width: auto; display: block;
  filter: brightness(0) invert(1);
}
.footer-year { font-size: 11px; letter-spacing: .5px; color: var(--muted); }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 18px;
}
.page-head-actions { display: flex; gap: 8px; }
.page-title  { font-family: 'Fraunces', serif; font-size: 38px; font-weight: 600; letter-spacing: -.5px; margin: 0; }
.page-sub    { color: var(--text-2); margin: 4px 0 0; }

/* ---------- flash ---------- */
.flash {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 18px;
  border: 1px solid var(--line); font-size: 14px;
}
.flash-ok    { background: rgba(62,224,127,0.08); color: var(--green); border-color: rgba(62,224,127,0.3); }
.flash-error { background: rgba(255,94,108,0.08); color: var(--red);   border-color: rgba(255,94,108,0.3); }

/* ---------- filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px;
  padding: 14px; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filters select, .filters input[type=text] {
  background: var(--ink-3); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 14px; font-family: inherit;
  min-width: 180px;
}
.filters select:focus, .filters input[type=text]:focus {
  outline: none; border-color: var(--orange);
}

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: var(--ink-2); border: 1px solid var(--line);
  padding: 22px 24px; border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--orange), transparent);
}
.kpi-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-2); font-weight: 600;
}
.kpi strong {
  font-family: 'Fraunces', serif; font-size: 42px; font-weight: 600;
  letter-spacing: -1px; line-height: 1;
}

/* ---------- charts ---------- */
.grid-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px;
}
.card-wide { grid-column: 1 / -1; }
.card-title {
  font-family: 'Fraunces', serif; font-size: 18px; font-weight: 600;
  margin: 0 0 16px; letter-spacing: -.2px;
}
.chart-box        { position: relative; height: 280px; width: 100%; }
.chart-box-tall   { height: 240px; }
.chart-box-bars   { height: 260px; }
.chart-box canvas { max-width: 100% !important; }

/* ---------- list rank ---------- */
.list-rank { list-style: none; padding: 0; margin: 0; }
.list-rank li {
  display: grid; grid-template-columns: 1fr auto 120px; gap: 16px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.list-rank li:last-child { border-bottom: 0; }
.list-rank .nb-name  { font-weight: 600; }
.list-rank .nb-city  { color: var(--text-2); font-size: 13px; }
.list-rank .nb-bar   { background: var(--ink-3); border-radius: 999px; height: 8px; overflow: hidden; }
.list-rank .nb-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-2)); }

/* ---------- table ---------- */
.table-wrap { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 12px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.tbl th {
  background: var(--ink-3); font-size: 11px; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-2); font-weight: 600;
}
.tbl tr:hover td { background: rgba(255,255,255,0.02); }
.tbl tr:last-child td { border-bottom: 0; }
.empty { text-align: center; color: var(--text-2); padding: 48px !important; }

.row-actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.row-actions a { color: var(--text-2); font-size: 13px; text-decoration: none; }
.row-actions a:hover { color: var(--orange); }
.row-actions form { margin: 0; }
.link-danger {
  background: none; border: 0; color: var(--text-2); cursor: pointer;
  font-size: 13px; padding: 0; font-family: inherit;
}
.link-danger:hover { color: var(--red); }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line); color: var(--text-2);
  text-transform: uppercase; letter-spacing: .5px;
}
.chip-city { background: rgba(255,255,255,0.04); color: var(--text); }
.src-landing     { background: rgba(255,122,26,0.15); color: #ff7a1a; border-color: rgba(255,122,26,0.3); }
.src-membership  { background: rgba(62,224,127,0.15); color: #3ee07f; border-color: rgba(62,224,127,0.3); }
.src-whatsapp    { background: rgba(37,211,102,0.15); color: #25d366; border-color: rgba(37,211,102,0.3); }
.src-facebook    { background: rgba(79,141,240,0.15); color: #4f8df0; border-color: rgba(79,141,240,0.3); }
.src-mailing     { background: rgba(192,132,252,0.15); color: #c084fc; border-color: rgba(192,132,252,0.3); }
.src-partnership { background: rgba(244,185,66,0.15);  color: #f4b942; border-color: rgba(244,185,66,0.3); }
.src-events      { background: rgba(255,94,138,0.15);  color: #ff5e8a; border-color: rgba(255,94,138,0.3); }
.src-other       { background: rgba(156,163,175,0.15); color: #9ca3af; border-color: rgba(156,163,175,0.3); }

/* ---------- forms ---------- */
.form-card {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px;
}
.form-grid .full { grid-column: 1 / -1; }
.lbl {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-2); margin-bottom: 6px; font-weight: 600;
}
.inp {
  width: 100%; background: var(--ink-3); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px;
  font-family: inherit; transition: border-color .15s;
}
.inp:focus { outline: none; border-color: var(--orange); }
textarea.inp { resize: vertical; min-height: 84px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }

.grid-2 { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.glow { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(80px); z-index: 0; }
.glow-orange { width: 500px; height: 500px; background: rgba(255,122,26,0.25); top: -100px; right: -100px; }
.glow-green  { width: 400px; height: 400px; background: rgba(62,224,127,0.20); bottom: -100px; left: -100px; }

.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.login-card {
  background: rgba(17,17,17,0.85); backdrop-filter: blur(20px);
  border: 1px solid var(--line-2); border-radius: 24px;
  padding: 40px; box-shadow: 0 20px 80px rgba(0,0,0,0.5);
}
.login-mark {
  width: 56px; height: 56px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  border-radius: 14px; font-weight: 800; font-size: 20px;
  color: #1a0a00; letter-spacing: 1px; margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(255,122,26,0.4);
}
.login-logo {
  width: 72px; height: 72px; object-fit: contain; display: block;
  margin-bottom: 18px;
  filter: drop-shadow(0 10px 30px rgba(255,122,26,0.4));
}
.login-title { font-family: 'Fraunces', serif; font-size: 32px; font-weight: 600; margin: 0; letter-spacing: -.5px; }
.login-sub   { color: var(--text-2); margin: 4px 0 28px; }

/* ---------- test data notice (modal) ---------- */
.test-notice-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,5,5,0.78); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: tn-fade .25s ease-out both;
}
@keyframes tn-fade { from { opacity: 0; } to { opacity: 1; } }
.test-notice-modal {
  position: relative; width: 100%; max-width: 460px;
  background: linear-gradient(135deg, #1a1208 0%, #16100a 100%);
  border: 1px solid rgba(255,122,26,0.35);
  border-radius: 18px; padding: 36px 32px 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,122,26,.08);
  text-align: center; color: var(--text);
  animation: tn-pop .35s cubic-bezier(.22,.9,.32,1.25) both;
}
@keyframes tn-pop {
  from { transform: scale(.9) translateY(10px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);   opacity: 1; }
}
.test-notice-icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  border-radius: 50%; font-weight: 800; font-size: 28px;
  color: #1a0a00;
  box-shadow: 0 10px 30px rgba(255,122,26,0.4);
}
.test-notice-modal h3 {
  font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600;
  margin: 0 0 10px; letter-spacing: -.3px; color: var(--text);
}
.test-notice-modal p {
  margin: 0 0 22px; font-size: 14px; color: var(--text-2);
  line-height: 1.55;
}
.test-notice-close {
  position: absolute; top: 12px; right: 12px;
  background: transparent; border: 0; color: var(--text-2);
  cursor: pointer; font-size: 26px; line-height: 1;
  width: 36px; height: 36px; padding: 0; border-radius: 10px;
  transition: all .15s; font-family: inherit;
}
.test-notice-close:hover { background: rgba(255,255,255,.08); color: var(--text); }
.test-notice-ok { min-width: 140px; }

/* ---------- agenda ---------- */
.agenda-wrap { display: flex; flex-direction: column; gap: 28px; }
.weekend-block { }
.weekend-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.weekend-title { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.2px; }
.weekend-num   { font-size: 11px; color: var(--text-2); letter-spacing: 1.5px; font-weight: 700; }
.agenda-grid   { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.agenda-cell   {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 160px;
}
.agenda-cell[data-city="Orlando"] { border-top: 3px solid var(--orange); }
.agenda-cell[data-city="Tampa"]   { border-top: 3px solid var(--green); }
.agenda-cell-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.agenda-cell-head strong { font-size: 13px; font-weight: 600; line-height: 1.3; display: block; }
.city-tag { font-size: 10px; color: var(--text-2); letter-spacing: .5px; text-transform: uppercase; }
.agenda-count {
  background: var(--ink-3); color: var(--text-2); border-radius: 999px;
  width: 26px; height: 26px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.agenda-count.has { background: var(--orange); color: #1a0a00; }
.agenda-empty    { color: var(--text-2); font-size: 12px; font-style: italic; padding: 16px 0; text-align: center; }
.agenda-cell-actions { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); }
.btn-add-event {
  display: block; text-align: center; text-decoration: none;
  color: var(--text-2); font-size: 12px; font-weight: 600;
  padding: 6px; border-radius: 6px; transition: all .15s;
}
.btn-add-event:hover { color: var(--orange); background: rgba(255,122,26,0.08); }

.event-pill {
  background: var(--ink-3); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 12px;
  display: flex; flex-direction: column; gap: 4px;
  border-left: 3px solid var(--orange);
}
.event-pill.st-confirmed { border-left-color: var(--green); }
.event-pill.st-done      { border-left-color: var(--text-2); opacity: .65; }
.event-pill.st-cancelled { border-left-color: var(--red); opacity: .55; text-decoration: line-through; }
.event-pill-head { display: flex; justify-content: space-between; gap: 6px; color: var(--text-2); font-size: 10px; letter-spacing: .5px; text-transform: uppercase; font-weight: 700; }
.event-day  { color: var(--text); }
.event-time { color: var(--text-2); }
.event-title { color: var(--text); font-weight: 600; text-decoration: none; line-height: 1.3; font-size: 13px; display: block; }
.event-title:hover { color: var(--orange); }
.event-type {
  display: inline-block; align-self: flex-start;
  padding: 2px 7px; border-radius: 999px; font-size: 10px;
  background: rgba(255,122,26,0.15); color: var(--orange);
  text-transform: uppercase; letter-spacing: .4px; font-weight: 700;
}
.event-status { font-size: 10px; color: var(--text-2); margin-left: 4px; }

/* ---------- integration form preview ---------- */
.preview-card  { margin-bottom: 20px; }
.preview-sub   { color: var(--text-2); font-size: 13px; margin: -8px 0 18px; }
.preview-frame {
  background: linear-gradient(135deg, #fafaf7 0%, #f0ebe2 100%);
  border-radius: var(--radius); padding: 40px 24px; display: grid; place-items: center;
  position: relative; overflow: hidden;
}
.preview-frame::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(800px 400px at 20% 10%, rgba(255,122,26,0.10), transparent 60%),
    radial-gradient(600px 400px at 90% 90%, rgba(62,224,127,0.08), transparent 60%);
  pointer-events: none;
}
.preview-form {
  position: relative; z-index: 1; width: 100%; max-width: 560px;
  background: #fff; border-radius: 16px; padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.06);
}
.preview-form-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid #eee; }
.preview-logo { width: 44px; height: 44px; object-fit: contain; }
.preview-form-head h4 { margin: 0 0 2px; font-family: 'Fraunces', serif; font-size: 20px; font-weight: 600; color: #1a0f08; letter-spacing: -.3px; }
.preview-form-head p  { margin: 0; color: #7a6f64; font-size: 13px; }
.pf-form { display: flex; flex-direction: column; gap: 14px; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-grid input, .pf-grid select {
  width: 100%; padding: 11px 13px; font-size: 14px; font-family: inherit;
  background: #f8f6f2; border: 1px solid #e8e2d5; border-radius: 10px;
  color: #1a0f08; transition: border-color .15s, background .15s;
}
.pf-grid input:focus, .pf-grid select:focus {
  outline: none; border-color: #ff7a1a; background: #fff;
  box-shadow: 0 0 0 3px rgba(255,122,26,0.12);
}
.pf-submit {
  width: 100%; padding: 13px 20px; font-size: 14px; font-weight: 700;
  background: linear-gradient(135deg, #ff7a1a, #ff9248);
  color: #1a0a00; border: 0; border-radius: 12px; cursor: pointer;
  font-family: inherit; transition: transform .15s, box-shadow .15s;
  box-shadow: 0 6px 20px rgba(255,122,26,0.30);
}
.pf-submit:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(255,122,26,0.40); }

/* ---------- integration ---------- */
.integ-info {
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; margin-bottom: 20px;
}
.info-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.info-cell .lbl { margin-bottom: 8px; }
.info-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info-value code {
  background: var(--ink); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 8px; font-size: 13px;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  color: var(--orange); user-select: all; word-break: break-all;
  flex: 1; min-width: 200px;
}
.info-note { color: var(--text-2); font-size: 12px; margin: 14px 0 0; }
.btn-copy {
  background: var(--ink-3); color: var(--text-2);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.btn-copy:hover  { color: var(--text); border-color: var(--text); }
.btn-copy-ok     { background: var(--green) !important; color: var(--ink) !important; border-color: var(--green) !important; }
.btn-sm          { padding: 7px 12px; font-size: 12px; }

.integ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.code-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.code-header .card-title { margin: 0; }
.code-block {
  background: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; margin: 0;
  overflow-x: auto; max-height: 360px;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 12px; line-height: 1.55; color: #e2e2e2;
  white-space: pre;
}
.tbl-compact th, .tbl-compact td { padding: 8px 12px; font-size: 13px; }
.tbl-compact code { background: var(--ink); padding: 2px 6px; border-radius: 4px; font-size: 12px; color: var(--orange); }

/* ---------- reports ---------- */
.report-print-head { display: none; }

.period-pills {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: 999px; margin-bottom: 24px;
}
.period-pills button {
  background: transparent; color: var(--text-2); border: 0; cursor: pointer;
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  font-family: inherit; transition: all .15s;
}
.period-pills button:hover { color: var(--text); }
.period-pills button.on { background: var(--text); color: var(--ink); }

.kpi-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
  margin-bottom: 24px;
}
.kpi-narrow strong { font-size: 22px !important; line-height: 1.2 !important; }
.kpi-narrow strong small { display: block; font-size: 11px; font-weight: 500; color: var(--text-2); margin-top: 4px; letter-spacing: .3px; }
.kpi-up   { color: var(--green) !important; }
.kpi-down { color: var(--red)   !important; }

.grid-2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

/* source ranking */
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li {
  display: grid; grid-template-columns: 160px 1fr 40px 50px 70px; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.rank-list li:last-child { border-bottom: 0; }
.rank-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.rank-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rank-bar  { background: var(--ink-3); border-radius: 999px; height: 8px; overflow: hidden; }
.rank-bar i{ display: block; height: 100%; }
.rank-share{ color: var(--text-2); font-size: 12px; text-align: right; }
.rank-delta{ font-size: 11px; font-weight: 700; text-align: right; }
.rank-up   { color: var(--green); }
.rank-down { color: var(--red); }
.rank-new  { color: var(--orange); }

/* demographics */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.demo-sub  { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-2); margin-bottom: 8px; font-weight: 600; }
.chart-box-small { height: 200px; }

/* upcoming birthdays */
.bday-list { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow-y: auto; }
.bday-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.bday-list li:last-child { border-bottom: 0; }
.bday-name { font-weight: 600; }
.bday-meta { color: var(--text-2); font-size: 11px; margin-top: 2px; }
.bday-today {
  background: var(--orange); color: #1a0a00; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.bday-days {
  background: var(--ink-3); color: var(--text-2); padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; border: 1px solid var(--line);
}
.bday-empty { text-align: center; color: var(--text-2); padding: 32px 0; justify-content: center; }

/* matrix */
.matrix-wrap { overflow-x: auto; }
.matrix-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix-table th, .matrix-table td {
  padding: 10px 12px; text-align: center; border: 1px solid var(--line);
}
.matrix-table thead th { background: var(--ink-3); color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.matrix-table tbody th { background: var(--ink-3); text-align: left; font-weight: 600; }
.matrix-table .matrix-sum { background: var(--ink-3); font-weight: 700; }
.matrix-table .matrix-foot th { color: var(--text); }

/* print */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { background: #fff !important; color: #000 !important; }
  .grain, .glow, .topbar, .footer, .no-print { display: none !important; }
  .container { max-width: 100% !important; padding: 0 !important; }
  .report-print-head { display: block !important; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid #000; }
  .report-print-head h1 { font-family: 'Fraunces', serif; font-size: 22px; margin: 0; color: #000; }
  .report-print-head p { margin: 4px 0 0; color: #666; font-size: 12px; }
  .card, .kpi { background: #fff !important; border: 1px solid #ccc !important; color: #000 !important; box-shadow: none !important; page-break-inside: avoid; }
  .kpi-label, .demo-sub, .rank-share, .bday-meta { color: #666 !important; }
  .kpi strong, .page-title, .card-title { color: #000 !important; }
  .matrix-table th, .matrix-table td { border-color: #999 !important; }
  .matrix-table thead th, .matrix-table tbody th, .matrix-table .matrix-sum { background: #f3f3f3 !important; color: #000 !important; }
  .grid-2-cols { gap: 10px; }
  .kpi-grid { gap: 8px; }
  .chart-box, .chart-box-bars, .chart-box-small { height: 180px !important; }
  @page { margin: 14mm; size: A4; }
}

@media (max-width: 880px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-charts { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2-cols { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
  .brand-text strong { font-size: 14px; }
  .brand-text small  { display: none; }
  .nav { order: 3; flex: 0 0 100%; flex-wrap: wrap; justify-content: center; padding-top: 8px; border-top: 1px solid var(--line); }
  .nav-row { top: 65px; }
  .nav-inner { padding: 6px 12px; flex-wrap: wrap; }
  .user-chip { display: none; }
  .page-title { font-size: 28px; }
  .container { padding: 18px; }
  .rank-list li { grid-template-columns: 110px 1fr 32px 70px; }
  .rank-list .rank-share { display: none; }
}
