@import url('https://fonts.googleapis.com/css2?family=Fjalla+One&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

/*
 * "Estación del intendente, después de la batalla."
 * Canvas: ironwood. Surfaces: pergamino oscuro. Bordes: bronce envejecido (low alpha).
 * Acentos: sello de cera (rojo profundo), musgo (aprobado), torcha (warning), lapis (élite).
 * Tipografía: Fjalla One (display condensado), DM Sans (body), JetBrains Mono (data tabular).
 */
:root {
  /* Surfaces — ironwood + pergamino, brightness creciendo en saltos sutiles */
  --canvas:        #0d0a07;   /* base, deep ironwood */
  --bg:            #0d0a07;   /* alias para componentes legacy */
  --surface-1:     #16110c;   /* cards, paneles */
  --bg-card:       #16110c;   /* alias legacy */
  --surface-2:     #1d1812;   /* dropdowns, hover, raised */
  --bg-hover:      #1d1812;   /* alias legacy */
  --surface-3:     #251f17;   /* modals, popovers */

  /* Borders — bronce con alpha creciendo */
  --border-soft:   rgba(184, 153, 112, 0.07);
  --border:        rgba(184, 153, 112, 0.14);
  --border-mid:    rgba(184, 153, 112, 0.22);
  --border-strong: rgba(212, 183, 138, 0.40);

  /* Brass scale — para divisores, sellos, énfasis */
  --brass-dim:     #6b563d;
  --brass:         #8b7355;
  --brass-bright:  #ba9970;
  --brass-gold:    #d4b78a;

  /* Ink hierarchy — texto */
  --ink:           #f0e4d0;   /* primary */
  --text:          #f0e4d0;   /* alias legacy */
  --ink-2:         #b8a78f;   /* secondary */
  --ink-3:         #8a7c66;   /* tertiary / metadata */
  --text-muted:    #8a7c66;   /* alias legacy */
  --ink-mute:      #5e5240;   /* disabled, placeholder */

  /* Semantic — desaturados para no gritar */
  --seal:          #962a2a;   /* sello de cera, primary action + danger */
  --seal-hover:    #ad3333;
  --seal-soft:     rgba(150, 42, 42, 0.18);
  --moss:          #5d7a3f;   /* aprobado, listo */
  --moss-bright:   #84a35e;
  --moss-soft:     rgba(93, 122, 63, 0.18);
  --ember:         #c47930;   /* en progreso, warning */
  --ember-soft:    rgba(196, 121, 48, 0.18);
  --lapis:         #5b7eaa;   /* élite, T8, info */
  --lapis-soft:    rgba(91, 126, 170, 0.18);

  /* Aliases legacy mapeados al nuevo sistema */
  --accent:        var(--seal);
  --accent-hover:  var(--seal-hover);
  --green:         var(--moss-bright);
  --yellow:        var(--ember);
  --red:           var(--seal-hover);
  --orange:        var(--ember);

  /* Tier seals — un hue por tier, inspirado en las ciudades de Albion */
  --tier-4:        #4a6b3a;   /* Lymhurst — verde */
  --tier-5:        #a14a30;   /* Bridgewatch — rojo */
  --tier-6:        #3d5e7e;   /* Martlock — azul */
  --tier-7:        #6b4a73;   /* Thetford — púrpura */
  --tier-8:        #b88f3c;   /* Maestro — oro */

  /* Type stacks */
  --font-display:  'Fjalla One', 'Oswald', 'Impact', sans-serif;
  --font-body:     'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', 'Consolas', monospace;

  /* Spacing scale (4px base, lifted to 8 for primary rhythm) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-8:  48px;
  --space-10: 64px;

  /* Radius — chico, este es un tool denso */
  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 10px;
}

body {
  font-family: var(--font-body);
  font-feature-settings: 'cv11' 1, 'ss01' 1;
  background: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;          /* Fjalla One es display, no necesita 700 */
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
}

/* Números y datos en mono tabular para alineación */
.num, .data, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ─── Scrollbars ───
 * Slim, bronce envejecido. Aplica a todo el documento y elementos con overflow.
 * WebKit (Chrome/Edge/Safari) + Firefox.
 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--brass-dim) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--brass-dim);
  border-radius: 10px;
  border: 2px solid var(--canvas);    /* da el efecto de "thumb mas chico" con respiro */
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--brass);
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

.container { max-width: 1280px; margin: 0 auto; padding: var(--space-5) var(--space-5) var(--space-8); }

/* App shell logueado: full-bleed (sin max-width). El sidebar se pega al borde izquierdo. */
#app-shell.has-sidebar { max-width: none; padding: 0; }
#app-shell.has-sidebar > header { padding: var(--space-5) var(--space-6) var(--space-4); margin-bottom: 0; }
/* Banner del gremio: full-bleed (sin margenes laterales). Contenido respeta padding interno. */
#app-shell.has-sidebar > #dashboard-section > #guild-banner {
  margin: 0 0 var(--space-5);
  border-radius: 0;
  border-left: none;
  border-right: none;
  padding: var(--space-5) var(--space-6);
}
#app-shell.has-sidebar > #dashboard-section > .app-layout,
#app-shell.has-sidebar > #dashboard-section > .saas-layout {
  padding: 0 var(--space-6) var(--space-8) 0;       /* sin padding-left: la sidebar ocupa el borde */
  gap: var(--space-6);
  align-items: stretch;
  min-height: calc(100vh - 220px);
}
#app-shell.has-sidebar > #dashboard-section > .app-layout > .sidebar,
#app-shell.has-sidebar > #dashboard-section > .saas-layout > .sidebar {
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface-1);
  padding: var(--space-5) var(--space-3);
  position: sticky;
  top: 0;
  height: 100%;
  align-self: start;
  min-height: calc(100vh - 220px);
}

/* ─── Header (top banner) ───
 * Banner-style: nombre de la app en display condensada, divisor hairline de bronce.
 */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 0 var(--space-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
  position: relative;
}
header > div:first-child { display: flex; flex-direction: column; gap: 4px; }
/* App brand: logo a la izquierda, titulo+subtitulo apilados a la derecha.
   Usamos selector mas especifico que el `:first-child` para ganarle por especificidad. */
header > div.app-brand:first-child,
header > div.app-brand { flex-direction: row !important; align-items: center; gap: 14px; }
header > div.app-brand > div { display: flex; flex-direction: column; gap: 4px; }
/* Filete de bronce sutil bajo el divisor — el detalle distintivo */
header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 64px;
  height: 1px;
  background: var(--brass-bright);
  opacity: 0.55;
}

header h1 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  letter-spacing: 0.04em;
  line-height: 1;
}
header .subtitle {
  color: var(--ink-3);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── Search ─── */
.search-box {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.search-box input, .search-box select, .modal-input, input[type="text"], input[type="password"], input[type="number"], select {
  background: var(--canvas);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input:focus, .search-box select:focus, .modal-input:focus,
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--brass-bright);
  box-shadow: 0 0 0 3px rgba(186, 153, 112, 0.10);
}

.search-box input { flex: 1; }

::placeholder { color: var(--ink-mute); }

/* ─── Buttons ─── */
button {
  background: var(--seal);
  color: var(--ink);
  border: 1px solid transparent;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
  line-height: 1.2;
}
button:hover { background: var(--seal-hover); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(150, 42, 42, 0.30); }

button.secondary {
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--ink-2);
}
button.secondary:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--ink); }

button.ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-2);
}
button.ghost:hover { color: var(--ink); background: var(--surface-2); }

button.success { background: var(--moss); }
button.success:hover { background: var(--moss-bright); }
button.warning { background: var(--ember); color: #1a1209; }
button.warning:hover { filter: brightness(1.1); }
button.danger { background: var(--seal); }
button.danger:hover { background: var(--seal-hover); }

/* ─── Tabs ─── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;          /* ocultar scrollbar en Firefox */
}
.tabs::-webkit-scrollbar { display: none; }  /* ocultar en WebKit */

.tab {
  padding: 12px 18px;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); background: transparent; }
.tab.active {
  color: var(--ink);
  border-bottom-color: var(--brass-bright);
}

/* ─── Stat cards ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-4);
  position: relative;
  transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--border-mid); }

.stat-card .label {
  color: var(--ink-3);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  font-family: var(--font-body);
}
.stat-card .value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 400;
  margin-top: var(--space-1);
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.stat-card .value.red    { color: var(--seal-hover); }
.stat-card .value.green  { color: var(--moss-bright); }
.stat-card .value.yellow { color: var(--ember); }

/* ─── Tables ─── */
.table-wrap {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-5);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
}
.table-header h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
}

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  padding: var(--space-3) var(--space-5);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-family: var(--font-body);
  background: var(--canvas);
}

td {
  padding: var(--space-3) var(--space-5);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-2);
}
td strong { color: var(--ink); font-weight: 600; }

tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }

/* ─── TierSeal — la signature del producto ─── */
/* Reemplaza los pills "T8 .2" por un sello circular con anillo de bronce.
 * Se usa donde sea que aparezca un tier: deaths, inventory, items needed, embos, plan compra.
 */
.tier-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--brass);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.04);
  position: relative;
  flex-shrink: 0;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.tier-seal.t-4 { background: var(--tier-4); }
.tier-seal.t-5 { background: var(--tier-5); }
.tier-seal.t-6 { background: var(--tier-6); }
.tier-seal.t-7 { background: var(--tier-7); }
.tier-seal.t-8 { background: var(--tier-8); border-color: var(--brass-gold); color: #1a1209; text-shadow: 0 1px 0 rgba(255,255,255,0.18); }
.tier-seal .ench {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: var(--canvas);
  color: var(--brass-gold);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brass);
  line-height: 1;
}

/* Compat: tags antiguos .tier .tier-N — se reestilizan ahora como mini-pills sutiles */
.tier {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  border: 1px solid var(--border-mid);
  background: var(--surface-2);
  color: var(--ink-2);
}
.tier-4 { background: rgba(74, 107, 58, 0.15);  color: #9ec88a; border-color: rgba(74, 107, 58, 0.40); }
.tier-5 { background: rgba(161, 74, 48, 0.15);  color: #d99270; border-color: rgba(161, 74, 48, 0.40); }
.tier-6 { background: rgba(61, 94, 126, 0.15);  color: #88aed4; border-color: rgba(61, 94, 126, 0.40); }
.tier-7 { background: rgba(107, 74, 115, 0.15); color: #c197cf; border-color: rgba(107, 74, 115, 0.40); }
.tier-8 { background: rgba(184, 143, 60, 0.15); color: var(--brass-gold); border-color: rgba(184, 143, 60, 0.45); }

.enchant { color: var(--ember); font-weight: 600; font-family: var(--font-mono); }

/* ─── Status pills (badges) — bordes hairline + bg translúcido, no pills sólidos ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-body);
  border: 1px solid transparent;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-pending   { background: var(--ember-soft); color: var(--ember); border-color: rgba(196,121,48,0.35); }
.badge-ready     { background: var(--lapis-soft); color: var(--lapis); border-color: rgba(91,126,170,0.35); }
.badge-delivered { background: var(--moss-soft); color: var(--moss-bright); border-color: rgba(93,122,63,0.40); }
.badge-danger    { background: var(--seal-soft); color: var(--seal-hover); border-color: rgba(150,42,42,0.40); }
.badge-muted     { background: var(--surface-2); color: var(--ink-3); border-color: var(--border); }
.badge-received  { background: var(--moss-soft); color: var(--moss-bright); border-color: rgba(93,122,63,0.40); }
.badge-problem   { background: var(--seal-soft); color: var(--seal-hover); border-color: rgba(150,42,42,0.45); }
/* Fila de reequipo listo que el jugador marco como NO recibido */
tr.row-problem > td { background: rgba(150,42,42,0.10); }

/* ─── Brass divider (ornamento recurrente) ─── */
.brass-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass) 30%, var(--brass) 70%, transparent);
  opacity: 0.4;
  margin: var(--space-5) 0;
}

/* ─── Banner del gremio (arriba del dashboard) ─── */
.guild-banner {
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-5);
  margin-bottom: var(--space-5);
  position: relative;
  overflow: hidden;
}
.guild-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brass-dim), var(--brass-bright) 40%, var(--brass-bright) 60%, var(--brass-dim));
  opacity: 0.6;
}
.guild-banner h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-transform: uppercase;
  line-height: 1;
}
.guild-banner .info p {
  color: var(--ink-3);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ─── Resultados de búsqueda de gremios ─── */
.guild-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.guild-result {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.guild-result:hover {
  border-color: var(--brass);
  background: var(--surface-2);
}
.guild-result .name { font-weight: 600; color: var(--ink); }
.guild-result .meta { color: var(--ink-3); font-size: 0.8rem; }

/* ─── Loading ─── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-mid);
  border-top-color: var(--brass-bright);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-8);
  color: var(--ink-3);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* ─── Sections ─── */
.section { display: none; }
.section.active { display: block; }

/* ─── Equipment list (en death detail) ─── */
.equip-list { display: flex; flex-wrap: wrap; gap: 6px; }

.equip-item {
  background: var(--canvas);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}
.equip-item img { border-radius: 3px; }

/* ─── Period selector (segmented) ─── */
.period-selector {
  display: inline-flex;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  gap: 0;
}
.period-btn {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-body);
  background: transparent;
  border: none;
  color: var(--ink-3);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.12s, color 0.12s;
}
.period-btn:hover { color: var(--ink); background: transparent; }
.period-btn.active {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--border-mid);
}

/* ─── Empty states ─── */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-5);
  color: var(--ink-3);
}
.empty-state h3 {
  font-family: var(--font-display);
  margin-bottom: var(--space-2);
  color: var(--ink-2);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

/* ─── Modal ─── */
/* El overlay scrollea (no el modal), asi los dropdowns absolutos del modal pueden
 * "escapar" sin causar doble scrollbar. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 3, 0.78);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
  padding: var(--space-6) var(--space-4);
}

.modal, .modal-content {
  background: var(--surface-3);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  width: 100%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(184,153,112,0.05);
  margin: auto 0;
}
.modal::before, .modal-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-bright) 50%, transparent);
  opacity: 0.4;
}

.modal h3, .modal-content h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-4);
  color: var(--ink);
}

.modal label, .modal-content label {
  display: block;
  color: var(--ink-3);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: var(--space-3);
}

.modal textarea {
  width: 100%;
  background: var(--canvas);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 10px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-body);
  resize: vertical;
  min-height: 60px;
}
.modal textarea:focus { border-color: var(--brass-bright); outline: none; }

.modal-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-soft);
}

.modal-input { width: 100%; margin-top: 4px; }

/* ─── Chips de roles (config Discord) ─── */
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.role-chips:empty { display: none; }
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: 14px;
  padding: 3px 6px 3px 10px;
  font-size: 0.8rem;
  color: var(--ink);
}
.role-chip button {
  all: unset;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 2px;
}
.role-chip button:hover { color: var(--seal-hover); }

/* Boton "Añadir bot al servidor" (estilo Discord) */
.btn-discord-invite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #5865f2;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 16px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn-discord-invite:hover { background: #4752c4; }

/* ─── Modal de eliminar CTA ─── */
.del-cta-lead {
  color: var(--ink);
  font-size: 0.95rem;
  margin-bottom: var(--space-4);
}
.del-cta-warn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--seal-soft);
  border: 1px solid rgba(150, 42, 42, 0.35);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: var(--space-4);
  color: var(--ink-2);
  font-size: 0.85rem;
  line-height: 1.55;
}
.del-cta-warn strong { color: var(--ink); }
.del-cta-warn-icon {
  color: var(--seal-hover);
  font-size: 1.05rem;
  line-height: 1.3;
  flex-shrink: 0;
}
/* Mayor especificidad que `.modal label` para anular el uppercase global */
.modal label.del-cta-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.modal label.del-cta-check:hover {
  border-color: var(--border-strong);
  background: var(--surface-1);
}
.del-cta-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--seal);
}
.del-cta-check-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.del-cta-check-title {
  color: var(--ink);
  font-weight: 600;
}
.del-cta-check-help {
  color: var(--ink-3);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ─── Vista previa del modal de crear CTA ─── */
.cta-preview {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid var(--border);
  background: var(--canvas);
  min-height: 40px;
  display: flex;
  align-items: center;
}
.cta-preview.ok { border-color: rgba(74, 124, 89, 0.4); color: var(--brass-gold); }
.cta-preview.warn { border-color: rgba(150, 42, 42, 0.4); color: var(--seal-hover); }
.cta-preview.now { border-color: var(--border-mid); color: var(--brass-bright); }

/* ─── Paperdoll (vista de reequipo estilo Albion) ─── */
.paperdoll-wrap {
  padding: 22px 18px;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(ellipse at center top, rgba(184,153,112,0.07), transparent 60%),
    radial-gradient(ellipse at center bottom, rgba(0,0,0,0.18), transparent 70%);
}
.paperdoll-skeleton {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 116px);
  grid-template-rows: repeat(3, auto);
  gap: 14px 18px;
  max-width: 100%;
}
/* Linea sutil que conecta cabeza-pecho-pies (vertical) y manos-pecho (horizontal) */
.paperdoll-skeleton::before,
.paperdoll-skeleton::after {
  content: '';
  position: absolute;
  background: linear-gradient(var(--dir, 180deg), transparent, rgba(184,153,112,0.18) 30%, rgba(184,153,112,0.18) 70%, transparent);
  pointer-events: none;
  z-index: 0;
}
.paperdoll-skeleton::before {
  --dir: 180deg;
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
}
.paperdoll-skeleton::after {
  --dir: 90deg;
  left: 12%;
  right: 12%;
  top: 50%;
  height: 1px;
  transform: translateY(-50%);
}
.paperdoll-skeleton > * { position: relative; z-index: 1; }

.pd-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 8px;
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(0,0,0,0.18));
  border: 1px solid var(--border-soft, var(--border));
  border-radius: 10px;
  min-height: 116px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 2px 6px rgba(0,0,0,0.25);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.pd-cell:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 6px 14px rgba(0,0,0,0.4);
  border-color: rgba(184,153,112,0.4);
}
.pd-empty {
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 6px, transparent 6px 12px);
  border: 1px dashed var(--border-soft, var(--border));
  color: var(--ink-3, var(--text-muted));
  font-size: 0.7rem;
  justify-content: center;
  min-height: 116px;
  opacity: 0.55;
  box-shadow: none;
}
.pd-empty:hover { transform: none; box-shadow: none; }
.pd-empty-mark { font-size: 1.4rem; opacity: 0.35; line-height: 1; }
.pd-empty-tag {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.7;
}

.pd-icon-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-icon-frame {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.06), rgba(0,0,0,0.45) 70%);
  border: 1px solid rgba(184,153,112,0.25);
  box-shadow: inset 0 0 18px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.4);
  overflow: hidden;
}
.pd-icon-frame img {
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}
/* Quality colors (Albion): 1 normal · 2 good · 3 outstanding · 4 excellent · 5 masterpiece */
.pd-icon-frame.q-2 { border-color: rgba(110,200,120,0.7); box-shadow: inset 0 0 18px rgba(0,0,0,0.55), 0 0 0 1px rgba(110,200,120,0.25); }
.pd-icon-frame.q-3 { border-color: rgba(96,170,255,0.75); box-shadow: inset 0 0 18px rgba(0,0,0,0.55), 0 0 0 1px rgba(96,170,255,0.25); }
.pd-icon-frame.q-4 { border-color: rgba(186,120,255,0.8);  box-shadow: inset 0 0 18px rgba(0,0,0,0.55), 0 0 0 1px rgba(186,120,255,0.3); }
.pd-icon-frame.q-5 { border-color: rgba(255,180,80,0.9);   box-shadow: inset 0 0 18px rgba(0,0,0,0.55), 0 0 12px rgba(255,180,80,0.25); }
.pd-icon-frame-assigned {
  border-color: var(--brass-bright, #b89970);
  box-shadow: inset 0 0 18px rgba(0,0,0,0.6), 0 0 0 1px var(--brass-bright, #b89970), 0 0 14px rgba(184,153,112,0.35);
}

.pd-tier-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  transform: scale(0.85);
  transform-origin: bottom right;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.pd-name {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink, var(--text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 108px;
  line-height: 1.15;
}
.pd-name-accent { color: var(--brass-bright, #b89970); }

.pd-slot-label {
  font-family: var(--font-display, inherit);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3, var(--text-muted));
  line-height: 1;
}
.pd-slot-label-accent { color: var(--brass-bright, #b89970); }

.pd-faded { opacity: 0.6; }
.pd-faded:hover { opacity: 0.85; }

/* Cuando hay swap, la tarjeta tiene el mismo tamano pero con tinte bronce y un mini-chip arriba */
.pd-cell-swap {
  background: linear-gradient(160deg, rgba(184,153,112,0.14), rgba(184,153,112,0.03));
  border-color: rgba(184,153,112,0.55);
  box-shadow: inset 0 0 0 1px rgba(184,153,112,0.18), 0 0 12px rgba(184,153,112,0.15);
}
.pd-swap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(184,153,112,0.45);
  color: var(--brass-bright, #b89970);
  margin-top: 2px;
  white-space: nowrap;
}
.pd-swap-from { color: var(--ink-3, var(--text-muted)); text-decoration: line-through; }
.pd-swap-arrow { opacity: 0.7; }
.pd-swap-to { color: var(--brass-bright, #b89970); font-weight: 700; }

/* ─── CTA active card ─── */
.cta-active-card {
  background: linear-gradient(135deg, var(--moss-soft), transparent);
  border: 1px solid rgba(93,122,63,0.45);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cta-active-card .pulse {
  width: 8px; height: 8px;
  background: var(--moss-bright);
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  box-shadow: 0 0 10px var(--moss-bright);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ─── User bar (top header) ─── */
.user-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
}

.role-badge {
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: var(--font-body);
  border: 1px solid transparent;
}
.role-staff       { background: var(--lapis-soft);  color: var(--lapis);        border-color: rgba(91,126,170,0.40); }
.role-guild_admin { background: var(--seal-soft);   color: var(--seal-hover);   border-color: rgba(150,42,42,0.40); }
.role-superadmin  { background: rgba(184,143,60,0.15); color: var(--brass-gold); border-color: rgba(184,143,60,0.45); }
.role-reequipador { background: var(--moss-soft);   color: var(--moss-bright);  border-color: rgba(93,122,63,0.40); }

/* ─── Sidebar layout (panel superadmin / vista densa) ─── */
.saas-layout, .app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-5);
  align-items: start;
}

.sidebar {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-2);
  position: sticky;
  top: var(--space-4);
}

.sidebar-section {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: var(--space-2) var(--space-3) var(--space-2);
  margin-top: var(--space-2);
}
.sidebar-section:first-child { margin-top: 0; }

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 9px var(--space-3);
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  text-align: left;
}
.sidebar-item:hover { background: var(--surface-2); color: var(--ink); }
.sidebar-item.active {
  background: var(--surface-2);
  color: var(--ink);
  border-left-color: var(--brass-bright);
}
.sidebar-item .badge-count {
  background: var(--canvas);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.saas-main {
  min-width: 0;            /* permite que tablas con contenido largo no expandan el grid */
}

@media (max-width: 880px) {
  .saas-layout, .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

/* ─── Suggest list (Albion guild search en create-guild) ─── */
/* Inline en el flujo del modal: el modal crece para contener la lista.
 * Conectada al input por arriba (sin gap, mismo border) y con scroll interno si supera 320px.
 */
.cg-suggest {
  background: var(--canvas);
  border: 1px solid var(--border-mid);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  margin-top: -1px;       /* solapa con el border del input */
}
.cg-suggest .cg-result:last-child { border-bottom: none !important; }
.cg-suggest .cg-result:hover { background: var(--surface-2); }
/* Si la lista esta visible, el input pierde el border-radius inferior para "fundirse" */
.modal-input.cg-search-active {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: var(--border-soft);
}

.role-staff { background: var(--accent); color: white; }
.role-reequipador { background: var(--orange); color: #000; }

/* Player lookup card */
.player-reequip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.player-reequip-card .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.discord-link {
  color: #5865F2;
  text-decoration: none;
  font-size: 0.85rem;
}
.discord-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .container { padding: 12px; }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 16px;
  }
  header h1 { font-size: 1.2rem; }
  header .subtitle { font-size: 0.8rem; }

  #header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px !important;
  }
  #header-actions button { font-size: 0.8rem; padding: 8px 12px; }
  .user-bar { flex-wrap: wrap; font-size: 0.8rem; }

  /* Tabs scroll horizontally on mobile */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: thin;
  }
  .tab {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 0.82rem;
    flex-shrink: 0;
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }
  .stat-card { padding: 12px; }
  .stat-card .value { font-size: 1.4rem; }
  .stat-card .label { font-size: 0.7rem; }

  /* Search box becomes vertical */
  .search-box {
    flex-direction: column;
  }
  .search-box input, .search-box select, .search-box button {
    width: 100%;
  }

  /* Tables scroll horizontally */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table { min-width: 100%; }
  th, td {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  /* Guild banner */
  .guild-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }
  .guild-banner .actions { width: 100%; flex-wrap: wrap; }
  .guild-banner .actions button { flex: 1; min-width: 120px; }

  /* Buying card */
  .buying-card { padding: 14px; }
  .buying-card-header {
    flex-direction: column;
    gap: 8px;
  }
  .buying-card-header .qty {
    font-size: 1.5rem;
    align-self: flex-end;
  }
  .buying-card-body {
    grid-template-columns: 1fr;
  }
  .buying-card .actions {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }
  .buying-card .actions button { flex: 1; }

  /* Modal */
  .modal {
    width: 95%;
    max-height: 90vh;
    padding: 16px;
  }

  /* Equipment list */
  .equip-list { gap: 4px; }
  .equip-item {
    font-size: 0.72rem;
    padding: 3px 6px;
  }
  .equip-item img { width: 22px !important; height: 22px !important; }

  /* Cta review header actions */
  #cta-review-header h3 { display: block !important; }

  /* Reequips grid already responsive */

  /* Pager */
  .pager { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  header h1 { font-size: 1.05rem; }

  /* Hide some less-important columns on very small screens via CSS */
  .hide-on-mobile { display: none !important; }

  /* Smaller buttons */
  button { font-size: 0.85rem; padding: 8px 14px; }
  .tab { font-size: 0.78rem; padding: 7px 10px; }

  /* Smaller cards */
  .player-reequip-card { padding: 12px; }
  .player-reequip-card .header { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* Inventory table especially cramped */
  th, td { padding: 6px 8px; font-size: 0.78rem; }
  .tier { font-size: 0.68rem; padding: 1px 6px; }
}

/* Buying plan cards */
.buying-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
}

.buying-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.buying-card-header .title {
  font-size: 1.05rem;
  font-weight: 600;
}

.buying-card-header .qty {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--red);
}

.buying-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .buying-card-body { grid-template-columns: 1fr; }
}

.buying-option {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.buying-option.best { border-color: var(--green); }
.buying-option .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.buying-option .item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.buying-option .price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--yellow);
}
.buying-option .city {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.buying-option .freshness {
  font-size: 0.75rem;
  margin-top: 4px;
}

.buying-card .actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}

/* Reequips grid */
.reequips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .reequips-grid { grid-template-columns: 1fr; }
}

/* ─── Public portal (per-guild) ─── */
.public-portal {
  min-height: 100vh;
  background: var(--canvas);
  display: flex;
  flex-direction: column;
}
.public-portal-header {
  border-bottom: 1px solid var(--border);
  padding: var(--space-8) var(--space-6) var(--space-5);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(184,143,60,0.05), transparent 60%),
    var(--canvas);
  position: relative;
}
.public-portal-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass-bright), transparent);
}
.public-portal-brand {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.public-portal-brand h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: var(--space-3);
}
.public-portal-brand p {
  color: var(--ink-3);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 6px;
}
.public-portal-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border);
}
.pp-tab {
  padding: 14px 22px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--ink-3);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.pp-tab:hover { color: var(--ink); background: transparent; }
.pp-tab.active { color: var(--ink); border-bottom-color: var(--brass-bright); }
.public-portal-content {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: var(--space-6);
  flex: 1;
}
.public-portal-footer {
  text-align: center;
  padding: var(--space-5);
  border-top: 1px solid var(--border-soft);
  color: var(--ink-mute);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── System banner (anuncios globales) ─── */
.system-banner {
  width: 100%;
  padding: 10px var(--space-6);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 90;
}
.system-banner.severity-info     { background: var(--lapis-soft); color: var(--lapis); border-bottom-color: rgba(91,126,170,0.45); }
.system-banner.severity-warning  { background: var(--ember-soft); color: var(--ember); border-bottom-color: rgba(196,121,48,0.45); }
.system-banner.severity-critical { background: var(--seal-soft); color: var(--seal-hover); border-bottom-color: rgba(150,42,42,0.50); }

/* ─── Auth screen (home cuando no hay sesion) ─── */
/* Centro completo, sin chrome de la app. Tarjeta con detalle de bronce arriba.
 * Sigil: un sello cuadrado con anillo doble — heráldica simplificada.
 */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(184,143,60,0.04), transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(150,42,42,0.05), transparent 60%),
    var(--canvas);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-1);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5) var(--space-5);
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass-bright) 20%, var(--brass-gold) 50%, var(--brass-bright) 80%, transparent);
  opacity: 0.7;
}

.auth-brand {
  text-align: center;
  margin-bottom: var(--space-6);
}

/* Sigil → logo de la app. mix-blend-mode: screen funde el fondo negro puro,
   y la mascara radial difumina los bordes que el blend solo no alcanza a borrar
   (el fondo del PNG no es 100% negro uniforme). */
.auth-sigil {
  width: 320px;
  height: 320px;
  margin: 0 auto;
  background-image: url('/img/logo.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 60% 65% at 50% 50%, #000 55%, rgba(0,0,0,0.4) 75%, transparent 95%);
          mask-image: radial-gradient(ellipse 60% 65% at 50% 50%, #000 55%, rgba(0,0,0,0.4) 75%, transparent 95%);
  filter: drop-shadow(0 0 24px rgba(184,40,55,0.18));
}
.public-portal-brand .auth-sigil {
  width: 360px;
  height: 360px;
}

/* Logo inline en la cabecera del app shell — mismo blend para que se integre con el fondo */
.app-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-brand-logo {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  object-fit: contain;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 55%, rgba(0,0,0,0.4) 75%, transparent 95%);
          mask-image: radial-gradient(circle at 50% 50%, #000 55%, rgba(0,0,0,0.4) 75%, transparent 95%);
  filter: drop-shadow(0 2px 8px rgba(184,40,55,0.25));
}
@media (max-width: 600px) {
  .app-brand-logo { width: 64px; height: 64px; }
}

.auth-brand h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-transform: uppercase;
  line-height: 1;
}
.auth-brand p {
  color: var(--ink-3);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 8px;
}

.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
  margin-top: var(--space-2);
}
.auth-form input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
}
.auth-form button {
  margin-top: var(--space-4);
  padding: 12px;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.auth-error {
  color: var(--seal-hover);
  font-size: 0.82rem;
  background: var(--seal-soft);
  border: 1px solid rgba(150,42,42,0.40);
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-top: var(--space-2);
}
