/* Facturación Simple · sistema visual Ad2Place (BRANDBOOK-2026: charcoal + gold, DM Serif Display + DM Sans) */

@font-face {
  font-family: 'DM Sans';
  src: url('/static/fonts/dm-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'DM Serif Display';
  src: url('/static/fonts/dm-serif-display-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Marca */
  --charcoal: #3d3d3d;
  --charcoal-900: hsl(0 0% 10%);
  --charcoal-800: hsl(0 0% 15%);
  --gold: #d4a843;
  --gold-600: hsl(42 50% 48%);
  --gold-700: hsl(42 45% 38%);
  --gold-100: hsl(42 65% 90%);
  --gold-50: hsl(42 65% 96%);
  --gold-tint: hsla(42 55% 55% / .08);

  /* Neutrales cálidos (hue 40) */
  --n-50: hsl(40 20% 98%);
  --n-100: hsl(40 15% 96%);
  --n-200: hsl(40 10% 90%);
  --n-300: hsl(40 8% 80%);
  --n-400: hsl(40 5% 46%);
  --n-500: hsl(40 4% 40%);
  --n-700: hsl(40 6% 24%);
  --surface-dark: hsl(40 12% 4%);
  --surface-dark-2: hsl(40 10% 9%);
  --cream: hsl(42 30% 96%);

  /* Semánticos */
  --success: hsl(152 55% 32%);
  --success-bg: hsl(152 45% 93%);
  --warning: hsl(32 80% 32%);
  --warning-bg: hsl(42 90% 91%);
  --error: hsl(0 65% 45%);
  --error-bg: hsl(0 80% 95%);

  --text: var(--charcoal);
  --muted: var(--n-500);
  --line: var(--n-200);
  --card: #fff;

  --font-head: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --r-btn: .75rem;
  --r-card: 1.25rem;
  --shadow-sm: 0 1px 2px hsla(40 10% 10% / .06), 0 1px 3px hsla(40 10% 10% / .06);
  --shadow-md: 0 6px 20px hsla(40 10% 10% / .08), 0 2px 6px hsla(40 10% 10% / .05);
  --shadow-lg: 0 24px 60px hsla(40 10% 10% / .22);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: var(--charcoal); text-underline-offset: 3px; text-decoration-color: var(--gold); }
h1, h2 { font-family: var(--font-head); font-weight: 400; margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h3 { font-weight: 700; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-700); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--charcoal); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── Logo Ad2Place (SVG en línea, usa la tipografía de la página) ── */
.a2p-logo { display: block; height: 24px; width: auto; color: var(--charcoal); }
.a2p-logo text { font-family: var(--font-head); }

/* ── Cabecera con co-branding: cliente a la izquierda, Ad2Place a la derecha ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: hsla(0 0% 100% / .92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; min-height: 68px; }
.client-brand { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.client-brand img { height: 54px; width: auto; max-width: 160px; object-fit: contain; }
.client-brand .name { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-brand .sub { font-size: .78rem; color: var(--muted); }
.cobrand { display: flex; align-items: center; gap: 12px; padding-left: 16px; border-left: 1px solid var(--n-300); }
.cobrand .by { font-size: .7rem; color: var(--muted); line-height: 1.2; text-align: right; }

/* ── Botones ── */
.btn {
  appearance: none; font: inherit; font-weight: 600; font-size: .94rem; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 18px; border-radius: var(--r-btn);
  border: 1px solid var(--n-300); background: #fff; color: var(--charcoal);
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { border-color: var(--charcoal); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn.dark { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.btn.dark:hover { background: var(--charcoal-900); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--charcoal-900); }
.btn.gold:hover { background: hsl(42 58% 60%); box-shadow: 0 8px 24px hsla(42 55% 40% / .35); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--n-100); box-shadow: none; }
.btn.on-dark { background: transparent; color: #fff; border-color: hsla(0 0% 100% / .28); }
.btn.on-dark:hover { border-color: #fff; background: hsla(0 0% 100% / .06); }
.btn.danger { color: var(--error); }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: .86rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ── Estructura ── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
main.wrap { display: grid; gap: 22px; padding-bottom: 56px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-sm); padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 1.45rem; }
.wrap > *, .grid2 > *, .uploads > *, .card-head > *, .hero-in > * { min-width: 0; }

/* ── Hero oscuro con KPIs del trimestre ── */
.hero { background: var(--surface-dark); color: #fff; position: relative; overflow: hidden; padding: 34px 0 96px; }
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 90% -10%, hsla(42 55% 55% / .22), transparent 60%),
    radial-gradient(500px 260px at -10% 120%, hsla(42 55% 55% / .10), transparent 60%);
}
.hero-in { position: relative; display: grid; grid-template-columns: 1.1fr 1.4fr; gap: 28px; align-items: end; }
.hero .eyebrow { color: var(--gold); }
.hero h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-top: 8px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p.lead { color: hsla(0 0% 100% / .72); margin-top: 10px; max-width: 46ch; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: hsla(0 0% 100% / .1); border: 1px solid hsla(0 0% 100% / .1); border-radius: var(--r-card); overflow: hidden; }
.kpi { background: var(--surface-dark-2); padding: 16px 18px; }
.kpi .label { font-size: .76rem; color: hsla(0 0% 100% / .6); letter-spacing: .04em; }
.kpi .value { font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .sub { font-size: .76rem; color: hsla(0 0% 100% / .55); margin-top: 2px; }
.kpi.main .value { color: var(--gold); }
.kpi .value.neg { color: hsl(0 80% 72%); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.kpi-head .t { font-size: .82rem; color: hsla(0 0% 100% / .7); }
.select-dark { background: var(--surface-dark-2); color: #fff; border: 1px solid hsla(0 0% 100% / .2); border-radius: var(--r-btn); min-height: 38px; padding: 6px 34px 6px 12px; font: inherit; font-size: .86rem; width: auto;
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d4a843' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* ── Aviso para conectar Google Drive (dentro del hero) ── */
.drive-banner { position: relative; margin-top: 26px; display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r-card); border: 1px solid hsla(42 55% 55% / .55); background: hsla(42 55% 55% / .08); }
.drive-banner-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: var(--charcoal-900); }
.drive-banner-icon svg { width: 22px; height: 22px; }
.drive-banner-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.drive-banner-text .eyebrow { color: var(--gold); }
.drive-banner-text strong { font-size: 1.05rem; }
.drive-banner-text span { color: hsla(0 0% 100% / .72); font-size: .9rem; }
.drive-banner-text .drive-banner-help { color: #fff; background: hsla(0 70% 55% / .22); border: 1px solid hsla(0 70% 65% / .5); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }

/* ── Confirmar factura de otra empresa ── */
.chip.confirmar { background: hsl(0 85% 95%); color: hsl(0 65% 40%); }
.modal-box.confirm-box { width: min(520px, 100%); }
.confirm-body { padding: 26px 24px 18px; display: grid; gap: 12px; text-align: center; justify-items: center; }
.confirm-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: hsl(0 85% 95%); color: hsl(0 65% 42%); font-weight: 700; font-size: 1.6rem; }
.confirm-body h3 { font-family: var(--font-head); font-weight: 400; font-size: 1.5rem; }
.confirm-box .modal-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-box .modal-foot > span { display: none; }
.confirm-box #cfView { grid-column: 1 / -1; order: -1; border-color: transparent; text-decoration: underline; text-decoration-color: var(--gold); }
.confirm-doc { width: 100%; background: var(--n-50); border: 1px solid var(--n-200); border-radius: 12px; padding: 12px 14px; text-align: left; font-size: .9rem; display: grid; gap: 2px; }

/* ── Cámara del ordenador ── */
.modal-box.cam-box { width: min(760px, 100%); }
.cam-stage { background: var(--surface-dark); display: grid; place-items: center; aspect-ratio: 4 / 3; max-height: 62vh; margin: 0 auto; width: 100%; }
.cam-stage video, .cam-stage img { width: 100%; height: 100%; object-fit: contain; }
.cam-msg { color: #fff; padding: 24px; text-align: center; max-width: 44ch; }
.cam-tip { padding: 10px 20px 0; }
.cam-select { width: auto; min-height: 40px; }

/* ── Zonas de subida (solapan el hero) ── */
.uploads { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: -64px; position: relative; z-index: 2; }
.drop {
  position: relative; background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow-md);
  border: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 16px;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.drop::after { content: ''; position: absolute; inset: 10px; border: 1.5px dashed transparent; border-radius: calc(var(--r-card) - 6px); pointer-events: none; transition: border-color .2s; }
.drop.over { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.drop.over::after { border-color: var(--gold); }
.drop-head { display: flex; gap: 14px; align-items: flex-start; }
.drop-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--n-100); color: var(--charcoal); }
/* Código de color fijo en todo el panel: rojo = compras/gastos, verde = ventas/ingresos */
.drop { overflow: hidden; }
.drop::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; }
.drop.compra { --tone: hsl(0 62% 45%); --tone-soft: hsl(0 85% 97%); --tone-mid: hsl(0 75% 92%); background: linear-gradient(180deg, var(--tone-soft) 0%, #fff 55%); }
.drop.venta { --tone: hsl(145 60% 30%); --tone-soft: hsl(140 55% 96%); --tone-mid: hsl(140 50% 88%); background: linear-gradient(180deg, var(--tone-soft) 0%, #fff 55%); }
.drop::before { background: var(--tone); }
.drop .drop-icon { background: var(--tone); color: #fff; }
.drop .tag { color: var(--tone); }
.drop.over { border-color: var(--tone); }
.drop.over::after { border-color: var(--tone); }
.drop .queue-item { border-left: 3px solid var(--tone); }
.drop-icon svg { width: 24px; height: 24px; }
.drop .tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.drop h2 { font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); margin-top: 2px; }
.drop .desc { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.drop .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drop .hint { font-size: .8rem; color: var(--muted); text-align: center; }
.drop input[type=file] { display: none; }
.queue { display: grid; gap: 6px; }
.queue:empty { display: none; }
.queue-item { display: flex; align-items: center; gap: 10px; font-size: .86rem; padding: 8px 12px; border-radius: 10px; background: var(--n-50); border: 1px solid var(--n-200); }
.queue-item .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Chips ── */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; background: var(--n-100); color: var(--n-700); }
.chip.ok { background: var(--success-bg); color: var(--success); }
.chip.revisar { background: var(--warning-bg); color: var(--warning); }
.chip.error { background: var(--error-bg); color: var(--error); }
.chip.compra { background: hsl(0 85% 95%); color: hsl(0 62% 38%); }
.chip.venta { background: hsl(140 55% 92%); color: hsl(145 65% 24%); }
.doc.compra { box-shadow: inset 3px 0 0 hsl(0 62% 45%); }
.doc.venta { box-shadow: inset 3px 0 0 hsl(145 60% 30%); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Bloque gestor + coste ── */
.grid2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; }
.gestor { background: var(--charcoal); color: #fff; border-color: var(--charcoal); position: relative; overflow: hidden; display: flex; flex-direction: column; }
.gestor .btn-row { margin-top: auto; }
.gestor::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, hsla(42 55% 55% / .25), transparent 70%); pointer-events: none; }
.gestor h2 { color: #fff; }
.gestor .muted { color: hsla(0 0% 100% / .72); }
.gestor .btn-row { position: relative; z-index: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--n-50); border: 1px solid var(--n-200); border-radius: 14px; padding: 14px; }
.stat .label { font-size: .78rem; color: var(--muted); }
.stat .value { font-size: 1.4rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .78rem; color: var(--muted); }
.stat.highlight { background: var(--gold-50); border-color: var(--gold-100); }
.pos { color: var(--success); }
.neg { color: var(--error); }

/* ── Formularios ── */
select, input, textarea {
  font: inherit; color: inherit; border: 1px solid var(--n-300); border-radius: var(--r-btn); padding: 10px 12px;
  background: #fff; min-height: 44px; width: 100%;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--charcoal); box-shadow: 0 0 0 3px var(--gold-tint), 0 0 0 1px var(--gold); }
label { display: grid; gap: 5px; font-size: .84rem; color: var(--n-700); font-weight: 600; align-content: start; }

/* ── Documentos ── */
.tabs { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; padding-bottom: 2px; scrollbar-width: none; }
.tab { border: 1px solid var(--n-200); background: #fff; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap; color: var(--n-700); }
.tab:hover { border-color: var(--charcoal); }
.tab.active { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.docs { display: grid; }
.doc-head, .doc { display: grid; grid-template-columns: 96px minmax(0, 1fr) 130px 110px; gap: 14px; align-items: center; padding: 12px 10px; }
.doc-head { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-top: 0; }
.doc-head .r { text-align: right; }
.doc { border-bottom: 1px solid var(--n-100); cursor: pointer; border-radius: 12px; transition: background .15s; }
.doc:hover { background: var(--n-50); }
.doc .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc .who > span { display: flex; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.doc .who > span .c { overflow: hidden; text-overflow: ellipsis; }
.doc .amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.doc .date { font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.doc .st { text-align: right; }
.empty { text-align: center; padding: 34px 10px; color: var(--muted); }
.empty h3 { font-family: var(--font-head); font-weight: 400; font-size: 1.3rem; color: var(--charcoal); margin-bottom: 4px; }

table.hist { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.hist th, table.hist td { padding: 9px 6px; border-bottom: 1px solid var(--n-100); text-align: right; font-variant-numeric: tabular-nums; }
table.hist th:first-child, table.hist td:first-child { text-align: left; }
table.hist th { color: var(--muted); font-weight: 700; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 50; background: hsla(40 12% 4% / .6); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.modal-box { background: #fff; border-radius: var(--r-card); width: min(1100px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: rise .3s var(--ease); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.modal-head { position: sticky; top: 0; background: #fff; display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); z-index: 2; }
.modal-head h3 { margin-right: auto; font-family: var(--font-head); font-weight: 400; font-size: 1.4rem; }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px; }
.preview { background: var(--n-100); border-radius: 14px; min-height: 440px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--n-200); }
.preview iframe { width: 100%; height: 70vh; border: 0; background: #fff; }
.preview img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.form .full { grid-column: 1 / -1; }
.warnings { display: grid; gap: 6px; }
.warnings div { background: var(--warning-bg); color: var(--warning); border-radius: 10px; padding: 9px 12px; font-size: .86rem; font-weight: 600; }
.warnings div.err { background: var(--error-bg); color: var(--error); }
.vat-table { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.vat-table th { font-size: .72rem; color: var(--muted); text-align: left; padding: 0 4px 4px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.vat-table td { padding: 3px; }
.vat-table input { min-height: 38px; padding: 6px 9px; }
.modal-foot { position: sticky; bottom: 0; background: #fff; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--charcoal-900); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: .92rem; z-index: 60; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); border-left: 3px solid var(--gold); }

/* ── Pie ── */
.footer { border-top: 1px solid var(--line); background: #fff; }
.footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 20px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.footer .a2p-logo { height: 20px; }

/* ── Login ── */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--surface-dark); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side::before { content: ''; position: absolute; inset: 0; background: radial-gradient(520px 320px at 100% 0%, hsla(42 55% 55% / .25), transparent 60%); pointer-events: none; }
.login-side > * { position: relative; }
.login-side .a2p-logo { height: 28px; color: #fff; }
.login-side h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); margin-top: 18px; }
.login-side h1 em { font-style: normal; color: var(--gold); }
.login-side ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; color: hsla(0 0% 100% / .78); }
.login-side li { display: flex; gap: 10px; align-items: flex-start; }
.login-side li::before { content: ''; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='3.5'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 11px no-repeat; }
.login-side .foot { font-size: .8rem; color: hsla(0 0% 100% / .5); }
.login-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-form { width: min(400px, 100%); display: grid; gap: 16px; }
.login-form .client-logo { height: 128px; max-width: 240px; object-fit: contain; margin-bottom: 4px; }
.login-form h2 { font-size: 2rem; }
.error-msg { color: var(--error); font-size: .88rem; min-height: 1.2em; font-weight: 600; }

/* ── Móvil ── */
@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar-in { padding: 8px 14px; gap: 10px; min-height: 60px; }
  .client-brand img { height: 40px; max-width: 110px; }
  .cobrand { padding-left: 10px; gap: 8px; }
  .cobrand .by { display: none; }
  .a2p-logo { height: 18px; }
  .wrap { padding: 0 14px; }
  .hero { padding: 24px 0 84px; }
  .drive-banner { flex-wrap: wrap; }
  .drive-banner .btn { width: 100%; }
  .uploads { grid-template-columns: 1fr; margin-top: -60px; gap: 14px; }
  .drop { padding: 18px; }
  .drop .actions .btn { padding: 10px 8px; white-space: nowrap; }
  .drop .hint { display: none; }
  .card { padding: 18px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .doc-head { display: none; }
  .doc { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 6px; }
  .doc .who { grid-column: 1; grid-row: 1; }
  .doc .amt { grid-column: 2; grid-row: 1; }
  .doc .date { grid-column: 1; grid-row: 2; }
  .doc .st { grid-column: 2; grid-row: 2; }
  .modal { padding: 0; align-items: stretch; }
  .modal-box { border-radius: 0; max-height: 100vh; height: 100%; }
  .modal-body { grid-template-columns: 1fr; padding: 14px; }
  .preview { min-height: 260px; }
  .preview iframe { height: 52vh; }
  .login { grid-template-columns: 1fr; }
  .login-side { padding: 26px 20px; }
  .login-side ul, .login-side .foot { display: none; }
  .login-side h1 { font-size: 1.9rem; margin-top: 12px; }
  .hide-mobile { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
