/* Botón de edición minimalista */
.btn-edit-icon {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.btn-edit-icon:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: rgba(99,102,241,0.15);
}

/* Cuadros de texto redimensionables */
#editModal textarea {
  width: 100%;
  min-height: 150px;
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--radius-sm);
  resize: both; /* <--- Esto permite estirar desde la esquina */
}
/* --- Edición Modal: campos redimensionables --- */
#editModal textarea,
#editModal input[type="text"] {
  resize: vertical;
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
}
:root {
  /* FONDO: 'Void Blue' - Profundo y místico, evita el negro puro */
  --bg-body: #0b0f19;
  
  /* SUPERFICIES: 'Deep Slate' - Para tarjetas, menús y la barra de navegación */
  --bg-surface: #151e2e;
  --bg-surface-hover: #1e293b;

  /* TEXTO: Leíble sin cansar la vista */
  --text-primary: #e2e8f0;  /* Blanco hueso */
  --text-secondary: #94a3b8; /* Gris azulado */

  /* ACENTOS: La 'Magia' y la Acción */
  --primary-color: #6366f1; /* Índigo arcano (Bordes, títulos activos) */
  --accent-color: #fbbf24;  /* Oro/Gnosis (Botón de Lanzar, acciones principales) */
  --accent-hover: #d97706;  /* Oro oscuro para hover */

  /* ESTADOS */
  --border-color: #2d3748; /* Bordes sutiles para separar secciones */
  
  /* Compatibilidad con código existente */
  --bg: #0b0f19;
  --bg-alt: #151e2e;
  --panel: #151e2e;
  --panel-alt: #0b0f19;
  --accent: #6366f1;
  --accent-soft: rgba(99,102,241,0.15);
  --accent-strong: #818cf8;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --danger: #f97373;
  --border: #2d3748;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-soft: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-inner: inset 0 0 0 1px rgba(99,102,241,0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.glow-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.12), transparent 60%);
  top: -120px;
  right: -80px;
  pointer-events: none;
  filter: blur(1px);
  opacity: 0.6;
  z-index: -1;
}

.glow-orb-2 {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251,191,36,0.08), transparent 60%);
  bottom: -140px;
  left: -60px;
  pointer-events: none;
  filter: blur(1px);
  opacity: 0.4;
  z-index: -1;
}

header {
  padding: 18px 32px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title-main {
  font-size: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.title-sub {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.badge-system {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--primary-color);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99,102,241,0.15);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary-color);
  box-shadow: 0 0 12px var(--primary-color);
}

.header-right {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  position: relative; /* Necesario para el dropdown */
  /* permitir que los elementos lleguen al borde derecho sin recortes */
  width: auto;
  max-width: none;
  padding-right: 0;
}

.campaign-name {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn {
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  padding: 7px 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.18s ease-out;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn:hover {
  border-color: var(--primary-color);
  background: var(--bg-surface-hover);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

main {
  flex: 1;
  padding: 18px 24px 24px;
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
  gap: 18px;
}

@media (max-width: 1100px) {
  main {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  padding: 14px 14px 12px;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(99,102,241,0.08), transparent 55%);
  opacity: 0.5;
  pointer-events: none;
  mix-blend-mode: screen;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.panel-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title span {
  color: var(--primary-color);
}

.panel-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--bg-surface-hover);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.tab {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  cursor: pointer;
  background: transparent;
  transition: all 0.16s ease-out;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--text-secondary);
}

.tab.active {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background: rgba(99,102,241,0.15);
  box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}

.tab.active .tab-dot {
  background: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
}

.tab-content {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 10px 10px 8px;
  /* max-height: 520px; */
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--text-secondary) var(--bg-surface);
}

.tab-content::-webkit-scrollbar {
  width: 6px;
}

.tab-content::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

.tab-content::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 999px;
}

.hidden {
  display: none !important;
}

/* Import preview modal styles */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal.hidden { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11,15,25,0.75); backdrop-filter: blur(6px); }
.modal-panel { position: relative; width: min(980px, 96%); max-height: 80vh; overflow: auto; background: var(--bg-surface); border: 1px solid var(--border-color); box-shadow: 0 12px 40px rgba(0,0,0,0.5); border-radius: 12px; padding: 14px; z-index: 61; }
.modal-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.modal-body { color:var(--text); font-size:13px; }
.modal-body .summary { display:flex; gap:18px; flex-wrap:wrap; margin-bottom:12px; }
.modal-body .summary .item { background:rgba(255,255,255,0.02); padding:8px 10px; border-radius:8px; border:1px solid rgba(255,255,255,0.03); min-width:120px }
.modal-body table { width:100%; border-collapse:collapse; margin-bottom:12px; }
.modal-body th { text-align:left; padding:6px; color:var(--accent); font-size:12px; }
.modal-body td { padding:6px; border-top:1px solid rgba(255,255,255,0.03); font-size:13px; color:var(--muted); }
.modal-footer { display:flex; justify-content:flex-end; gap:10px; margin-top:10px; }
.modal .warning { color:var(--danger); font-weight:600; }
.modal .sample { font-family: monospace; background: rgba(255,255,255,0.02); padding:6px; border-radius:6px; display:block; white-space:pre-wrap; max-height:120px; overflow:auto; }

@media (max-width: 768px) {
  #editModal .modal-panel {
    width: 96vw;
    max-width: 96vw;
    max-height: 90vh;
    overflow: auto;
  }
}

/* Diff badges */
.diff-badge { display:inline-flex; align-items:center; justify-content:center; min-width:30px; padding:4px 8px; border-radius:999px; font-size:12px; color:var(--text); background:rgba(255,255,255,0.03); border:1px solid rgba(255,255,255,0.03); }
.diff-badge + .diff-badge { margin-left:6px; }
.diff-new { background: linear-gradient(180deg, rgba(34,197,94,0.08), rgba(34,197,94,0.04)); color:#bbf7d0; border-color: rgba(34,197,94,0.12); }
.diff-updated { background: linear-gradient(180deg, rgba(250,204,21,0.06), rgba(250,204,21,0.03)); color:#fef3c7; border-color: rgba(250,204,21,0.08); }
.diff-unchanged { background: rgba(255,255,255,0.02); color:var(--muted); border-color: rgba(255,255,255,0.02); }
.diff-removed { background: linear-gradient(180deg, rgba(244,63,94,0.04), rgba(244,63,94,0.02)); color:#fecaca; border-color: rgba(244,63,94,0.06); }

.similarity-badge { display:inline-flex; align-items:center; gap:8px; padding:4px 8px; border-radius:999px; font-size:12px; color:var(--text); background:linear-gradient(180deg, rgba(99,102,241,0.06), rgba(99,102,241,0.02)); border:1px solid rgba(99,102,241,0.06); }
.similarity-score { font-weight:700; color: #e6eef8; }
.similarity-meta { color:var(--muted); font-size:12px; }

/* Per-item match action buttons */
.match-action-btn { border-radius: 8px; padding:6px 10px; font-size:13px; background: rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.03); color:var(--muted); cursor:pointer; }
.match-action-btn.active { box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2); color:var(--text); border-color: rgba(56,189,248,0.18); background: linear-gradient(180deg, rgba(56,189,248,0.06), rgba(56,189,248,0.02)); }
.match-decision { font-size:13px; color:var(--muted); }

/* Reader / long-text layout */
.reader-overlay { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(2,6,23,0.78); z-index:1200; padding:28px; }
.reader-overlay.hidden { display:none; }
.reader-panel { width:min(1100px, 96%); max-height:calc(100vh - 80px); background:linear-gradient(180deg, rgba(6,7,11,0.9), rgba(10,12,16,0.95)); border-radius:12px; box-shadow:0 10px 40px rgba(2,6,23,0.6); overflow:hidden; display:flex; flex-direction:column; border:1px solid rgba(255,255,255,0.03); }
.reader-header { position:sticky; top:0; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:18px 22px; border-bottom:1px solid rgba(255,255,255,0.02); background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent); z-index:3; }
.reader-header strong { font-size:18px; color: #f8fafc; }
.reader-content { overflow:auto; padding:28px 36px; line-height:1.85; font-size:18px; font-family: Georgia, 'Times New Roman', serif; color:#e6eef8; -webkit-font-smoothing:antialiased; }
.reader-content p { max-width:66ch; margin-bottom:1.2em; color:#dbeafe; }
.reader-content h1, .reader-content h2, .reader-content h3 { font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; color:#f8fafc; margin-top:0.6em; }
.reader-content::-webkit-scrollbar { height:10px; width:10px; }
.reader-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.04); border-radius:999px; }
.no-scroll { overflow:hidden !important; }

/* Snapshot history panel */
.snapshot-overlay { position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background:linear-gradient(rgba(2,6,23,0.75), rgba(2,6,23,0.85)); z-index:1300; padding:22px; }
.snapshot-overlay.hidden { display:none; }
.snapshot-box { width:min(920px, 96%); max-height:80vh; background:linear-gradient(180deg, rgba(8,10,14,0.96), rgba(10,12,16,0.99)); border-radius:12px; border:1px solid rgba(255,255,255,0.03); box-shadow:0 20px 60px rgba(2,6,23,0.6); overflow:hidden; display:flex; flex-direction:column; }
.snapshot-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:18px 20px; border-bottom:1px solid rgba(255,255,255,0.02); }
.snapshot-header strong { font-size:16px; color:#f8fafc; }
.snapshot-body { overflow:auto; padding:14px 18px; display:block; }
.snapshot-list { display:flex; flex-direction:column; gap:10px; }
.snapshot-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px; border-radius:10px; background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00)); border:1px solid rgba(255,255,255,0.02); }
.snapshot-row .meta { display:flex; flex-direction:column; }
.snapshot-row .meta .label { font-weight:700; color:#f1f5f9; }
.snapshot-row .meta .ts { font-size:12px; color:var(--muted); }
.snapshot-row .actions { display:flex; gap:8px; align-items:center; }
.snapshot-empty { color:var(--muted); padding:18px; text-align:center; }
.snapshot-footer { padding:10px 18px; border-top:1px solid rgba(255,255,255,0.02); background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent); color:var(--muted); font-size:13px; }
.snapshot-box .chip { cursor:pointer; padding:6px 10px; border-radius:8px; border:1px solid rgba(255,255,255,0.03); background:rgba(255,255,255,0.01); color:var(--muted); }
.snapshot-box .chip:hover { background:rgba(255,255,255,0.02); color:var(--text); }

/* Diff viewer inside snapshot panel */
.snapshot-diff-root { display:flex; flex-direction:column; gap:14px; }
.snapshot-diff-top { display:flex; justify-content:space-between; align-items:center; padding:8px 6px; border-bottom:1px solid rgba(255,255,255,0.02); }
.snapshot-diff-meta { display:flex; flex-direction:column; gap:6px; }
.snapshot-diff-summary { display:flex; flex-direction:column; gap:8px; padding:12px 6px; }
.diff-summary-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:8px; border-radius:8px; background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent); border:1px solid rgba(255,255,255,0.02); }
.diff-summary-row .cat { font-weight:700; color:#f8fafc; text-transform:capitalize; }
.diff-summary-row .badges { display:flex; gap:8px; align-items:center; }
.snapshot-diff-details { display:flex; flex-direction:column; gap:12px; padding:8px 6px; }
.diff-cat-block { display:flex; flex-direction:column; gap:10px; padding:8px; border-radius:10px; border:1px solid rgba(255,255,255,0.02); background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.00)); }
.diff-cat-body { display:flex; gap:12px; }
.diff-col { flex:1; min-width:200px; }
.subhead { font-size:12px; color:var(--muted); margin-bottom:8px; }
.item-row { display:flex; flex-direction:column; gap:6px; padding:8px; border-radius:8px; background:rgba(255,255,255,0.01); border:1px solid rgba(255,255,255,0.02); margin-bottom:8px; }
.item-row.added { border-left:3px solid rgba(34,197,94,0.6); }
.item-row.removed { border-left:3px solid rgba(244,63,94,0.6); }
.item-row.updated { border-left:3px solid rgba(250,204,21,0.6); }
.item-label { font-weight:700; color:#e6eef8; }
.item-meta { font-size:12px; color:var(--muted); }
.field-diff-root { display:flex; flex-direction:column; gap:6px; margin-top:8px; }
.field-row { display:grid; grid-template-columns: 160px 1fr 1fr; gap:12px; padding:8px; border-radius:8px; background:linear-gradient(180deg, rgba(255,255,255,0.01), transparent); border:1px solid rgba(255,255,255,0.02); }
.field-name { font-weight:600; color:#e6eef8; }
.field-old { color:#fecaca; opacity:0.9; white-space:pre-wrap; }
.field-new { color:#bbf7d0; white-space:pre-wrap; }
.field-merged { grid-column: 2 / -1; white-space:pre-wrap; color:var(--text); background:rgba(255,255,255,0.02); padding:10px; border-radius:8px; border:1px solid rgba(255,255,255,0.02); }
.field-merged-fallback { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.diff-removed-inline { background: rgba(244,63,94,0.06); color:#fecaca; text-decoration: line-through; padding:0 2px; border-radius:4px; }
.diff-added-inline { background: rgba(34,197,94,0.06); color:#bbf7d0; padding:0 2px; border-radius:4px; }
.field-diff-inline { display:block; line-height:1.8; }
.diff-back { background:transparent; border-color:rgba(255,255,255,0.03); }



/* Inline expanded card */
.entity-card.expanded { grid-column: 1 / -1; width: calc(100% - 40px); margin:10px 20px; box-shadow: 0 8px 30px rgba(2,6,23,0.6); border-radius:12px; }
.entity-card.long-text .teaser { color:var(--muted); font-size:15px; }
@media (prefers-reduced-motion: reduce) { .reader-panel, .entity-card.expanded { transition:none !important; } }

/* Collapsed card: mostrar solo la cabecera */
.entity-card.collapsed { overflow: visible; }
.entity-card.collapsed .entity-content { display: none !important; }
.entity-card .card-toggle-btn { appearance: none; border: 1px solid rgba(255,255,255,0.04); background: transparent; color: var(--accent); padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.entity-card .card-toggle-btn[aria-expanded="true"] { background: rgba(56,189,248,0.08); box-shadow: 0 6px 20px rgba(2,6,23,0.6); }

/* Visual hint when navigating-to an entity */
.entity-card.highlight { box-shadow: 0 14px 40px rgba(2,6,23,0.6), 0 0 0 4px rgba(56,189,248,0.06); border-color: rgba(56,189,248,0.18); transition: box-shadow 240ms ease-out; }

/* Related chips (Personajes Relacionados / Lugares) */
.related-chip { display: inline-flex; gap:8px; align-items:center; padding:6px 10px; border-radius:999px; background: rgba(56,189,248,0.08); color: var(--accent); border: 1px solid rgba(56,189,248,0.12); cursor: pointer; font-size:13px; }
.related-chip:hover { background: linear-gradient(180deg, rgba(56,189,248,0.12), rgba(56,189,248,0.04)); }
.related-chip + .related-chip { margin-left:8px; }

/* Ensure header-right stays pinned to the right */
.header-right { justify-content: flex-end; margin-left: auto; }

/* Per-item match action buttons */
.match-action-btn { border-radius: 8px; padding:6px 10px; font-size:13px; background: rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.03); color:var(--muted); cursor:pointer; }
.match-action-btn.active { box-shadow: inset 0 -2px 0 rgba(0,0,0,0.2); color:var(--text); border-color: rgba(56,189,248,0.18); background: linear-gradient(180deg, rgba(56,189,248,0.06), rgba(56,189,248,0.02)); }
.match-decision { font-size:13px; color:var(--muted); }


.campaign-block-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin: 10px 0 4px;
} 

.campaign-text {
  font-size: 13px;
  line-height: 1.5;
  color: #e5e7eb;
  white-space: pre-wrap;
  background: radial-gradient(circle at top left, rgba(15,23,42,0.98), rgba(15,23,42,1));
  border-radius: var(--radius-md);
  border: 1px solid rgba(31,41,55,0.9);
  padding: 8px 9px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(55,65,81,0.9);
  color: var(--muted);
  background: rgba(15,23,42,0.96);
}

.npc-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(31,41,55,0.9);
  background: radial-gradient(circle at top left, rgba(15,23,42,0.98), rgba(15,23,42,1));
  padding: 6px 8px;
  margin-bottom: 5px;
  font-size: 12px;
}

.npc-name {
  font-size: 13px;
  color: var(--accent-strong);
  font-weight: 500;
  margin-bottom: 2px;
}

.npc-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
}

.npc-notes {
  font-size: 12px;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.status-bar {
  padding: 6px 24px 10px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid rgba(15,23,42,0.95);
  background: radial-gradient(circle at bottom, rgba(15,23,42,0.96), rgba(15,23,42,1));
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.status-pill {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(55,65,81,0.9);
  background: rgba(15,23,42,0.96);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(56,189,248,0.8);
}

.status-message {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Estilo para el lanzador en la barra de estado (widget central eliminado) */
/* El antiguo widget rápido se ha eliminado — usar `.dice-roller-top` en la cabecera. */


.btn-mini {
    padding: 2px 8px;
    background: #00d4ff;
    color: #000;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    font-size: 10px;
}

/* Icono de dados en las tablas */
.roll-icon {
    cursor: pointer;
    transition: transform 0.1s;
    display: inline-block;
}
.roll-icon:hover {
    transform: scale(1.3);
}

/* Botón pequeño para tirar desde tablas */
.btn-die {
    background: none;
    border: 1px solid #00d4ff;
    color: #00d4ff;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 5px;
    font-size: 14px;
    transition: 0.2s;
}
.btn-die:hover {
    background: #00d4ff;
    color: black;
}  

.small {
  font-size: 11px;
}

.mono {
  font-family: "JetBrains Mono", monospace;
}
/* --- Estilos para las Tablas de Reglas --- */
.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 12px 0;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
}

.rules-table th {
  background: var(--accent-soft);
  color: var(--accent);
  text-align: left;
  padding: 8px;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.rules-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* Grid responsive para tablas de reglas */
.rules-grid-responsive {
  display: grid;
  grid-template-columns: 1fr; /* Por defecto: 1 columna que ocupa TODO el ancho */
  gap: 12px;
  width: 100%;
}

/* En pantallas muy anchas (1280px+): 2 columnas */
@media (min-width: 1280px) {
  .rules-grid-responsive {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Asegurar que las tarjetas de tabla ocupen todo el ancho */
.rules-grid-responsive > div {
  width: 100%;
}

.small-list {
  margin: 10px 0;
  padding-left: 20px;
}

.small-list li {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.4;
}

.small-list strong {
  color: var(--accent-strong);
}
/* Botones de dado */
.roll-btn {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 5px;
  margin-left: 8px;
  transition: all 0.2s;
}

.roll-btn:hover {
  background: var(--accent);
  color: white;
}

/* Pantalla de resultado del dado */
.dice-display {
  margin-top: 15px;
  padding: 10px;
  background: var(--bg-surface-hover);
  border: 1px dashed var(--accent-color);
  color: var(--accent-color);
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  font-weight: bold;
  border-radius: var(--radius-sm);
}

/* Lanzador de dados en la cabecera */
.dice-roller-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 0;
    padding-right: 0;
    margin-left: 8px;
    border-right: none;
}

.dice-result-popup {
    position: fixed;
    top: 12px; /* will be adjusted dynamically by JS to sit under the header */
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface);
    border: 2px solid var(--accent-color);
    padding: 12px 22px;
    border-radius: 10px;
    z-index: 9999 !important;
    box-shadow: 0 12px 40px rgba(251,191,36,0.3);
    text-align: center;
    animation: slideDown 220ms cubic-bezier(.2,.9,.2,1);
    max-width: min(92vw, 620px);
    backdrop-filter: blur(8px);
  }

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px) translateX(-50%); } to { opacity: 1; transform: translateY(0) translateX(-50%); } }

.die {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    margin: 3px;
    background: var(--bg-surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
  }
  .die.success { border-color: #22c55e; color: #22c55e; font-weight: bold; background: rgba(34,197,94,0.1); }
  .die.crit { border-color: var(--accent-color); color: var(--accent-color); box-shadow: 0 0 8px var(--accent-color); background: rgba(251,191,36,0.15); font-weight: bold; }
/* Layout Principal */
.main-layout {
  display: flex;
  flex-direction: row; /* Asegura que estén en fila */
  gap: 0; /* Quitamos el gap para que el resizer encaje perfecto */
  padding: 0 20px 20px;
  height: calc(100vh - 180px);
  overflow: hidden;
  user-select: none; /* Evita seleccionar texto al arrastrar */
}

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
    height: auto;
    overflow: auto;
    padding: 0 12px 16px;
  }

  .rules-panel,
  .campaign-panel {
    width: 100% !important;
    min-width: 0;
  }

  .resizer {
    display: none;
  }

  .header-right {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tab-content,
  .master-console {
    max-height: none;
  }
}

/* El panel de reglas con ancho inicial */
.rules-panel {
  width: 400px; 
  min-width: 280px;
  flex-shrink: 0; /* Importante: que no se encoja solo */
}

/* El panel de campaña ocupa el resto */
.campaign-panel {
  flex: 1; 
  min-width: 300px;
}

/* La pestaña de arrastre ahora es una línea elegante y sutil */
.resizer {
  width: 4px; /* Lo que se ve */
  cursor: col-resize;
  background: var(--border-color);
  margin: 0 10px;
  position: relative;
  transition: all 0.3s ease;
  border-radius: 10px;
  touch-action: none; /* Evita que el móvil haga scroll al tocar la barra */
}

/* Efecto de luz al pasar el ratón */
.resizer:hover, .resizing {
  background: var(--primary-color);
  box-shadow: 0 0 15px var(--primary-color);
  width: 6px;
}

/* Área táctil invisible de 20px para que el dedo la encuentre fácil */
.resizer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -8px; 
  right: -8px;
  z-index: 10;
}

/* Decoración: Un pequeño círculo en medio para indicar que se agarra ahí */
.resizer::after {
  content: "⁞";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--primary-color);
  font-weight: bold;
  font-size: 14px;
  opacity: 0.5;
  pointer-events: none; /* No bloquea el área táctil */
}

/* Cambia a color índigo al tocar */
.resizer:active {
  background-color: var(--primary-color);
}

/* Ajuste del panel de reglas para que se vea más suave */
.rules-panel {
  border-right: none; /* Quitamos el borde duro */
  box-shadow: 5px 0 15px rgba(0,0,0,0.2);
}

/* Estilo tuneado para Buscador y Filtro */
.search-container {
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.search-input, .type-filter {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border) !important;
  color: var(--accent) !important;
  padding: 8px 12px;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
}

.search-input:focus, .type-filter:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 10px var(--accent-soft);
}

/* Estilo para que el selector no se vea blanco al abrirlo */
.type-filter option {
  background: #1a1a1a;
  color: var(--accent);
}

/* Ajustes para que los paneles tengan scroll independiente */
.panel {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tab-content, .master-console {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

/* Estilos de las tarjetas interactivas en la consola */
.entity-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
}

.entity-header {
  padding: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  transition: background 0.2s;
}

.entity-header:hover { background: var(--accent-soft); }

.entity-content {
  padding: 15px;
  border-top: 1px solid var(--border);
  display: none; /* Oculto por defecto */
  background: rgba(0, 0, 0, 0.2);
}

.entity-content.active { display: block; }

.tag {
  font-size: 10px;
  background: var(--accent);
  color: #000;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 8px;
  text-transform: uppercase;
  font-weight: bold;
}
.edit-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.edit-grid textarea {
    min-height: 80px;
    background: rgba(0,0,0,0.3);
    color: #ccc;
    border: 1px solid var(--border);
    padding: 5px;
}

.stats-editor {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    background: rgba(var(--accent-rgb), 0.05);
    padding: 10px;
    border-radius: 5px;
}

.stat-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}

.stat-box input {
    width: 35px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--accent);
    color: var(--accent);
    text-align: center;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}
.sheet-section {
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
    font-weight: bold;
    padding: 4px 8px;
    margin: 15px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.stat-row input {
    width: 40px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    color: white;
    text-align: center;
}

.stat-row button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
}

.stat-row button:hover { opacity: 1; }
.cat-btn { 
  background: transparent; border: 1px solid transparent; color: var(--text-secondary); 
  padding: 8px; border-radius: 8px; cursor: pointer; font-size: 18px; transition: 0.2s; 
}
.cat-btn:hover { background: var(--bg-surface-hover); }
.cat-btn.active { background: rgba(99,102,241,0.15); border-color: var(--primary-color); color: var(--primary-color); }

.chip { 
  background: var(--bg-surface-hover); border: 1px solid var(--border-color); color: var(--text-secondary); 
  padding: 4px 12px; border-radius: 15px; font-size: 11px; cursor: pointer; white-space: nowrap; 
}
.chip.active { background: var(--accent-color); color: #0b0f19; font-weight: bold; border-color: var(--accent-color); }

.entity-card { border-left: 3px solid var(--primary-color); margin: 10px; background: rgba(99,102,241,0.05); }

/* Enlaces mágicos */
.wiki-link {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px dashed var(--primary-color);
  cursor: pointer;
  font-weight: bold;
}

.wiki-link:hover {
  background: rgba(99,102,241,0.15);
  border-bottom: 1px solid var(--primary-color);
}

/* Panel lateral deslizante */
#quickViewPanel {
  position: fixed;
  right: -400px;
  top: 0;
  width: 350px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 2px solid var(--primary-color);
  box-shadow: -8px 0 24px rgba(0,0,0,0.5);
  z-index: 3000;
  transition: right 0.3s ease-in-out;
  padding: 20px;
  color: var(--text-primary);
  overflow-y: auto;
}

#quickViewPanel.open { right: 0; }

.close-panel {
    background: #ff4d4d;
    border: none;
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    float: right;
    border-radius: 4px;
}

/* ==========================================
   FICHA DE PERSONAJE - 2ª EDICIÓN
   ========================================== */

.ficha-personaje {
    background: var(--panel);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 10px 0;
    border: 1px solid var(--border);
}

.ficha-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

.ficha-header h2 {
    color: var(--accent);
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: 2px;
}

.ficha-personaje .sheet-section {
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: bold;
    padding: 6px 10px;
    margin: 20px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-left: 3px solid var(--accent);
}

/* Campos en modo visualización */
.campo-visible {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.campo-visible strong {
    color: var(--accent);
    min-width: 150px;
    font-weight: 600;
}

.campo-visible span {
    color: var(--text);
}

.text-wrap {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Campos en modo edición */
.campo-editable {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.campo-editable label {
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campo-editable .ficha-input,
.campo-editable input,
.campo-editable textarea {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-main);
    transition: border-color 0.2s;
}

.campo-editable .ficha-input:focus,
.campo-editable input:focus,
.campo-editable textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.05);
}

.campo-editable textarea {
    min-height: 80px;
    resize: vertical;
}

/* Atributos y Habilidades */
.atributos-categoria,
.habilidades-categoria {
    margin-bottom: 20px;
}

.atributos-categoria h4,
.habilidades-categoria h4 {
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.atributos-grid,
.habilidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.atributo-row,
.habilidad-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.atributo-row span:first-child,
.habilidad-row span:first-child {
    color: var(--muted);
    text-transform: capitalize;
    min-width: 120px;
}

.dots {
    color: var(--accent);
    font-size: 16px;
    letter-spacing: 2px;
    font-family: monospace;
}

.arcano-dots {
    color: #a78bfa;
    font-size: 18px;
}

.atributo-row input[type="number"],
.habilidad-row input[type="number"],
.arcano-row input[type="number"] {
    width: 50px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--accent);
    text-align: center;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.roll-icon {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.1s;
}

.roll-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Arcanos */
.arcanos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.arcano-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(167, 139, 250, 0.08);
    border-radius: var(--radius-sm);
    border-left: 3px solid #a78bfa;
}

.arcano-row span:first-child {
    color: #a78bfa;
    text-transform: capitalize;
    font-weight: 600;
    font-size: 12px;
}

/* Méritos */
.meritos-lista {
    margin-top: 10px;
}

.merito-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    border-left: 3px solid var(--accent);
}

.merito-nombre {
    flex: 1;
    color: var(--text);
    font-weight: 500;
}

.merito-nota {
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
}

.merito-row-edit {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.merito-row-edit input[type="text"] {
    flex: 1;
}

.merito-row-edit input[type="number"] {
    width: 60px;
}

.merito-row-edit button {
    background: var(--danger);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .atributos-grid,
    .habilidades-grid,
    .arcanos-grid {
        grid-template-columns: 1fr;
    }
    
    .ficha-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* ===== MENÚ DESPLEGABLE DEL HEADER ===== */

.header-hamburger-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #818cf8 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.header-hamburger-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.header-hamburger-btn:active {
    transform: scale(0.95);
}

.header-hamburger-btn svg {
    color: white;
}

.header-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    padding: 16px;
    z-index: 1000;
    animation: dropdownSlideIn 0.3s ease-out;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-section {
    margin-bottom: 12px;
}

.dropdown-section:last-child {
    margin-bottom: 0;
}

.dropdown-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.dropdown-btn {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 6px;
}

.dropdown-btn:last-child {
    margin-bottom: 0;
}

/* ===== BOTÓN DE LANZAR DADOS (GNOSIS/GOLD) ===== */
.dice-roller-dropdown .btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    border: 1px solid var(--accent-hover);
    color: #0b0f19;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.dice-roller-dropdown .btn:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, #b45309 100%);
    border-color: var(--accent-hover);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.6);
    transform: translateY(-2px);
}

.dice-roller-dropdown .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.5);
}

/* Input de dados con estilo Material */
.dice-roller-dropdown input[type="number"],
#dicePool {
    background: var(--bg-surface-hover) !important;
    color: var(--primary-color) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 6px !important;
    text-align: center;
    padding: 6px;
    font-weight: 600;
}

.dice-roller-dropdown input[type="number"]:focus,
#dicePool:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Ajustar posición relativa del header-right para el dropdown */
.header-right {
    position: relative;
}

/* ===== RESPONSIVE: HEADER EN DESKTOP ===== */

@media (min-width: 769px) {
    /* Ocultar botón hamburguesa en desktop */
    .header-hamburger-btn {
        display: none !important;
    }

    /* Mostrar menú siempre visible en desktop */
    #header-dropdown-menu {
        display: flex !important;
        position: static !important;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        min-width: auto;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        animation: none;
    }

    /* Organizar secciones horizontalmente */
    .dropdown-section {
        margin-bottom: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Ocultar labels en desktop (no son necesarios cuando todo es visible) */
    .dropdown-label {
        display: none;
    }

    /* Ocultar divisores en desktop */
    .dropdown-divider {
        display: none;
    }

    /* Ajustar botones para layout horizontal */
    .dropdown-btn {
        width: auto;
        margin-bottom: 0;
        white-space: nowrap;
    }

    /* Ajustar input de búsqueda */
    #header-dropdown-menu #globalSearchInput {
        width: 200px;
    }

    /* Ajustar dice roller */
    .dice-roller-dropdown {
        gap: 6px !important;
    }

    .dice-roller-dropdown input {
        width: 50px !important;
    }
}

/* ===== RESPONSIVE: HEADER EN MÓVIL ===== */

@media (max-width: 768px) {
    /* Ajustar dropdown en móvil */
    .header-dropdown {
        right: -10px; /* Alinear mejor con el borde */
        min-width: 280px;
        max-width: calc(100vw - 40px); /* No salirse de la pantalla */
    }

    /* Ajustar header para mejor visualización en móvil */
    header {
        padding: 12px 16px 8px;
        gap: 8px;
    }

    .title-block {
        flex: 1;
        min-width: 0;
    }

    .title-main {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .title-sub {
        display: none; /* Ocultar subtítulo en móvil para ahorrar espacio */
    }

    .badge-system {
        font-size: 9px;
        padding: 3px 8px;
    }

    .campaign-name {
        max-width: 120px;
        font-size: 11px;
    }

    .header-hamburger-btn {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .header-hamburger-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ===== OPTIMIZACIÓN PARA MÓVILES EN HORIZONTAL ===== */
/* Detectar móviles en horizontal con altura limitada */
@media (orientation: landscape) and (max-height: 600px) {
    
    /* 1. Ocultar el Título/Logo para ganar espacio vertical */
    .title-block, 
    .title-main, 
    .title-sub {
        display: none;
    }

    /* 2. Mantener el menú hamburguesa a la DERECHA */
    header {
        justify-content: flex-end; /* Fuerza los elementos al final (derecha) */
        padding: 8px 16px; /* Reducir padding vertical */
        min-height: 50px; /* Altura mínima del header */
    }

    .header-right {
        justify-content: flex-end; /* Mantener botón hamburguesa a la derecha */
        margin-left: auto;
    }

    /* Optimizar espaciado general para aprovechar mejor el espacio vertical */
    .master-console {
        padding: 8px;
    }

    .panel {
        margin-bottom: 8px;
    }
}
