/* Mi Contador — estilos compartidos (colores y tipografías del manual de marca) */
@font-face { font-family: "Montserrat"; src: url("../fonts/Montserrat.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../fonts/NunitoSans.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }

:root {
  --violeta: #7B4FE0;
  --violeta-hover: #6A3FD0;
  --lila: #C25CEC;
  --indigo: #4A3A8C;
  --nube: #ECEBF1;
  --grafito: #1E1B2E;
  --oro: #F5C542;
  --coral: #E5484D;
  --exito: #1F9D6B;
  --blanco: #FFFFFF;
  --degradado: linear-gradient(135deg, #C25CEC, #7B4FE0 55%, #5B3FCB);
  --texto-suave: #5E5A73;
  --texto-tenue: #8C88A0;
  --borde: #DEDCE8;
  --violeta-10: #F3EEFD;
  --violeta-20: #E5DBFB;
  --sombra: 0 1px 2px rgba(30,27,46,.06), 0 8px 24px rgba(74,58,140,.08);
  --sombra-fuerte: 0 20px 50px rgba(74,58,140,.22);
  --radio: 16px;
  --radio-s: 10px;
  --f-titulo: "Montserrat", system-ui, sans-serif;
  --f-texto: "Nunito Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-texto); color: var(--grafito); background: var(--blanco); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--f-titulo); margin: 0; line-height: 1.15; color: var(--grafito); }
p { margin: 0; }
a { color: var(--violeta); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font-family: var(--f-titulo); font-weight: 700; font-size: 14px; padding: 11px 18px; border-radius: 12px; transition: background .15s, box-shadow .15s, transform .05s, color .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primario { background: var(--violeta); color: #fff; box-shadow: 0 6px 18px rgba(123,79,224,.28); }
.btn-primario:hover { background: var(--violeta-hover); }
.btn-secundario { background: #fff; color: var(--grafito); border: 1px solid var(--borde); }
.btn-secundario:hover { background: var(--nube); }
.btn-suave { background: var(--violeta-10); color: var(--violeta); }
.btn-suave:hover { background: var(--violeta-20); }
.btn-peligro { background: #FDECEC; color: var(--coral); }
.btn-peligro:hover { background: #FAD7D8; }
.btn-grande { padding: 15px 26px; font-size: 16px; border-radius: 14px; }
.btn-chico { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-icono { padding: 8px; border-radius: 10px; background: transparent; color: var(--texto-suave); }
.btn-icono:hover { background: var(--nube); color: var(--grafito); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Formularios */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 13px; font-weight: 700; color: var(--texto-suave); }
.input, select.input, textarea.input { width: 100%; padding: 11px 13px; border: 1px solid var(--borde); border-radius: var(--radio-s); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--violeta); box-shadow: 0 0 0 3px var(--violeta-20); }
.grid-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-campos .ancho { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid-campos { grid-template-columns: 1fr; } }

/* Etiquetas de estado */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-activo { background: #E3F6EE; color: var(--exito); }
.chip-vencido { background: #FEF6DD; color: #9A7206; }
.chip-suspendido { background: #FDECEC; color: var(--coral); }
.chip-pendiente { background: var(--violeta-10); color: var(--violeta); }
.chip-neutro { background: var(--nube); color: var(--texto-suave); }

/* Tarjetas */
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 20px; }

/* Modal */
.modal-fondo { position: fixed; inset: 0; background: rgba(30,27,46,.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; animation: aparecer .15s ease; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--sombra-fuerte); animation: subir .2s ease; }
.modal-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-cabecera h3 { font-size: 19px; }
.modal-cuerpo { padding: 18px 22px; }
.modal-pie { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 22px; flex-wrap: wrap; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(12px); } }

/* Avisos flotantes */
.toast-zona { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--grafito); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: var(--sombra-fuerte); animation: subir .2s ease; display: flex; gap: 10px; align-items: center; max-width: 360px; }
.toast svg { width: 18px; height: 18px; color: var(--oro); flex: none; }
@media (max-width: 560px) { .toast-zona { left: 16px; right: 16px; } }

/* Tablas */
.tabla-envoltura { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-family: var(--f-titulo); font-size: 12px; font-weight: 700; color: var(--texto-tenue); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 12px; border-bottom: 1px solid var(--nube); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: #FAF9FD; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vacio { text-align: center; color: var(--texto-tenue); padding: 36px 12px !important; }

.cifra { font-family: var(--f-titulo); font-weight: 700; font-variant-numeric: tabular-nums; }
.tenue { color: var(--texto-tenue); }
.suave { color: var(--texto-suave); }
