/* ============================================================
   BazarApp — Estilos globales
   ============================================================ */

/* ── Fuentes ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Syne:wght@500;600;700&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --green-dark:   #0a4a36;
  --green-mid:    #0f6e56;
  --green-soft:   #1d9e75;
  --green-pale:   #e1f5ee;
  --green-border: #5dcaa5;

  --amber:        #ba7517;
  --amber-pale:   #faeeda;
  --amber-border: #fac775;

  --red:          #a32d2d;
  --red-pale:     #fcebeb;
  --red-border:   #f7c1c1;

  --blue:         #185fa5;
  --blue-pale:    #e6f1fb;
  --blue-border:  #b5d4f4;

  --wa:           #25d366;
  --wa-dark:      #1da851;

  --bg:           #f5f4f0;
  --surface:      #ffffff;
  --surface2:     #f0eeea;
  --surface3:     #e8e6e1;

  --border:       rgba(0,0,0,.10);
  --border2:      rgba(0,0,0,.06);

  --text:         #1a1a18;
  --text2:        #5a5a55;
  --text3:        #9a9a94;

  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --radius-xl:    20px;

  --shadow-sm:    0 1px 4px rgba(0,0,0,.06);
  --shadow:       0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:    0 4px 24px rgba(0,0,0,.12);

  --topbar-h:     56px;
  --sidebar-w:    224px;
  --transition:   .15s ease;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }

/* ── Shell ───────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--green-dark);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  height: var(--topbar-h);
}
.topbar-logo {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
  white-space: nowrap;
}
.topbar-evento {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.topbar-badge {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.topbar-icon-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-sm);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.topbar-icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.menu-toggle { display: none; }

/* ── Sidebar overlay (mobile) ────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 150;
  opacity: 0;
  transition: opacity .25s;
}
.sidebar-overlay.open { opacity: 1; }

/* ── Main layout ─────────────────────────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border2);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 12px 0 24px;
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sidebar.sidebar-hidden { display: none; }

.sidebar-bazar {
  margin: 0 12px 8px;
  padding: 10px 12px;
  background: var(--green-pale);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
}
.sidebar-bazar-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--green-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-bazar-meta {
  font-size: 11px;
  color: var(--green-mid);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 12px 16px 4px;
}
.sidebar-section { padding: 0 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text2);
  font-size: 13px;
  transition: var(--transition);
  position: relative;
  user-select: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: var(--green-pale);
  color: var(--green-dark);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--green-soft);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 16px; opacity: .85; flex-shrink: 0; }
.nav-badge {
  background: #e24b4a;
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  padding: 1px 6px;
  margin-left: auto;
  font-weight: 600;
}

/* ── Content ─────────────────────────────────────────────── */
.content {
  padding: 24px;
  overflow-y: auto;
  min-width: 0;
}

/* ── Pages ───────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.page-subtitle {
  font-size: 12px;
  color: var(--text3);
  margin-top: 3px;
}

/* ── Contexto evento (banner) ────────────────────────────── */
.ctx-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--green-pale);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.ctx-banner-info { display: flex; align-items: center; gap: 10px; }
.ctx-banner-name { font-size: 13px; font-weight: 500; color: var(--green-dark); }
.ctx-banner-meta { font-size: 11px; color: var(--green-mid); margin-top: 1px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-sm {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.card + .card { margin-top: 16px; }

/* ── Métricas ────────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.metric-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.metric-value {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1;
}
.mv-green { color: var(--green-soft); }
.mv-amber { color: var(--amber); }
.mv-red   { color: var(--red); }
.mv-blue  { color: var(--blue); }
.mv-gray  { color: var(--text3); }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  color: var(--text2);
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
}
.tab:hover { background: rgba(255,255,255,.5); }
.tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* ── Tabla ───────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border2);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface2); }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}
.b-green  { background: var(--green-pale);  color: var(--green-dark); }
.b-amber  { background: var(--amber-pale);  color: #854f0b; }
.b-red    { background: var(--red-pale);    color: var(--red); }
.b-blue   { background: var(--blue-pale);   color: var(--blue); }
.b-gray   { background: var(--surface2);    color: var(--text2); }

/* ── Botones ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  color: var(--text);
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
}
.btn:hover   { background: var(--surface2); }
.btn:active  { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--green-mid); color: #fff; border-color: var(--green-mid); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }

.btn-danger { background: var(--red-pale); color: var(--red); border-color: var(--red-border); }
.btn-danger:hover { background: #f8d0d0; }

.btn-blue { background: var(--blue-pale); color: var(--blue); border-color: var(--blue-border); }
.btn-blue:hover { background: #d5e8f8; }

.btn-wa { background: var(--wa); color: #fff; border-color: var(--wa); }
.btn-wa:hover { background: var(--wa-dark); border-color: var(--wa-dark); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text2);
  transition: var(--transition);
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }

/* ── Formularios ─────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-1 { grid-template-columns: 1fr; }

.fg { display: flex; flex-direction: column; gap: 4px; }
.fg label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text2);
}
.fg-hint { font-weight: 400; color: var(--text3); }

.fg input,
.fg select,
.fg textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  outline: none;
  border-color: var(--green-soft);
  box-shadow: 0 0 0 3px rgba(29,158,117,.1);
}
.fg textarea { resize: vertical; min-height: 72px; }
.fg input[type="number"] { text-align: center; font-weight: 500; }

/* ── Buscador ────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}
.search-wrap input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
  transition: border-color var(--transition);
}
.search-wrap input:focus { outline: none; border-color: var(--green-soft); }
.search-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 15px;
  pointer-events: none;
}

/* ── Banners ─────────────────────────────────────────────── */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}
.banner-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.banner-green  { background: var(--green-pale); border: 1px solid var(--green-border); color: var(--green-dark); }
.banner-amber  { background: var(--amber-pale); border: 1px solid var(--amber-border); color: #854f0b; }
.banner-red    { background: var(--red-pale);   border: 1px solid var(--red-border);   color: var(--red); }
.banner-blue   { background: var(--blue-pale);  border: 1px solid var(--blue-border);  color: var(--blue); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.modal-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text3);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ── Mapa de mesas ───────────────────────────────────────── */
.mesa-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.mesa-cell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 7px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.mesa-cell:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.mesa-cell.libre   { background: var(--green-pale); border-color: var(--green-border); }
.mesa-cell.asignada { background: var(--blue-pale);  border-color: var(--blue-border); }
.mesa-cell.selected { border: 2px solid var(--green-soft); background: #fff; }
.mesa-num  { font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 600; }
.libre   .mesa-num  { color: var(--green-dark); }
.asignada .mesa-num { color: var(--blue); }
.mesa-tipo  { font-size: 10px; color: var(--text3); margin-top: 2px; }
.mesa-nombre {
  font-size: 10px;
  color: var(--text2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── WhatsApp preview ────────────────────────────────────── */
.wa-preview {
  background: #e8f5e3;
  border: 1px solid #a8d5a2;
  border-radius: var(--radius-lg);
  padding: 14px;
}
.wa-preview-header {
  font-size: 11px;
  font-weight: 600;
  color: #2d6a2d;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wa-bubble {
  background: #fff;
  border-radius: 2px 12px 12px 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
  white-space: pre-wrap;
  word-break: break-word;
}
.wa-time {
  font-size: 10px;
  color: #888;
  text-align: right;
  margin-top: 5px;
}

/* ── Detalle rows ────────────────────────────────────────── */
.detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border2);
  font-size: 13px;
}
.detail-row:last-child { border-bottom: none; }
.detail-icon  { font-size: 15px; color: var(--text3); width: 20px; text-align: center; flex-shrink: 0; }
.detail-label { color: var(--text3); width: 110px; font-size: 12px; flex-shrink: 0; }
.detail-value { color: var(--text); flex: 1; }

/* ── Chip / Tag ──────────────────────────────────────────── */
.chip {
  display: inline-block;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  color: var(--text2);
  white-space: nowrap;
}

/* ── Divider ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border2); margin: 16px 0; }

/* ── Utilities ───────────────────────────────────────────── */
.mt-4  { margin-top: 4px; }  .mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-4  { margin-bottom: 4px; }  .mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }

.flex         { display: flex; }
.flex-center  { align-items: center; }
.flex-between { justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.gap-4  { gap: 4px; }  .gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }  .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.text-sm   { font-size: 12px; }
.text-xs   { font-size: 11px; }
.fw-500    { font-weight: 500; }
.fw-600    { font-weight: 600; }
.text-muted { color: var(--text3); }
.text-2     { color: var(--text2); }
.text-green { color: var(--green-mid); }
.text-red   { color: var(--red); }
.text-wa    { color: var(--wa); }
.text-center { text-align: center; }

.section-title {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Progress bar ────────────────────────────────────────── */
.prog-wrap   { margin-bottom: 12px; }
.prog-label  { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; color: var(--text2); }
.prog-bar    { height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.prog-fill   { height: 100%; border-radius: 4px; background: var(--green-soft); transition: width .4s ease; }

/* ── Avatar ──────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px; flex-shrink: 0;
}
.av-green { background: var(--green-pale); color: var(--green-dark); }
.av-amber { background: var(--amber-pale); color: #854f0b; }
.av-blue  { background: var(--blue-pale);  color: var(--blue); }
.av-gray  { background: var(--surface2);   color: var(--text2); }

/* ── Estrellas ───────────────────────────────────────────── */
.stars { display: flex; gap: 3px; font-size: 18px; color: var(--amber); cursor: pointer; }

/* ── Pantalla móvil (consulta pública) ───────────────────── */
.mobile-frame {
  max-width: 360px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.mobile-hdr {
  background: var(--green-mid);
  color: #fff;
  padding: 16px 18px 14px;
}
.mobile-hdr h2 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 600;
}
.mobile-hdr p { font-size: 12px; opacity: .75; margin-top: 3px; }
.mobile-body  { padding: 16px; }

/* ── Stepper (envío masivo) ──────────────────────────────── */
.stepper {
  display: flex;
  overflow-x: auto;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border2);
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--surface2);
  color: var(--text2);
  border-right: 1px solid var(--border2);
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  transition: var(--transition);
  flex: 1;
  justify-content: center;
}
.step:last-child { border-right: none; }
.step:hover { background: var(--surface3); }
.step.active {
  background: var(--green-mid);
  color: #fff;
  font-weight: 500;
}
.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  background: rgba(255,255,255,.2);
}
.step:not(.active) .step-num {
  background: var(--border);
  color: var(--text2);
}

/* ── Dropzone ────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--surface2);
}
.dropzone:hover,
.dropzone.dragover { border-color: var(--green-soft); background: var(--green-pale); }

/* ── Log masivo ──────────────────────────────────────────── */
.log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  background: var(--surface2);
}
.log-ok   { border-left: 3px solid var(--green-soft); }
.log-wait { border-left: 3px solid var(--amber); }
.log-skip { border-left: 3px solid var(--text3); }

/* ── PIN screen ──────────────────────────────────────────── */
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 20px 0; }
.pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: var(--transition);
}
.pin-dot.filled { background: var(--green-soft); border-color: var(--green-soft); }
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 220px;
  margin: 0 auto;
}
.pin-key {
  padding: 13px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 18px;
  font-weight: 500;
  font-family: 'Syne', sans-serif;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  user-select: none;
}
.pin-key:hover   { background: var(--surface2); }
.pin-key:active  { transform: scale(.95); }

/* ── Historico item ──────────────────────────────────────── */
.hitem {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border2);
}
.hitem:last-child { border-bottom: none; }
.hico {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--green-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.hinfo { flex: 1; min-width: 0; }
.hinfo-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hinfo-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* ── Comentario card ─────────────────────────────────────── */
.com-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--green-soft);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.com-card.nuevo { border-left-color: var(--amber); }
.com-meta { font-size: 11px; color: var(--text3); margin-top: 5px; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}
.empty-icon   { font-size: 40px; margin-bottom: 10px; }
.empty-title  { font-size: 14px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.empty-desc   { font-size: 13px; }

/* ── Loading ─────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  color: var(--text3);
  font-size: 13px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--green-soft);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .2s ease;
  max-width: 320px;
}
.toast.toast-ok  { background: var(--green-mid); }
.toast.toast-err { background: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .topbar-evento { display: none; }

  .main-layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 260px;
    height: 100vh;
    z-index: 160;
    transform: translateX(-100%);
    padding-top: 70px;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }

  .content { padding: 14px; }

  .split2, .split3 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid [style*="grid-column"] { grid-column: 1 !important; }

  .metrics { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }

  .mobile-frame { border-radius: var(--radius-lg); }

  table { font-size: 12px; }
  th, td { padding: 8px 8px; }

  .stepper { flex-direction: column; border-radius: var(--radius); }
  .step { border-right: none; border-bottom: 1px solid var(--border2); }
  .step:last-child { border-bottom: none; }
}

@media (min-width: 769px) {
  .menu-toggle { display: none !important; }
  .sidebar-overlay { display: none !important; }
}
