/* Panel de administración: reutiliza tokens y componentes de styles.css */
body.admin { min-height: 100dvh; }
a { color: var(--lime); }
.btn { text-decoration: none; color: inherit; }
.admin-main { max-width: 1320px; margin: 0 auto; padding: 28px 22px 60px; display: flex; flex-direction: column; gap: 22px; }
.admin-msg { padding: 60px 20px; text-align: center; color: var(--text-2); }
#adminRoot { display: flex; flex-direction: column; gap: 22px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 6px;
}
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi b { font: 800 30px/1 var(--font-head); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi:nth-child(2) b { color: var(--lime); }
.kpi small { font-size: 11.5px; color: var(--muted); }

.card { background: var(--surface); border-radius: var(--r-xl); box-shadow: inset 0 0 0 1px var(--line); padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { font: 700 20px/1 var(--font-head); margin: 0; letter-spacing: -.01em; }
.card-tools { display: flex; gap: 10px; }

.admin input:not([type="checkbox"]) {
  background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 8px 10px; font: 13.5px var(--font-body); width: 100%; min-width: 0;
  transition: border-color .2s var(--ease); color-scheme: dark;
}
.admin input:focus { outline: none; border-color: var(--lime); }
#search { width: 240px; border-radius: 999px; padding: 9px 14px; }

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; min-width: 980px; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 10px; border-bottom: 1px solid var(--line); }
td { padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,240,.015); }
td b { display: block; font-weight: 600; }
td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
td:nth-child(1) { min-width: 200px; }
td:nth-child(3) { min-width: 150px; }
td:nth-child(4) input, td:nth-child(5) input { min-width: 78px; }
td:nth-child(6) input { min-width: 140px; }
td:nth-child(6) { width: 150px; }
td:nth-child(8) { min-width: 160px; }
.empty-row { text-align: center; color: var(--muted); padding: 40px; }

.use span { font-variant-numeric: tabular-nums; font-size: 13px; }
.use i { display: block; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 6px 0 4px; overflow: hidden; }
.use em { display: block; height: 100%; background: var(--lime); border-radius: inherit; }
.use em.warn { background: var(--warn); }
.use em.full { background: var(--error); }

.pill { display: inline-block; margin-top: 6px; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.pill.ok { background: var(--lime-soft); color: var(--lime); }
.pill.warn { background: rgba(242,193,78,.12); color: var(--warn); }
.pill.err { background: rgba(255,122,107,.12); color: var(--error); }
.legend { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.legend .pill { margin: 0 2px; }

.link { background: none; border: 0; padding: 4px 0 0; color: var(--lime); font-size: 12px; cursor: pointer; }
.link:hover { text-decoration: underline; }

dialog {
  width: min(520px, calc(100% - 32px)); border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  background: var(--surface); color: var(--text); padding: 26px; box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(8,8,6,.7); backdrop-filter: blur(4px); }
dialog form { display: flex; flex-direction: column; gap: 12px; }
dialog h2 { font: 800 24px/1 var(--font-head); margin: 0; letter-spacing: -.02em; }
dialog label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 10px; }
.form-error { color: var(--error); font-size: 13px; min-height: 1em; }
.form-error:empty { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  #search { width: 100%; }
  .card-tools { width: 100%; }
  .brand-name { display: none; }
}

.admin select { background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 8px 10px; font: 13.5px var(--font-body); width: 100%; color-scheme: dark; }
.admin select:focus { outline: none; border-color: var(--lime); }
td:nth-child(2) { width: 100px; }
