:root {
  --azul: #0b2a6f;
  --azul-2: #1747b0;
  --azul-claro: #e8eefb;
  --texto: #1a1f2e;
  --muted: #667085;
  --borde: #d9dee8;
  --fondo: #f4f6fa;
  --blanco: #fff;
  --ok: #127a46;
  --ok-bg: #e5f5ec;
  --error: #b42318;
  --error-bg: #fdecea;
  --warn: #b54708;
  --info-bg: #eaf1fd;
  --radio: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--texto); background: var(--fondo); font-size: 15px; line-height: 1.45; }
a { color: var(--azul-2); }
h1 { font-size: 1.45rem; margin: 0 0 .6rem; line-height: 1.25; }
h2 { font-size: 1.08rem; margin: 0 0 .7rem; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.strong { font-weight: 600; text-decoration: none; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.num { text-align: right; }
code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; }

/* Barra superior */
.topbar { background: var(--blanco); border-bottom: 1px solid var(--borde); padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--azul); font-weight: 700; }
.brand img { height: 36px; }
.brand small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.topbar nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.topbar nav a { text-decoration: none; color: var(--texto); font-weight: 500; }
.topbar nav a.btn { color: #fff; }

.container { max-width: 1120px; margin: 0 auto; padding: 24px 16px 40px; }
.pie { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px 16px 30px; }

/* Tarjetas */
.card { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card.narrow { max-width: 420px; width: 100%; }
.empty { text-align: center; padding: 40px 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .card, .grid-2 > div > .card { margin-bottom: 18px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head-row h1, .head-row h2 { margin-bottom: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--azul); color: #fff; border: 1px solid var(--azul); border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--azul-2); border-color: var(--azul-2); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-sm { padding: 5px 11px; font-size: .86rem; }
.btn-lg { padding: 13px 20px; font-size: 1.05rem; width: 100%; }
.btn-ghost { background: var(--blanco); color: var(--azul); border-color: var(--borde); }
.btn-ghost:hover { background: var(--azul-claro); border-color: var(--azul-claro); }
.btn-warn { background: var(--warn); border-color: var(--warn); }
.btn-danger { background: var(--error); border-color: var(--error); }
.danger { color: var(--error) !important; }

/* Formularios */
.form label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 14px; }
.form input:not([type=radio]):not([type=checkbox]), .form textarea, .form select, .search input, .copy-row input {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: inherit; font-weight: 400; color: var(--texto);
  border: 1px solid var(--borde); border-radius: 8px; background: #fff;
}
.form input:focus, .form textarea:focus, .search input:focus { outline: 2px solid var(--azul-2); outline-offset: -1px; border-color: transparent; }
.form textarea { resize: vertical; }
.grid-form { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 16px; }
.grid-form .c4 { grid-column: span 4; } .grid-form .c6 { grid-column: span 6; } .grid-form .c12 { grid-column: span 12; }
@media (max-width: 720px) { .grid-form .c4, .grid-form .c6 { grid-column: span 12; } }
fieldset { border: 1px solid var(--borde); border-radius: 8px; padding: 10px 14px 4px; margin: 0 0 14px; }
legend { font-weight: 600; font-size: .92rem; padding: 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { display: inline-flex !important; align-items: center; gap: 6px; border: 1px solid var(--borde); border-radius: 999px; padding: 6px 12px; font-weight: 500 !important; margin: 0 !important; cursor: pointer; background: #fff; }
.chip:has(input:checked) { background: var(--azul-claro); border-color: var(--azul-2); color: var(--azul); }
.search { display: flex; gap: 8px; min-width: min(420px, 100%); }
.search input { margin-top: 0; }
.hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0; }

/* Alertas y etiquetas */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: .93rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-info { background: var(--info-bg); color: var(--azul); }
.badge { display: inline-block; background: #eef1f6; color: var(--muted); border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; vertical-align: middle; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }

/* Tablas */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 0; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--borde); background: #fafbfd; }
.tabla td { padding: 10px 12px; border-bottom: 1px solid #eef0f4; vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla form { margin: 0; }
.firma-mini { height: 34px; max-width: 120px; background: #fff; border: 1px solid #eef0f4; border-radius: 4px; }

/* Detalle reunión */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { margin-top: 0; font-size: .85rem; background: #fafbfd; }
.qr-row { display: flex; gap: 18px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.qr { padding: 8px; background: #fff; border: 1px solid var(--borde); border-radius: 8px; line-height: 0; }
.qr-row form { margin: 8px 0; }
.datos { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0; font-size: .93rem; }
.datos dt { color: var(--muted); }
.datos dd { margin: 0; }
.zona-peligro summary { cursor: pointer; color: var(--error); font-weight: 600; }
.qr-full { position: fixed; inset: 0; background: rgba(10,20,50,.85); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; cursor: zoom-out; }
.qr-full-box { background: #fff; border-radius: 16px; padding: 28px; text-align: center; max-width: 480px; width: 100%; }
.qr-full-box img { height: 40px; }
.qr-full-box #qr-big { display: inline-block; margin: 10px 0; }
.qr-full-box #qr-big img { max-width: 100%; height: auto; }

/* Login / instalación */
.centrado { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.logo-login { height: 52px; display: block; margin: 0 auto 14px; }
.centrado h1 { text-align: center; }
.centrado .muted { text-align: center; }
.centrado .form .btn { width: 100%; }

/* Formulario público */
.publico { padding: 20px 16px 40px; background: linear-gradient(180deg, var(--azul) 0, var(--azul) 160px, var(--fondo) 160px); min-height: 100vh; }
.registro { max-width: 560px; margin: 0 auto; padding: 22px; }
.reg-head { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--borde); margin-bottom: 16px; color: var(--azul); }
.reg-head img { height: 40px; }
.reunion-info { background: var(--azul-claro); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.reunion-info h1 { font-size: 1.2rem; margin: 6px 0 4px; color: var(--azul); }
.reunion-info p { margin: 2px 0; }
.tag { display: inline-block; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--azul-2); }
.firma-wrap { margin-bottom: 14px; }
.firma-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
#firma { display: block; width: 100%; height: 180px; border: 2px dashed #b8c2d6; border-radius: 8px; background: #fff linear-gradient(transparent 140px, #c9d1e0 140px, #c9d1e0 141px, transparent 141px); touch-action: none; cursor: crosshair; }
#firma.firmado { border-style: solid; border-color: var(--azul-2); }
.firma-hint { margin: 4px 0 0; }
.check-acepto { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: .9rem !important; background: #fafbfd; border: 1px solid var(--borde); border-radius: 8px; padding: 12px; cursor: pointer; }
.check-acepto input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.exito { text-align: center; padding: 20px 0 10px; }
.exito .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 34px; line-height: 64px; margin: 0 auto 12px; font-weight: 700; }
.exito h1 { color: var(--ok); }
