/* Ruta: public/assets/css/app.css */

:root {
  --ink: #12202c;
  --paper: #ffffff;
  --canvas: #f5f7fb;
  --forest: #1e3a5f;
  --forest-deep: #0f1c2e;
  --gold: #c4a35a;
  --orange: #c56a0a;
  --muted: #5c6570;
  --muted-soft: #7a8490;
  --border: #dce3ec;
  --danger: #9f1d1d;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

a { color: var(--forest); }

button, input, select, textarea { font: inherit; }

.sae-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse 86% 64% at 50% 22%, #2b5a8a 0%, #163454 38%, #0c1c30 70%, #050a12 100%);
}

.sae-home { width: 100%; max-width: 560px; text-align: left; }
.sae-home h1 { margin: 0; font-size: 36px; line-height: 1.05; letter-spacing: -0.03em; color: #fff; }
.sae-home p { margin: 12px 0 0; font-size: 18px; color: rgba(255,255,255,.95); }
.sae-public-stack { width: 100%; max-width: 26rem; display: grid; gap: 22px; }
.sae-home-card { max-width: none; }
.sae-home-grid { margin-top: 40px; display: grid; gap: 16px; }
@media (min-width: 640px) { .sae-home-grid { grid-template-columns: 1fr 1fr; } }

.sae-glass-link, .sae-glass-card {
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  color: #fff;
}
.sae-glass-link { display: block; padding: 28px; text-decoration: none; }
.sae-glass-link:hover { background: rgba(0,0,0,.4); }
.sae-glass-card { width: 100%; max-width: 24rem; padding: 32px; }
.sae-kicker { font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.sae-glass-link .sae-kicker + div, .sae-glass-card h1 + p { margin-top: 8px; }
.sae-glass-link div:last-child { margin-top: 8px; font-size: 18px; color: #fff; }
.sae-glass-card h1 { margin: 0; text-align: center; font-size: 30px; color: #fff; }
.sae-glass-card .lead { margin: 4px 0 24px; text-align: center; font-size: 14px; color: rgba(255,255,255,.8); }
.sae-glass-card label { display: block; color: rgba(255,255,255,.8); font-size: 14px; }
.sae-glass-card .back { display: block; margin-top: 16px; text-align: center; color: var(--gold); text-decoration: none; font-size: 14px; }
.sae-glass-card .back:hover { text-decoration: underline; }
.sae-field { margin-bottom: 12px; }
.sae-field .sae-input { margin-top: 4px; }

.sae-shell { display: flex; min-height: 100vh; background: var(--canvas); }
.sae-nav-toggle {
  position: fixed; top: 12px; left: 12px; z-index: 40; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px;
  background: var(--forest); color: #fff; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sae-nav-toggle svg { width: 20px; height: 20px; display: none; }
.sae-shell.is-nav-open .sae-nav-icon-close, .sae-shell.is-nav-collapsed .sae-nav-icon-open { display: block; }
.sae-sidebar {
  width: 232px; flex-shrink: 0; display: flex; flex-direction: column; color: #f4f0e6;
  background: linear-gradient(180deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 22%),
    linear-gradient(180deg, #244a73 0%, #1e3a5f 46%, #0f1c2e 100%);
  transition: transform .2s ease, width .2s ease;
}
.sae-shell.is-nav-open .sae-nav-toggle { left: 196px; }
.sae-shell.is-nav-collapsed .sae-sidebar { transform: translateX(-100%); width: 0; overflow: hidden; }
.sae-shell.is-nav-collapsed .sae-nav-toggle { left: 12px; }
.sae-shell.is-nav-collapsed .sae-main { padding-left: 64px; }
@media (max-width: 768px) {
  .sae-sidebar { position: fixed; z-index: 30; height: 100vh; transform: translateX(-100%); width: 232px; }
  .sae-shell.is-nav-open .sae-sidebar { transform: none; width: 232px; }
  .sae-shell.is-nav-collapsed .sae-sidebar { transform: translateX(-100%); width: 232px; }
  .sae-main { padding: 64px 16px 24px; }
  .sae-shell.is-nav-collapsed .sae-main, .sae-shell.is-nav-open .sae-main { padding-left: 16px; padding-top: 64px; }
}
.sae-main { min-width: 0; flex: 1; padding: 28px; }
.sae-brand { display: block; padding: 24px 20px 16px; text-decoration: none; color: inherit; }
.sae-brand strong { display: block; font-size: 22px; line-height: 1; letter-spacing: -.03em; color: #fff; }
.sae-brand small { display: block; margin-top: 6px; font-size: 13px; color: rgba(255,255,255,.8); }
.sae-nav { display: flex; flex: 1; flex-direction: column; padding: 0 12px 16px; }
.sae-nav-link, .sae-logout {
  display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 8px;
  padding: 10px 12px; background: transparent; color: rgba(255,255,255,.9); text-decoration: none;
  font-size: 14px; text-align: left; cursor: pointer;
}
.sae-nav-link:hover, .sae-logout:hover { background: rgba(255,255,255,.1); color: #fff; }
.sae-nav-link.is-active { background: var(--orange); color: #fff; font-weight: 600; }
.sae-nav-link svg, .sae-logout svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.sae-user { display: flex; align-items: center; gap: 12px; padding: 16px 12px 8px; }
.sae-avatar {
  width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: #1d4ed8; color: #fff; font-size: 12px; font-weight: 700;
}
.sae-user strong, .sae-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sae-user strong { font-size: 14px; font-weight: 600; color: #fff; }
.sae-user small { font-size: 12px; color: rgba(255,255,255,.6); }

.sae-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.sae-heading h1 { margin: 0; font-size: 28px; line-height: 1.15; color: var(--forest); }
.sae-heading p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.sae-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.sae-card-pad { padding: 20px; }
.sae-card h2 { margin: 0; font-size: 18px; color: var(--forest); }
.sae-card .muted { margin: 4px 0 16px; font-size: 14px; color: var(--muted); }
.sae-table-wrap { overflow-x: auto; }
.sae-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sae-table th { text-align: left; font-weight: 600; color: var(--muted-soft); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sae-table td { padding: 11px 12px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
table.sae-table thead th[data-dir="asc"]::after { content: " ↑"; }
table.sae-table thead th[data-dir="desc"]::after { content: " ↓"; }
.sae-col-filter { width: 100%; min-height: 28px; margin-top: 6px; font-size: 12px; padding: 4px 8px; }

.sae-input, .sae-select, .sae-textarea {
  width: 100%; min-height: 38px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; padding: 8px 11px; color: var(--ink);
}
.sae-textarea { min-height: 88px; resize: vertical; }
.sae-input:focus, .sae-select:focus, .sae-textarea:focus {
  outline: none; border-color: var(--forest); box-shadow: 0 0 0 2px rgba(30,58,95,.12);
}

.sae-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 9px; font-size: .75rem; font-weight: 700; }
.sae-pill-ok { background: #e8f6ee; color: #166534; }
.sae-pill-no { background: #fde8e8; color: #991b1b; }
.sae-pill-wait { background: #fff4d6; color: #92400e; }
.sae-pill-auto { background: #e8f1fb; color: #1d4ed8; }
.sae-pill-done { background: #ede9fe; color: #5b21b6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  border-radius: 8px; border: 1px solid transparent; padding: 6px 12px; background: var(--forest);
  color: #fff; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn-lg { min-height: 40px; width: 100%; }
.btn-sm { min-height: 28px; padding: 2px 8px; font-size: 13px; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--forest); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ok { background: #166534; color: #fff; }

.alert { margin-bottom: 16px; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.alert-ok, .alert-success { background: #e8f6ee; color: #166534; }
.alert-error, .alert-danger { background: #fde8e8; color: #991b1b; }
.alert-info { background: #e8f1fb; color: #1e3a5f; }

.sae-search { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sae-search .sae-input { max-width: 36rem; flex: 1; }
.form-stack { display: grid; gap: 12px; }
.form-stack label { display: block; font-size: 14px; }
.form-stack .sae-input, .form-stack .sae-select, .form-stack .sae-textarea { margin-top: 4px; }
.grid-2 { display: grid; gap: 12px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.nowrap { white-space: nowrap; }
.text-muted { color: var(--muted); }
.mt { margin-top: 20px; }
.photo-preview { max-width: 280px; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.photo-guide { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }
.photo-rules { font-size: 14px; line-height: 1.45; }
.photo-rules-title { display: block; margin-bottom: 8px; }
.vote-list { display: grid; gap: 8px; }
.vote-list label { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.vote-list label:hover { background: #f4f7fb; }
.officer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.officer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 0; cursor: pointer; white-space: nowrap; }
.check-stack { display: grid; gap: 10px; }
.open-votes { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.open-votes li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; align-items: baseline; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.open-votes a { color: inherit; font-weight: 600; text-decoration: none; }
.open-votes a:hover { text-decoration: underline; }
.progress { font-size: 14px; color: var(--muted); margin: 8px 0; }
.dl-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.dl-grid dt { color: var(--muted); }
.stack-cards { display: grid; gap: 16px; }
.readonly { background: #f3f5f8; }

.brand-registered {
  position: fixed; left: 18px; bottom: 18px; z-index: 40; display: inline-grid; place-items: center;
  width: 28px; height: 28px; color: var(--muted); font-size: 2rem; font-weight: 700; line-height: 1;
  text-decoration: none; cursor: pointer; user-select: none;
}
.brand-registered-tip {
  position: absolute; left: 0; bottom: calc(100% + 8px); padding: 6px 10px; border-radius: 8px;
  background: #1f2a23; color: #fff; font-size: .78rem; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease;
}
.brand-registered:hover .brand-registered-tip, .brand-registered:focus-visible .brand-registered-tip { opacity: 1; transform: translateY(0); }

.admin-access {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: 30px;
  height: 30px;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 0.83rem;
  opacity: 0.7;
  z-index: 20;
}
.admin-access:hover,
.admin-access:focus-visible { opacity: 1; color: #fff; }

.sae-status-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.sae-status-btn:hover { filter: brightness(0.95); }

.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }

.slate-grid { display: grid; gap: 14px; }
@media (min-width: 768px) { .slate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slate-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: #fff; display: grid; gap: 6px; }
.slate-card img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; background: #f3f5f8; }
.slate-card h3, .slate-card strong { margin: 0; }
.slate-card p, .slate-card span { margin: 0; font-size: 14px; }
.slate-choice { cursor: pointer; }
.slate-choice input { justify-self: start; }
.slate-choice:has(input:checked) { outline: 2px solid var(--forest); }
.slate-winner { outline: 2px solid #166534; }
