/* ═══════════════════════════════════════════════════════════
   CALCULADORA DE PENSIONES IMSS — styles.css
   ─────────────────────────────────────────────────────────
   Para cambiar colores principales, edita las variables
   dentro de :root  (líneas 10-20)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;600&display=swap');

:root {
  /* ── Paleta Áurea — Negro, Dorado y Crema (igual que la página principal) ── */
  --verde:        #0D0D0D;   /* Negro principal (header, botones) */
  --verde-medio:  #1E1E1E;   /* Negro más claro (hover) */
  --verde-claro:  #1E1E1E;   /* Fondo oscuro para campos calculados */
  --dorado:       #C9A84C;   /* Dorado principal */
  --dorado-claro: #E8C97A;   /* Crema/dorado claro para badges y acentos */

  /* ── Neutros Áurea ── */
  --gris:   #141414;   /* Fondo general — igual que la página principal */
  --borde:  #3A3A3A;   /* Bordes neutros */
  --texto:  #F2EEE6;   /* Texto principal — crema cálido */
  --muted:  #9A9A9A;   /* Texto secundario — gris claro */
  --rojo:   #c0392b;   /* Botón eliminar */
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--gris);
  color: var(--texto);
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════ */
header {
  background: var(--verde);
  color: #fff;
  padding: 0 2rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
header .brand {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: 'Cormorant Garamond', serif;
  color: var(--dorado);
}
header .brand svg { opacity: .9; }
header .nav-btns { display: flex; gap: .5rem; }
header .nav-btns button {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: .85rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
header .nav-btns button:hover  { background: rgba(255,255,255,.28); }
header .nav-btns button.active { background: rgba(255,255,255,.3); font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ══════════════════════════════════════════════════════════ */
.app { display: flex; min-height: calc(100vh - 56px); }

/* ══════════════════════════════════════════════════════════
   SIDEBAR (panel izquierdo con lista de clientes)
   ══════════════════════════════════════════════════════════ */
aside {
  width: 260px;          /* ← cambia aquí el ancho del sidebar */
  background: #1E1E1E;
  border-right: 1px solid var(--borde);
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  flex-shrink: 0;
}
aside .aside-header {
  padding: .4rem 1rem .8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
aside .aside-header span {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}
aside .btn-nuevo {
  background: var(--verde);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: .8rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
aside .btn-nuevo:hover { background: var(--verde-medio); }

aside .search-box { padding: 0 .75rem .75rem; }
aside .search-box input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--borde);
  border-radius: 6px;
  font-size: .85rem;
  font-family: inherit;
  background: #141414;
  outline: none;
}
aside .search-box input:focus { border-color: var(--verde-medio); }

/* Ítem de la lista de clientes */
.cliente-item {
  padding: .65rem 1rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .12s;
}
.cliente-item:hover  { background: #2A2A2A; }
.cliente-item.active { background: #2A2A2A; border-left-color: var(--dorado); }
.cliente-item .nombre { font-size: .88rem; font-weight: 600; }
.cliente-item .meta   { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.empty-list { padding: 2rem 1rem; text-align: center; color: var(--muted); font-size: .85rem; }

/* ══════════════════════════════════════════════════════════
   ÁREA PRINCIPAL (main)
   ══════════════════════════════════════════════════════════ */
main { flex: 1; padding: 2rem; overflow-y: auto; }

/* ── Pantalla de bienvenida ── */
.welcome {
  max-width: 480px;
  margin: 6rem auto;
  text-align: center;
}
.welcome .icon-circle {
  width: 80px; height: 80px;
  background: #2A2A2A;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem;
}
.welcome h2 { font-size: 1.4rem; margin-bottom: .5rem; }
.welcome p  { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }

/* ══════════════════════════════════════════════════════════
   TARJETAS DE SECCIÓN (formulario y detalle)
   ══════════════════════════════════════════════════════════ */
.form-wrap   { max-width: 860px; margin: 0 auto; }
.section-card {
  background: #1E1E1E;
  border: 1px solid var(--borde);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.section-card .sc-header {
  background: #0D0D0D;
  color: var(--dorado);
  border-bottom: 1px solid #2A2A2A;
  padding: .65rem 1.25rem;
  font-size: .85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: .3px;
}
.section-card .sc-body { padding: 1.25rem; background: #1E1E1E; }

/* ── Grid de columnas ── */
.grid { display: grid; gap: 1rem; }
.g1   { grid-template-columns: 1fr; }
.g2   { grid-template-columns: repeat(2, 1fr); }
.g3   { grid-template-columns: repeat(3, 1fr); }
.g4   { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }

/* ── Inputs / selects / textareas ── */
label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: #374151;
}
input[type=text],
input[type=email],
input[type=date],
input[type=number],
select,
textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--borde);
  border-radius: 7px;
  font-size: .88rem;
  font-family: inherit;
  background: #1E1E1E;
  color: var(--texto);
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(201,168,76,.18);
}
textarea { resize: vertical; min-height: 70px; }

/* Calendario del input type=date — forzado a tema oscuro con ícono dorado */
input[type=date] {
  color-scheme: dark;
}
input[type=date]::-webkit-calendar-picker-indicator {
  filter: invert(76%) sepia(56%) saturate(496%) hue-rotate(2deg) brightness(96%) contrast(92%);
  cursor: pointer;
  opacity: .9;
}
input[type=date]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* ── Campos calculados automáticamente (fondo verde) ── */
.calc-field {
  background: #2A2A2A !important;
  border-color: #C9A84C !important;
  font-weight: 600;
  color: #C9A84C;
  font-family: 'IBM Plex Mono', monospace;
}
.calc-label { color: #C9A84C !important; }

/* ══════════════════════════════════════════════════════════
   BANNER DE RESULTADO (vista detalle)
   ══════════════════════════════════════════════════════════ */
.resultado-banner {
  background: linear-gradient(135deg, #0D0D0D 0%, #000000 100%);
  border: 1px solid #C9A84C;
  color: #fff;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.resultado-banner .total-box   { flex: 0 0 auto; }
.resultado-banner .total-label {
  font-size: .75rem; opacity: .7;
  text-transform: uppercase; letter-spacing: .8px;
}
.resultado-banner .total-monto {
  font-size: 2.4rem; font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1;
}
.resultado-banner .divider {
  width: 1px; height: 60px;
  background: rgba(255,255,255,.2);
  flex-shrink: 0;
}
.resultado-banner .grid-montos {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 1rem;
  flex: 1;
}
.resultado-banner .monto-item .ml { font-size: .72rem; opacity: .65; }
.resultado-banner .monto-item .mv {
  font-size: 1.1rem; font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

/* ══════════════════════════════════════════════════════════
   BOTONES
   ══════════════════════════════════════════════════════════ */
.form-actions { display: flex; gap: .75rem; align-items: center; justify-content: center; margin-top: .5rem; }

.btn-guardar {
  background: var(--verde);
  color: #fff;
  border: none;
  padding: 9px 24px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-guardar:hover { background: var(--verde-medio); }

.btn-cancelar {
  background: transparent;
  border: 1px solid var(--borde);
  color: var(--muted);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: .9rem;
  cursor: pointer;
  font-family: inherit;
}
.btn-cancelar:hover { background: #2A2A2A; }

.btn-eliminar {
  background: transparent;
  border: 1px solid #fca5a5;
  color: var(--rojo);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .85rem;
  cursor: pointer;
  font-family: inherit;
}
.btn-eliminar:hover { background: #fef2f2; }

/* ══════════════════════════════════════════════════════════
   VISTA DETALLE
   ══════════════════════════════════════════════════════════ */
.detalle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th {
  text-align: left;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 500;
  padding: 5px 0;
  width: 45%;
}
.detail-table td {
  font-size: .88rem;
  padding: 5px 0;
  border-bottom: 1px solid #2A2A2A;
}
.mono { font-family: 'IBM Plex Mono', monospace; }
.tag-afore {
  display: inline-block;
  background: #2A2A2A;
  color: #C9A84C;
  border: 1px solid #C9A84C;
  border-radius: 4px;
  font-size: .72rem;
  padding: 1px 7px;
  font-weight: 600;
}
.detalle-btns { display: flex; gap: .75rem; margin-bottom: 1.25rem; align-items: center; justify-content: flex-start; }
.detalle-btns .btn-editar { margin-left: auto; }
.btn-editar {
  background: var(--verde); color: #fff; border: none;
  padding: 7px 18px; border-radius: 7px; font-size: .85rem;
  cursor: pointer; font-family: inherit; font-weight: 500;
}
.btn-editar:hover { background: var(--verde-medio); }
.btn-del {
  background: transparent; border: 1px solid #fca5a5;
  color: var(--rojo); padding: 6px 14px; border-radius: 7px;
  font-size: .85rem; cursor: pointer; font-family: inherit;
}
.btn-del:hover { background: #fef2f2; }
.back-link {
  color: var(--muted); font-size: .85rem; cursor: pointer;
  display: flex; align-items: center; gap: .3rem;
  text-decoration: none; background: none; border: none; font-family: inherit;
}
.back-link:hover { color: var(--texto); }

/* ══════════════════════════════════════════════════════════
   TOAST (notificaciones)
   ══════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: #0D0D0D; color: #fff;
  padding: .75rem 1.25rem; border-radius: 8px;
  font-size: .85rem; z-index: 999;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  transform: translateY(80px); opacity: 0;
  transition: all .25s;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ══════════════════════════════════════════════════════════
   MODAL (confirmar eliminar)
   ══════════════════════════════════════════════════════════ */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 200;
  align-items: center; justify-content: center;
}
.overlay.show { display: flex; }
.modal { background: #1E1E1E; border-radius: 12px; padding: 2rem; max-width: 380px; width: 90%; text-align: center; }
.modal h3 { margin-bottom: .5rem; }
.modal p  { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }
.modal-btns { display: flex; gap: .75rem; justify-content: center; }
.modal-btns button { padding: 8px 22px; border-radius: 7px; cursor: pointer; font-family: inherit; font-weight: 500; }
.btn-confirm-del    { background: var(--rojo); color: #fff; border: none; }
.btn-confirm-del:hover { background: #b91c1c; }
.btn-confirm-cancel { background: transparent; border: 1px solid var(--borde); color: var(--texto); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE (móvil)
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .g3, .g4 { grid-template-columns: repeat(2, 1fr); }
  aside { width: 220px; }
}
@media (max-width: 700px) {
  aside { display: none; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .detalle-grid { grid-template-columns: 1fr; }
  .resultado-banner .grid-montos { grid-template-columns: repeat(2,1fr); }
  .resultado-banner .divider { display: none; }
  .span2 { grid-column: span 1; }
  header { flex-wrap: wrap; height: auto; padding: .75rem 1rem; gap: .5rem; }
  header .nav-btns { width: 100%; justify-content: flex-end; }
  .firma-block { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  header .brand-title { font-size: 1rem; }
  header .brand-subtitle { font-size: .55rem; }
  .resultado-banner .total-monto { font-size: 1.8rem; }
  .resultado-banner .grid-montos { grid-template-columns: 1fr; }
}


/* ══════════════════════════════════════════════════════════
   DETALLES ÁUREA
   ══════════════════════════════════════════════════════════ */

/* Scrollbar dorada */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #141414; }
::-webkit-scrollbar-thumb { background: #3A3A3A; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #C9A84C; }

/* Selección de texto */
::selection { background: rgba(201,168,76,.3); color: #F2EEE6; }

/* Labels */
label { color: #9A9A9A; }

/* Section card border dorado al hover */
.section-card:hover { border-color: #3A3A3A; transition: border-color .2s; }

/* Aside search input */
aside .search-box input { color: var(--texto); }

/* Empty list */
.empty-list { color: #9A9A9A; }

/* Detail table th */
.detail-table th { color: #9A9A9A; }

/* Cliente item nombre/meta */
.cliente-item .nombre { color: #F2EEE6; }
.cliente-item .meta   { color: #9A9A9A; }

/* Back link */
.back-link { color: #9A9A9A; }
.back-link:hover { color: var(--dorado); }

/* Aside header span */
aside .aside-header span { color: #9A9A9A; }

/* Toast dorado */
.toast { background: #0D0D0D; border: 1px solid #C9A84C; color: #F2EEE6; }

/* Welcome h2 */
.welcome h2 { color: #F2EEE6; }
.welcome p  { color: #9A9A9A; }

/* Monto item label en banner */
.resultado-banner .monto-item .ml { color: rgba(201,168,76,.65); }
.resultado-banner .total-label    { color: rgba(201,168,76,.65); }


/* ══════════════════════════════════════════════════════════
   AJUSTES: LOGO, CENTRADO DE DETALLE, AYUDA DE CAMPOS, IMPRESIÓN
   ══════════════════════════════════════════════════════════ */

header .brand { gap: .85rem; }
header .brand-logo {
  height: 42px;
  width: 42px;
  object-fit: cover;
  border-radius: 50%;
  border: 1.5px solid var(--dorado);
  background: #000;
  flex-shrink: 0;
}
header .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
header .brand-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dorado);
}
header .brand-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #E8C97A;
  margin-top: 2px;
}

.detalle-wrap { max-width: 860px; margin: 0 auto; }

.campo-ayuda {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 4px;
}
.campo-ayuda a {
  color: var(--dorado);
  text-decoration: underline;
}

@media print {
  header, aside, .toast, .overlay, .no-print { display: none !important; }
  main { padding: 0; }
  body { background: #fff; color: #000; }
  .section-card, .resultado-banner { border-color: #ccc !important; }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  @page {
    size: auto;
    margin: 10mm;
  }
}


.solo-impresion { display: none; }
@media print {
  .solo-impresion { display: block !important; }
  .pantalla-detalle { display: none !important; }
}
.firma-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin: 2.5rem 1rem 0;
}
.detalle-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
}
.firma-item .firma-linea {
  height: 50px;
  border-bottom: 1px solid var(--muted);
}
.firma-item .firma-label {
  font-size: .78rem;
  color: var(--muted);
  margin-top: .4rem;
  text-align: center;
}


.btn-menu-movil {
  display: none;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}

@media (max-width: 700px) {
  .btn-menu-movil { display: inline-block; }
  aside {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 90;
    overflow-y: auto;
  }
  aside.show-movil { display: flex; }
  main { padding: 1rem; }
  .form-actions, .detalle-actions { flex-wrap: wrap; }
  .form-actions button, .detalle-actions button { flex: 1 1 auto; min-width: 120px; }
  .resultado-banner { padding: 1rem 1.25rem; gap: 1rem; }
  .resultado-banner .total-monto { font-size: 2rem; }
}

@media (max-width: 1100px) and (min-width: 701px) {
  .grid.g2 { grid-template-columns: 1fr; }
}


.site-footer {
  background: #0D0D0D;
  border-top: 1px solid var(--borde);
  color: #9A9A9A;
  font-size: .72rem;
  padding: .75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
}
@media (max-width: 700px) {
  .site-footer {
    justify-content: center;
    text-align: center;
    padding: .75rem 1rem;
  }
}


html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
header { flex-shrink: 0; }
.app {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
aside { overflow-y: auto; }
main { flex: 1; overflow-y: auto; }
.site-footer { flex-shrink: 0; }


