/* =========================================================================
   Portal de Dictaminación de Expedientes — Subsecretaría
   Nuevos Beneficiarios 2026 · Hoja de estilos base
   Paleta extraída pixel a pixel de los bocetos originales.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root{
  /* Marca */
  --guinda:        #5F1A2D;
  --guinda-700:    #4E1524;
  --guinda-500:    #7A2338;
  --guinda-tint:   #FAEBF0;
  --tan:           #C69B66;
  --teal:          #366158;

  /* Semáforo de dictaminación */
  --verde:         #23C55E;
  --verde-600:     #1FAE53;
  --verde-toggle:  #4BAF28;
  --rojo:          #F04444;
  --rosa:          #F14462;
  --ambar:         #E9A23B;
  --gris-toggle:   #858585;

  /* Superficies */
  --bg:            #F2F2F2;
  --surface:       #FFFFFF;
  --thead:         #F1FDFB;
  --chip-folio:    #D0FBF2;
  --pill-dark:     #484647;
  --btn-soft:      #E4E3E8;

  /* Líneas y texto */
  --line:          #E4E3E8;
  --line-soft:     #EDEDF0;
  --line-card:     #E8E8E8;
  --ink:           #1D1D1F;
  --ink-2:         #4A4A4F;
  --ink-3:         #8A8A90;

  --sidebar-w:     241px;
  --header-h:      78px;
  --radius:        14px;
  --shadow-sm:     0 1px 2px rgba(16,16,20,.06);
  --shadow-md:     0 6px 22px rgba(16,16,20,.09);
  --shadow-lg:     0 18px 48px rgba(16,16,20,.16);
}

*,*::before,*::after{box-sizing:border-box}

html,body{height:100%}
body{
  margin:0;
  font-family:'Poppins',-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--ink);
  font-size:14px;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
button{font-family:inherit}
img{max-width:100%;display:block}

/* ============================= LAYOUT =================================== */
.app{display:flex;min-height:100vh}

/* ----------------------------- SIDEBAR --------------------------------- */
.sidebar{
  width:var(--sidebar-w);flex:0 0 var(--sidebar-w);
  background:var(--surface);
  border-right:1px solid var(--line);
  display:flex;flex-direction:column;
  position:sticky;top:0;height:100vh;z-index:40;
}
.sidebar__logo{padding:14px 18px 10px}
.sidebar__logo img{width:172px;height:auto}
.sidebar__nav{padding:14px 0 24px;overflow-y:auto}
.nav-section{
  font-size:13.5px;font-weight:700;letter-spacing:.2px;
  color:var(--ink);padding:16px 20px 8px;text-transform:uppercase;
}
.nav-item{
  display:flex;align-items:center;gap:12px;
  padding:11px 20px;margin:2px 0;
  font-size:14.5px;color:var(--ink-2);font-weight:400;
  border-left:3px solid transparent;cursor:pointer;
  transition:background .14s,color .14s;
}
.nav-item svg{width:20px;height:20px;flex:0 0 20px;color:var(--guinda)}
.nav-item:hover{background:#FAFAFA}
.nav-item.is-active{background:var(--bg);color:var(--ink);font-weight:500;border-left-color:var(--guinda)}
.sidebar__foot{margin-top:auto;padding:16px 20px;border-top:1px solid var(--line-soft)}
.sidebar__foot small{display:block;color:var(--ink-3);font-size:11px;line-height:1.5}

/* ----------------------------- MAIN ------------------------------------ */
.main{flex:1;min-width:0;display:flex;flex-direction:column}

.topbar{
  height:var(--header-h);background:var(--surface);
  border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:18px;
  padding:0 32px 0 24px;position:sticky;top:0;z-index:30;
}
.topbar__back{
  width:34px;height:34px;border:0;background:transparent;cursor:pointer;
  display:grid;place-items:center;border-radius:8px;color:var(--ink);
}
.topbar__back:hover{background:var(--bg)}
.topbar__sep{width:1px;height:34px;background:var(--line)}
.topbar__title{font-size:25px;font-weight:700;letter-spacing:-.2px;margin:0}
.topbar__title .crumb-sep{color:var(--ink-3);font-weight:400;margin:0 6px}
.topbar__title .crumb-dim{color:var(--ink)}
.topbar__spacer{margin-left:auto}
.avatar-btn{
  width:44px;height:44px;border-radius:7px;overflow:hidden;border:1px solid var(--line);
  background:var(--guinda);cursor:pointer;padding:0;
}
.avatar-btn img{width:100%;height:100%;object-fit:cover}

.usermenu{
  position:absolute;top:66px;right:32px;width:236px;background:#fff;
  border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-md);
  padding:8px;z-index:60;display:none;
}
.usermenu.is-open{display:block}
.usermenu__head{padding:10px 12px 12px;border-bottom:1px solid var(--line-soft);margin-bottom:6px}
.usermenu__head b{display:block;font-size:13.5px}
.usermenu__head span{font-size:11.5px;color:var(--ink-3)}
.usermenu__item{
  display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;
  font-size:13.5px;color:var(--ink-2);cursor:pointer;
}
.usermenu__item:hover{background:var(--bg)}
.usermenu__item svg{width:17px;height:17px}

.content{flex:1;padding:26px 32px 34px}
.content--narrow{max-width:1290px;margin:0 auto;width:100%}

.footerbar{
  background:var(--guinda);color:#fff;text-align:center;
  padding:15px 10px;font-size:13px;font-weight:400;
}
.footerbar b{font-weight:700}

/* ----------------------------- PANELES --------------------------------- */
.panel{
  background:var(--surface);border:1px solid var(--line-card);
  border-radius:var(--radius);padding:24px;margin-bottom:26px;
}
.panel--tight{padding:18px}
.panel__title{
  text-align:center;font-size:33px;font-weight:800;color:var(--guinda);
  letter-spacing:.4px;margin:12px 0 26px;text-transform:uppercase;
}

/* ----------------------------- KPI ------------------------------------- */
.kpis{display:grid;grid-template-columns:1fr 1.42fr 1fr;gap:28px;align-items:stretch}
.kpi{
  background:var(--surface);border:1px solid var(--line-card);border-radius:16px;
  padding:26px 28px;min-height:258px;display:flex;flex-direction:column;
  position:relative;text-decoration:none;color:inherit;
  transition:transform .16s,box-shadow .16s;
}
.kpi:hover{transform:translateY(-3px);box-shadow:var(--shadow-md)}
.kpi__num{font-size:52px;font-weight:800;line-height:1;letter-spacing:-1.5px}
.kpi__label{margin-top:auto;font-size:19px;font-weight:700;line-height:1.25}
.kpi__label span{display:block;color:var(--ink-3);font-weight:700}
.kpi__sub{font-size:12.5px;color:var(--ink-3);margin-top:6px}
.kpi__icon{
  position:absolute;top:26px;right:28px;width:52px;height:52px;border-radius:50%;
  display:grid;place-items:center;color:#fff;
}
.kpi__go{position:absolute;right:28px;bottom:30px;width:34px;height:34px;color:var(--ink)}
.kpi--feature{
  background:var(--guinda);color:#fff;border-color:var(--guinda);
  min-height:258px;padding:32px 34px;
}
.kpi--feature .kpi__num{font-size:62px}
.kpi--feature .kpi__label{font-size:23px}
.kpi--feature .kpi__go{color:#fff}
.kpi--feature .kpi__icon{width:78px;height:78px;background:#fff;color:var(--guinda);top:30px;right:34px}
.kpi__icon--tan{background:var(--tan)}
.kpi__icon--teal{background:var(--teal)}
.kpi__icon--rose{background:var(--rosa)}

/* ----------------------------- FORMULARIOS ------------------------------ */
.field{margin-bottom:16px}
.field__label{
  display:block;font-size:12.5px;font-weight:700;letter-spacing:.4px;
  text-transform:uppercase;margin-bottom:7px;color:var(--ink);
}
.input,.select{
  width:100%;height:44px;border:1px solid #D9D9DE;border-radius:9px;
  padding:0 15px;font-size:14px;font-family:inherit;color:var(--ink);
  background:#fff;outline:none;transition:border-color .15s,box-shadow .15s;
}
.input::placeholder{color:#B6B6BC;text-transform:none}
.input:focus,.select:focus{border-color:var(--guinda);box-shadow:0 0 0 3px rgba(95,26,45,.10)}
.select{
  appearance:none;padding-right:42px;cursor:pointer;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231D1D1F'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat:no-repeat;background-position:right 12px center;background-size:22px;
}
.filters{display:grid;grid-template-columns:repeat(3,1fr);gap:26px;margin-top:18px}

/* ----------------------------- TABLA ------------------------------------ */
.table-wrap{border:1px solid var(--line);border-radius:10px;overflow:hidden;margin-top:22px}
table.grid{width:100%;border-collapse:collapse;font-size:13.5px}
table.grid thead th{
  background:var(--thead);color:var(--ink);font-size:12.5px;font-weight:700;
  letter-spacing:.5px;text-transform:uppercase;padding:17px 14px;
  text-align:center;white-space:nowrap;border-bottom:1px solid var(--line);
  user-select:none;
}
table.grid thead th.sortable{cursor:pointer}
table.grid thead th .sort{display:inline-flex;vertical-align:-3px;margin-left:6px;opacity:.55}
table.grid thead th.is-sorted .sort{opacity:1;color:var(--guinda)}
table.grid tbody td{
  padding:13px 14px;border-bottom:1px solid var(--line);text-align:center;
  color:var(--ink-2);vertical-align:middle;
}
table.grid tbody tr:last-child td{border-bottom:0}
table.grid tbody tr:hover{background:#FCFBFC}
table.grid td.left{text-align:left}
table.grid .muted{color:var(--ink-3)}
.checkbox{
  width:17px;height:17px;border:1.5px solid #C9C9CF;border-radius:4px;
  appearance:none;cursor:pointer;background:#fff;position:relative;
}
.checkbox:checked{background:var(--guinda);border-color:var(--guinda)}
.checkbox:checked::after{
  content:'';position:absolute;left:5px;top:1.5px;width:5px;height:9px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(43deg);
}
.icon-btn{
  width:31px;height:31px;border-radius:50%;border:1px solid #CFCFD1;background:#fff;
  display:inline-grid;place-items:center;cursor:pointer;color:var(--ink-2);
  transition:all .14s;
}
.icon-btn:hover{border-color:var(--guinda);color:var(--guinda);background:var(--guinda-tint)}
.icon-btn svg{width:17px;height:17px}

/* ----------------------------- BADGES ----------------------------------- */
.badge{
  display:inline-block;min-width:152px;padding:8px 14px;border-radius:6px;
  font-size:11.5px;font-weight:700;letter-spacing:.5px;color:#fff;
  text-transform:uppercase;text-align:center;
}
.badge--verde{background:var(--verde)}
.badge--rosa{background:var(--rosa)}
.badge--ambar{background:var(--ambar)}
.badge--guinda{background:var(--guinda)}
.badge--gris{background:#9A9AA1}
.tag{
  display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:20px;
  font-size:11px;font-weight:600;letter-spacing:.3px;text-transform:uppercase;
}
.tag--ok{background:#E8F9EF;color:#12833F}
.tag--warn{background:#FDF1E1;color:#9A6014}
.tag--bad{background:#FDECEC;color:#B62020}

/* ----------------------------- PAGINACIÓN -------------------------------- */
.pager{
  display:flex;align-items:center;gap:14px;margin-top:20px;
  border:1px solid var(--line);border-radius:10px;padding:14px 20px;
}
.pager__count{font-size:13.5px;color:var(--ink-2)}
.pager__count b{color:var(--ink)}
.pager__nav{margin-left:auto;display:flex;align-items:center;gap:6px}
.pager__btn{
  min-width:34px;height:34px;border-radius:50%;border:0;background:transparent;
  color:var(--ink-2);font-size:13.5px;cursor:pointer;display:grid;place-items:center;
}
.pager__btn:hover:not(:disabled){background:var(--bg)}
.pager__btn:disabled{opacity:.3;cursor:default}
.pager__btn.is-active{background:var(--thead);color:var(--ink);font-weight:600;box-shadow:inset 0 0 0 1px #CDECE5}
.pager .select{width:92px;height:38px;margin-left:10px}

/* ----------------------------- BOTONES ---------------------------------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  height:46px;padding:0 26px;border-radius:9px;border:0;cursor:pointer;
  font-size:14px;font-weight:600;letter-spacing:.3px;transition:filter .15s,transform .1s;
}
.btn:active{transform:translateY(1px)}
.btn:hover{filter:brightness(.94)}
.btn svg{width:19px;height:19px}
.btn--guinda{background:var(--guinda);color:#fff}
.btn--verde{background:var(--verde);color:#fff}
.btn--rojo{background:var(--rojo);color:#fff}
.btn--soft{background:var(--btn-soft);color:var(--ink)}
.btn--ghost{background:#fff;color:var(--ink);box-shadow:inset 0 0 0 1px var(--line)}
.btn--lg{height:52px;padding:0 40px;font-size:15px;text-transform:uppercase}
.btn--block{width:100%}
.btn:disabled{opacity:.45;cursor:not-allowed}

/* ----------------------------- EXPEDIENTE ------------------------------- */
.recordnav{
  display:flex;align-items:center;background:var(--surface);
  border:1px solid var(--line-card);border-radius:var(--radius);
  padding:14px 16px;margin-bottom:22px;gap:16px;
}
.recordnav__btn{
  display:inline-flex;align-items:center;gap:12px;background:var(--btn-soft);
  border:0;border-radius:9px;padding:11px 20px;font-size:15px;font-weight:500;
  cursor:pointer;color:var(--ink);
}
.recordnav__btn:hover{background:#D8D7DE}
.recordnav__btn svg{width:26px;height:26px}
.recordnav__id{
  margin:0 auto;background:var(--pill-dark);color:#fff;border-radius:7px;
  padding:12px 30px;font-size:16px;font-weight:600;letter-spacing:.3px;
}

.student{
  background:var(--surface);border:1px solid var(--line-card);border-radius:var(--radius);
  padding:26px 30px;display:flex;gap:34px;align-items:center;margin-bottom:22px;
}
.student__photo{
  width:186px;height:186px;border-radius:50%;background:#D9D9D9;flex:0 0 186px;
  display:grid;place-items:center;overflow:hidden;
}
.student__photo svg{width:104px;height:104px;color:var(--guinda)}
.student__name{font-size:29px;font-weight:800;color:var(--guinda);margin:0 0 14px;letter-spacing:-.2px}
.student__meta{display:flex;gap:36px;font-size:14.5px;margin-bottom:12px;flex-wrap:wrap}
.student__meta b{font-weight:700;letter-spacing:.2px}
.student__meta span{color:var(--ink-2)}
.chip{
  display:inline-flex;align-items:center;gap:9px;border-radius:22px;
  padding:9px 20px;font-size:14.5px;margin:0 10px 10px 0;
}
.chip b{font-weight:700}
.chip--curp{background:var(--guinda-tint)}
.chip--folio{background:var(--chip-folio)}
.student__contact{display:flex;gap:44px;align-items:center;margin-top:8px;flex-wrap:wrap}
.student__contact div{display:flex;align-items:center;gap:12px;font-size:14.5px;color:var(--ink-2)}
.student__contact svg{width:20px;height:20px;color:var(--ink)}

.split{display:grid;grid-template-columns:1fr 1.28fr;gap:26px}
.card{background:#fff;border:1px solid var(--line-card);border-radius:12px;padding:22px 24px}
.card h3{font-size:17.5px;font-weight:700;margin:0 0 4px;letter-spacing:-.1px}
.card h3+.datalist{margin-top:12px}
.card h3:not(:first-child){margin-top:26px}
.card .rule{height:1px;background:var(--line);margin:10px 0 4px}
.datalist{margin:0 0 6px}
.datarow{
  display:flex;align-items:center;gap:12px;padding:9px 0;
  border-bottom:1px solid var(--line-soft);font-size:13.5px;
}
.datarow:last-child{border-bottom:0}
.datarow__ico{width:19px;height:19px;color:var(--guinda);flex:0 0 19px;opacity:.85}
.datarow__k{color:var(--ink-2)}
.datarow__v{margin-left:auto;text-align:right;font-weight:500;color:var(--ink)}

/* ----------------------------- VALIDAR DOCS ----------------------------- */
.docpanel{background:var(--bg);border-radius:12px;padding:22px 24px}
.docpanel>h3{font-size:17.5px;font-weight:700;margin:0 0 18px}
.docitem{margin-bottom:18px}
.docitem__head{
  display:flex;align-items:stretch;gap:0;background:#fff;border-radius:10px;
  border:1px solid var(--line);overflow:hidden;
}
.docitem__ico{
  width:70px;display:grid;place-items:center;border-right:1px solid var(--line);
  color:var(--ink);flex:0 0 70px;
}
.docitem__ico svg{width:30px;height:30px}
.docitem__name{
  flex:1;display:flex;align-items:center;padding:0 18px;font-size:13.5px;
  font-weight:600;letter-spacing:.3px;text-transform:uppercase;
}
.docitem__eye{
  width:56px;display:grid;place-items:center;border-left:1px solid var(--line);
  cursor:pointer;color:var(--ink-2);background:#fff;border-top:0;border-bottom:0;border-right:0;
}
.docitem__eye:hover{color:var(--guinda);background:var(--guinda-tint)}
.docitem__eye svg{width:20px;height:20px}
.docitem__sw{width:104px;display:grid;place-items:center;border-left:1px solid var(--line);background:#fff}

.switch{width:62px;height:31px;border-radius:16px;background:var(--gris-toggle);border:0;
  position:relative;cursor:pointer;transition:background .2s;padding:0}
.switch::after{
  content:'';position:absolute;top:3px;left:3px;width:25px;height:25px;border-radius:50%;
  background:#fff;transition:left .2s;box-shadow:0 1px 3px rgba(0,0,0,.25);
}
.switch.is-on{background:var(--verde-toggle)}
.switch.is-on::after{left:34px}
.switch.is-pending{background:#C7C7CC}

.docitem__obs{
  width:100%;margin-top:8px;border:1px solid var(--line);border-radius:10px;background:#fff;
  padding:14px 16px;min-height:66px;font-family:inherit;font-size:13px;color:var(--ink-2);
  resize:vertical;outline:none;
}
.docitem__obs::placeholder{color:#B0B0B6}
.docitem__obs:focus{border-color:var(--guinda);box-shadow:0 0 0 3px rgba(95,26,45,.08)}
.docitem.is-rejected .docitem__obs{border-color:#F3C3C3;background:#FFFBFB}
.docitem__reasons{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}
.reason{
  border:1px solid #E5D4D9;background:#fff;color:var(--guinda);border-radius:20px;
  padding:5px 12px;font-size:11.5px;cursor:pointer;font-weight:500;
}
.reason:hover{background:var(--guinda-tint)}

.actions-row{display:flex;justify-content:center;gap:26px;margin-top:30px;flex-wrap:wrap}

/* ----------------------------- MISC ------------------------------------- */
.empty{padding:56px 20px;text-align:center;color:var(--ink-3)}
.empty svg{width:52px;height:52px;margin-bottom:12px;opacity:.4}

.toast-wrap{position:fixed;right:26px;bottom:26px;z-index:9999;display:flex;flex-direction:column;gap:10px}
.toast{
  background:#1D1D1F;color:#fff;border-radius:11px;padding:14px 20px;font-size:13.5px;
  box-shadow:var(--shadow-lg);display:flex;align-items:center;gap:11px;
  animation:toastIn .25s ease-out;max-width:390px;
}
.toast svg{width:19px;height:19px;flex:0 0 19px}
.toast--ok{background:#12833F}
.toast--bad{background:#B62020}
.toast--info{background:var(--guinda)}
@keyframes toastIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}

.modal-back{
  position:fixed;inset:0;background:rgba(20,16,18,.62);backdrop-filter:blur(3px);
  z-index:200;display:none;align-items:center;justify-content:center;padding:30px;
}
.modal-back.is-open{display:flex}
.modal{
  background:#fff;border-radius:16px;width:min(1080px,100%);max-height:92vh;
  display:flex;flex-direction:column;overflow:hidden;box-shadow:var(--shadow-lg);
}
.modal__head{
  display:flex;align-items:center;gap:14px;padding:16px 20px;border-bottom:1px solid var(--line);
}
.modal__head h4{margin:0;font-size:16px;font-weight:700}
.modal__head .close{margin-left:auto}
.modal__body{padding:18px 20px;overflow:auto;background:#F7F7F8}

.hint{
  background:#FFF9E8;border:1px solid #F1E0AE;color:#7A5A11;border-radius:10px;
  padding:11px 15px;font-size:12.5px;display:flex;gap:10px;align-items:flex-start;
}
.hint svg{width:17px;height:17px;flex:0 0 17px;margin-top:1px}

.progressbar{height:8px;border-radius:6px;background:#E9E9EE;overflow:hidden}
.progressbar span{display:block;height:100%;background:var(--verde);transition:width .4s}

.kbd{
  display:inline-block;min-width:20px;padding:1px 6px;border-radius:5px;background:#EFEFF2;
  border:1px solid #DDD;font-size:11px;font-family:ui-monospace,Menlo,Consolas,monospace;color:#444;
}

/* ----------------------------- RESPONSIVE ------------------------------- */
@media (max-width:1180px){
  .kpis{grid-template-columns:1fr;gap:18px}
  .split{grid-template-columns:1fr}
  .filters{grid-template-columns:1fr}
}
@media (max-width:860px){
  .sidebar{position:fixed;left:-260px;transition:left .2s}
  .sidebar.is-open{left:0;box-shadow:var(--shadow-lg)}
  .content{padding:18px}
  .topbar{padding:0 16px}
  .topbar__title{font-size:19px}
  .student{flex-direction:column;text-align:center}
  .table-wrap{overflow-x:auto}
}
