@font-face { font-family: 'Inter'; src: url(/static/fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url(/static/fonts/bodoni.woff2) format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url(/static/fonts/bodoni-italic.woff2) format('woff2'); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Mono'; src: url(/static/fonts/mono.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  /* Zarelo Agency: negro, dorado y marfil */
  --brand: #8a7a3e;
  --gold: #a49054;
  --gold-light: #c8b884;
  --gold-ink: #74673a;
  --serif: 'Bodoni Moda', 'Didot', Georgia, serif;
  --ink: #17150f;
  --ink-2: #4a4437;
  --muted: #7b7363;
  --line: #e8e0cd;
  --bg: #f7f3ea;
  --card: #fffdf8;
  --side: #0e0d0b;
  --side-2: #1f1c16;
  --side-line: #2a261e;
  --side-text: #d9d1bf;
  --side-muted: #958c79;
  --ok: #059669;
  --ok-bg: #e7f7ef;
  --warn: #d97706;
  --warn-bg: #fdf3e1;
  --bad: #dc2626;
  --bad-bg: #fdecec;
  --off: #a39b8a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 21, 15, .05), 0 6px 20px -12px rgba(23, 21, 15, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: 34px; letter-spacing: -.005em; line-height: 1.15; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 30px; margin: 0 0 6px; }
h3 { font-size: 20px; margin: 0 0 14px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mono { font-family: Mono, ui-monospace, monospace; letter-spacing: .02em; }
.i { width: 20px; height: 20px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex: none; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 22px 14px; border-right: 1px solid var(--side-line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: #fff; }
.brand strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 19px; letter-spacing: .01em; line-height: 1.15; }
.brand small { display: block; color: var(--gold); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; margin-top: 2px; }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; object-fit: cover; flex: none; }
.brand-logo .i { width: 22px; height: 22px; }
.brand-logo.mark { background: var(--side); border-radius: 50%; padding: 2px; object-fit: contain; }
.brand-logo.sm { width: 30px; height: 30px; border-radius: 8px; }
.brand-logo.lg { width: 64px; height: 64px; border-radius: 16px; }
.brand-logo.mark.lg { border-radius: 50%; padding: 4px; }
.brand-logo.mark.xl { width: 56px; height: 56px; }
.brand-logo.lg .i { width: 32px; height: 32px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-text); font-size: 15px; position: relative; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--side-2); color: #fff; }
.nav-item.active { background: var(--side-2); color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 var(--gold); }
.nav-item.active .i { color: var(--gold-light); }
.nav-title { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 600; margin: 24px 12px 8px; }
.badge-extra { margin-left: auto; background: rgba(200, 184, 132, .14); color: var(--gold-light); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge-extra.big { background: #f1e8d0; color: var(--gold-ink); font-size: 13px; padding: 4px 12px; display: inline-block; margin: 0 0 14px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-top: 20px; }
.provider-card { border: 1px solid var(--side-line); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.provider-card strong { font-size: 13px; color: #fff; }
.provider-card small { grid-column: 2; color: var(--side-muted); font-size: 12px; }
.provider-card .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); display: inline-block; flex: none; }
.dot.ok { background: #10b981; } .dot.warn { background: #f59e0b; } .dot.bad { background: #ef4444; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--side-2); color: var(--gold-light); border: 1px solid var(--side-line); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.me-text { flex: 1; min-width: 0; }
.me-text strong { display: block; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--side-muted); font-size: 12px; }
.icon-btn { background: none; border: 0; color: var(--side-muted); padding: 6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: #fff; background: var(--side-2); }
.icon-btn.light { color: var(--side-text); }
.main { flex: 1; min-width: 0; }
.topbar { display: none; }
#page { padding: 30px 32px 60px; max-width: 1400px; }

/* ---------- Cabecera de página ---------- */
.page-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.page-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.chip-demo { font-family: Inter, sans-serif; font-size: 13px; font-weight: 600; background: #efe7d4; color: var(--ink-2); padding: 4px 12px; border-radius: 999px; letter-spacing: 0; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.crumbs a { display: flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--ink); }
.crumbs .i { width: 16px; height: 16px; }
.crumbs strong { color: var(--ink); font-weight: 600; }

/* ---------- Botones y formularios ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 15px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, filter .15s; }
.btn:hover { border-color: #d3c7ab; background: #fbf7ee; }
.btn .i { width: 18px; height: 18px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.dark { background: transparent; color: #fff; border-color: #4a4436; }
.btn.dark:hover { background: var(--side-2); border-color: var(--gold); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.block { width: 100%; padding: 14px; }
.btn:disabled, .btn.busy { opacity: .55; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; }
.link:disabled { color: var(--muted); cursor: default; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  font: inherit; width: 100%; padding: 11px 14px; border: 1px solid #ddd3bc; border-radius: 10px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
label input, label select, label textarea { font-weight: 400; }
.dlg .file-list { margin-bottom: 0; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; font-size: 15px; cursor: pointer; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; cursor: pointer; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 4px; }
.form-error { color: var(--bad); background: var(--bad-bg); padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.search { position: relative; flex-direction: row; align-items: center; font-weight: 400; }
.search .i { position: absolute; left: 14px; color: var(--muted); width: 18px; height: 18px; }
.search input { padding-left: 42px; width: 320px; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 26px 28px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 28px 16px; border-bottom: 1px solid var(--line); gap: 12px; }
.card-head h3 { margin: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 24px; }
.empty { color: var(--muted); padding: 30px; text-align: center; grid-column: 1 / -1; }
.note { display: flex; gap: 10px; align-items: center; margin-top: 18px; font-size: 14px; }
.note .i { width: 18px; height: 18px; }

/* ---------- Estado ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.on { background: var(--ok-bg); color: var(--ok); }
.status.starting { background: var(--warn-bg); color: var(--warn); }
.status.off, .status.unknown { background: #efe9dc; color: #7b7363; }
.status.expired, .status.failed { background: var(--bad-bg); color: var(--bad); }
.tag { display: inline-block; background: #f1eadb; color: var(--ink-2); font-size: 13px; padding: 2px 9px; border-radius: 6px; margin: 0 4px 4px 0; }
.pill-ok { background: var(--ok-bg); color: var(--ok); font-weight: 600; font-size: 13px; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.pill-wait { background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: 13px; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.pill-bad { background: var(--bad-bg); color: var(--bad); font-weight: 600; font-size: 13px; padding: 4px 12px; border-radius: 999px; }

/* ---------- Móviles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 26px; }
.stat { background: var(--card); box-shadow: var(--shadow); position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.stat span { color: var(--ink-2); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.stat strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1.1; margin: 6px 0 2px; }
.stat small { color: var(--muted); font-size: 13px; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.segmented { max-width: 100%; overflow-x: auto; display: inline-flex; background: #ece4d2; border-radius: 12px; padding: 4px; gap: 2px; }
.segmented button { font: inherit; font-weight: 600; color: var(--ink-2); background: none; border: 0; padding: 8px 16px; border-radius: 9px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.segmented button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.segmented .count { background: #e0d6bf; font-size: 12px; padding: 1px 8px; border-radius: 999px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font: inherit; font-weight: 500; background: var(--card); border: 1px solid var(--line); padding: 8px 18px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.pill.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill .count { font-size: 12px; background: #f1eadb; color: var(--ink-2); padding: 1px 8px; border-radius: 999px; }
.pill.on .count { background: #3a352a; color: var(--gold-light); }
.bulkbar { background: var(--side); border: 1px solid var(--side-line); color: #fff; border-radius: var(--radius); padding: 12px 14px 12px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; position: sticky; top: 12px; z-index: 5; }
.bulk-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.phone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.phone-card { background: var(--card); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.phone-card.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.phone-card header { display: flex; align-items: center; gap: 12px; }
.phone-card header .name { font-family: Mono, monospace; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-body { display: flex; gap: 16px; }
.mini-phone { width: 46px; height: 80px; border: 4px solid var(--ink); border-radius: 10px; background: linear-gradient(160deg, #e9dfbf, #c8b884); flex: none; }
.mini-phone.off, .mini-phone.expired, .mini-phone.unknown { background: #24211b; }
.mini-phone.starting { background: #f6ead0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; align-content: start; min-width: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.since { color: var(--muted); font-size: 14px; }
.pending { display: inline-flex; align-items: center; gap: 6px; color: var(--warn); font-size: 13px; font-weight: 600; margin-top: 4px; }
.pending .i { width: 14px; height: 14px; }
.phone-card footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: auto; }
.phone-card footer .btn { padding-left: 8px; padding-right: 8px; min-width: 0; }
.phone-card footer .btn.wide { grid-column: 1 / -1; }

/* ---------- Ficha ---------- */
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; }
.detail-head h1 { font-family: Mono, monospace; font-weight: 600; }
.detail-head h1 .status, .detail-head h1 .chip-demo { font-family: Inter, sans-serif; }
.detail-grid { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
.big-phone { padding: 36px 28px 24px; text-align: center; }
.screen-frame { width: 270px; max-width: 100%; aspect-ratio: 9 / 18; margin: 0 auto 16px; border: 12px solid var(--ink); border-radius: 36px; background: linear-gradient(170deg, #f3ecda, #e2d5b0); position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.screen-frame::before { content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 72px; height: 6px; border-radius: 3px; background: var(--ink); }
.screen-frame.off, .screen-frame.expired, .screen-frame.unknown { background: #1d1b16; color: var(--side-text); }
.screen-frame.starting { background: #f6ead0; }
.screen-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.power-dot { width: 80px; height: 80px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; margin-bottom: 16px; }
.power-dot .i { width: 34px; height: 34px; }
.screen-frame strong { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.screen-frame p { font-size: 14px; margin-top: 8px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 24px; }
.kv dt { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.inline-form { display: flex; gap: 12px; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .grow small { color: var(--muted); }
.app-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.file-icon { width: 44px; height: 44px; border-radius: 10px; background: #f3ecda; color: var(--brand); display: grid; place-items: center; flex: none; }
.section-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 22px 0 6px; }
.detail-stack { display: flex; flex-direction: column; gap: 24px; }

/* ---------- Archivos ---------- */
.dropzone { border: 2px dashed #d8ccb0; border-radius: 14px; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; font-weight: 400; margin-bottom: 16px; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: #fbf6ea; }
.drop-icon { width: 56px; height: 56px; border-radius: 12px; background: #f3ecda; color: var(--brand); display: grid; place-items: center; margin-bottom: 8px; }
.drop-icon .i { width: 26px; height: 26px; }
.file-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.file-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.file-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item small { color: var(--muted); white-space: nowrap; }
.file-item .bar { height: 4px; background: #ede6d6; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.file-item .bar i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.file-item .icon-btn { color: var(--muted); }
.file-item .icon-btn:hover { background: #f1eadb; color: var(--ink); }
.pills.wrap { margin-bottom: 12px; }
.pick-phones { margin: 6px 0 14px; }
.pick-phones summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; max-height: 260px; overflow: auto; }
.check-grid label { font-weight: 400; font-size: 14px; }
.send-list { padding: 0 28px 8px; }
.send-row { display: grid; grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 6px 16px; align-items: start; padding: 18px 0; border-top: 1px solid var(--line); }
.send-row:first-child { border-top: 0; }
.send-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-row small { color: var(--muted); display: block; }
.send-row .when { color: var(--ink-2); font-size: 14px; text-align: right; white-space: nowrap; }
.send-status { grid-column: 2 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Apps ---------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.app-card { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.app-card header { display: flex; gap: 16px; align-items: center; }
.app-card header .app-icon { width: 56px; height: 56px; font-size: 22px; border-radius: 12px; }
.app-card header strong { font-size: 18px; display: block; }
.progress { height: 8px; border-radius: 4px; background: #ede6d6; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.app-card .row-between { font-size: 14px; color: var(--ink-2); }

/* ---------- Directo ---------- */
.live-wrap { padding: 28px; }
.live-grid { display: grid; gap: 28px; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); }
.live-cell { text-align: center; }
.live-cell .screen-frame { width: 100%; border-width: 8px; border-radius: 26px; padding: 0; justify-content: flex-start; background: #f3ecda; margin-bottom: 10px; }
.live-cell .screen-frame::before { width: 40%; height: 5px; top: 8px; z-index: 2; }
.live-cell .name { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: Mono, monospace; font-size: 15px; }
.live-cell a.open { color: var(--brand); font-weight: 600; font-size: 15px; display: inline-block; margin-top: 4px; }
.live-cell .expand { position: absolute; right: 6px; bottom: 6px; z-index: 3; background: rgba(14, 13, 11, .65); color: #fff; }
.demo-screen { position: absolute; inset: 0; padding: 30px 12% 16px; display: flex; flex-direction: column; gap: 8px; }
.demo-screen .hero { flex: 0 0 48%; border-radius: 10px; background: var(--c, #c8b884); animation: pulse 3.2s ease-in-out infinite; }
.demo-screen .line { height: 9px; border-radius: 5px; background: color-mix(in srgb, var(--c, #c8b884) 55%, #fff); }
.demo-screen .line.s { width: 60%; } .demo-screen .line.m { width: 80%; }
.demo-screen .dock { margin-top: auto; display: flex; justify-content: space-around; }
.demo-screen .dock i { width: 22%; aspect-ratio: 1; border-radius: 6px; background: color-mix(in srgb, var(--c, #c8b884) 70%, #fff); }
.boot-label { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(14, 13, 11, .55); font-weight: 600; z-index: 2; }
@keyframes pulse { 50% { opacity: .65; } }

/* ---------- Pantalla en su pestaña ---------- */
body.screen-page { background: radial-gradient(ellipse at 50% 0%, #2a2518 0%, #0e0d0b 60%); min-height: 100vh; display: flex; flex-direction: column; }
.screen-bar { display: flex; align-items: center; gap: 16px; padding: 10px 18px; color: #fff; background: rgba(8, 7, 6, .85); border-bottom: 1px solid var(--side-line); flex-wrap: wrap; }
.screen-bar .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.screen-title { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.screen-title strong { font-family: Mono, monospace; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-actions { display: flex; gap: 8px; }
.screen-main { flex: 1; display: grid; place-items: center; padding: 20px; }
.screen-frame.big { width: min(100%, calc((100vh - 120px) / 2), 450px); min-width: 240px; height: auto; aspect-ratio: 9 / 18; margin: 0; text-align: center; border-color: #2e2a21; box-shadow: 0 0 0 1px #4a4232, 0 30px 80px -20px rgba(0, 0, 0, .7); }
.screen-frame.big::before { background: #2e2a21; z-index: 2; }
.screen-frame.big.on { padding: 0; }
@media (max-width: 600px) {
  .screen-bar { gap: 10px; padding: 10px 14px; }
  .screen-bar .brand strong, .screen-title .chip-demo { display: none; }
  .screen-bar .brand { flex: 1; }
  .screen-title { order: 3; flex-basis: 100%; }
  .screen-main { padding: 14px; }
  .screen-frame.big { width: min(100%, calc((100vh - 160px) / 2)); border-width: 8px; border-radius: 26px; }
}

/* ---------- Ajustes ---------- */
.swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch { width: 52px; height: 52px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--ink); }
.logo-row { display: flex; gap: 18px; align-items: center; margin: 6px 0 22px; }
.logo-row .btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.team-row { display: flex; align-items: center; gap: 14px; padding: 16px 28px; border-top: 1px solid var(--line); }
.team-row:first-child { border-top: 0; }
.team-row .avatar { background: #efe7d4; color: var(--gold-ink); border: 0; }
.team-row .avatar.me { background: var(--side); color: var(--gold-light); }
.team-row { flex-wrap: wrap; }
.team-row .grow { flex: 1 1 180px; min-width: 0; }
.team-row .grow small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; }
.team-row .meta { color: var(--muted); font-size: 14px; text-align: right; }
.team-actions { display: flex; gap: 8px; }
.card-foot { padding: 16px 28px 22px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.secret-box { background: #f3eee2; border-radius: 10px; padding: 12px 14px; font-family: Mono, monospace; font-size: 16px; user-select: all; margin: 10px 0; }
.extra-card { max-width: 640px; }
.extra-card p { margin-bottom: 10px; }

/* ---------- Ventanas y avisos ---------- */
dialog { border: 0; border-radius: 16px; background: var(--card); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(14, 13, 11, .25); color: var(--ink); }
dialog::backdrop { background: rgba(14, 13, 11, .45); }
.dlg { padding: 26px 28px; display: flex; flex-direction: column; gap: 16px; max-height: 85vh; overflow: auto; }
.dlg h3 { margin: 0; font-size: 22px; }
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast { background: var(--side); border: 1px solid var(--side-line); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(14, 13, 11, .25); max-width: 380px; font-size: 14px; animation: rise .2s ease-out; }
.toast.bad { background: var(--bad); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Acceso ---------- */
body.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: 48px 60px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  background: radial-gradient(ellipse 80% 60% at 85% 0%, rgba(164, 144, 84, .28), transparent 60%), radial-gradient(ellipse 60% 50% at 0% 100%, rgba(164, 144, 84, .12), transparent 60%), var(--side); }
.auth-hero::after { content: ''; position: absolute; width: 620px; height: 620px; right: -190px; bottom: -200px; background: url(/static/marca/zarelo.svg) center / contain no-repeat; opacity: .07; pointer-events: none; }
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero .brand { padding: 0; }
.auth-hero .brand .brand-logo { width: 52px; height: 52px; }
.auth-hero .brand strong { font-size: 24px; }
.auth-hero h1 { font-size: 56px; font-weight: 400; line-height: 1.06; letter-spacing: -.01em; max-width: 600px; display: block; }
.auth-hero h1 em { color: var(--gold-light); font-style: italic; }
.auth-hero .hairline { display: block; width: 64px; height: 1px; background: var(--gold); margin: 28px 0 0; }
.auth-hero p { color: var(--side-text); font-size: 18px; margin-top: 22px; max-width: 500px; }
.auth-hero small { color: var(--side-muted); letter-spacing: .02em; }
.hero-phones { display: flex; gap: 14px; margin-top: 44px; }
.hero-phones i { width: 52px; height: 92px; border-radius: 11px; border: 1.5px solid var(--gold); background: rgba(164, 144, 84, .08); }
.hero-phones i:nth-child(3n+1) { background: linear-gradient(160deg, #d9cba0, #8a7a3e); border-color: #d9cba0; }
.hero-phones i:nth-child(3n) { border-color: #4a4232; background: transparent; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: radial-gradient(ellipse at 50% 30%, #fffdf8, var(--bg) 70%); }
.auth-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 36px 34px; box-shadow: 0 30px 60px -30px rgba(23, 21, 15, .25); }
.auth-card::before { content: ''; width: 40px; height: 1px; background: var(--gold); margin-bottom: -4px; }
.auth-card h2 { font-size: 34px; margin: 0; }
.auth-card > .muted { margin-top: -8px; }

/* ---------- Móvil y tablet ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .live-grid { grid-template-columns: repeat(min(var(--cols, 6), 4), minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(14, 13, 11, .45); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 20; }
  #page { padding: 20px 16px 50px; }
  h1 { font-size: 28px; }
  .search input { width: 100%; }
  .page-actions, .search { width: 100%; }
  .kv { grid-template-columns: 1fr 1fr; }
  .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .send-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .send-row > div:nth-child(3) { grid-column: 2 / -1; grid-row: 2; }
  .send-row .when { grid-column: 3; grid-row: 1; }
  .send-status { grid-row: 3; justify-content: flex-start; }
  .team-row { flex-wrap: wrap; padding: 14px 18px; }
  body.auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 20px 32px; gap: 26px; }
  .auth-hero::after { width: 340px; height: 340px; right: -120px; bottom: -120px; }
  .auth-hero h1 { font-size: 36px; }
  .auth-hero .hairline { margin-top: 18px; }
  .auth-hero p { font-size: 16px; margin-top: 14px; }
  .auth-hero > small { display: none; }
  .auth-card .row-between .link { text-align: right; }
  .auth-form { padding: 28px 16px 40px; }
  .auth-card { padding: 28px 22px; }
  .hero-phones { display: none; }
  .bulkbar { padding: 12px 16px; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 14px 16px; }
  .stat strong { font-size: 26px; }
  .inline-form { flex-direction: column; }
}

/* ---------- Detalles de Zarelo ---------- */
.stat::before { content: ''; position: absolute; left: 22px; top: 0; width: 28px; height: 2px; background: var(--gold); }
.phone-card:hover { border-color: #d8ccb0; }
.page-head h1 { font-size: 38px; }
.card-head h3 { font-size: 22px; }
::selection { background: #e9dcb4; color: var(--ink); }
@media (max-width: 860px) { .page-head h1 { font-size: 30px; } }
