/* ====================================================== */
/* SABANDIJA · ALBUM MUNDIAL 2026 · v36 (rediseño)         */
/* ====================================================== */

/* ===== THEME SYSTEM (CSS vars cambian por data-theme) ===== */
:root {
  --bg-deep:    #0A0E1A;
  --bg-card:    #151B2B;
  --bg-elev:    #1A2235;
  --accent:     #eab308;        /* yellow-500 */
  --accent-soft: rgba(234,179,8,0.10);
  --accent-text: #eab308;
  --accent-on-accent: #000;
  --text:       #f5f7fb;
  --text-dim:   #94a3b8;
  --text-mute:  #475569;
  --danger:     #ff4d6d;
  --blue:       #3b82f6;
  --green:      #10b981;
  --border:     rgba(255,255,255,0.06);
  --shadow:     0 6px 20px rgba(0,0,0,0.35);
  --radius:     16px;
  --radius-lg:  24px;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body[data-theme="modern"] {
  --bg-deep:  #0A0E1A;
  --bg-card:  #151B2B;
  --bg-elev:  #1A2235;
  --accent:   #eab308;
  --accent-text: #eab308;
  --accent-on-accent: #000;
  --accent-soft: rgba(234,179,8,0.10);
  --text: #f5f7fb;
}
body[data-theme="classic"] {
  --bg-deep:  #1a472a;
  --bg-card:  #2a5c3a;
  --bg-elev:  #3a6d4a;
  --accent:   #facc15;
  --accent-text: #facc15;
  --accent-on-accent: #1a472a;
  --accent-soft: rgba(250,204,21,0.12);
  --text: #fff;
}
body[data-theme="argentina"] {
  --bg-deep:  #75AADB;
  --bg-card:  rgba(255,255,255,0.10);
  --bg-elev:  rgba(255,255,255,0.20);
  --accent:   #facc15;
  --accent-text: #facc15;
  --accent-on-accent: #003876;
  --accent-soft: rgba(250,204,21,0.18);
  --text: #fff;
  --border: rgba(255,255,255,0.18);
}
body[data-theme="gold"] {
  --bg-deep:  #1a1300;
  --bg-card:  #2d2100;
  --bg-elev:  #443300;
  --accent:   #ffd700;
  --accent-text: #ffd700;
  --accent-on-accent: #000;
  --accent-soft: rgba(255,215,0,0.12);
  --text: #fff;
}

/* ===== RESET / BASE ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', system-ui, sans-serif;
  min-height: 100vh;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease;
}
body { padding-top: var(--safe-top); }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
input, select, textarea {
  font-family: inherit;
}

/* ===== VIEW SWITCHING ===== */
.view { width: 100%; }
.view[hidden] { display: none !important; }

/* ===== WELCOME (NO TOCAR EL DISEÑO, queda como antes) ===== */
.view-welcome {
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  position: relative;
  overflow: hidden;
}
.welcome-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(234,179,8,0.20), transparent 60%),
    radial-gradient(circle at 70% 90%, rgba(59,130,246,0.18), transparent 60%),
    linear-gradient(180deg, #061429 0%, #0a1f3d 100%);
  z-index: 0;
}
.welcome-content {
  position: relative; z-index: 1;
  flex: 1;
  padding: max(28px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}
.welcome-brand {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px;
}
.welcome-logo-icon { font-size: 38px; }
.welcome-brand-title {
  margin: 0; font-size: 28px; font-weight: 900;
  letter-spacing: 0.3px; line-height: 1; color: #fff;
}
.welcome-brand-sub {
  font-size: 12px; color: rgba(255,255,255,0.7);
  font-weight: 600; margin-top: 2px;
}
.welcome-hero {
  width: 100%; max-width: 320px;
  margin: 12px auto 4px;
}
.welcome-card-img {
  width: 100%; height: auto;
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}
.welcome-card {
  width: 100%; aspect-ratio: 3/4;
  background: linear-gradient(135deg, #ffc832, #f59e0b);
  border-radius: 18px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  color: #000;
  font-weight: 800;
}
.welcome-card-decor {
  position: absolute; top: 12px; right: 14px;
  font-size: 28px; font-weight: 900;
  color: rgba(0,0,0,0.4);
}
.welcome-card-photo { font-size: 84px; }
.welcome-card-strip {
  margin-top: auto;
  width: 100%;
  background: rgba(0,0,0,0.15);
  border-radius: 0 0 18px 18px;
  padding: 10px 14px;
  text-align: left;
}
.welcome-card-name { font-size: 16px; font-weight: 900; letter-spacing: 1px; }
.welcome-card-meta { font-size: 11px; opacity: 0.7; }
.welcome-title {
  margin: 4px 0 0;
  font-size: 22px; font-weight: 800;
  color: #fff; line-height: 1.2;
}
.welcome-cta {
  width: 100%; max-width: 320px;
  background: #fff;
  color: #1f2937;
  border: 0;
  padding: 14px 18px;
  border-radius: 16px;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  transition: transform 0.12s, box-shadow 0.12s;
}
.welcome-cta:active { transform: translateY(1px) scale(0.99); }
.welcome-tagline {
  color: rgba(255,255,255,0.65);
  font-size: 13px; line-height: 1.4;
  margin: 0;
  max-width: 280px;
}

/* ===== DASHBOARD ===== */
.dash-container {
  max-width: 540px;
  margin: 0 auto;
  padding: 18px 16px max(24px, env(safe-area-inset-bottom)) 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.dash-brand {
  display: flex; align-items: center; gap: 10px;
}
.dash-logo-box {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-on-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(234,179,8,0.30);
}
.dash-logo-icon { font-size: 18px; }
.dash-brand-text { line-height: 1.05; }
.dash-brand-title {
  margin: 0; font-size: 16px; font-weight: 900;
  letter-spacing: 0.2px; text-transform: uppercase;
}
.dash-brand-sub {
  font-size: 10px; font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.18em; text-transform: uppercase;
  display: block; margin-top: 2px;
}
.dash-header-actions {
  display: flex; gap: 8px;
}
.round-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, transform 0.12s;
}
.round-btn:active { transform: scale(0.92); }
.round-btn-icon { font-size: 16px; }
.round-btn-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px; font-weight: 900;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-deep);
  line-height: 1;
}
.avatar-btn {
  background: var(--bg-card);
  overflow: hidden;
}
.avatar-initial {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 900; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0;
}
.avatar-img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* Banner de invitaciones */
.invitation-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.10));
  border: 1px solid rgba(16,185,129,0.35);
  color: #34d399;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  text-align: left;
  width: 100%;
}
.invitation-banner-icon { font-size: 18px; }
.invitation-banner-text { flex: 1; font-weight: 600; }
.invitation-banner-cta {
  font-size: 11px;
  font-weight: 800;
  background: rgba(16,185,129,0.25);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

/* Stats card grande */
.dash-stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.dash-stats-card::before {
  content: "";
  position: absolute;
  top: -32px; right: -32px;
  width: 96px; height: 96px;
  background: var(--accent);
  opacity: 0.10;
  filter: blur(40px);
  border-radius: 50%;
}
.dash-ring {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
}
.ring-svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.ring-bg-circle {
  fill: transparent;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 6;
}
.ring-fg-circle {
  fill: transparent;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.ring-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  line-height: 1;
}
.ring-text strong {
  font-size: 18px; font-weight: 900;
}
.ring-text span {
  font-size: 7px; font-weight: 900;
  color: var(--text-mute);
  letter-spacing: 0.2em;
  margin-top: 3px;
  text-transform: uppercase;
}
.dash-stats-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 6px;
  padding: 0 4px;
}
.stat-box {
  flex: 1; text-align: center;
}
.stat-val {
  display: block;
  font-size: 22px; font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.stat-val.stat-dim { color: var(--text-dim); }
.stat-val.stat-blue { color: var(--blue); }
.stat-lbl {
  display: block;
  margin-top: 6px;
  font-size: 7px; font-weight: 900;
  color: var(--text-mute);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.stat-divider {
  width: 1px; height: 22px;
  background: var(--border);
}

/* Grid 2x2 de botones grandes */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dash-btn {
  padding: 16px 12px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: transform 0.12s, box-shadow 0.12s;
}
.dash-btn:active { transform: translateY(1px) scale(0.99); }
.dash-btn h3 {
  margin: 0;
  font-size: 14px; font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
.dash-btn p {
  margin: 0;
  font-size: 7px; font-weight: 900;
  color: var(--text-mute);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.dash-btn-icon {
  font-size: 18px;
  display: block;
  opacity: 0.9;
}
.dash-btn-primary {
  background: var(--accent);
  color: var(--accent-on-accent);
  border-color: transparent;
}
.dash-btn-primary p {
  color: rgba(0,0,0,0.5);
}
.dash-btn-primary[disabled],
.dash-btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.dash-secondary-link {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  padding: 12px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 700;
  text-align: center;
  margin-top: 2px;
}

/* ===== ALBUM VIEW (circulitos) ===== */
.alb-header {
  display: flex; align-items: center;
  padding: 18px 18px 8px;
  gap: 12px;
}
.alb-back { flex-shrink: 0; }
.alb-title {
  flex: 1;
  margin: 0;
  font-size: 18px; font-weight: 800;
}
.alb-badge {
  font-size: 10px; font-weight: 800;
  color: var(--accent-text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.alb-search-row {
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alb-search-box {
  flex: 1;
  position: relative;
}
.alb-search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px 10px 36px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.alb-search-box input:focus { border-color: var(--accent); }
.alb-search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-mute);
}
.alb-clear {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 12px;
  padding: 4px 8px;
}
.alb-select {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
}

.alb-pills {
  display: flex;
  gap: 8px;
  padding: 8px 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.alb-pills::-webkit-scrollbar { display: none; }
.alb-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
  transition: all 0.15s;
}
.alb-pill.active {
  background: var(--accent);
  color: var(--accent-on-accent);
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(234,179,8,0.30);
}

.alb-team-row {
  display: flex;
  gap: 10px;
  padding: 10px 18px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.alb-team-row::-webkit-scrollbar { display: none; }
.alb-team-chip {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.15s;
}
.alb-team-chip.active {
  opacity: 1;
}
.alb-team-chip-inner {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.alb-team-chip.active .alb-team-chip-inner {
  transform: scale(1.05);
  border-color: var(--accent);
}
.alb-team-chip-code {
  font-size: 16px; font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  z-index: 1;
}
.alb-team-chip-flag {
  position: absolute;
  top: 2px; right: 4px;
  font-size: 10px;
  z-index: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.4));
}
.alb-team-chip-bar {
  width: 52px;
  height: 3px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
}
.alb-team-chip-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.5s;
}

.alb-grid-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px max(120px, env(safe-area-inset-bottom));
}
.alb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
  justify-items: center;
}
@media (min-width: 480px) {
  .alb-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 640px) {
  .alb-grid { grid-template-columns: repeat(6, 1fr); }
}

.circle-sticker {
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  -webkit-user-select: none;
  user-select: none;
}
.circle-btn {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 4px dashed rgba(255,255,255,0.06);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mute);
  font-size: 11px; font-weight: 900;
  letter-spacing: -0.2px;
  transition: transform 0.12s, border-color 0.18s, background 0.18s, color 0.18s;
}
@media (min-width: 480px) {
  .circle-btn { width: 72px; height: 72px; font-size: 12px; }
}
.circle-btn:active { transform: scale(0.92); }
.circle-sticker.have .circle-btn {
  background: var(--bg-elev);
  border: 4px solid var(--accent);
  color: var(--accent-text);
  box-shadow: 0 6px 18px rgba(234,179,8,0.18);
}
.circle-sticker.have .circle-btn::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.04;
  pointer-events: none;
}
.circle-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--blue);
  color: #fff;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
  font-size: 10px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
  animation: pop 0.25s ease-out;
}
@keyframes pop {
  0% { transform: scale(0.4); }
  100% { transform: scale(1); }
}
.circle-label {
  font-size: 9px; font-weight: 900;
  color: var(--text-mute);
  letter-spacing: -0.2px;
  text-transform: uppercase;
  text-align: center;
  width: 68px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
@media (min-width: 480px) {
  .circle-label { width: 76px; }
}
.circle-sticker.have .circle-label {
  color: var(--text-dim);
}

/* Solo-lectura: opacar todos los circulitos sin desactivarlos */
.alb-grid.readonly .circle-btn { cursor: not-allowed; }

/* ===== SCAN VIEW (mantengo casi tal cual) ===== */
.view-scan {
  display: flex; flex-direction: column;
  min-height: 100dvh;
  background: #000;
}
.scan-viewport {
  position: relative;
  flex: 1;
  background: #000;
  overflow: hidden;
  min-height: 50vh;
}
#cam-video {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
}
.scan-overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 18px;
}
.scan-frame {
  width: min(78vw, 360px);
  aspect-ratio: 3 / 4;
  max-height: 70vh;
  border: 3px solid var(--accent);
  border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
}
.scan-status {
  margin-top: 12px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  pointer-events: none;
}
.scan-status.warn  { background: rgba(255,200,50,0.85); color: #000; }
.scan-status.error { background: rgba(255,77,109,0.85); color: #000; }
.scan-hint {
  position: absolute; bottom: 12px; left: 12px; right: 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  text-align: center;
}
.scan-debug-thumb {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,0.7);
  padding: 6px;
  border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  font-size: 9px;
  color: rgba(255,255,255,0.7);
  pointer-events: none;
}
.scan-debug-thumb .lbl {
  font-weight: 800; letter-spacing: 1px;
}
.scan-debug-thumb canvas {
  background: #000;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
}
.ocr-raw {
  font-size: 9px;
  font-family: ui-monospace, Menlo, monospace;
  max-width: 110px;
  word-break: break-all;
  text-align: center;
}
.scan-controls {
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
}
.scan-feed {
  background: var(--bg-deep);
  max-height: 28vh;
  overflow-y: auto;
  padding: 4px 10px 12px;
}
.feed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  margin-top: 6px;
}
.feed-code { font-weight: 900; color: var(--accent-text); font-family: ui-monospace, Menlo, monospace; }
.feed-status { font-size: 11px; font-weight: 700; }
.feed-undo {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--danger);
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ===== SEARCH ===== */
.search-box {
  padding: 12px 18px;
  display: flex; gap: 8px;
}
.search-box input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
}
.search-result { padding: 12px 18px; }
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.result-card .row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.result-card .row:last-of-type { border-bottom: 0; }
.result-card .actions {
  display: flex; gap: 8px;
  margin-top: 12px;
}
.search-suggestions {
  padding: 16px 18px;
}
.search-suggestions h3 {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-family: ui-monospace, Menlo, monospace;
}

/* ===== BUTTONS GENERICOS ===== */
.bigbtn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px; font-weight: 700;
  width: 100%;
  text-align: center;
  margin-top: 8px;
  transition: transform 0.1s;
}
.bigbtn:active { transform: scale(0.99); }
.bigbtn.primary {
  background: var(--accent);
  color: var(--accent-on-accent);
  border-color: transparent;
}
.bigbtn.ghost {
  background: transparent;
  color: var(--text-dim);
}
.bigbtn.danger {
  background: rgba(255,77,109,0.12);
  color: var(--danger);
  border-color: rgba(255,77,109,0.30);
}
.bigbtn[disabled] {
  opacity: 0.4; pointer-events: none;
}

/* ===== MODAL FRAMEWORK ===== */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal[hidden] { display: none !important; }
.modal-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px 28px 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 8px 0 max(12px, env(safe-area-inset-bottom));
}
.modal-sheet-sm {
  border-radius: 28px;
  width: calc(100% - 32px);
  max-width: 360px;
  margin: 0 16px max(16px, env(safe-area-inset-bottom));
}
@media (min-width: 600px) {
  .modal { align-items: center; padding: 24px; }
  .modal-sheet { border-radius: 28px; max-width: 480px; }
  .modal-sheet-sm { margin: 0; }
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px 8px;
}
.modal-head h3 {
  margin: 0;
  font-size: 22px; font-weight: 900;
}
.modal-x {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 22px;
  padding: 6px 10px;
}
.modal-body {
  padding: 8px 22px 16px;
  overflow-y: auto;
  flex: 1;
}

/* ===== ALBUM MANAGER ===== */
.album-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.album-row {
  display: flex; gap: 8px;
}
.album-row-main {
  flex: 1;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
}
.album-row-main.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.album-row-name {
  display: flex; align-items: center; gap: 10px;
}
.album-row-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
}
.album-row-name.own .album-row-dot { background: var(--accent); }
.album-row-name strong {
  font-size: 14px; font-weight: 800;
}
.album-row-name small {
  display: block;
  font-size: 10px;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 2px;
}
.album-row-meta {
  font-size: 10px;
  color: var(--text-mute);
  font-weight: 700;
}
.album-row-delete {
  background: rgba(255,77,109,0.10);
  color: var(--danger);
  border: 1px solid rgba(255,77,109,0.20);
  border-radius: 14px;
  width: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.album-create-form {
  display: flex; gap: 8px;
  margin-top: 4px;
}
.album-create-form input {
  flex: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}
.album-create-form .bigbtn { margin-top: 0; width: auto; padding: 12px 20px; }

.invitations-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.invitations-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.invitation-item {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.invitation-info { font-size: 13px; }
.invitation-info small {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.invitation-actions { display: flex; gap: 6px; }
.invitation-actions .bigbtn { margin-top: 0; flex: 1; padding: 10px; font-size: 12px; }

/* ===== SETTINGS MODAL ===== */
.setting-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}
.setting-block h4 {
  margin: 0 0 10px;
  font-size: 14px; font-weight: 800;
}
.setting-block .setting-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin: 4px 0 8px;
  line-height: 1.4;
}
.setting-block input[type="password"],
.setting-block input[type="email"],
.setting-block input[type="text"] {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 6px;
}
.account-block .account-user {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.account-block #account-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue);
}
.account-info strong { font-size: 14px; }
.account-info small { font-size: 11px; color: var(--text-dim); display: block; }

.share-form { display: flex; flex-direction: column; gap: 6px; }
.share-form select {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}
.share-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 6px;
}
.share-info strong { font-size: 13px; }
.share-info small { display: block; font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.share-actions { display: flex; gap: 6px; align-items: center; }
.share-perm-select {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 6px;
}
.share-revoke {
  background: rgba(255,77,109,0.10);
  border: 0;
  color: var(--danger);
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 14px;
}

/* ===== THEME PICKER ===== */
.theme-list { display: flex; flex-direction: column; gap: 10px; }
.theme-option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text);
  text-align: left;
  transition: border-color 0.15s;
}
.theme-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.theme-info strong { display: block; font-size: 14px; font-weight: 800; }
.theme-info small { font-size: 11px; color: var(--text-dim); }
.theme-swatch {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.20);
  flex-shrink: 0;
}
.theme-swatch-modern    { background: #0A0E1A; }
.theme-swatch-classic   { background: #1a472a; }
.theme-swatch-argentina { background: #75AADB; }
.theme-swatch-gold      { background: #1a1300; }

/* ===== MANUAL ENTRY MODAL ===== */
.manual-head { text-align: center; margin-bottom: 18px; }
.manual-head h3 { margin: 0; font-size: 28px; font-weight: 900; color: var(--accent-text); }
.manual-head p { margin: 6px 0 0; font-size: 13px; color: var(--text-dim); }
.manual-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: 0 12px;
  margin-bottom: 18px;
}
.manual-btn {
  width: 60px; height: 60px;
  border-radius: 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 28px; font-weight: 900;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s, background 0.15s;
}
.manual-btn:active { transform: scale(0.92); }
.manual-minus { color: var(--danger); }
.manual-plus { color: var(--green); }
.manual-count {
  font-size: 52px;
  font-weight: 900;
  color: var(--accent-text);
  text-align: center;
  flex: 1;
  letter-spacing: -2px;
}

/* ===== STICKER DETAIL MODAL ===== */
#sticker-modal .modal-body .row {
  display: flex; justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 13px; font-weight: 700;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  animation: toastIn 0.2s ease-out;
}
.toast.success { background: rgba(16,185,129,0.95); color: #fff; border-color: rgba(16,185,129,0.6); }
.toast.error   { background: rgba(255,77,109,0.95); color: #fff; border-color: rgba(255,77,109,0.5); }
.toast.warn    { background: rgba(234,179,8,0.95); color: #000; }
@keyframes toastIn {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ===== ANIMACION OVERLAY GRANDE SCAN ===== */
@keyframes bigPop {
  0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  60%  { transform: translate(-50%, -50%) scale(1.06); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.safe-bottom { height: var(--safe-bottom); }
