@import url("/auth.css");
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #16191d;
  --ink-soft: #5c6672;
  --line: #e3e7ec;
  --accent: #b4530a;
  --accent-soft: #fdf3e9;
  --ok: #14794a;
  --warn: #9a6a00;
  --err: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,25,45,.06), 0 8px 24px rgba(16,25,45,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
a { color: inherit; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.error { color: var(--err); font-size: 13px; min-height: 18px; margin: 6px 0 0; }

/* ---------- chrome ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none;
         font-size: 15px; letter-spacing: -.02em; color: var(--ink); }
.brand svg { width: 19px; height: 19px; color: var(--accent); }
.brand b { font-weight: 600; color: var(--accent); }
.quien { font-size: 13px; color: var(--ink-soft); padding: 0 6px 0 10px; border-left: 1px solid var(--line); margin-left: 6px; }
@media (max-width: 560px) { .quien { display: none; } }
.topbar nav { display: flex; align-items: center; gap: 4px; }
.topbar nav a, .linkish {
  padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-soft);
  font-size: 14px; font-weight: 500; border: 0; background: none; cursor: pointer; font-family: inherit;
}
.topbar nav a:hover, .linkish:hover { background: #eef1f4; color: var(--ink); }
.topbar nav a.on { background: var(--accent-soft); color: var(--accent); }

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 80px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* ---------- controls ---------- */
input, select, textarea {
  font: inherit; color: inherit; background: #fff;
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
label { display: block; font-size: 13px; font-weight: 550; color: var(--ink-soft); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

.btn {
  font: inherit; font-weight: 550; cursor: pointer; border-radius: 9px; padding: 9px 15px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); white-space: nowrap;
}
.btn:hover { background: #f2f4f7; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #9a460a; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: #eef1f4; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.row-end { justify-content: flex-end; }

/* ---------- cards / lists ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-body { padding: 18px; }

.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none;
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: #fafbfc; }
.list-item .t { font-weight: 550; }
.chev { color: #c3cad3; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-soft); }
.empty .big { font-size: 30px; display: block; margin-bottom: 8px; }

.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #eef1f4; color: var(--ink-soft); }
.pill.ok { background: #e7f5ee; color: var(--ok); }
.pill.warn { background: #fdf3e0; color: var(--warn); }
.pill.err { background: #fdeceb; color: var(--err); }

/* ---------- dictado ---------- */
.dictado { position: sticky; bottom: 0; z-index: 10; padding-top: 12px; background: linear-gradient(180deg, transparent, var(--bg) 26%); }
.dictado-inner { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.dictado textarea { width: 100%; border: 0; padding: 6px 4px; min-height: 52px; font-size: 15px; }
.dictado textarea:focus { box-shadow: none; }
.dictado-bar { display: flex; align-items: center; gap: 8px; }
.mic { width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; font-size: 17px; padding: 0; }
.mic.rec { background: var(--err); border-color: var(--err); color: #fff; animation: pulse 1.3s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(179,38,30,.45); } 50% { box-shadow: 0 0 0 8px rgba(179,38,30,0); } }
.hint { font-size: 12.5px; color: var(--ink-soft); padding: 0 4px 8px; }

/* ---------- tabla de partidas ---------- */
.cap { padding: 11px 18px; background: #fafbfc; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line);
       font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.linea { display: grid; grid-template-columns: 1fr 74px 96px 104px 34px; gap: 10px; align-items: start;
         padding: 12px 18px; border-bottom: 1px solid var(--line); }
.linea:last-child { border-bottom: 0; }
.linea .desc { font-size: 14.5px; }
.linea .meta { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.linea .meta a { color: var(--accent); }
.linea input { width: 100%; padding: 6px 8px; font-size: 14px; text-align: right; }
.linea .num { text-align: right; font-variant-numeric: tabular-nums; }
.linea .importe { font-weight: 600; }
.linea.busca { background: #fffdf7; }
.linea.err-row { background: #fffafa; }
@media (max-width: 720px) {
  .linea { grid-template-columns: 1fr 60px 84px; grid-template-areas: "d d d" "u c p" "i i x"; }
  .linea .desc-wrap { grid-area: d; }
}

.dots::after { content: '·'; animation: dots 1.4s steps(4,end) infinite; }
@keyframes dots { 0% { content:''; } 25% { content:'·'; } 50% { content:'··'; } 75% { content:'···'; } }

.totales { padding: 16px 18px; display: grid; gap: 7px; justify-content: end; }
.tot-line { display: grid; grid-template-columns: auto 130px; gap: 22px; font-size: 14px; }
.tot-line .v { text-align: right; font-variant-numeric: tabular-nums; }
.tot-line.big { font-size: 19px; font-weight: 700; padding-top: 9px; border-top: 1px solid var(--line); margin-top: 4px; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(16,25,45,.35); display: grid; place-items: center; padding: 20px; z-index: 40; }
.modal { background: #fff; border-radius: var(--radius); width: min(520px, 100%); box-shadow: 0 20px 60px rgba(16,25,45,.25); max-height: 90dvh; overflow: auto; }

/* ---------- toasts ---------- */
.toast-wrap { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: #16191d; color: #fff; padding: 11px 15px; border-radius: 9px; font-size: 14px;
         box-shadow: var(--shadow); max-width: 340px; animation: rise .2s ease; }
.toast.err { background: var(--err); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

.logo-prev { max-height: 56px; max-width: 190px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
