/* Mi Cumple 12 — estilos. Tema Boca: azul + amarillo. Mobile-first. */

:root {
  /* Opt out of any UA dark-mode auto-inversion (Chrome Android "force dark"). */
  color-scheme: light;
  --boca-azul: #0a3a6f;
  --boca-azul-dark: #062547;
  --boca-azul-light: #134c8e;
  --boca-amarillo: #fcd116;
  --boca-amarillo-soft: #ffe066;
  --boca-amarillo-dark: #e6bd0e;
  --bg: var(--boca-azul);
  --surface: #ffffff;
  --text: #161a1f;
  --text-muted: #5b6470;
  --border: #d9dde3;
  --success: #137a3f;
  --success-bg: #d9f3e3;
  --warning: #b66400;
  --warning-bg: #fff4d6;
  --danger: #b3261e;
  --danger-bg: #fde2e1;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 6px 24px rgba(0, 0, 0, 0.32);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background: var(--boca-azul);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: var(--radius);
  font-weight: 700;
  min-height: 48px;
  padding: 0 18px;
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}
button:hover { background: var(--boca-amarillo-dark); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary {
  background: #e9ecef;
  color: var(--text);
}
button.secondary:hover { background: #d8dde2; }

button.success {
  background: var(--success);
  color: #fff;
  font-size: 18px;
  min-height: 56px;
  padding: 0 28px;
}
button.success:hover { background: #0e5e30; }

button.danger {
  background: var(--danger);
  color: #fff;
}
button.danger:hover { background: #8d1f18; }

input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-size: 16px;
  color: var(--text);
}
input:focus {
  outline: 2px solid var(--boca-amarillo);
  outline-offset: 1px;
  border-color: var(--boca-amarillo);
}

/* ---------- LOGIN ---------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, var(--boca-azul) 0%, var(--boca-azul-dark) 100%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  padding: 28px 28px 32px;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  border-top: 6px solid var(--boca-amarillo);
}
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.login-logo img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}
.login-card h1 {
  margin: 4px 0 4px;
  font-size: 24px;
  color: var(--boca-azul);
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.login-card .subtitle {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}
.login-card label {
  display: block;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--boca-azul-dark);
}
.login-card input {
  margin-top: 6px;
  font-weight: 400;
  color: var(--text);
}
.login-card button[type="submit"] {
  width: 100%;
  margin-top: 10px;
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
  font-size: 17px;
  border: 2px solid var(--boca-amarillo-dark);
}
.login-card button[type="submit"]:hover { background: var(--boca-amarillo-dark); }
.login-card .error {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius);
  font-size: 14px;
  display: none;
}
.login-card .error.visible { display: block; }

/* ---------- APP ---------- */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--boca-azul);
}

.app-header {
  background: var(--boca-azul-dark);
  color: var(--boca-amarillo);
  padding: 8px 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  box-shadow: var(--shadow);
  border-bottom: 3px solid var(--boca-amarillo);
}
.app-header .logo {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
}
.app-header .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.app-header .title-row {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  display: flex;
  align-items: center;
  min-width: 0;
}
.app-header .title {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header .counter {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: #fff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header .counter strong {
  color: var(--boca-amarillo);
  font-size: 26px;
  font-weight: 900;
  margin-right: 2px;
}
.app-header .user {
  grid-column: 3 / 4;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #fff;
}
.app-header .user-name {
  display: none; /* ocultamos en celular angosto, se ve en >=600px */
}
.app-header .user button {
  min-height: 44px;
  padding: 0 14px;
  font-size: 13px;
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
  font-weight: 800;
}
.app-header .user button:hover { background: var(--boca-amarillo-dark); }

@media (min-width: 600px) {
  .app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 10px 16px;
  }
  .app-header .logo { width: 52px; height: 52px; }
  .app-header .title { font-size: 14px; }
  .app-header .counter { font-size: 22px; }
  .app-header .counter strong { font-size: 30px; }
  .app-header .user-name { display: inline; }
}

.banner {
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 2px solid var(--boca-amarillo-dark);
  display: none;
}
.banner.visible { display: block; }

.controls {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--boca-azul);
  padding: 12px 12px 10px;
  border-bottom: 2px solid var(--boca-amarillo);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.controls input[type="search"] {
  height: 56px;
  font-size: 18px;
  font-weight: 500;
  border: 2px solid transparent;
  padding-left: 44px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a3a6f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat 12px center;
  background-size: 22px 22px;
}
.controls input[type="search"]:focus {
  border-color: var(--boca-amarillo);
  outline: none;
}
.filters {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.filters .chip {
  flex: none;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(252, 209, 22, 0.45);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  min-height: 44px;
  white-space: nowrap;
}
.filters .chip:hover {
  background: rgba(255, 255, 255, 0.2);
}
.filters .chip.active {
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
  border-color: var(--boca-amarillo);
}

@media (min-width: 600px) {
  .controls { top: 78px; }
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--boca-azul);
}

.list {
  flex: 1;
  padding: 8px 12px 100px;
}
.list .row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  min-height: 64px;
  cursor: pointer;
  transition: transform 0.06s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.list .row:hover {
  border-color: var(--boca-amarillo);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.list .row:active { transform: scale(0.99); }
.list .row[data-state="checked-in"] {
  background: var(--success-bg);
  border-color: #a8d9bb;
}
.list .row .name {
  font-size: 17px;
  margin: 0 0 3px;
  color: var(--boca-azul-dark);
  word-break: break-word;
}
.list .row .name .last {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.list .row .name .first {
  font-weight: 400;
  color: var(--text);
}
.list .row .meta {
  font-size: 13px;
  color: var(--text-muted);
}
.list .row .badge {
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.list .row[data-state="checked-in"] .badge {
  background: var(--success);
  color: #fff;
}

.list .empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--boca-amarillo-soft);
  font-size: 15px;
  font-weight: 600;
}

.feed {
  border-top: 1px solid rgba(252, 209, 22, 0.3);
  background: var(--boca-azul-dark);
  color: #fff;
  padding: 12px 14px 18px;
}
.feed h3 {
  font-size: 13px;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--boca-amarillo);
  font-weight: 800;
}
.feed ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feed li {
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}
.feed li .last { text-transform: uppercase; font-weight: 800; color: var(--boca-amarillo); }
.feed li .first { font-weight: 400; }
.feed li:last-child { border-bottom: 0; }
.feed li .when {
  color: var(--boca-amarillo-soft);
  font-size: 12px;
  margin-left: 6px;
}
.feed .empty {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}

/* Tablet/desktop: lista a la izquierda, feed lateral fijo */
@media (min-width: 900px) {
  .main-area {
    flex-direction: row;
  }
  .list {
    flex: 1;
    padding: 14px 16px 30px;
  }
  .feed {
    flex: none;
    width: 320px;
    border-top: 0;
    border-left: 1px solid rgba(252, 209, 22, 0.25);
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    position: sticky;
    top: 160px;
  }
}

/* ---------- MODAL ---------- */

dialog#child-modal {
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  border-top: 6px solid var(--boca-amarillo);
}
@media (min-width: 600px) {
  dialog#child-modal {
    border-radius: 14px;
    width: min(92vw, 560px);
    height: auto;
    max-height: 92vh;
    margin: auto;
  }
}
dialog#child-modal::backdrop {
  background: rgba(6, 37, 71, 0.7);
}
.modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
@media (min-width: 600px) {
  .modal-content { max-height: 92vh; height: auto; }
}
.modal-header { flex: none; }
.modal-footer { flex: none; }
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.modal-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  color: var(--boca-azul);
  font-weight: 700;
}
.modal-header h2 .last { text-transform: uppercase; font-weight: 900; letter-spacing: 0.01em; }
.modal-header h2 .first { font-weight: 500; }
.modal-header .modal-meta {
  font-size: 18px;
  color: var(--text);
  font-weight: 500;
}
.modal-header .modal-meta > div { margin-bottom: 2px; }
.modal-header .modal-meta .label {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 14px;
  margin-right: 4px;
}
.modal-body {
  padding: 16px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.modal-body h3 {
  margin: 4px 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--boca-azul);
  font-weight: 800;
}
.modal-body .companion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.modal-body .companion:hover {
  border-color: var(--boca-amarillo);
}
.modal-body .companion .companion-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d9dde3;
  flex: none;
  border: 2px solid #c0c5cb;
}
.modal-body .companion .companion-dot.present {
  background: var(--success);
  border-color: var(--success);
}
.modal-body .companion input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: none;
  accent-color: var(--success);
}
.modal-body .companion .info {
  flex: 1;
  min-width: 0;
}
.modal-body .companion .name {
  font-size: 17px;
  color: var(--boca-azul-dark);
}
.modal-body .companion .name .last { text-transform: uppercase; font-weight: 800; }
.modal-body .companion .name .first { font-weight: 400; }
.modal-body .companion .rel {
  font-size: 13px;
  color: var(--text-muted);
}
.modal-body .checked-in-info {
  background: var(--success-bg);
  color: var(--success);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 15px;
  margin-bottom: 10px;
  border: 1px solid #a8d9bb;
  font-weight: 600;
}
.modal-body .notes {
  background: #fff8db;
  border-left: 3px solid var(--boca-amarillo);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-top: 6px;
  color: var(--boca-azul-dark);
}
.modal-observations {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
}
.modal-obs-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--boca-azul);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.modal-obs-hint {
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}
#modal-notes-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  min-height: 48px;
  background: #fff;
  color: var(--text);
}
@media (min-width: 600px) {
  #modal-notes-input { min-height: 64px; }
}
#modal-notes-input:focus {
  outline: 2px solid var(--boca-amarillo);
  outline-offset: 1px;
  border-color: var(--boca-amarillo);
}
#modal-notes-input:disabled {
  background: #f4f6f8;
  color: var(--text-muted);
  cursor: not-allowed;
}
.modal-footer {
  display: flex;
  gap: 10px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: #fafbfc;
}
.modal-footer button { flex: 1; min-height: 56px; font-size: 17px; }
.modal-footer button.secondary { flex: 0 0 auto; min-width: 110px; }
.modal-error {
  padding: 8px 22px 0;
  color: var(--danger);
  font-size: 14px;
  display: none;
  font-weight: 600;
}
.modal-error.visible { display: block; }

/* ---------- ADMIN PANEL ---------- */

.online-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--success);
  color: #fff;
  border-bottom: 2px solid #0e5e30;
  font-size: 14px;
}
.online-banner.offline {
  background: var(--boca-azul-dark);
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
.online-banner .online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  flex: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
  animation: online-pulse 1.6s ease-in-out infinite;
}
.online-banner.offline .online-dot {
  background: #6b7480;
  box-shadow: none;
  animation: none;
}
@keyframes online-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.10); }
}
.online-banner .online-text {
  font-weight: 700;
  white-space: nowrap;
}
.online-banner .online-text strong {
  font-size: 18px;
  margin-right: 4px;
  font-weight: 900;
}
.online-banner .online-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.online-banner .online-chip {
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}


.admin-grid {
  display: grid;
  gap: 12px;
  padding: 12px;
  grid-template-columns: 1fr;
  background: var(--boca-azul);
}
@media (min-width: 900px) {
  .admin-grid {
    grid-template-columns: minmax(260px, 1fr) minmax(420px, 2fr);
    grid-template-areas:
      "chart feed"
      "ops   feed";
    align-items: start;
    padding: 16px;
  }
  .chart-panel { grid-area: chart; }
  .ops-panel   { grid-area: ops; }
  .feed-panel  {
    grid-area: feed;
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .feed-panel .checkin-table-wrap { flex: 1; max-height: none; }
}

/* Página de operadores */
.operators-main {
  padding: 16px;
  background: var(--boca-azul);
  min-height: calc(100vh - 80px);
}
.users-panel-full {
  max-width: 720px;
  margin: 0 auto;
}

/* Botón ghost (back / operadores) */
.app-header .user button.ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid var(--boca-amarillo);
}
.app-header .user button.ghost:hover {
  background: rgba(252, 209, 22, 0.15);
}

.panel {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  border-top: 4px solid var(--boca-amarillo);
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--boca-azul);
  font-weight: 800;
}
.panel .hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* Donut */
.chart-panel { display: flex; flex-direction: column; align-items: center; }
.donut-wrap { width: 100%; max-width: 260px; aspect-ratio: 1; }
.donut { width: 100%; height: 100%; }
.donut .donut-bg {
  stroke: #e9ecef;
  stroke-width: 24;
  fill: none;
}
.donut .donut-fill {
  stroke: var(--success);
  stroke-width: 24;
  fill: none;
  stroke-linecap: butt;
  transition: stroke-dasharray 0.4s ease-out;
}
.kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}
.kpi {
  text-align: center;
  padding: 10px 6px;
  border-radius: 10px;
  background: #f4f6f8;
}
.kpi.checked { background: var(--success-bg); }
.kpi.pending { background: var(--warning-bg); }
.kpi-value {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  color: var(--boca-azul-dark);
}
.kpi.checked .kpi-value { color: var(--success); }
.kpi.pending .kpi-value { color: var(--warning); }
.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 700;
}

/* Por operador */
.ops-list { list-style: none; margin: 0; padding: 0; }
.ops-list li {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr 40px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f4;
}
.ops-list li:last-child { border-bottom: 0; }
.ops-list .op-name {
  font-weight: 700;
  color: var(--boca-azul-dark);
  font-size: 14px;
}
.ops-list .op-bar {
  height: 10px;
  background: #eef1f4;
  border-radius: 5px;
  overflow: hidden;
}
.ops-list .op-bar-fill {
  height: 100%;
  background: var(--boca-amarillo);
  transition: width 0.3s ease-out;
}
.ops-list .op-count {
  text-align: right;
  font-weight: 800;
  color: var(--boca-azul);
  font-size: 16px;
}
.ops-list .empty { color: var(--text-muted); padding: 20px 0; text-align: center; }

/* Tabla de acreditaciones (admin) */
.feed-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.feed-head-row h2 { margin: 0; }
.feed-count {
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.checkin-table-wrap {
  max-height: 540px;
  overflow-y: auto;
  border-radius: 8px;
}
.checkin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.checkin-table thead th {
  position: sticky;
  top: 0;
  background: #fff;
  text-align: left;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.07em;
  color: var(--boca-azul);
  padding: 10px 12px 8px;
  border-bottom: 2px solid var(--boca-amarillo);
  font-weight: 800;
  white-space: nowrap;
  z-index: 1;
}
.checkin-table tbody tr {
  border-bottom: 1px solid #eef1f4;
  transition: background 0.15s;
}
.checkin-table tbody tr.clickable { cursor: pointer; }
.checkin-table tbody tr:hover { background: #f8f9fb; }
.checkin-table tbody tr.clickable:focus { outline: 2px solid var(--boca-amarillo); outline-offset: -2px; }
.checkin-table tbody tr:last-child { border-bottom: 0; }
.checkin-table td {
  padding: 10px 12px;
  vertical-align: middle;
}
.checkin-table .col-name {
  color: var(--boca-azul-dark);
  font-size: 15px;
}
.checkin-table .col-name .last { text-transform: uppercase; font-weight: 800; }
.checkin-table .col-name .first { font-weight: 400; color: var(--text); }
.checkin-table .col-name .note-flag {
  font-size: 14px;
  vertical-align: middle;
  cursor: help;
}
.checkin-table .col-time {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}
.checkin-table .col-time .time-abs {
  color: var(--boca-azul-dark);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.checkin-table .col-time .time-rel { color: var(--text-muted); }
.checkin-table .col-op { white-space: nowrap; }
.checkin-table .op-chip {
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.checkin-table .empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 12px;
}

/* Mobile: cada fila se transforma en una card vertical con labels. */
@media (max-width: 720px) {
  .checkin-table thead { display: none; }
  .checkin-table, .checkin-table tbody, .checkin-table tr, .checkin-table td {
    display: block;
    width: 100%;
  }
  .checkin-table tbody tr {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 6px 12px;
  }
  .checkin-table tbody tr:hover { background: #fff; }
  .checkin-table td {
    padding: 6px 0;
    border: 0;
    display: grid;
    grid-template-columns: 110px 1fr;
    align-items: center;
    gap: 8px;
  }
  .checkin-table td::before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.04em;
  }
  .checkin-table .empty-row td { display: block; text-align: center; }
  .checkin-table .empty-row td::before { display: none; }
}

/* Lista de operadores con botón */
.users-list { list-style: none; margin: 0; padding: 0; }
.users-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eef1f4;
}
.users-list li:last-child { border-bottom: 0; }
.user-info { min-width: 0; }
.user-name-row { font-weight: 700; color: var(--boca-azul-dark); font-size: 15px; }
.user-username { font-size: 12px; color: var(--text-muted); }
.users-list button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  background: var(--boca-azul);
  color: #fff;
  font-weight: 700;
  flex: none;
}
.users-list button.small:hover { background: var(--boca-azul-dark); }
.users-list button.small.ghost {
  background: transparent;
  color: var(--boca-azul);
  border: 1.5px solid var(--boca-azul);
}
.users-list button.small.ghost:hover {
  background: rgba(10, 58, 111, 0.08);
}

.users-list .user-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: none;
}

.role-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}
.role-chip.role-admin {
  background: var(--boca-azul);
  color: var(--boca-amarillo);
}
.role-chip.role-operator {
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
}
.role-chip.role-viewer {
  background: #e9ecef;
  color: var(--text);
}

.users-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.role-tab {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0 14px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.role-tab.active {
  background: var(--boca-azul);
  color: #fff;
  border-color: var(--boca-azul);
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.profile-field span {
  font-size: 13px;
  font-weight: 700;
  color: var(--boca-azul);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.profile-field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  background: #fff;
}
.profile-field input:focus {
  outline: 2px solid var(--boca-amarillo);
  outline-offset: 1px;
  border-color: var(--boca-amarillo);
}
.profile-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.profile-hint strong {
  color: var(--boca-azul-dark);
  font-weight: 800;
}

/* Modal cambio de password */
#password-modal .pw-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 15px;
}
#password-modal .pw-mode input { width: 18px; height: 18px; }
#password-modal #pw-input {
  margin-top: 8px;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 16px;
  letter-spacing: 0.04em;
}
#password-modal .pw-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--success-bg);
  border: 1px solid #a8d9bb;
}
#password-modal .pw-result-label {
  font-size: 13px;
  color: var(--success);
  font-weight: 700;
  margin-bottom: 6px;
}
#password-modal .pw-result-code {
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 24px;
  font-weight: 800;
  color: var(--boca-azul-dark);
  letter-spacing: 0.06em;
  user-select: all;
  background: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
}
#password-modal .pw-result-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--success);
}

/* ---------- TOAST ---------- */

.toast-stack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--success);
  color: #fff;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.18s ease-out;
}
.toast.error { background: var(--danger); }
.toast.warning {
  background: var(--boca-amarillo);
  color: var(--boca-azul-dark);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
