:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent-hover: #5a9dff;
  --danger: #e05555;
  --danger-hover: #ff7070;
  --ok: #3ecf8e;
  --radius: 10px;
  --font: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #1a2744 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}

.header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.main-screen .header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.main-screen .user-info {
  margin-top: 0;
}

.login-lang-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.lang-label {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.lang-select {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  min-width: 7.5rem;
}

.toolbar-strip {
  background: #0c1018;
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 1rem;
}

.toolbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-start;
}

.linea-toolbar-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-right: 0.35rem;
  padding-right: 0.65rem;
  border-right: 1px solid var(--border);
}

.linea-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.linea-select {
  min-width: 8rem;
  max-width: 14rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
}

.linea-admin-list .linea-admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.linea-visible-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted, #666);
}

.linea-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.linea-nueva-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.linea-nueva-row .nombre-input {
  flex: 1 1 12rem;
}

.fijos-semana-block {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.fijos-semana-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.fijos-semana-grid {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.fijos-semana-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.5rem;
  align-items: center;
}

.fijos-semana-dia {
  font-size: 0.85rem;
  color: var(--muted);
}

.fijos-semana-select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
}

.layout {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.msg {
  min-height: 1.5rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.msg.error {
  background: rgba(224, 85, 85, 0.15);
  color: #ffb4b4;
}

.msg.ok {
  background: rgba(62, 207, 142, 0.12);
  color: var(--ok);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

.card h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 600;
  color: #c5d4e8;
}

.card.muted {
  opacity: 0.92;
}

/* Almanaque semanal */
.almanaque-card .almanaque-head {
  margin-bottom: 0.35rem;
}

.almanaque-card .almanaque-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: #c5d4e8;
}

.almanaque-card .almanaque-hint {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
}

.almanaque-card .almanaque-modo {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
}

.almanaque-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.65rem;
}

.almanaque-tab {
  border: 1px solid var(--border);
  background: rgba(22, 30, 46, 0.85);
  color: #a8bdd4;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: capitalize;
}

.almanaque-tab:hover {
  border-color: rgba(61, 139, 253, 0.45);
  color: #d8e8ff;
}

.almanaque-tab.active {
  background: rgba(61, 139, 253, 0.2);
  border-color: rgba(61, 139, 253, 0.55);
  color: #e8f2ff;
}

.almanaque-wk-head {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.almanaque-wk-head-cell {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7d93ad;
}

.almanaque-mes-dias {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0;
}

.almanaque-semanal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.35rem;
}

@media (max-width: 720px) {
  .almanaque-mes-dias,
  .almanaque-wk-head,
  .almanaque-semanal {
    grid-template-columns: repeat(7, minmax(5.75rem, 1fr));
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
}

.almanaque-dia {
  border-radius: 12px;
  padding: 0.65rem 0.55rem 0.7rem;
  background: linear-gradient(
    160deg,
    rgba(32, 44, 64, 0.55) 0%,
    rgba(22, 30, 46, 0.9) 100%
  );
  border: 1px solid var(--border);
  min-width: 0;
}

.almanaque-dia--hoy {
  border-color: rgba(61, 139, 253, 0.5);
  box-shadow:
    0 0 0 1px rgba(61, 139, 253, 0.1),
    0 6px 20px rgba(0, 0, 0, 0.22);
}

.almanaque-dia--otro-mes {
  opacity: 0.52;
}

.almanaque-tanda {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #8fa3bc;
  margin: 0 0 0.45rem;
  line-height: 1.2;
}

.almanaque-dia--hoy .almanaque-tanda {
  color: #b8d4ff;
}

.almanaque-tanda--past {
  color: #5c6b7d;
  font-weight: 600;
}

.almanaque-dia-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(45, 58, 77, 0.65);
}

.almanaque-dia-wk {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.almanaque-dia--hoy .almanaque-dia-wk {
  color: #9ec8ff;
}

.almanaque-dia-fecha {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.almanaque-par {
  margin-bottom: 0.4rem;
}

.almanaque-par:last-of-type {
  margin-bottom: 0;
}

.almanaque-par-badge {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  margin-bottom: 0.2rem;
}

.almanaque-par-badge--cond {
  background: rgba(61, 139, 253, 0.2);
  color: #b8d9ff;
  border: 1px solid rgba(61, 139, 253, 0.35);
}

.almanaque-par-badge--vip {
  background: rgba(212, 168, 75, 0.14);
  color: #e8c97a;
  border: 1px solid rgba(212, 168, 75, 0.32);
}

.almanaque-par-nombre {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
  color: var(--text);
}

.almanaque-par-nombre--vip {
  color: #fcecc0;
  font-weight: 700;
}

.almanaque-par-nombre--muted {
  color: var(--muted);
  font-weight: 500;
}

.almanaque-estado {
  margin: 0.45rem 0 0;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(45, 58, 77, 0.55);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b9cb3;
  text-align: center;
}

.almanaque-estado--pasado-ok {
  color: var(--ok);
  border-top-color: rgba(62, 207, 142, 0.35);
}

/* Diálogo registro pasado */
.dlg-registro-pasado {
  max-width: min(92vw, 420px);
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.dlg-registro-pasado::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.dlg-registro-inner {
  padding: 1rem 1.15rem 1.1rem;
}

.dlg-registro-inner .form-row {
  margin-bottom: 0.85rem;
}

.dlg-registro-inner label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.dlg-registro-inner select,
.dlg-registro-inner input[type="date"] {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121a26;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.msg-registro {
  min-height: 1.25rem;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.msg-registro.ok {
  color: var(--ok);
}

.msg-registro.error {
  color: #ffb4b4;
}

/* Registros históricos */
.registros-log {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121a26;
  max-height: 16rem;
  overflow-y: auto;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
}

.registros-log-empty {
  margin: 0;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.9rem;
}

.registro-log-line {
  margin: 0 0 0.35rem;
  word-break: break-word;
}

.registro-log-line:last-child {
  margin-bottom: 0;
}

.registro-log-fecha {
  color: var(--ok);
  font-weight: 600;
}

.registro-log-sep {
  color: var(--muted);
  padding: 0 0.35rem;
}

.ref-conductores-title {
  margin: 0 0 0.35rem;
}

.conductores-ref-host {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}

.conductores-ref-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.conductores-ref-row:last-child {
  border-bottom: none;
}

.conductores-ref-name {
  flex: 1;
  min-width: 8rem;
}

.conductores-ref-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.btn.compact {
  padding: 0.3rem 0.55rem;
  font-size: 0.78rem;
}

.meta {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.resumen {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.mensaje-wrap label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

#mensaje-turno {
  width: 100%;
  resize: vertical;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121a26;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

.mensaje-turno-hint {
  margin-top: 0;
}

.mensaje-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.checks .disp-check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.2rem 0;
}

.checks .disp-check-row label {
  flex: 1;
  min-width: 0;
}

.checks .disp-check-actions {
  flex-shrink: 0;
}

.checks input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.segundo-acomp-wrap {
  display: none;
  margin: 0 0 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(120, 180, 140, 0.35);
  background: rgba(120, 180, 140, 0.08);
}

body.tren-modo-admin .segundo-acomp-wrap {
  display: block;
}

/* Roles restringidos: solo Almanaque y Registros (ajustable por privilegios) */
body.tren-modo-user #card-hoy,
body.tren-modo-user #grid-hoy-asignaciones,
body.tren-modo-user #card-referencia,
body.tren-modo-r5_4 #card-hoy,
body.tren-modo-r5_4 #grid-hoy-asignaciones,
body.tren-modo-r5_4 #card-referencia {
  display: none !important;
}

.segundo-acomp-wrap label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.segundo-acomp-select {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 2rem 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121a26;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
}

.segundo-acomp-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
}

.asig-badge--segundo {
  background: rgba(120, 180, 140, 0.18);
  color: #b8e0c8;
  border: 1px solid rgba(120, 180, 140, 0.35);
}

.asig-nombre--segundo {
  color: #d4f0dc;
  font-weight: 600;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  /* Usuario sin columna de disponibilidad: una sola columna a ancho completo */
  .grid-2.grid-2--solo-asignaciones {
    grid-template-columns: 1fr;
  }
}

.lista {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
}

.lista li {
  margin-bottom: 0.25rem;
}

.no-disp {
  margin: 0;
  font-size: 0.9rem;
}

.no-disp .label {
  color: var(--muted);
}

/* —— Asignaciones (tarjetas conductor / VIP) —— */
.card-asignaciones .asig-intro {
  margin-top: 0;
  margin-bottom: 1rem;
}

.asig-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0 0 1rem;
}

.asig-empty {
  margin: 0;
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.asig-card {
  position: relative;
  border-radius: 14px;
  padding: 0.85rem 1rem 1rem;
  background: linear-gradient(
    155deg,
    rgba(30, 42, 62, 0.92) 0%,
    rgba(18, 26, 40, 0.98) 100%
  );
  border: 1px solid var(--border);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.asig-card--primera {
  border-color: rgba(61, 139, 253, 0.45);
  box-shadow:
    0 0 0 1px rgba(61, 139, 253, 0.12),
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.asig-ribbon {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.65rem;
}

.asig-card--primera .asig-ribbon {
  color: #9ec8ff;
}

.asig-lane {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem 0.85rem;
  align-items: start;
}

.asig-lane + .asig-lane {
  margin-top: 0.15rem;
}

.asig-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 0.2rem;
}

.asig-badge--conductor {
  background: rgba(61, 139, 253, 0.22);
  color: #b8d9ff;
  border: 1px solid rgba(61, 139, 253, 0.35);
}

.asig-badge--vip {
  background: rgba(212, 168, 75, 0.16);
  color: #f0d9a0;
  border: 1px solid rgba(212, 168, 75, 0.35);
}

.asig-lane-body {
  min-width: 0;
}

.asig-nombre {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  word-break: break-word;
}

.asig-nombre--vip {
  font-size: 1.12rem;
  font-weight: 700;
  color: #fcecc0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

.asig-lane--sin-vip .asig-nombre--vip {
  color: var(--muted);
  font-weight: 500;
  font-size: 1rem;
  text-shadow: none;
}

.asig-bridge {
  display: flex;
  align-items: center;
  margin: 0.35rem 0 0.35rem 0.15rem;
  padding-left: 0.5rem;
  border-left: 2px solid rgba(61, 139, 253, 0.35);
  min-height: 1.25rem;
}

.asig-bridge-line {
  width: 2.75rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(61, 139, 253, 0.55),
    rgba(212, 168, 75, 0.5)
  );
}

.btn {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.secondary {
  background: #243044;
  color: var(--text);
  border-color: var(--border);
}

.btn.secondary:hover {
  background: #2c3c54;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.danger:hover {
  background: var(--danger-hover);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dlg-gestion {
  max-width: min(92vw, 640px);
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.dlg-gestion::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.dlg-gestion-inner {
  padding: 1rem 1.15rem 1.1rem;
}

.dlg-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.dlg-hint {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.gestion-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.gestion-tabs .tab {
  flex: 1;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121a26;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

.gestion-tabs .tab.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.gestion-panel[hidden] {
  display: none !important;
}

.gestion-panel .filtro {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121a26;
  color: var(--text);
  font-family: inherit;
}

.persona-list {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  max-height: 200px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #121a26;
}

.persona-list li {
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
}

.persona-list li:last-child {
  border-bottom: none;
}

.persona-list li:hover {
  background: #1c2838;
}

.persona-list li.selected {
  background: rgba(61, 139, 253, 0.22);
  outline: 1px solid var(--accent);
}

.persona-list li.inactive {
  color: var(--muted);
  opacity: 0.72;
  text-decoration: line-through;
}

.gestion-meta {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.nombre-input {
  width: 100%;
  margin-bottom: 0.55rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121a26;
  color: var(--text);
  font-family: inherit;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.btn-row .btn {
  font-size: 0.82rem;
  padding: 0.45rem 0.65rem;
}

.btn-sep {
  display: inline-block;
  width: 1px;
  height: 1.25rem;
  background: var(--border);
  margin: 0 0.15rem;
}

.masiva-block {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.masiva-block label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.masiva-ta {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121a26;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.msg-gestion {
  min-height: 1.25rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 0.85rem;
  color: var(--ok);
}

.msg-gestion.error {
  color: #ffb4b4;
}

.dlg-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

/* ========== LOGIN STYLES ========== */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.login-container .header {
  margin-bottom: 2rem;
  border: none;
  background: transparent;
  padding: 0;
  text-align: center;
}

.login-container h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.login-form h2 {
  margin: 0 0 1.5rem;
  font-size: 1.3rem;
  color: #c5d4e8;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.form-group input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121a26;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 139, 253, 0.1);
}

.error-message {
  background: rgba(224, 85, 85, 0.15);
  color: #ffb4b4;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border-left: 3px solid var(--danger);
}

.login-info {
  background: rgba(61, 139, 253, 0.08);
  border: 1px solid rgba(61, 139, 253, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
}

.login-info p {
  margin: 0.35rem 0;
  color: var(--muted);
}

.login-info strong {
  color: var(--text);
}

.login-info code {
  background: #121a26;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: var(--accent);
  font-family: "Courier New", monospace;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.btn.small {
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}

.header-top {
  flex: 1;
}

@media (max-width: 480px) {
  .login-container {
    padding: 1rem;
  }

  .login-form {
    padding: 1.5rem;
  }

  .login-container .header h1 {
    font-size: 1.5rem;
  }
}
