/* CONANE · Control de Asistencia y Nómina Electrónica · Una solución CISTI */
:root {
  --cn-navy: #0F1B33;
  --cn-navy-2: #16264A;
  --cn-navy-3: #1D3160;
  --cn-cyan: #22C5F0;
  --cn-blue: #1F5FE0;
  --cn-yellow: #F5B52E;
  --cn-grad: linear-gradient(135deg, #22C5F0 0%, #1F5FE0 100%);
  --cn-bg: #F3F6FB;
  --cn-ink: #0F1B33;
  --cn-muted: #64748B;
  --cn-line: #E3E9F2;
  --cn-radius: 14px;
  --bs-body-font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-primary: #1F5FE0;
  --bs-primary-rgb: 31, 95, 224;
  --bs-link-color: #1F5FE0;
  --bs-link-color-rgb: 31, 95, 224;
}
body { font-family: var(--bs-body-font-family); background: var(--cn-bg); color: var(--cn-ink); font-size: .92rem; }
h1, h2, h3, h4, h5, .fw-head { font-weight: 700; letter-spacing: -.01em; }
.text-muted { color: var(--cn-muted) !important; }
a { text-decoration: none; }

/* ---------- Botones ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-brand { background: var(--cn-grad); color: #fff; border: 0; box-shadow: 0 6px 18px -8px rgba(31, 95, 224, .7); }
.btn-brand:hover, .btn-brand:focus { color: #fff; filter: brightness(1.07); }
.btn-primary { background: var(--cn-blue); border-color: var(--cn-blue); }
.btn-soft { background: #EAF1FE; color: var(--cn-blue); border: 0; }
.btn-soft:hover { background: #D9E6FD; color: var(--cn-blue); }
.btn-yellow { background: var(--cn-yellow); color: var(--cn-navy); border: 0; }

/* ---------- Estructura ---------- */
.cn-shell { display: flex; min-height: 100vh; }
.cn-side { width: 252px; flex: 0 0 252px; background: var(--cn-navy); color: #C9D5EA; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background-image: radial-gradient(600px 300px at -20% -10%, rgba(34, 197, 240, .18), transparent 60%), radial-gradient(500px 400px at 120% 110%, rgba(31, 95, 224, .25), transparent 60%); }
.cn-side .brand { padding: 22px 22px 14px; display: flex; align-items: center; gap: 10px; }
.cn-side .brand img { height: 34px; }
.cn-side .company { margin: 0 14px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: .78rem; }
.cn-side .company b { color: #fff; display: block; font-size: .85rem; }
.cn-side .company select { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .2); font-size: .8rem; }
.cn-side .company select option { color: #000; }
.cn-nav { padding: 6px 10px 20px; flex: 1; }
.cn-nav .sec { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: #6F86AE; padding: 14px 12px 6px; font-weight: 700; }
.cn-nav a { display: flex; align-items: center; gap: 11px; color: #C9D5EA; padding: 8px 12px; border-radius: 10px; font-weight: 500; font-size: .87rem; margin-bottom: 1px; }
.cn-nav a i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .85; }
.cn-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.cn-nav a.active { background: var(--cn-grad); color: #fff; box-shadow: 0 8px 22px -10px rgba(34, 197, 240, .8); }
.cn-nav a .badge { margin-left: auto; }
.cn-side .foot { padding: 14px 22px 20px; font-size: .7rem; color: #6F86AE; border-top: 1px solid rgba(255, 255, 255, .06); }
.cn-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cn-top { height: 64px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--cn-line); display: flex; align-items: center; gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 20; }
.cn-top h1 { font-size: 1.12rem; margin: 0; }
.cn-top .crumb { font-size: .75rem; color: var(--cn-muted); }
.cn-top .user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--cn-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex: 0 0 36px; }
.avatar.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: .7rem; }
.cn-content { padding: 26px 28px 40px; }
.cn-burger { display: none; }

/* ---------- Tarjetas ---------- */
.card { border: 1px solid var(--cn-line); border-radius: var(--cn-radius); box-shadow: 0 1px 2px rgba(15, 27, 51, .04); }
.card-header { background: transparent; border-bottom: 1px solid var(--cn-line); padding: 14px 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-header .ms-auto { font-weight: 500; }
.card-body { padding: 18px; }
.kpi { position: relative; overflow: hidden; padding: 18px; }
.kpi .lbl { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--cn-muted); font-weight: 700; }
.kpi .num { font-size: 2rem; font-weight: 800; line-height: 1.1; margin-top: 6px; }
.kpi .sub { font-size: .78rem; color: var(--cn-muted); }
.kpi .ico { position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.ico-blue { background: #E7EFFE; color: var(--cn-blue); }
.ico-green { background: #E3F7EC; color: #15925A; }
.ico-yellow { background: #FEF4DC; color: #B57F07; }
.ico-red { background: #FDE8E8; color: #D33A3A; }
.ico-cyan { background: #E0F7FD; color: #0B95BA; }
.hero { background: var(--cn-navy); color: #fff; border: 0; overflow: hidden; position: relative;
  background-image: radial-gradient(500px 260px at 100% 0, rgba(34, 197, 240, .35), transparent 60%), radial-gradient(400px 260px at 0 100%, rgba(31, 95, 224, .45), transparent 60%); }
.hero .text-muted { color: #A9B9D6 !important; }
.hero .clock { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.grad-text { background: var(--cn-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .62rem .8rem; border-bottom-color: var(--cn-line); vertical-align: middle; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--cn-muted); font-weight: 700; background: #F8FAFD; white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background: #F5F8FE; }
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }

/* ---------- Estados ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-success { background: #E3F7EC; color: #15925A; }
.st-warning { background: #FEF4DC; color: #A87403; }
.st-danger { background: #FDE8E8; color: #D33A3A; }
.st-orange { background: #FFEEDD; color: #C2610C; }
.st-info { background: #E0F7FD; color: #0B88AA; }
.st-primary { background: #E7EFFE; color: var(--cn-blue); }
.st-purple { background: #F0E9FE; color: #7044D6; }
.st-teal { background: #DDF6F1; color: #0E8C74; }
.st-secondary { background: #EEF1F5; color: #55657E; }
.st-dark { background: #1F2937; color: #fff; }
.st-light { background: #F3F5F8; color: #8492A6; }

/* Tarjeta de asistencia (matriz) */
.matrix { font-size: .74rem; }
.matrix th, .matrix td { padding: 4px 3px !important; text-align: center; min-width: 30px; }
.matrix td.name, .matrix th.name { text-align: left; min-width: 190px; position: sticky; left: 0; background: #fff; z-index: 1; }
.cell { display: block; border-radius: 6px; padding: 3px 0; font-weight: 700; font-size: .7rem; }
.cell.c-success { background: #D7F3E3; color: #0F7A4A; }
.cell.c-warning { background: #FDEBBE; color: #8A5F00; }
.cell.c-danger { background: #FBD5D5; color: #B42323; }
.cell.c-orange { background: #FFE0C2; color: #A8520A; }
.cell.c-info, .cell.c-teal { background: #D3F2FA; color: #0A7C9B; }
.cell.c-primary { background: #DCE7FD; color: #1A4FC0; }
.cell.c-purple { background: #E7DCFD; color: #5B33B8; }
.cell.c-secondary, .cell.c-dark { background: #E5E9EF; color: #4B5A70; }
.cell.c-light { background: #F4F6F9; color: #A3AEC0; }

/* Monitor en vivo */
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #18B26B; box-shadow: 0 0 0 0 rgba(24, 178, 107, .6); animation: pulse 1.8s infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(24, 178, 107, .55); } 70% { box-shadow: 0 0 0 10px rgba(24, 178, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(24, 178, 107, 0); } }
.feed { max-height: 430px; overflow-y: auto; }
.feed-item { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--cn-line); }
.feed-item.new { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: #E3F4FF; } to { background: transparent; } }
.feed-item .t { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }

/* Formularios */
.form-control, .form-select { border-radius: 10px; border-color: #D5DEEA; }
.form-control:focus, .form-select:focus { border-color: var(--cn-cyan); box-shadow: 0 0 0 .2rem rgba(34, 197, 240, .2); }
.form-label { font-weight: 600; font-size: .8rem; color: #334155; margin-bottom: .3rem; }
.nav-pills .nav-link { border-radius: 10px; font-weight: 600; color: #475569; }
.nav-pills .nav-link.active { background: var(--cn-navy); }

/* Chat del asistente */
.chat { height: calc(100vh - 290px); min-height: 380px; overflow-y: auto; padding: 18px; background: #FAFCFF; }
.msg { max-width: 82%; margin-bottom: 14px; display: flex; gap: 10px; }
.msg .b { padding: 12px 15px; border-radius: 16px; white-space: pre-wrap; line-height: 1.5; }
.msg.user { margin-left: auto; flex-direction: row-reverse; }
.msg.user .b { background: var(--cn-grad); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .b { background: #fff; border: 1px solid var(--cn-line); border-bottom-left-radius: 4px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--cn-line); background: #fff; font-size: .78rem; margin: 0 6px 6px 0; cursor: pointer; color: #334155; }
.chip:hover { border-color: var(--cn-cyan); color: var(--cn-blue); }
.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #9FB0C9; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* Acceso */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--cn-navy); font-family: 'Montserrat', system-ui, sans-serif; padding: 24px;
  background-image: radial-gradient(800px 500px at 0 0, rgba(34, 197, 240, .25), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(31, 95, 224, .4), transparent 60%); }
.auth-card { width: 100%; max-width: 410px; background: #fff; border-radius: 20px; padding: 34px 32px 26px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.auth-logo { height: 46px; display: block; margin: 0 auto 6px; }
.auth-foot { text-align: center; font-size: .72rem; color: var(--cn-muted); margin: 22px 0 0; }
.auth-split { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 1040px; width: 100%; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.auth-split .pitch { color: #fff; padding: 48px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-right: 0; border-radius: 24px 0 0 24px; }
.auth-split .pitch h2 { font-size: 2rem; font-weight: 800; line-height: 1.15; }
.auth-split .pitch li { margin-bottom: 10px; color: #C9D5EA; }
.auth-split .pitch li i { color: var(--cn-cyan); margin-right: 8px; }
.auth-split .auth-card { max-width: none; border-radius: 0 24px 24px 0; padding: 48px 44px; box-shadow: none; }

/* Recibo imprimible */
.recibo { background: #fff; max-width: 900px; margin: 0 auto; padding: 32px; border-radius: 14px; border: 1px solid var(--cn-line); }
.recibo .hd { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--cn-navy); padding-bottom: 14px; margin-bottom: 16px; }
.recibo .tot { background: var(--cn-navy); color: #fff; border-radius: 12px; padding: 14px 18px; }
.qr { width: 110px; height: 110px; flex: 0 0 110px; }
.qr svg { width: 100%; height: 100%; display: block; }
@media print {
  .cn-side, .cn-top, .no-print { display: none !important; }
  body, .cn-content { background: #fff; padding: 0; }
  .recibo { border: 0; padding: 0; }
}
@media (max-width: 992px) {
  .cn-side { position: fixed; left: -260px; z-index: 50; transition: left .2s; }
  .cn-side.open { left: 0; }
  .cn-burger { display: inline-flex; }
  .cn-content { padding: 18px 14px 30px; }
  .cn-top { padding: 0 14px; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-split .pitch { display: none; }
  .auth-split .auth-card { border-radius: 20px; padding: 34px 28px; }
}
