/* dBusinessWebsite — panel. Marca: petróleo (confianza), verde azulado (navegación), bermellón (acción principal). */
:root {
  --brand: #14606a; --brand-strong: #0f2a2e; --on-brand: #fff; --accent: #d23b1f; --on-accent: #fff;
  --bg: #eef2f2; --surface: #fff; --surface-2: #f5f8f8; --ink: #0f2a2e; --soft: #39545a; --muted: #56696d; --line: #d2dcdc;
  --ok: #17603a; --ok-bg: #e2f3ea; --warn: #8a5300; --warn-bg: #fdf0d8; --err: #a3271f; --err-bg: #fbe6e3;
  --r: 16px; --r-sm: 11px; --field-h: 46px; --shadow: 0 18px 40px -24px rgba(15, 42, 46, .45);
  --display: "Anybody", system-ui, sans-serif; --body: "Hanken Grotesk", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand: #55b7c1; --brand-strong: #7fcfd7; --on-brand: #06201e; --accent: #f26a4b; --on-accent: #1d0a05;
  --bg: #0b1c1f; --surface: #12282c; --surface-2: #183238; --ink: #e9f1f1; --soft: #c2d1d3; --muted: #9bb0b3; --line: #27474c;
  --ok: #7fdca4; --ok-bg: #143324; --warn: #f3c56c; --warn-bg: #3a2c0d; --err: #ff9d94; --err-bg: #3d1a17;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15.5px/1.55 var(--body); color: var(--ink); background: var(--bg); min-height: 100dvh; overflow-x: clip; }
h1, h2, h3 { font-family: var(--display); font-stretch: 100%; font-weight: 700; margin: 0; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 3vw, 2rem); } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0; } a { color: var(--brand); } small, .small { font-size: 13px; } .muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 19px; height: 19px; flex: none; }

/* Botones: todos con icono; el principal destaca */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--field-h); padding: 0 18px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 14.5px var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s; }
.btn:hover { border-color: var(--brand); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); } .btn.primary:hover { background: var(--brand-strong); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { color: var(--err); } .btn.danger:hover { border-color: var(--err); background: var(--err-bg); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 13.5px; } .btn.icon { padding: 0; width: var(--field-h); } .btn.icon.sm { width: 38px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; } .btn.block { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; } .grow { flex: 1 1 auto; min-width: 0; }

/* Formularios: campos del mismo alto y ancho */
.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--soft); min-width: 0; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input, select, textarea { font: 400 15.5px var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 13px; min-height: var(--field-h); width: 100%; min-width: 0; }
textarea { padding: 11px 13px; resize: vertical; line-height: 1.5; } select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
input[type="color"] { padding: 4px; cursor: pointer; } input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--brand); flex: none; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); } .form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--ink); min-height: 34px; cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 0; min-width: 0; } legend { font: 700 13px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 8px; }

/* Acceso */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: #0f2a2e; }
.auth-card { width: min(440px, 100%); background: var(--surface); border-radius: 22px; padding: clamp(22px, 5vw, 36px); box-shadow: var(--shadow); display: grid; gap: 16px; }
.logo { font: 800 1.12rem var(--display); font-stretch: 100%; letter-spacing: -.02em; color: var(--ink); display: inline-flex; align-items: center; gap: 10px; text-decoration: none; } .logo img { width: 34px; height: 34px; } .logo b { font-weight: inherit; }
.auth-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; font-size: 14px; } .linkbtn { background: none; border: 0; color: var(--brand); font: 600 14px var(--body); cursor: pointer; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Estructura: barra lateral en escritorio, barra inferior en móvil */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; }
.side .logo { padding: 4px 8px 14px; }
.nav-group { font: 700 11.5px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav-a { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); color: var(--soft); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.nav-a:hover { background: var(--surface-2); } .nav-a.on { background: var(--brand); color: var(--on-brand); } .nav-a .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.main { padding: clamp(16px, 3vw, 34px); min-width: 0; padding-bottom: 48px; } .page { width: min(1160px, 100%); margin-inline: auto; display: grid; gap: 18px; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; } .page-head p { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.bottom { display: none; }
.banner { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: var(--r); background: var(--warn-bg); color: var(--warn); font-weight: 600; } .banner.err { background: var(--err-bg); color: var(--err); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(16px, 2.2vw, 22px); min-width: 0; } .card.flat { padding: 0; overflow: hidden; }
.card-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; } .cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); } .cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); } .cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.stat { display: grid; gap: 4px; } .stat .n { font: 800 1.9rem/1.05 var(--display); font-stretch: 100%; letter-spacing: -.02em; } .stat .l { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); color: var(--soft); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; } .badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; } .badge.err { background: var(--err-bg); color: var(--err); border-color: transparent; }
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); } .bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }

/* Pestañas con aspecto de botón */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--soft); font: 600 14px var(--body); cursor: pointer; white-space: nowrap; flex: none; }
.tab.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* Listas y tablas */
.list { display: grid; } .item { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); } .item:last-child { border-bottom: 0; } .item.unread { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.item .t { font-weight: 700; overflow-wrap: anywhere; } .item .s { color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; } table { width: 100%; border-collapse: collapse; font-size: 14.5px; } th { text-align: left; font: 700 12px var(--body); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; } tr:last-child td { border-bottom: 0; } td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Editor del sitio: formulario + vista previa */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.preview { position: sticky; top: 16px; display: grid; gap: 10px; } .frame { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #fff; height: min(78dvh, 820px); }
.frame iframe { border: 0; display: block; transform-origin: top left; }
.tpl { display: grid; gap: 8px; padding: 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; } .tpl.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.tpl .mock { height: 84px; border-radius: 10px; display: grid; gap: 6px; padding: 10px; } .tpl .mock i { display: block; border-radius: 5px; }
.rep { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.photo { display: flex; gap: 12px; align-items: center; } .thumb { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--muted); }
.media-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } .media { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 1; padding: 0; cursor: pointer; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; } .media .del { position: absolute; top: 6px; right: 6px; }
.media.pick:hover, .media.pick:focus-visible { outline: 3px solid var(--brand); }
.plan { display: grid; gap: 12px; align-content: start; } .plan.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); } .plan .price { font: 800 1.9rem/1 var(--display); font-stretch: 100%; } .plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14.5px; } .plan li { display: flex; gap: 8px; align-items: flex-start; } .plan li .ic { color: var(--ok); margin-top: 2px; }
.code { font: 600 14px ui-monospace, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; overflow-wrap: anywhere; }

/* Ventanas (popups) y avisos */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(8, 20, 19, .58); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { width: min(620px, 100%); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); display: grid; gap: 16px; padding: clamp(18px, 3vw, 26px); max-height: calc(100dvh - 32px); overflow-y: auto; } .modal.wide { width: min(920px, 100%); }
.modal-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.toasts { position: fixed; z-index: 80; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { padding: 13px 16px; border-radius: 13px; background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: var(--shadow); } .toast.err { background: var(--err); color: #fff; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 3px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: spin .7s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px 0; color: var(--muted); }
.receipt { display: grid; gap: 14px; } .receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; } .receipt dt { color: var(--muted); } .receipt dd { margin: 0; font-weight: 600; text-align: right; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); } .side { display: none; }
  .main { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
  .bottom { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom a, .bottom button { display: grid; justify-items: center; gap: 3px; padding: 7px 2px; min-height: 54px; border-radius: 12px; border: 0; background: none; color: var(--muted); font: 600 11.5px var(--body); text-decoration: none; cursor: pointer; position: relative; }
  .bottom .on { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); } .bottom .dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
  .editor { grid-template-columns: minmax(0, 1fr); } .preview { display: none; } .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .only-desktop { display: none !important; }
}
@media (min-width: 961px) { .only-mobile { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .spin { animation-duration: 2s; } }
@media print { .side, .bottom, .toasts, .no-print { display: none !important; } .overlay { position: static; background: none; padding: 0; } .modal { box-shadow: none; max-height: none; } body { background: #fff; } body > #app { display: none; } }
