﻿:root {
  --br-red: #C0392B;
  --br-red-hover: #A93226;
  --br-red-light: #FCEBEB;
  --br-red-border: #f5c1c1;
  --br-amber: #E8A020;
  --br-amber-light: #FEF3DC;
  --br-amber-dark: #7A5010;
  --br-warm: #FAF7F2;
  --br-warm2: #F2EDE5;
  --br-border: #E8E0D4;
  --br-text: #1A1410;
  --br-muted: #7A6F65;
  --br-green: #1A6B3A;
  --br-green-light: #EAF7EF;
  --br-blue: #185FA5;
  --br-blue-light: #E6F1FB;
  --br-dark: #1A1410;
  --br-white: #fff;
  --shadow-sm: 0 1px 3px rgba(26,20,16,.06);
  --shadow-md: 0 4px 12px rgba(26,20,16,.10);
  --touch-min: 44px;
  --ink: var(--br-text);
  --muted: var(--br-muted);
  --line: var(--br-border);
  --bg: var(--br-warm);
  --brand: var(--br-red);
  --dark: var(--br-dark);
  --red: var(--br-red);
  --amber: var(--br-amber-dark);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Trebuchet MS', 'Gill Sans', sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
}
a {
  color: var(--brand);
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
}
button,
.button {
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  padding: 11px 18px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:hover,
.button:hover {
  background: var(--br-red-hover);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}
input,
select {
  background: white;
  border: 1px solid var(--br-border);
  border-radius: 12px;
  padding: 11px 12px;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  color: var(--ink);
  max-width: 100%;
}
input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--br-blue);
  outline-offset: 2px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
h1,
h2,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin-bottom: 10px;
}
h2 {
  font-size: 17px;
}
p {
  line-height: 1.6;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 1.8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
}
.brand {
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  background: var(--br-red-light);
  color: var(--br-red);
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size: 22px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 228px;
  background: var(--dark);
  padding: 30px 22px;
  color: white;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  margin-bottom: 48px;
}
.sidebar a {
  color: var(--br-warm2);
  display: block;
  padding: 13px 15px;
  margin: 4px 0;
  border-radius: 12px;
}
.sidebar a.active {
  color: white;
  background: #ffffff15;
  border-left: 3px solid var(--br-red);
}
.sidebar .bottom {
  margin-top: auto;
  font-size: 12px;
  color: var(--br-warm2);
  line-height: 1.8;
}
.workspace {
  margin-left: 228px;
  padding: 38px 42px;
  max-width: 1600px;
}
.topbar,
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar {
  margin-bottom: 30px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 3px 12px rgba(26,20,16,.06);
}
.notice {
  padding: 14px 18px;
  background: var(--br-amber-light);
  border: 1px solid var(--br-amber);
  color: var(--br-amber-dark);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  margin: 18px 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 24px 0;
}
.stat small {
  display: block;
  font-size: 12px;
  margin-bottom: 16px;
}
.stat strong {
  font-size: 32px;
  letter-spacing: -1px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.filters input[type="search"] {
  flex: 1;
  min-width: 200px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
}
th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--br-warm2);
  padding: 14px 12px;
}
td {
  padding: 18px 12px;
  border-bottom: 1px solid var(--br-border);
}
td small {
  display: block;
  margin-top: 5px;
}
td.reason {
  white-space: normal;
  min-width: 190px;
  max-width: 300px;
  color: var(--muted);
  line-height: 1.5;
}
.badge {
  display: inline-block;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 650;
  border-radius: 6px;
  background: var(--br-amber-light);
  color: var(--br-amber-dark);
}
.badge.aprobada {
  color: var(--br-green);
  background: var(--br-green-light);
}
.badge.repetir {
  color: var(--br-red);
  background: var(--br-red-light);
}
.empty {
  text-align: center;
  padding: 45px 20px;
  color: var(--muted);
}
.status {
  min-height: 24px;
  font-size: 14px;
  line-height: 1.6;
  margin: 14px 0;
}
.status.error {
  color: var(--red);
}
.login {
  max-width: 430px;
  margin: 70px auto;
}
.login input {
  width: 100%;
  margin-bottom: 18px;
}
.login button {
  width: 100%;
}
.qr-layout {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
}
.qr-layout img {
  width: 210px;
  height: 210px;
}
.qr-layout input {
  width: 100%;
}
.mobile-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 25px 20px 40px;
}
.mobile-shell header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 35px;
}
.mobile-shell .card {
  padding: 26px;
}
.mobile-shell input {
  width: 100%;
  margin-bottom: 18px;
}
.mobile-shell h1 {
  font-size: 27px;
}
.mobile-shell button {
  width: 100%;
}
.steps {
  display: flex;
  justify-content: space-between;
  margin: 26px 0;
  color: var(--muted);
  font-size: 12px;
}
.steps span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.steps b {
  display: grid;
  place-items: center;
  border: 1px solid var(--br-red-border);
  background: var(--br-red-light);
  color: var(--brand);
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.mobile-shell footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 25px;
}
.camera {
  position: relative;
  background: var(--br-dark);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 3/4;
}
.camera video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(-1);
}
#ovalo {
  position: absolute;
  left: 18%;
  top: 12%;
  width: 64%;
  height: 72%;
  border: 3px solid var(--br-red);
  border-radius: 50%;
  box-shadow: 0 0 0 150px rgba(26,20,16,.28);
  pointer-events: none;
}
#ovalo.ok {
  border-color: var(--br-green);
}
.privacy {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  line-height: 1.5;
}
.check input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
}
.subtle-link {
  display: block;
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  .sidebar {
    width: 190px;
  }
  .workspace {
    margin-left: 190px;
    padding: 28px 24px;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 680px) {
  .sidebar {
    position: static;
    width: auto;
    padding: 18px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar .brand {
    margin: 0;
  }
  .sidebar nav {
    display: flex;
  }
  .sidebar nav a {
    font-size: 12px;
    padding: 8px;
  }
  .sidebar .bottom,
  .sidebar .nav-label {
    display: none;
  }
  .workspace {
    margin: 0;
    padding: 25px 16px;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 17px;
  }
  .card {
    padding: 18px;
  }
  h1 {
    font-size: 26px;
  }
  .login {
    margin: 28px auto;
  }
  .filters > * {
    width: 100%;
  }
  .row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .topbar {
    margin-bottom: 22px;
  }
}
dialog::backdrop {
  background: rgba(26,20,16,.5);
}
#cambio {
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 600;
}

.resultado {font-size: clamp(1.3rem, 5vw, 1.8rem); line-height: 1.5; white-space: pre-line; font-weight: 650;}
.resultado.aceptada {color: var(--br-green);}
.resultado.revision {color: var(--br-amber-dark);}
.camera.destello::after {content: ""; position: absolute; inset: 0; background: white; opacity: .8; pointer-events: none;}


/* Identidad compartida Brasero Rojo: todas las páginas usan estos tokens. */
.br-topbar {
  display:flex;align-items:center;gap:12px;min-height:72px;padding:12px 24px;
  background:var(--br-dark);color:var(--br-warm);box-shadow:var(--shadow-md);
}
.br-topbar .br-logo {width:44px;height:44px;object-fit:contain;flex:none;}
.br-topbar strong {font-size:17px;line-height:1.3;font-weight:700;}
.br-topbar .br-section {margin-left:auto;color:var(--br-warm2);font-size:13px;}
.card {box-shadow:var(--shadow-sm);border-radius:20px;}
button,.button {touch-action:manipulation;transition:background-color .15s;}
.secondary:hover {background:var(--br-warm2);color:var(--br-text);}
a:hover {text-decoration:underline;text-underline-offset:3px;}
input,select,textarea {accent-color:var(--br-red);}
.sidebar {top:72px;}
.sidebar .brand {font-size:18px;}
.sidebar .nav-label {color:var(--br-warm2);}
.sidebar a {min-height:44px;}
.sidebar a:hover {background:rgba(255,255,255,.08);}
.mobile-shell header {flex-wrap:wrap;gap:12px;}
.mobile-shell header a {display:inline-flex;align-items:center;min-height:44px;}
#textoAutorizacion {
  padding:20px;background:var(--br-warm);border:1px solid var(--br-border);
  border-radius:16px;overflow-wrap:anywhere;
}
#firma {display:block;width:100%;height:auto;background:var(--br-white);
  border:2px solid var(--br-border);border-radius:12px;touch-action:none;}
#limpiarFirma,#noAutorizo {margin:12px 0;}
.check {align-items:center;min-height:44px;cursor:pointer;padding:8px 0;}
.check input {width:24px;height:24px;min-width:24px;min-height:24px;margin:0;}
#msg,[role="status"] {color:var(--br-blue);overflow-wrap:anywhere;}
#msg:not(:empty),[role="status"]:not(:empty) {
  padding:12px 16px;border:1px solid currentColor;border-radius:12px;
  background:var(--br-blue-light);line-height:1.6;
}
#msg.aceptada,.status.aceptada,[role="status"][data-tono="aceptada"] {
  color:var(--br-green);background:var(--br-green-light);
}
#msg.dudosa,.status.dudosa,[role="status"][data-tono="dudosa"] {
  color:var(--br-amber-dark);background:var(--br-amber-light);
}
#msg.error,.status.error,[role="status"][data-tono="error"] {
  color:var(--br-red);background:var(--br-red-light);
}
.card.intento-aceptada {border-left:5px solid var(--br-green);}
.card.intento-dudosa {border-left:5px solid var(--br-amber);background:var(--br-amber-light);}
.card.intento-error {border-left:5px solid var(--br-red);}
.badge.aceptada {color:var(--br-green);background:var(--br-green-light);}
.badge.dudosa,.badge.revision {color:var(--br-amber-dark);background:var(--br-amber-light);}
.badge.error {color:var(--br-red);background:var(--br-red-light);}
@media(max-width:680px) {
  .br-topbar {padding:12px 16px;gap:10px;}
  .br-topbar strong {font-size:15px;}
  .br-topbar .br-section {display:none;}
  .sidebar {top:auto;flex-wrap:wrap;gap:12px;}
  .sidebar nav {flex-wrap:wrap;}
}
@media(prefers-reduced-motion:reduce) {button,.button {transition:none;}}

/* Pestañas del panel */
.responsable-barra {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:12px;}
.responsable-barra input {max-width:320px;}
.pestanas {display:flex;gap:4px;overflow-x:auto;border-bottom:1px solid var(--br-border);margin:0 0 16px;}
.pestanas button {flex:none;min-height:44px;padding:10px 16px;border:0;border-bottom:3px solid transparent;border-radius:0;background:none;color:var(--br-muted);font-weight:700;box-shadow:none;cursor:pointer;}
.pestanas button.activa {color:var(--br-red);border-bottom-color:var(--br-red);}
section[data-pestana] h2 {margin-top:0;}
.fila-controles {display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
.qr-impresos {display:flex;flex-wrap:wrap;gap:16px;}
.qr-impresos figure {margin:0;text-align:center;}
.qr-impresos img {width:160px;height:auto;border:1px solid var(--br-border);border-radius:12px;}
