/* Gift Cards · La Birra Bar — estilos de la aplicación (sin compilación). */

:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --ink: #1f1c18;
  --ink-2: #4a453e;
  --muted: #7a746c;
  --line: #e8e5df;
  --line-2: #dcd8d0;
  --black: #1a1714;
  --sidebar: #141210;
  --sidebar-ink: #e6e2da;
  --sidebar-muted: #a39d93;
  --sidebar-hover: #24201c;
  --gold: #e3a82b;
  --gold-ink: #8a5f0f;
  --gold-soft: #fdf3dc;
  --ok: #2f8a4f;
  --ok-soft: #e8f5ec;
  --warn: #a8641a;
  --warn-soft: #fcf0e1;
  --danger: #c2352b;
  --danger-soft: #fbeceb;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 18, 16, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.icon { flex-shrink: 0; vertical-align: middle; }
.mono { font-family: var(--mono); font-weight: 600; letter-spacing: 0.02em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Layout ─────────────────────────────────────────────────────────── */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px 32px; }
.brand-tag { display: block; margin-top: 4px; font-size: 10px; font-weight: 600; letter-spacing: 0.28em; color: var(--gold); }
.nav { flex: 1; padding: 0 12px; display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); font-weight: 500; color: var(--sidebar-muted); transition: background 0.15s, color 0.15s; }
.nav a:hover { background: var(--sidebar-hover); color: #fff; }
.nav a.active { background: var(--sidebar-hover); color: #fff; }
.nav a.active .icon { color: var(--gold); }
.sidebar-user { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: 16px; font-size: 13px; }
.sidebar-user .name { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .meta { color: var(--sidebar-muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.sidebar-user button { margin-top: 12px; display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; color: var(--sidebar-muted); font: inherit; font-size: 12px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.sidebar-user button:hover { background: var(--sidebar-hover); color: #fff; }
.topbar { display: none; }
.main { margin-left: 240px; }
.container { max-width: 1280px; margin: 0 auto; padding: 32px 40px 64px; }
.backdrop { display: none; }

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; width: 260px; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 30; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; height: 56px; align-items: center; gap: 12px; padding: 0 16px; background: var(--sidebar); color: #fff; }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; border-radius: 8px; cursor: pointer; }
  .main { margin-left: 0; }
  .container { padding: 24px 16px 48px; }
}

/* ─── Cabecera de página ─────────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page-head .desc { margin-top: 4px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.page-head .desc b { color: var(--ink); font-weight: 600; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; color: var(--muted); }
.back:hover { color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ─── Botones ────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 550; white-space: nowrap; cursor: pointer; transition: background 0.15s, border-color 0.15s, opacity 0.15s; background: var(--black); color: #fff; }
.btn:hover { background: #33302b; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn-outline { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover { background: #f1efea; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #efede8; }
.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: #d69c22; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f6dad7; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 8px; }
.btn-icon { width: 32px; padding: 0; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-label { display: inline-block; }
.btn .spinner { display: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--muted); }
.link:hover { color: var(--ink); text-decoration: underline; }

/* ─── Formularios ────────────────────────────────────────────────────── */
.field label, .form-label { display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; margin-bottom: 6px; font-weight: 550; font-size: 13px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field .req { color: var(--danger); }
.field .error, .form-error { margin-top: 4px; color: var(--danger); font-size: 12px; }
.form-error { margin: 0 0 16px; padding: 10px 12px; background: var(--danger-soft); border-radius: var(--radius); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=date], input:not([type]), textarea, select {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); color: var(--ink); font: inherit; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
/* Desplegables con el mismo aspecto en todos los navegadores */
select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a746c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
input:focus, textarea:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 168, 43, 0.25); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.grid-2 .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-prefix input { padding-left: 22px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar .search { position: relative; }
.toolbar .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { padding-left: 32px; width: 240px; }
.toolbar select { width: auto; }
@media (max-width: 640px) { .toolbar .search, .toolbar .search input { width: 100%; } }

/* ─── Paneles, tarjetas y tablas ─────────────────────────────────────── */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); min-height: 52px; }
.panel-head h2 { font-size: 14px; font-weight: 650; }
.panel-body { padding: 20px; }
.section-title { font-size: 14px; font-weight: 650; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
@media (max-width: 1535px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.stat.accent { background: var(--gold-soft); border-color: #f1d79c; }
.stat .label { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 18px; margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.stat .label .icon { color: #a8a299; }
.stat .value { margin-top: 8px; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .hint { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfaf8; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.cell-sub { font-size: 12px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li.inactive { opacity: 0.6; }
.empty { margin: 16px; padding: 48px 24px; border: 1px dashed var(--line-2); border-radius: var(--radius-lg); text-align: center; }
.empty p:first-child { font-weight: 600; }
.empty p + p { margin-top: 4px; color: var(--muted); }
.empty .btn { margin-top: 16px; }

/* Tablas que se vuelven tarjetas en móvil */
@media (max-width: 767px) {
  .table-stack thead { display: none; }
  .table-stack tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-stack td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; }
  .table-stack td[data-label]::before { content: attr(data-label); color: var(--muted); font: 400 12px/1.5 var(--font); letter-spacing: 0; }
  .table-stack td:first-child, .table-stack td:last-child { padding-left: 0; padding-right: 0; }
}

/* ─── Badges y progreso ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 550; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-gold { background: var(--gold-soft); color: var(--gold-ink); }
.badge-gold .dot { background: var(--gold); }
.badge-muted, .badge-neutral { background: #efede8; color: var(--muted); }
.badge-neutral { color: var(--ink-2); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-plain { background: #efede8; color: var(--muted); font-weight: 500; }
.progress { height: 8px; border-radius: 999px; background: #eeebe5; overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--gold); }
.progress.lg { height: 12px; }
.usage-head { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.usage-head b { color: var(--ink); font-weight: 600; }

/* ─── Gráficos ───────────────────────────────────────────────────────── */
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0 32px; }
@media (max-width: 1023px) { .charts { grid-template-columns: 1fr; } }
.chart-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; }
.chart-card h3 { font-size: 14px; font-weight: 650; }
.chart-card p { font-size: 12px; color: var(--muted); }
.chart { display: block; width: 100%; height: auto; margin-top: 12px; }
.chart .hit:hover path, .chart .hit:hover circle[r="4"] { opacity: 0.85; }
.chart-empty { margin-top: 12px; height: 200px; display: flex; align-items: center; justify-content: center; background: #f6f4f0; border-radius: var(--radius); color: var(--muted); font-size: 13px; }

/* ─── Pestañas ───────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a { padding-bottom: 10px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 550; }
.tabs a.active { border-color: var(--gold); color: var(--ink); }

/* ─── Mensajes ───────────────────────────────────────────────────────── */
.messages { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); }
.msg { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); animation: msg-in 0.2s ease; }
.msg-success { background: var(--ok-soft); border-color: #bfe3cb; color: var(--ok); }
.msg-error { background: var(--danger-soft); border-color: #f2c7c3; color: var(--danger); }
.msg.hide { opacity: 0; transition: opacity 0.3s; }
@keyframes msg-in { from { opacity: 0; transform: translateY(-6px); } }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius); font-size: 13px; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }

/* ─── Diálogos (<dialog> nativo) ─────────────────────────────────────── */
dialog { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(440px, calc(100% - 32px)); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2); color: var(--ink); }
dialog::backdrop { background: rgba(20, 18, 16, 0.35); backdrop-filter: blur(2px); }
.dialog-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dialog-body h2 { font-size: 17px; font-weight: 650; }
.dialog-body .desc { color: var(--muted); margin-top: 4px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; background: #faf9f6; border-top: 1px solid var(--line); }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; padding: 12px; background: #f4f2ee; border-radius: var(--radius); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 500; }

/* ─── Menú desplegable ───────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); min-width: 210px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1); padding: 4px; z-index: 30; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; background: none; border: 0; border-radius: 8px; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.dropdown-menu button:hover { background: #f1efea; }
.dropdown-menu button.danger { color: var(--danger); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ─── Nueva campaña ──────────────────────────────────────────────────── */
.new-campaign { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.new-campaign .stack { display: flex; flex-direction: column; gap: 24px; }
.total-box { position: sticky; top: 32px; background: var(--sidebar); color: var(--sidebar-ink); border-radius: var(--radius-lg); padding: 20px; }
.total-box .label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sidebar-muted); margin: 0; font-weight: 500; }
.total-box .total { margin-top: 4px; font-size: 30px; font-weight: 650; color: var(--gold); font-variant-numeric: tabular-nums; }
.total-box .calc { color: var(--sidebar-muted); font-variant-numeric: tabular-nums; }
.total-box .btn { margin-top: 20px; }
@media (max-width: 1023px) { .new-campaign { grid-template-columns: 1fr; } .total-box { position: static; } }

/* ─── Registrar Gift Card ────────────────────────────────────────────── */
.redeem { max-width: 576px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.redeem-head { text-align: center; margin-bottom: 8px; }
.redeem-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.redeem-head p { color: var(--muted); margin-top: 4px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.code-row { display: flex; gap: 8px; }
.code-input { height: 56px !important; font-family: var(--mono) !important; font-size: 24px !important; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.code-input::placeholder { color: #cfcac2; text-transform: none; }
.code-field { flex: 1; display: flex; align-items: center; height: 56px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); transition: border-color 0.15s, box-shadow 0.15s; }
.code-field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(227, 168, 43, 0.25); }
.code-prefix { padding-left: 14px; font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted); user-select: none; }
.code-field .code-input { border: 0 !important; box-shadow: none !important; padding-left: 2px; background: transparent; }
.code-row .btn { height: 56px; padding: 0 22px; font-size: 15px; }
@media (max-width: 640px) { .code-row { flex-direction: column; } .code-field { justify-content: center; } .code-field .code-input { width: 8.4em; flex: none; } }
.result { border-radius: 18px; padding: 20px; border: 1px solid; }
.result-ok { background: var(--card); border-color: #bfe3cb; }
.result-used { background: var(--gold-soft); border-color: #f1d79c; }
.result-bad { background: var(--danger-soft); border-color: #f2c7c3; }
.result-title { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 15px; }
.result-ok .result-title .icon { color: var(--ok); }
.result-used .result-title { color: var(--gold-ink); }
.result-bad .result-title { color: var(--danger); }
.result dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin: 16px 0 0; }
.result dt { font-size: 12px; color: var(--muted); }
.result dd { margin: 0; }
.result dd.big { font-size: 16px; font-weight: 650; }
.previous { margin-top: 16px; padding: 10px 12px; background: rgba(255, 255, 255, 0.7); border-radius: var(--radius); }
.success { background: var(--ok-soft); border: 1px solid #bfe3cb; border-radius: 18px; padding: 20px; }
.success .title { display: flex; gap: 10px; color: var(--ok); font-weight: 650; }
.success .code { font-family: var(--mono); font-size: 18px; font-weight: 700; margin-top: 4px; }
.success .btn { margin-top: 16px; }

/* ─── Login ──────────────────────────────────────────────────────────── */
.login { min-height: 100svh; display: flex; align-items: center; justify-content: center; background: var(--sidebar); padding: 16px; }
.login-inner { width: 100%; max-width: 380px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 32px; }
.login-card { background: var(--card); border-radius: 18px; padding: 24px; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; gap: 16px; }
.login-card h1 { font-size: 18px; font-weight: 650; }
.login-card input { height: 40px; }

.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-40 { margin-top: 40px; } .mb-24 { margin-bottom: 24px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 1279px) { .settings-grid { grid-template-columns: 1fr; } }

/* ─── Selector cuadrícula / lista ────────────────────────────────────── */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: #efede8; border-radius: var(--radius); }
.segmented a { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 550; }
.segmented a:hover { color: var(--ink); }
.segmented a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
@media (max-width: 640px) { .segmented span { display: none; } }

/* ─── Campañas en cuadrícula: cada tarjeta evoca la Gift Card física ─── */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.ccard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.ccard:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20, 18, 16, 0.08); }
.ccard-top { position: relative; margin: 8px 8px 0; padding: 16px 18px 18px; background: #1c1915; color: #f4f1ea; border-radius: 10px; }
.ccard-top::after { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(212, 154, 34, 0.75); border-radius: 7px; pointer-events: none; }
.ccard-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ccard-tag { font-size: 10px; letter-spacing: 0.28em; color: #b4ac9f; }
.ccard-value { margin-top: 14px; font-size: 28px; line-height: 1.15; font-weight: 750; color: var(--gold); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard-sub { margin-top: 2px; font-size: 13px; color: #b4ac9f; }
.ccard-name { margin-top: 10px; font-size: 16px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-company { font-size: 12px; color: #b4ac9f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.ccard-usage { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted); }
.ccard-usage b { color: var(--ink); }
.ccard-pct { font-size: 20px; font-weight: 700; color: var(--ink); }
.ccard-stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 12px; margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.ccard-stats dt { font-size: 11px; color: var(--muted); }
.ccard-stats dd { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.panel-body-grid { padding: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 16px; font-weight: 650; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 16px; }

/* ─── Montos de la campaña ───────────────────────────────────────────── */
.budget-field { max-width: 320px; margin-bottom: 20px; }
.denoms { display: flex; flex-direction: column; gap: 8px; }
.denom-head, .denom-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 10px; align-items: center; }
.denom-head { font-size: 12px; color: var(--muted); font-weight: 500; }
.denom-subtotal { text-align: right; font-weight: 600; white-space: nowrap; }
@media (max-width: 640px) {
  .denom-head { display: none; }
  .denom-row { grid-template-columns: 1fr 1fr 32px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .denom-subtotal { grid-column: 1 / 3; text-align: left; font-size: 12px; color: var(--muted); }
}
.budget-status { margin-top: 12px; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 550; }
.budget-status.ok { background: rgba(47, 138, 79, 0.18); color: #8fdcaa; }
.budget-status.warn { background: rgba(227, 168, 43, 0.16); color: var(--gold); }
.budget-status.bad { background: rgba(194, 53, 43, 0.22); color: #f2a29b; }
.btn.btn-gold:disabled { opacity: 0.4; }

/* Desglose por monto (detalle de campaña) */
.denom-table td, .denom-table th { white-space: nowrap; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; background: var(--card); }
.chip.active { background: var(--black); color: #fff; border-color: var(--black); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.total-after { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 13px; color: var(--sidebar-muted); }
.total-after b { font-size: 18px; color: #fff; font-weight: 650; }


/* ─── Paginación ─────────────────────────────────────────────────────── */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 4px 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.panel > .pagination { padding: 12px 20px; border-top: 1px solid var(--line); background: #fcfbf9; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.pagination-count b { color: var(--ink); font-weight: 600; }
.pagination-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.per-page { display: flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; }
.per-page select { width: auto; min-width: 76px; height: 32px; padding-left: 10px; font-size: 13px; }
.page-nav { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-nav .page-info { margin-right: 6px; }
.page-nav a, .page-nav span.disabled { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--ink); }
.page-nav a:hover { background: #f1efea; }
.page-nav span.disabled { opacity: 0.4; }
@media (max-width: 640px) {
  .pagination, .pagination-controls { justify-content: space-between; width: 100%; }
}
.results-count { margin: 0 0 12px 2px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.results-count b { color: var(--ink); font-weight: 600; }

/* Barra de filtros: el selector de vista va al final; en móvil, rejilla ordenada de 2 columnas */
.filter-bar .toolbar { flex: 1; }
.toolbar .segmented { margin-left: auto; }
@media (max-width: 640px) {
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .toolbar .search { grid-column: 1 / -1; }
  .toolbar > select, .toolbar > input, .toolbar > .btn { width: 100% !important; min-width: 0 !important; }
  /* Desplegables y texto a ancho completo para que nunca se corten; las fechas, de dos en dos */
  .toolbar > select, .toolbar > input[type=text], .toolbar > .btn { grid-column: 1 / -1; }
  .toolbar:has(.segmented) > .btn { grid-column: auto; }
  .toolbar .link { align-self: center; justify-self: start; }
  .toolbar .segmented { margin-left: 0; justify-self: end; }
}
.demo-note { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--gold-soft); color: var(--gold-ink); font-size: 13px; }
/* Foco visible con el color de la marca (en lugar del contorno azul del navegador) */
.btn:focus-visible, .segmented a:focus-visible, .page-nav a:focus-visible, .nav a:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(227, 168, 43, 0.45); }

/* ─── Diseño de la tarjeta (vista previa a escala de 8 × 6 cm) ───────── */
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Regular.093ee89be9ed.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-SemiBold.6f1520d10720.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/Poppins-Bold.08c20a487911.ttf") format("truetype"); font-weight: 700; font-display: swap; }
.design-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 28px; align-items: start; }
.design-fields { display: flex; flex-direction: column; gap: 20px; }
.design-fields textarea { font-size: 13px; line-height: 1.55; }
.design-fields code { padding: 1px 5px; border-radius: 5px; background: #efede8; font-size: 12px; color: var(--ink); }
.design-fields input[type=file] { display: block; width: 100%; padding: 8px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: #faf9f6; font: inherit; font-size: 13px; }
.check { display: flex !important; align-items: center; gap: 8px; margin: 10px 0 0 !important; font-weight: 500 !important; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--black); }
.design-preview { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 24px; }
.preview-label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.gcp { position: relative; aspect-ratio: 4 / 3; container-type: inline-size; background: #0a0a0a; color: #fff; font-family: "Poppins", var(--font); border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); overflow: hidden; }
/* 1 mm de la tarjeta = 1,25cqw */
/* El relleno va en un hijo: las unidades cqw se miden sobre el contenedor .gcp, no sobre sí mismo */
.gcp-front { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 11.25cqw 8.75cqw 6cqw; }
.gcp-wordmark { width: 42.5cqw; height: auto; }
.gcp-text { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 3.7cqw; margin: 2.5cqw 0; text-align: center; font-size: 3.09cqw; line-height: 1.2; }
.gcp-text p { margin: 0; }
.gcp-text b { font-weight: 700; }
.gcp-code { width: 50cqw; height: 7.5cqw; display: flex; align-items: center; justify-content: center; background: #fff; color: #000; font-size: 3.97cqw; font-weight: 500; letter-spacing: 0.22cqw; }
.gcp-valid { margin-top: 1.6cqw; font-size: 3.3cqw; font-weight: 700; }
.gcp-valid:empty { display: none; }
.gcp-back { display: flex; align-items: center; justify-content: center; }
.gcp-logo { width: 55cqw; height: auto; }
.gcp-back.cobrand .gcp-logo { width: 30cqw; position: absolute; left: 27%; transform: translateX(-50%); }
.gcp-sep { position: absolute; left: 50%; top: 28%; bottom: 28%; width: 0; border-left: 1px solid #fff; }
.gcp-partner { position: absolute; left: 73%; transform: translateX(-50%); max-width: 32.5cqw; max-height: 30%; object-fit: contain; }
.gcp-partner.whiten { filter: brightness(0) invert(1); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 1023px) { .design-grid { grid-template-columns: 1fr; } .design-preview { position: static; max-width: 380px; } }
