:root {
  --bg: #F7F6F3; --surface: #FFFFFF; --surface2: #F0EEE9;
  --border: rgba(0,0,0,0.08); --border2: rgba(0,0,0,0.14);
  --text: #1A1916; --text2: #6B6860; --text3: #A09D97;
  --blue: #2563EB; --blue-bg: #EFF4FF; --blue-text: #1D4ED8;
  --green: #16A34A; --green-bg: #F0FDF4; --green-text: #15803D;
  --amber: #D97706; --amber-bg: #FFFBEB; --amber-text: #B45309;
  --red: #DC2626; --red-bg: #FEF2F2; --red-text: #B91C1C;
  --purple: #7C3AED; --purple-bg: #F5F3FF; --purple-text: #6D28D9;
  --radius: 8px; --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

/* ── MODO OSCURO ── */
body.dark {
  --bg: #0F1117;
  --surface: #1A1D27;
  --surface2: #222534;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);
  --text: #E8E6E1;
  --text2: #9B9890;
  --text3: #6B6860;
  --blue-bg: #1E2A4A;
  --green-bg: #0F2318;
  --amber-bg: #2A1F0A;
  --red-bg: #2A0F0F;
  --purple-bg: #1E1535;
}

/* Transición suave al cambiar modo */
*, *::before, *::after {
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.1s ease;
}

/* Sidebar en dark mode */
body.dark 

/* Inputs en dark mode */
body.dark input, body.dark select, body.dark textarea {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border2);
}

/* Autofill del navegador (Chrome/Safari) ignora el CSS normal y
   pinta el campo de blanco cuando recuerda un valor guardado.
   Forzamos el mismo estilo oscuro también ahí. */
body.dark input:-webkit-autofill,
body.dark input:-webkit-autofill:hover,
body.dark input:-webkit-autofill:focus,
body.dark select:-webkit-autofill,
body.dark textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0px 1000px var(--surface2) inset;
  box-shadow: 0 0 0px 1000px var(--surface2) inset;
  border-color: var(--border2);
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

/* Tabla en dark mode */
body.dark table thead tr {
  background: var(--surface2);
}
body.dark tr:hover {
  background: rgba(255,255,255,0.03);
}

/* Cards en dark mode */
body.dark .card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Badge modo oscuro */
#btn-dark-mode:hover {
  background: var(--surface2) !important;
  color: var(--text) !important;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; height: 100vh; overflow: hidden; }
.app { display: flex; height: 100vh; }
.sidebar { width: 200px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.brand { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); }
.brand-name { font-size: 16px; font-weight: 500; letter-spacing: -0.3px; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.brand-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.nav { padding: 12px 10px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-section { font-size: 10px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; padding: 10px 8px 4px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius); font-size: 13px; color: var(--text2); cursor: pointer; transition: all 0.1s; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--blue-bg); color: var(--blue-text); font-weight: 500; }
.nav-icon { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text3); }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.screen { display: none; flex-direction: column; height: 100%; overflow: hidden; width: 100%; }
.screen.active { display: flex; }
.topbar { padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.topbar-left { display: flex; flex-direction: column; gap: 2px; }
.topbar-back { font-size: 12px; color: var(--blue); cursor: pointer; margin-bottom: 2px; }
.topbar-title { font-size: 16px; font-weight: 500; letter-spacing: -0.2px; }
.topbar-sub { font-size: 12px; color: var(--text3); }
.btn { padding: 7px 14px; border-radius: var(--radius); font-size: 13px; font-family: 'DM Sans', sans-serif; border: 1px solid var(--border2); background: var(--surface); color: var(--text); cursor: pointer; transition: all 0.1s; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--blue); color: white; border-color: transparent; }
.btn.primary:hover { background: var(--blue-text); }
.btn.success { background: var(--green-bg); color: var(--green-text); border-color: transparent; }
.btn-group { display: flex; gap: 8px; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.metrics { display: grid; gap: 10px; }
.metrics.col4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.metrics.col3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px; box-shadow: var(--shadow); }
.metric-label { font-size: 11px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.metric-value { font-size: 26px; font-weight: 300; letter-spacing: -0.5px; }
.metric-value.red { color: var(--red); }
.metric-value.amber { color: var(--amber); }
.metric-value.green { color: var(--green); }
.metric-value.blue { color: var(--blue); }
.metric-sub { font-size: 11px; color: var(--text3); margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.card-header { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 11px; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; }
.card-link { font-size: 12px; color: var(--blue); cursor: pointer; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; font-weight: 500; color: var(--text3); padding: 10px 18px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 18px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--bg); }
.mono { font-family: 'DM Mono', monospace; font-size: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge.red { background: var(--red-bg); color: var(--red-text); }
.badge.amber { background: var(--amber-bg); color: var(--amber-text); }
.badge.green { background: var(--green-bg); color: var(--green-text); }
.badge.blue { background: var(--blue-bg); color: var(--blue-text); }
.badge.gray { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }
.badge.purple { background: var(--purple-bg); color: var(--purple-text); }
.dias { font-weight: 500; font-size: 13px; }
.dias.red { color: var(--red); }
.dias.amber { color: var(--amber); }
.dias.green { color: var(--green); }
.toolbar { display: flex; gap: 8px; padding: 12px 24px; background: var(--surface); border-bottom: 1px solid var(--border); align-items: center; flex-shrink: 0; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border2); border-radius: var(--radius); padding: 0 12px; background: var(--surface); flex: 1; }
.search-box input { border: none; outline: none; font-size: 13px; font-family: 'DM Sans', sans-serif; background: transparent; color: var(--text); padding: 8px 0; width: 100%; }
select { border: 1px solid var(--border2); border-radius: var(--radius); padding: 8px 12px; font-size: 13px; font-family: 'DM Sans', sans-serif; background: var(--surface); color: var(--text); outline: none; cursor: pointer; }
.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 24px; background: var(--surface); flex-shrink: 0; }
.tab { padding: 10px 16px; font-size: 13px; color: var(--text2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.1s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 500; }
.meta-bar { display: flex; gap: 24px; padding: 10px 24px; border-bottom: 1px solid var(--border); background: var(--surface2); flex-shrink: 0; flex-wrap: wrap; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; }
.meta-value { font-size: 13px; font-weight: 500; }
.tl { display: flex; flex-direction: column; padding: 16px 18px; }
.tl-item { display: flex; gap: 14px; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-left { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.tl-dot.estudio { background: var(--blue); }
.tl-dot.juzgado { background: var(--green); }
.tl-dot.contraria { background: #EA580C; }
.tl-dot.urgente { background: var(--red); }
.tl-line { width: 1px; background: var(--border2); flex: 1; margin-top: 4px; min-height: 20px; }
.tl-content { flex: 1; }
.tl-tipo { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.tl-tipo.estudio { color: var(--blue); }
.tl-tipo.juzgado { color: var(--green); }
.tl-tipo.contraria { color: #C2410C; }
.tl-tipo.urgente { color: var(--red); }
.tl-desc { font-size: 13px; line-height: 1.4; margin-bottom: 3px; }
.tl-fecha { font-size: 11px; color: var(--text3); }
.tl-fecha.urgente { color: var(--red); font-weight: 500; }
.split { flex: 1; display: flex; overflow: hidden; }
.split-list { width: 230px; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; background: var(--surface); }
.split-list-header { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.split-list-body { flex: 1; overflow-y: auto; }
.list-item { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.1s; }
.list-item:hover { background: var(--bg); }
.list-item.active { background: var(--blue-bg); border-left: 2px solid var(--blue); }
.list-item-name { font-size: 13px; font-weight: 500; }
.list-item-sub { font-size: 11px; color: var(--text3); margin-top: 2px; }
.split-detail { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.split-side { width: 200px; border-left: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex-shrink: 0; background: var(--surface); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; flex-shrink: 0; }
.av-blue { background: var(--blue-bg); color: var(--blue-text); }
.av-green { background: var(--green-bg); color: var(--green-text); }
.av-purple { background: var(--purple-bg); color: var(--purple-text); }
.av-amber { background: var(--amber-bg); color: var(--amber-text); }
.info-block { background: var(--surface2); border-radius: var(--radius); padding: 10px 12px; }
.info-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 3px; }
.info-value { font-size: 13px; font-weight: 500; }
.info-sub { font-size: 12px; color: var(--text2); margin-top: 2px; line-height: 1.5; }
.alerta-box { background: var(--amber-bg); border: 1px solid rgba(217,119,6,0.2); border-radius: var(--radius); padding: 10px 12px; }
.alerta-titulo { font-size: 11px; font-weight: 500; color: var(--amber-text); margin-bottom: 3px; }
.alerta-texto { font-size: 12px; color: var(--amber); line-height: 1.5; }
.ia-box { background: var(--blue-bg); border: 1px solid rgba(37,99,235,0.15); border-radius: var(--radius); padding: 10px 12px; }
.ia-label { font-size: 10px; font-weight: 500; color: var(--blue-text); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.progress-bar { height: 5px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--green); }
.escrito-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.escrito-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.escrito-proveido { padding: 10px 16px; background: rgba(22,163,74,0.04); border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.pdf-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--radius); border: 1px solid var(--border2); font-size: 11px; font-family: 'DM Sans',sans-serif; color: var(--text2); cursor: pointer; background: var(--surface); }
.form-section { display: none; flex-direction: column; gap: 16px; width: 100%; }
.form-section.active { display: flex; width: 100%; }
.form-row { display: grid; gap: 12px; }
.form-row.col2 { grid-template-columns: 1fr 1fr; }
.form-row.col3 { grid-template-columns: 1fr 1fr 1fr; }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo label { font-size: 11px; font-weight: 500; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; }
.campo input, .campo select, .campo textarea { border: 1px solid var(--border2); border-radius: var(--radius); padding: 9px 12px; font-size: 13px; font-family: 'DM Sans', sans-serif; background: var(--surface); color: var(--text); outline: none; transition: border-color 0.1s; }
.campo input:focus, .campo select:focus { border-color: var(--blue); }
.campo textarea { resize: vertical; min-height: 72px; }
.radio-group { display: flex; gap: 16px; margin-top: 4px; }
.radio-opt { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.form-footer { display: flex; gap: 8px; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; }
.section-label { font-size: 11px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.abogado-bar { display: flex; align-items: center; gap: 10px; }
.abogado-bar-inner { flex: 1; }
.abogado-bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.abogado-bar-label span { color: var(--text3); }
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.visible {
  display: flex;
}

/* ── INNER TABS ── */
.inner-tab { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.inner-tab.active { display: flex; }
.inner-tab-split { flex-direction: row; }

/* ── JURISPRUDENCIA IA ── */
.jur-sugerencia {
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.1s;
  text-align: left;
}
.jur-sugerencia:hover {
  background: var(--blue-bg);
  color: var(--blue-text);
  border-color: var(--blue);
}
.jur-msg { display: flex; gap: 10px; animation: fadeIn 0.2s ease; }
.jur-msg.user { flex-direction: row-reverse; }
.jur-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.6;
}
.jur-msg.user .jur-bubble {
  background: var(--blue);
  color: white;
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
}
.jur-msg.ia .jur-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4px;
}
.jur-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}
.jur-msg.user .jur-avatar { background: var(--blue); color: white; }
.jur-msg.ia .jur-avatar { background: var(--surface2); border: 1px solid var(--border); }
.jur-typing { display: flex; gap: 4px; align-items: center; padding: 4px 0; }
.jur-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text3);
  animation: typing 1s infinite;
}
.jur-typing span:nth-child(2) { animation-delay: 0.2s; }
.jur-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,100%{opacity:0.3;transform:scale(1)} 50%{opacity:1;transform:scale(1.2)} }
@keyframes fadeIn { from{opacity:0;transform:translateY(4px)} to{opacity:1;transform:translateY(0)} }

/* ── TABLE WRAP ── */
.table-wrap { flex: 1; overflow-y: auto; }
.table-wrap table { width: 100%; }

.search-icon { color: var(--text3); font-size: 14px; flex-shrink: 0; }

/* ── JURISPRUDENCIA IA NAV ── */
.nav-item-ia {
  margin-top: 4px;
  background: linear-gradient(135deg, rgba(37,99,235,0.15), rgba(124,58,237,0.1));
  border: 1px solid rgba(37,99,235,0.25);
  border-radius: var(--radius);
  color: var(--blue-text) !important;
  font-weight: 500;
  position: relative;
}
.nav-item-ia:hover {
  background: linear-gradient(135deg, rgba(37,99,235,0.25), rgba(124,58,237,0.2));
}
.nav-item-ia.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.35), rgba(124,58,237,0.25));
}
.nav-badge {
  font-size: 9px;
  font-weight: 600;
  background: var(--blue);
  color: white;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: auto;
  letter-spacing: 0.5px;
}

/* ── JURISPRUDENCIA IA — CARDS ── */
.jur-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.jur-card:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
}
.jur-card-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  color: white;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.jur-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.jur-card-desc {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}

/* ── SIDEBAR REFINADO ── */
.sidebar { width: 200px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; height: 100vh; overflow: hidden; }
body.dark .sidebar { background: #0D0F18; border-right-color: rgba(255,255,255,0.06); }
.brand { padding: 16px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.nav { padding: 8px 8px; flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 1px; min-height: 0; }
.nav-section { padding: 12px 10px 4px; font-size: 9.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text3); font-weight: 600; flex-shrink: 0; }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text3); flex-shrink: 0; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius); font-size: 13px; color: var(--text2); cursor: pointer; transition: all 0.15s; flex-shrink: 0; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--blue-bg); color: var(--blue-text); font-weight: 500; border-left: 2px solid var(--blue); padding-left: 8px; }
body.dark .nav-item.active { background: rgba(37,99,235,0.18); }


/* ── MEJORAS ESTÉTICAS GENERALES ── */

/* Fondo gris muy claro dentro de los contenedores */

body.dark 

/* Inputs más definidos */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="time"],
select, textarea {
  background: #FFFFFF;
  border: 1px solid #D1CFC9;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  font-family: DM Sans, sans-serif;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
body.dark input, body.dark select, body.dark textarea {
  background: var(--surface2);
  border-color: var(--border2);
}

/* Métricas con fondo gris claro */
.metric {
  background: #F9F8F6;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
body.dark .metric {
  background: rgba(255,255,255,0.03);
}

/* Tabla con fondo alterno */
tbody tr:nth-child(even) {
  background: #FAFAF8;
}
body.dark tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.02);
}

/* Scroll con fondo gris claro */
.scroll {
  background: #F5F4F1;
}
body.dark .scroll {
  background: var(--bg);
}


/* ── FIX PANTALLA PARÁMETROS ── */
#screen-parametros .scroll {
  padding: 16px;
  gap: 12px;
  display: flex;
  flex-direction: column;
}
#screen-parametros .card {
  overflow: visible;
}
#screen-parametros .form-row.col2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
#screen-parametros .form-row.col3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
#screen-parametros .campo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
#screen-parametros select,
#screen-parametros input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ── FIX LOGIN CENTRADO ── */
#login-container {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
#login-container > div:last-child {
  margin: auto;
  padding: 20px;
}

/* ── LÍNEA BLANCA LOGIN — eliminar ── */
#login-container::after {
  display: none;
}

/* ── TRIAL BANNER — aviso no invasivo de fin de prueba ── */
.trial-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  font-size: 12.5px;
  line-height: 1.4;
  border-bottom: 1px solid transparent;
}
.trial-banner--info {
  background: #EFF6FF;
  color: #1E3A8A;
  border-bottom-color: #BFDBFE;
}
.trial-banner--warn {
  background: #FFFBEB;
  color: #92400E;
  border-bottom-color: #FDE68A;
}
.trial-banner--danger {
  background: #FEF2F2;
  color: #991B1B;
  border-bottom-color: #FECACA;
}
.trial-banner-msg { flex: 1; }
.trial-banner-cta {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 11.5px;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(0,0,0,0.08);
  color: inherit;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.trial-banner-cta:hover { background: rgba(0,0,0,0.14); }
.trial-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0 2px;
}
.trial-banner-close:hover { opacity: 1; }

/* ── BLOQUEO POR CUENTA SUSPENDIDA ── */
.cuenta-bloqueada-card {
  background: white;
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.cuenta-bloqueada-icono {
  width: 52px; height: 52px; border-radius: 50%;
  background: #FEF2F2; color: #DC2626;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin: 0 auto 16px;
}
.cuenta-bloqueada-titulo {
  font-size: 18px; font-weight: 700; color: #1A1916; margin-bottom: 8px;
}
.cuenta-bloqueada-texto {
  font-size: 13.5px; color: #6B6963; line-height: 1.6; margin-bottom: 24px;
}
.cuenta-bloqueada-acciones {
  display: flex; flex-direction: column; gap: 10px;
}

/* ── LOGIN: columna de features, solo en pantallas suficientemente anchas ── */
@media (max-width: 860px) {
  .login-hero { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   PWA / MOBILE — sidebar tipo drawer + ajustes de pantalla chica
   ═══════════════════════════════════════════════════════════ */

/* Topbar mobile con hamburguesa — oculta en desktop */
.mobile-topbar { display: none; }
.mobile-menu-btn {
  background: none; border: none; padding: 6px; cursor: pointer;
  color: var(--text); display: flex; align-items: center; justify-content: center;
}
#sidebar-backdrop { display: none; }

@media (max-width: 860px) {

  .mobile-topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 45; flex-shrink: 0;
  }
  .mobile-topbar-brand { font-size: 15px; font-weight: 300; color: var(--text); }
  .mobile-topbar-brand strong { font-weight: 700; }

  .app { flex-direction: column; }

  /* Sidebar pasa a ser un panel deslizable, oculto por defecto */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 240px;
    z-index: 50; transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .sidebar.open { transform: translateX(0); }

  #sidebar-backdrop.open {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,0.45); z-index: 49;
  }

  .main { width: 100%; }

  /* Topbars de cada pantalla: menos padding, permiten wrap */
  .topbar {
    padding: 12px 16px; flex-wrap: wrap; gap: 10px;
  }
  .topbar-title { font-size: 15px; }

  /* Pantallas con padding grande en desktop, lo bajamos */
  .screen > div[style*="padding:20px 24px"],
  .screen > div[style*="padding: 20px 24px"] {
    padding: 14px 16px !important;
  }

  /* Login: la tarjeta ocupa casi todo el ancho, menos padding */
  #login-container > div { padding: 16px !important; }
  #login-card-elegir, #login-card-form { padding: 24px 20px !important; }
}
