:root{
  --central-blue:#0099c9;
  --central-blue-dark:#007fa8;
  --central-blue-soft:#e8f8fd;
  --central-black:#050505;
  --central-dark:#07111f;
  --central-gray:#64748b;
  --central-border:#d8e4ec;
  --central-bg:#edf5f9;
  --white:#ffffff;

  --green:#0099c9;
  --green-dark:#07111f;
  --green-soft:#e8f8fd;

  --red:#dc2626;
  --orange:#ea580c;
  --purple:#7c3aed;
  --blue:#0099c9;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  font-family:Arial, Helvetica, sans-serif;
  background:var(--central-bg);
  color:var(--central-dark);
}

a{
  text-decoration:none;
}

.app{
  min-height:100vh;
  display:flex;
}

/* SIDEBAR */
.sidebar{
  width:270px;
  background:#ffffff;
  border-right:1px solid var(--central-border);
  display:flex;
  flex-direction:column;
  box-shadow:6px 0 22px rgba(15,23,42,.04);
}

.brand{
  min-height:116px;
  padding:20px 22px 16px;
  border-bottom:1px solid #eef4f7;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.brand-logo{
  width:190px;
  max-width:100%;
  height:auto;
  display:block;
}

.brand-subtitle{
  margin:6px 0 0;
  color:#74869a;
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
}

.sidebar nav{
  padding:22px 18px;
}

.sidebar nav a{
  display:block;
  padding:13px 14px;
  border-radius:12px;
  color:#26364d;
  font-weight:900;
  font-size:14px;
  margin-bottom:8px;
  transition:.18s ease;
}

.sidebar nav a:hover{
  background:var(--central-blue-soft);
  color:var(--central-blue-dark);
  transform:translateX(2px);
}

.menu-section{
  margin:20px 0 9px;
  padding:0 14px;
  font-size:10px;
  font-weight:900;
  letter-spacing:.16em;
  color:#8ea1b4;
}

.sidebar-footer{
  margin-top:auto;
  padding:22px;
  border-top:1px solid #eef4f7;
  background:#fbfdff;
}

.sidebar-footer p{
  margin:0;
  font-weight:900;
  color:#07111f;
  line-height:1.25;
}

.sidebar-footer small{
  display:block;
  color:#718096;
  margin-top:4px;
  font-size:12px;
}

.logout{
  display:block;
  margin-top:14px;
  background:#eef5f8;
  padding:12px;
  border-radius:12px;
  text-align:center;
  color:#26364d;
  font-weight:900;
  transition:.18s ease;
}

.logout:hover{
  background:#dff3fa;
  color:var(--central-blue-dark);
}

/* MAIN */
.main{
  flex:1;
  padding:28px;
  min-width:0;
  background:
    radial-gradient(circle at top right, rgba(0,153,201,.10), transparent 28%),
    var(--central-bg);
}

.top-title{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:24px;
}

.top-title h2{
  font-size:30px;
  margin:0;
  font-weight:900;
  color:#07111f;
  letter-spacing:-.03em;
}

.top-title p{
  margin:6px 0 0;
  color:#64748b;
  font-size:14px;
}

/* CARDS */
.grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:18px;
}

.card{
  background:rgba(255,255,255,.96);
  border:1px solid var(--central-border);
  border-radius:18px;
  padding:24px;
  box-shadow:0 8px 24px rgba(15,23,42,.06);
}

.card h3{
  margin:0 0 10px;
  font-size:18px;
  font-weight:900;
  color:#07111f;
}

.card p{
  color:#66788f;
}

.stat-number{
  font-size:38px;
  font-weight:900;
  margin-top:8px;
  color:#07111f;
  letter-spacing:-.04em;
}

/* BUTTONS */
.btn{
  border:0;
  border-radius:13px;
  padding:13px 20px;
  font-weight:900;
  cursor:pointer;
  display:inline-block;
  transition:.18s ease;
  font-size:14px;
}

.btn-primary{
  background:linear-gradient(135deg,var(--central-blue),var(--central-blue-dark));
  color:white;
  box-shadow:0 10px 20px rgba(0,153,201,.20);
}

.btn-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 24px rgba(0,153,201,.28);
}

.btn-dark{
  background:#07111f;
  color:white;
}

.btn-dark:hover{
  background:#0c1d33;
}

.btn-light{
  background:#eef5f8;
  color:#26364d;
}

.btn-light:hover{
  background:#dff3fa;
  color:var(--central-blue-dark);
}

.btn-red{
  background:var(--red);
  color:white;
}

/* FORMS */
.form-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:16px;
}

.form-full{
  grid-column:1/-1;
}

label{
  display:block;
  font-size:13px;
  font-weight:900;
  margin-bottom:7px;
  color:#132033;
}

input,
select,
textarea{
  width:100%;
  border:1px solid var(--central-border);
  border-radius:13px;
  padding:13px 14px;
  font-size:14px;
  outline:none;
  background:white;
  color:#1e293b;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--central-blue);
  box-shadow:0 0 0 4px rgba(0,153,201,.12);
}

textarea{
  min-height:96px;
}

/* TABLES */
.table-wrap{
  overflow:auto;
  background:white;
  border:1px solid var(--central-border);
  border-radius:18px;
  box-shadow:0 8px 24px rgba(15,23,42,.06);
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}

th{
  background:#f5fafe;
  text-align:left;
  font-size:11px;
  letter-spacing:.09em;
  color:#64748b;
  padding:15px;
  text-transform:uppercase;
}

td{
  padding:15px;
  border-top:1px solid #eef4f7;
  color:#26364d;
}

tbody tr:hover{
  background:#f8fcfe;
}

/* BADGES */
.badge{
  display:inline-block;
  padding:6px 11px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
}

.badge-green{
  background:#dff8ef;
  color:#057a55;
}

.badge-blue{
  background:#e0f5fb;
  color:#007fa8;
}

.badge-orange{
  background:#ffedd5;
  color:#c2410c;
}

.badge-red{
  background:#fee2e2;
  color:#b91c1c;
}

.badge-purple{
  background:#ede9fe;
  color:#6d28d9;
}

.badge-gray{
  background:#f1f5f9;
  color:#475569;
}

/* ALERTS */
.alert{
  padding:13px 15px;
  border-radius:13px;
  font-weight:800;
  margin-bottom:15px;
}

.alert-error{
  background:#fee2e2;
  color:#991b1b;
}

.alert-ok{
  background:#dff8ef;
  color:#057a55;
}

/* QR */
.qr-box{
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    linear-gradient(180deg,#ffffff,#f8fcfe);
  border:2px dashed var(--central-border);
  border-radius:18px;
  min-height:320px;
  padding:20px;
}

.code-box{
  background:#07111f;
  color:#dff8ff;
  padding:14px;
  border-radius:13px;
  font-family:monospace;
  font-size:12px;
  word-break:break-all;
}

/* LOGIN */
.login-logo{
  width:230px;
  max-width:100%;
  display:block;
  margin:0 auto 12px;
}

/* RESPONSIVE */
@media(max-width:1100px){
  .grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:900px){
  .sidebar{
    display:none;
  }

  .grid{
    grid-template-columns:1fr;
  }

  .form-grid{
    grid-template-columns:1fr;
  }

  .main{
    padding:18px;
  }
}

/* ============================
   MODAL QR GENERADO
============================ */
.qr-modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(7,17,31,.72);
  backdrop-filter:blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:22px;
}

.qr-modal{
  width:100%;
  max-width:760px;
  background:#fff;
  border-radius:24px;
  box-shadow:0 30px 80px rgba(0,0,0,.28);
  overflow:hidden;
  border:1px solid #d8e4ec;
}

.qr-modal-header{
  padding:22px 26px;
  background:linear-gradient(135deg,#07111f,#06344d);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.qr-modal-header h3{
  margin:0;
  font-size:24px;
  font-weight:900;
}

.qr-modal-header p{
  margin:5px 0 0;
  color:#c6eaf5;
  font-size:13px;
}

.qr-modal-close{
  width:38px;
  height:38px;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.14);
  color:white;
  font-size:22px;
  cursor:pointer;
}

.qr-modal-body{
  padding:26px;
  display:grid;
  grid-template-columns:1fr 300px;
  gap:24px;
}

.qr-modal-info{
  display:grid;
  gap:10px;
  color:#26364d;
}

.qr-modal-info p{
  margin:0;
  font-size:14px;
}

.qr-modal-info b{
  color:#07111f;
}

.qr-modal-qr{
  display:flex;
  align-items:center;
  justify-content:center;
  border:2px dashed #cfe0ea;
  border-radius:18px;
  padding:14px;
  background:#fbfdff;
}

.qr-modal-actions{
  padding:0 26px 26px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.print-sheet{
  display:none;
}

/* ============================
   FORMATO IMPRESIÓN QR
============================ */
@media print{
  body{
    background:#fff !important;
  }

  .sidebar,
  .top-title,
  .qr-modal-overlay,
  .no-print,
  .btn,
  .sidebar-footer,
  nav{
    display:none !important;
  }

  .app{
    display:block !important;
  }

  .main{
    padding:0 !important;
    background:#fff !important;
  }

  .card,
  .table-wrap{
    box-shadow:none !important;
    border:none !important;
  }

  .print-sheet{
    display:block !important;
    width:100%;
    min-height:100vh;
    padding:22px 28px;
    color:#07111f;
    page-break-inside:avoid;
  }

  .print-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:2px solid #07111f;
    padding-bottom:12px;
    margin-bottom:18px;
  }

  .print-logo{
    width:190px;
    height:auto;
  }

  .print-title{
    text-align:right;
  }

  .print-title h1{
    margin:0;
    font-size:22px;
    font-weight:900;
  }

  .print-title p{
    margin:4px 0 0;
    font-size:12px;
  }

  .print-content{
    display:grid;
    grid-template-columns:1fr 260px;
    gap:22px;
    align-items:start;
  }

  .print-box{
    border:1px solid #d8e4ec;
    border-radius:14px;
    padding:18px;
  }

  .print-box h2{
    margin:0 0 12px;
    font-size:20px;
  }

  .print-row{
    margin-bottom:9px;
    font-size:14px;
  }

  .print-row b{
    display:inline-block;
    min-width:120px;
  }

  .print-qr{
    border:1px dashed #9fb7c7;
    border-radius:14px;
    padding:14px;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .print-footer{
    margin-top:22px;
    border-top:1px solid #d8e4ec;
    padding-top:12px;
    font-size:11px;
    color:#475569;
  }

  @page{
    size:A4;
    margin:12mm;
  }
}

@media(max-width:800px){
  .qr-modal-body{
    grid-template-columns:1fr;
  }
}

@media print{
  .detail-screen{
    display:none !important;
  }

  .detail-print{
    display:block !important;
  }
}

.detail-print{
  display:none;
}

.suggest-box{
  position:relative;
  margin-top:6px;
}

.suggest-item{
  background:#fff;
  border:1px solid #d8e4ec;
  border-radius:12px;
  padding:10px 12px;
  margin-bottom:6px;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(15,23,42,.06);
}

.suggest-item:hover{
  background:#e8f8fd;
}

.suggest-item b{
  color:#07111f;
}

.suggest-item small{
  display:block;
  color:#64748b;
  margin-top:2px;
}

@media print{
  html, body{
    width:100%;
    height:auto;
    background:#fff !important;
  }

  .detail-screen,
  .sidebar,
  .top-title,
  .qr-modal-overlay,
  .no-print,
  .btn,
  nav,
  .sidebar-footer{
    display:none !important;
  }

  .detail-print,
  .print-sheet{
    display:block !important;
  }

  .app,
  .main{
    display:block !important;
    padding:0 !important;
    margin:0 !important;
    background:#fff !important;
  }

  .print-sheet{
    width:100%;
    min-height:auto !important;
    padding:10mm 8mm !important;
    color:#07111f;
    page-break-inside:avoid;
  }

  .print-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:2px solid #07111f;
    padding-bottom:8px;
    margin-bottom:12px;
  }

  .print-logo{
    width:165px;
    height:auto;
  }

  .print-title h1{
    margin:0;
    font-size:20px;
  }

  .print-title p{
    margin:3px 0 0;
    font-size:11px;
  }

  .print-content{
    display:grid;
    grid-template-columns:1fr 250px;
    gap:14px;
    align-items:start;
  }

  .print-box{
    border:1px solid #d8e4ec;
    border-radius:12px;
    padding:12px;
  }

  .print-box h2{
    margin:0 0 10px;
    font-size:17px;
    line-height:1.2;
  }

  .print-row{
    margin-bottom:6px;
    font-size:12px;
  }

  .print-row b{
    display:inline-block;
    min-width:105px;
  }

  .print-qr{
    border:1px dashed #9fb7c7;
    border-radius:12px;
    padding:10px;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .print-footer{
    margin-top:12px;
    border-top:1px solid #d8e4ec;
    padding-top:8px;
    font-size:10px;
    color:#475569;
  }

  @page{
    size:A4;
    margin:8mm;
  }
}

/* ==================================================
   IMPRESIÓN LIMPIA 1 SOLA PÁGINA PARA QR TEMPORAL/VIP
================================================== */
@media print {
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  body * {
    visibility: hidden !important;
  }

  .print-sheet,
  .print-sheet * {
    visibility: visible !important;
  }

  .print-sheet {
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 8mm 8mm !important;
    background: #fff !important;
    color: #07111f !important;
    page-break-after: avoid !important;
    page-break-before: avoid !important;
    page-break-inside: avoid !important;
  }

  .sidebar,
  .main > .top-title,
  .card,
  .table-wrap,
  .qr-modal-overlay,
  .qr-modal,
  .detail-screen,
  .no-print,
  .btn,
  nav,
  .sidebar-footer,
  .code-box {
    display: none !important;
    visibility: hidden !important;
  }

  .app,
  .main {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  .print-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 2px solid #07111f !important;
    padding-bottom: 7px !important;
    margin-bottom: 10px !important;
  }

  .print-logo {
    width: 145px !important;
    height: auto !important;
  }

  .print-title {
    text-align: right !important;
  }

  .print-title h1 {
    margin: 0 !important;
    font-size: 18px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
  }

  .print-title p {
    margin: 2px 0 0 !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  .print-content {
    display: grid !important;
    grid-template-columns: 1fr 235px !important;
    gap: 12px !important;
    align-items: start !important;
  }

  .print-box {
    border: 1px solid #d8e4ec !important;
    border-radius: 10px !important;
    padding: 10px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }

  .print-box h2 {
    margin: 0 0 8px !important;
    font-size: 16px !important;
    line-height: 1.15 !important;
    font-weight: 900 !important;
  }

  .print-row {
    margin-bottom: 4px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
  }

  .print-row b {
    display: inline-block !important;
    min-width: 95px !important;
    font-weight: 900 !important;
  }

  .print-qr {
    border: 1px dashed #9fb7c7 !important;
    border-radius: 10px !important;
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    page-break-inside: avoid !important;
  }

  .print-qr canvas,
  .print-qr img {
    width: 205px !important;
    height: 205px !important;
  }

  .print-footer {
    margin-top: 8px !important;
    border-top: 1px solid #d8e4ec !important;
    padding-top: 6px !important;
    font-size: 9px !important;
    line-height: 1.25 !important;
    color: #475569 !important;
  }

  @page {
    size: A4 portrait;
    margin: 7mm;
  }
}

/* BUSCADOR EN TABLAS */
.search-panel{
  background:#ffffff;
  border:1px solid #d8e4ec;
  border-radius:18px;
  padding:18px;
  margin-bottom:16px;
  box-shadow:0 8px 24px rgba(15,23,42,.05);
}

.search-row{
  display:grid;
  grid-template-columns:1.5fr .7fr .7fr;
  gap:12px;
  align-items:end;
}

.search-row label{
  font-size:12px;
  font-weight:900;
  color:#132033;
}

.search-info{
  margin-top:10px;
  color:#64748b;
  font-size:13px;
  font-weight:700;
}

@media(max-width:900px){
  .search-row{
    grid-template-columns:1fr;
  }
}

.pagination{
  display:flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  margin-top:16px;
}

.pagination a,
.pagination strong,
.pagination span{
  min-width:38px;
  padding:10px 13px;
  border-radius:12px;
  text-align:center;
  font-weight:900;
  font-size:13px;
}

.pagination a{
  background:#ffffff;
  border:1px solid #d8e4ec;
  color:#26364d;
}

.pagination a:hover{
  background:#e8f8fd;
  color:#007fa8;
}

.pagination strong{
  background:#0099c9;
  color:#ffffff;
  border:1px solid #0099c9;
}

.pagination span{
  color:#64748b;
}

.search-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:end;
}

.search-actions .btn{
  height:46px;
}

/* MENU LATERAL MEJORADO */
.side-nav{
  padding:18px 16px 24px !important;
}

.menu-section{
  margin:18px 0 8px !important;
  padding:0 10px !important;
  font-size:10px !important;
  font-weight:900 !important;
  letter-spacing:.16em !important;
  color:#8da0b3 !important;
}

.nav-item{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  padding:11px 12px !important;
  border-radius:13px !important;
  color:#26364d !important;
  font-size:14px !important;
  font-weight:900 !important;
  margin-bottom:5px !important;
  transition:.18s ease !important;
}

.nav-item:hover{
  background:#e8f8fd !important;
  color:#007fa8 !important;
  transform:translateX(2px);
}

.nav-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#0099c9;
  opacity:.35;
  flex:none;
}

.nav-item:hover .nav-dot{
  opacity:1;
}

.nav-subitem{
  display:block !important;
  margin:4px 0 4px 20px !important;
  padding:9px 12px !important;
  border-left:2px solid #d8e4ec !important;
  border-radius:0 10px 10px 0 !important;
  color:#475569 !important;
  font-size:13px !important;
  font-weight:800 !important;
}

.nav-subitem:hover{
  background:#f2fbfe !important;
  border-left-color:#0099c9 !important;
  color:#007fa8 !important;
}

.config-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.config-tab{
  padding:11px 14px;
  border-radius:13px;
  background:#fff;
  border:1px solid #d8e4ec;
  color:#26364d;
  font-weight:900;
  font-size:13px;
}

.config-tab.active{
  background:#0099c9;
  color:white;
  border-color:#0099c9;
}

/* FIX CABECERA + BUSCADOR + TABLAS */
.top-title{
  width:100%;
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:18px !important;
  margin-bottom:18px !important;
}

.top-title > div:first-child{
  max-width:620px;
}

.top-title h2{
  margin:0 0 6px !important;
  line-height:1.1 !important;
}

.top-title p{
  margin:0 !important;
}

.top-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

.search-panel{
  width:100%;
  box-sizing:border-box;
  margin:0 0 18px 0 !important;
}

.table-wrap{
  width:100%;
  overflow-x:auto;
}

.table-wrap table{
  min-width:1200px;
}

.table-actions{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  align-items:center;
}

.table-actions form{
  margin:0;
}

@media(max-width:900px){
  .top-title{
    flex-direction:column !important;
  }

  .top-actions{
    justify-content:flex-start;
  }

  .table-wrap table{
    min-width:1050px;
  }
}

/* ==================================================
   FIX DEFINITIVO: CONTENIDO DEL PANEL EN UNA COLUMNA
================================================== */
.main{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  box-sizing:border-box !important;
  overflow-x:hidden !important;
}

.main > *{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

.top-title{
  display:flex !important;
  width:100% !important;
  max-width:100% !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:18px !important;
  margin-bottom:18px !important;
  float:none !important;
  clear:both !important;
}

.top-title > div:first-child{
  max-width:620px !important;
  width:auto !important;
}

.top-title h2{
  margin:0 0 6px !important;
  line-height:1.1 !important;
  font-size:34px !important;
}

.top-title p{
  margin:0 !important;
  max-width:520px !important;
}

.top-actions{
  display:flex !important;
  gap:10px !important;
  flex-wrap:wrap !important;
  justify-content:flex-end !important;
  align-items:center !important;
  width:auto !important;
  max-width:420px !important;
}

.search-panel{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  margin:0 0 18px 0 !important;
  clear:both !important;
  float:none !important;
}

.search-row{
  display:grid !important;
  grid-template-columns:minmax(320px,1fr) 180px 140px !important;
  gap:12px !important;
  align-items:end !important;
}

.search-row > div{
  width:100% !important;
  max-width:100% !important;
}

.search-row input,
.search-row select{
  width:100% !important;
}

.search-actions{
  display:flex !important;
  gap:10px !important;
  flex-wrap:wrap !important;
  margin-top:14px !important;
}

.table-wrap{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  clear:both !important;
  float:none !important;
  margin-top:0 !important;
}

.table-wrap table{
  width:100% !important;
  min-width:1250px !important;
  table-layout:auto !important;
}

.table-wrap th,
.table-wrap td{
  white-space:nowrap !important;
  vertical-align:middle !important;
  height:auto !important;
  padding:14px 16px !important;
}

.table-wrap td{
  font-size:13px !important;
  line-height:1.25 !important;
}

.table-wrap td:first-child,
.table-wrap td:nth-child(3){
  white-space:normal !important;
  min-width:170px !important;
  max-width:220px !important;
}

.table-actions{
  display:flex !important;
  gap:6px !important;
  flex-wrap:nowrap !important;
  align-items:center !important;
}

.table-actions form{
  margin:0 !important;
}

.pagination{
  width:100% !important;
  clear:both !important;
}

@media(max-width:900px){
  .top-title{
    flex-direction:column !important;
  }

  .top-actions{
    justify-content:flex-start !important;
    max-width:100% !important;
  }

  .search-row{
    grid-template-columns:1fr !important;
  }

  .table-wrap table{
    min-width:1100px !important;
  }
}

/* ==================================================
   FIX REAL: PÁGINAS DE LISTADO EN COLUMNA VERTICAL
================================================== */
html body .app .main,
html body main.main{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
  grid-template-columns:1fr !important;
  grid-auto-flow:row !important;
  gap:0 !important;
  width:calc(100vw - 280px) !important;
  max-width:calc(100vw - 280px) !important;
  min-width:0 !important;
  box-sizing:border-box !important;
  overflow-x:hidden !important;
}

html body .main .top-title,
html body .main form.search-panel,
html body .main .table-wrap,
html body .main .pagination{
  flex:0 0 auto !important;
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  min-width:0 !important;
  clear:both !important;
  float:none !important;
  box-sizing:border-box !important;
}

html body .main .top-title{
  display:flex !important;
  flex-direction:row !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:18px !important;
}

html body .main .top-title > div:first-child{
  flex:1 1 auto !important;
  width:auto !important;
  max-width:720px !important;
}

html body .main .top-actions{
  flex:0 0 auto !important;
  display:flex !important;
  flex-direction:row !important;
  gap:10px !important;
  width:auto !important;
  max-width:none !important;
}

html body .main form.search-panel{
  margin-top:0 !important;
  margin-bottom:18px !important;
}

html body .main .search-row{
  display:grid !important;
  grid-template-columns:minmax(420px,1fr) 180px 140px !important;
  gap:12px !important;
  width:100% !important;
}

html body .main .search-actions{
  display:flex !important;
  flex-direction:row !important;
  gap:10px !important;
  width:100% !important;
}

html body .main .table-wrap{
  overflow-x:auto !important;
  overflow-y:hidden !important;
  background:#fff !important;
}

html body .main .table-wrap table{
  width:100% !important;
  min-width:1250px !important;
}

html body .main .table-wrap tr{
  height:auto !important;
}

html body .main .table-wrap th,
html body .main .table-wrap td{
  padding:14px 16px !important;
  vertical-align:middle !important;
  line-height:1.25 !important;
}

html body .main .table-wrap td{
  height:auto !important;
}

html body .main .table-wrap td:first-child,
html body .main .table-wrap td:nth-child(3){
  white-space:normal !important;
  min-width:170px !important;
  max-width:230px !important;
}

@media(max-width:1100px){
  html body .app .main,
  html body main.main{
    width:100% !important;
    max-width:100% !important;
  }

  html body .main .top-title{
    flex-direction:column !important;
  }

  html body .main .search-row{
    grid-template-columns:1fr !important;
  }
}

.config-inline-form{
  display:flex;
  gap:10px;
  align-items:center;
  margin:0;
}

.config-inline-form input{
  min-width:280px;
  max-width:480px;
}

.table-actions{
  display:flex !important;
  gap:8px !important;
  align-items:center !important;
  flex-wrap:wrap !important;
}

.table-actions form{
  margin:0 !important;
}

.config-inline-form input{
  min-width:280px;
  max-width:520px;
}

.config-inline-form input:focus{
  border-color:#0099c9 !important;
  box-shadow:0 0 0 3px rgba(0,153,201,.12) !important;
}

.alert-info{
  background:#eef8ff;
  border:1px solid #bee3f8;
  color:#164e63;
  padding:14px 16px;
  border-radius:14px;
  font-weight:700;
  line-height:1.6;
}

/* BUSCADOR DE USUARIOS ORDENADO */
.user-search-panel{
  padding:22px !important;
}

.user-search-row{
  display:grid !important;
  grid-template-columns:1fr auto !important;
  gap:14px !important;
  align-items:end !important;
  width:100% !important;
}

.user-search-row input{
  width:100% !important;
}

.user-search-actions{
  display:flex !important;
  gap:10px !important;
  align-items:center !important;
  justify-content:flex-end !important;
  white-space:nowrap !important;
}

.user-search-actions .btn{
  height:46px !important;
}

@media(max-width:900px){
  .user-search-row{
    grid-template-columns:1fr !important;
  }

  .user-search-actions{
    justify-content:flex-start !important;
  }
}

/* ==================================================
   EFECTO CONEXIÓN DEL MENÚ LATERAL
================================================== */

.sidebar{
  position:relative !important;
  overflow:hidden !important;
}

/* Línea principal que baja desde el logo */
.sidebar::before{
  content:"";
  position:absolute;
  left:34px;
  top:150px;
  bottom:120px;
  width:2px;
  background:linear-gradient(
    to bottom,
    rgba(0,153,201,.10),
    rgba(0,153,201,.45),
    rgba(0,153,201,.12)
  );
  border-radius:999px;
  z-index:0;
}

/* Todo el nav encima de la línea */
.sidebar .brand,
.sidebar .side-nav,
.sidebar .sidebar-footer{
  position:relative;
  z-index:2;
}

/* Menú principal conectado */
.nav-item{
  position:relative !important;
  padding-left:28px !important;
}

/* Línea horizontal que conecta punto con texto */
.nav-item::before{
  content:"";
  position:absolute;
  left:13px;
  top:50%;
  width:18px;
  height:2px;
  background:rgba(0,153,201,.25);
  transform:translateY(-50%);
  border-radius:999px;
  transition:.22s ease;
}

/* Punto del menú */
.nav-dot{
  position:absolute !important;
  left:6px !important;
  top:50% !important;
  width:8px !important;
  height:8px !important;
  transform:translateY(-50%) !important;
  border-radius:999px !important;
  background:#9dd9e8 !important;
  opacity:1 !important;
  box-shadow:0 0 0 4px rgba(0,153,201,.08);
  animation:menuPulse 2.2s infinite;
}

/* Submenús conectados */
.nav-subitem{
  position:relative !important;
  margin-left:24px !important;
  padding-left:26px !important;
  border-left:2px solid rgba(0,153,201,.18) !important;
}

/* Punto de submenú */
.nav-subitem::before{
  content:"";
  position:absolute;
  left:-6px;
  top:50%;
  width:9px;
  height:9px;
  transform:translateY(-50%);
  border-radius:999px;
  background:#a7dfee;
  box-shadow:0 0 0 4px rgba(0,153,201,.08);
  animation:submenuBlink 1.7s infinite;
}

/* Línea horizontal submenú */
.nav-subitem::after{
  content:"";
  position:absolute;
  left:-1px;
  top:50%;
  width:18px;
  height:2px;
  transform:translateY(-50%);
  background:rgba(0,153,201,.22);
  border-radius:999px;
}

/* Hover menú principal */
.nav-item:hover{
  background:#e8f8fd !important;
  color:#007fa8 !important;
  transform:translateX(3px);
}

.nav-item:hover::before{
  background:#0099c9;
  width:24px;
}

.nav-item:hover .nav-dot{
  background:#0099c9 !important;
  box-shadow:0 0 0 6px rgba(0,153,201,.16), 0 0 18px rgba(0,153,201,.55);
}

/* Hover submenú */
.nav-subitem:hover{
  background:#f2fbfe !important;
  border-left-color:#0099c9 !important;
  color:#007fa8 !important;
  transform:translateX(3px);
}

.nav-subitem:hover::before{
  background:#0099c9;
  box-shadow:0 0 0 6px rgba(0,153,201,.14), 0 0 16px rgba(0,153,201,.45);
}

/* Activo seleccionado */
.nav-item.active,
.nav-subitem.active{
  background:#e8f8fd !important;
  color:#007fa8 !important;
  font-weight:900 !important;
}

.nav-item.active{
  box-shadow:inset 3px 0 0 #0099c9;
}

.nav-item.active::before{
  background:#0099c9;
  width:24px;
}

.nav-item.active .nav-dot{
  background:#0099c9 !important;
  box-shadow:0 0 0 6px rgba(0,153,201,.18), 0 0 18px rgba(0,153,201,.55);
  animation:activePulse 1.3s infinite;
}

.nav-subitem.active{
  border-left-color:#0099c9 !important;
  box-shadow:inset 3px 0 0 rgba(0,153,201,.22);
}

.nav-subitem.active::before{
  background:#0099c9;
  box-shadow:0 0 0 6px rgba(0,153,201,.18), 0 0 16px rgba(0,153,201,.45);
  animation:activePulse 1.3s infinite;
}

/* Animaciones */
@keyframes menuPulse{
  0%{
    box-shadow:0 0 0 3px rgba(0,153,201,.08);
  }
  50%{
    box-shadow:0 0 0 6px rgba(0,153,201,.16), 0 0 12px rgba(0,153,201,.25);
  }
  100%{
    box-shadow:0 0 0 3px rgba(0,153,201,.08);
  }
}

@keyframes submenuBlink{
  0%, 100%{
    opacity:.45;
    transform:translateY(-50%) scale(.85);
  }
  50%{
    opacity:1;
    transform:translateY(-50%) scale(1.12);
  }
}

@keyframes activePulse{
  0%{
    transform:translateY(-50%) scale(1);
  }
  50%{
    transform:translateY(-50%) scale(1.18);
  }
  100%{
    transform:translateY(-50%) scale(1);
  }
}

/* ==================================================
   RESTAURAR MENÚ SIMPLE - SIN EFECTOS CONECTADOS
================================================== */

.sidebar::before{
  display:none !important;
  content:none !important;
}

.nav-item{
  position:relative !important;
  padding-left:12px !important;
  transform:none !important;
  box-shadow:none !important;
}

.nav-item::before,
.nav-item::after{
  display:none !important;
  content:none !important;
}

.nav-dot{
  position:static !important;
  display:inline-block !important;
  width:8px !important;
  height:8px !important;
  min-width:8px !important;
  border-radius:999px !important;
  background:#9dd9e8 !important;
  opacity:1 !important;
  transform:none !important;
  box-shadow:none !important;
  animation:none !important;
}

.nav-subitem{
  position:relative !important;
  margin:4px 0 4px 20px !important;
  padding:9px 12px !important;
  border-left:2px solid #d8e4ec !important;
  border-radius:0 10px 10px 0 !important;
  transform:none !important;
  box-shadow:none !important;
}

.nav-subitem::before,
.nav-subitem::after{
  display:none !important;
  content:none !important;
}

.nav-item.active,
.nav-subitem.active{
  background:transparent !important;
  color:#26364d !important;
  box-shadow:none !important;
}

.nav-item.active .nav-dot{
  background:#9dd9e8 !important;
  box-shadow:none !important;
  animation:none !important;
}

.nav-item:hover{
  background:#e8f8fd !important;
  color:#007fa8 !important;
  transform:none !important;
}

.nav-subitem:hover{
  background:#f2fbfe !important;
  border-left-color:#0099c9 !important;
  color:#007fa8 !important;
  transform:none !important;
}

.nav-item:hover .nav-dot{
  background:#9dd9e8 !important;
  box-shadow:none !important;
}

/* ==================================================
   TABLAS FIJAS PARA TEMPORALES Y VIP
   Scroll interno vertical/horizontal
================================================== */

.fixed-table-box{
  width:100% !important;
  max-width:100% !important;
  max-height:calc(100vh - 360px) !important;
  min-height:360px !important;
  overflow:auto !important;
  background:#ffffff !important;
  border:1px solid #d8e4ec !important;
  border-radius:18px !important;
  box-shadow:0 8px 24px rgba(15,23,42,.05) !important;
  margin-top:0 !important;
}

/* El encabezado de la tabla queda fijo al hacer scroll */
.fixed-table-box thead th{
  position:sticky !important;
  top:0 !important;
  z-index:5 !important;
  background:#f2f8fb !important;
  box-shadow:0 1px 0 #d8e4ec !important;
}

/* Tabla con ancho suficiente para scroll lateral */
.fixed-table-box table{
  min-width:1350px !important;
  width:100% !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
}

/* Filas más ordenadas y compactas */
.fixed-table-box th,
.fixed-table-box td{
  padding:12px 14px !important;
  vertical-align:middle !important;
  height:auto !important;
  line-height:1.25 !important;
}

/* Evita filas exageradamente altas */
.fixed-table-box tbody tr{
  min-height:58px !important;
}

/* Nombre y apoderado pueden saltar línea sin romper todo */
.fixed-table-box td:first-child,
.fixed-table-box td:nth-child(3){
  white-space:normal !important;
  min-width:180px !important;
  max-width:230px !important;
}

/* El resto de columnas se mantienen ordenadas */
.fixed-table-box td:not(:first-child):not(:nth-child(3)),
.fixed-table-box th{
  white-space:nowrap !important;
}

/* Acciones compactas dentro del cuadro */
.fixed-table-box .table-actions{
  display:flex !important;
  flex-wrap:nowrap !important;
  gap:6px !important;
  align-items:center !important;
}

.fixed-table-box .table-actions form{
  margin:0 !important;
}

/* Scroll más visible */
.fixed-table-box::-webkit-scrollbar{
  width:10px;
  height:10px;
}

.fixed-table-box::-webkit-scrollbar-thumb{
  background:#9fb7c7;
  border-radius:999px;
}

.fixed-table-box::-webkit-scrollbar-track{
  background:#eef6fa;
}

/* ==================================================
   BUSCADORES SIN SELECTOR MOSTRAR - 10 FIJO
================================================== */
.search-row{
  display:grid !important;
  grid-template-columns:minmax(360px,1fr) 220px !important;
  gap:12px !important;
  align-items:end !important;
}

.search-row:has(.search-actions){
  grid-template-columns:minmax(360px,1fr) auto !important;
}

.search-actions{
  display:flex !important;
  gap:10px !important;
  align-items:center !important;
  justify-content:flex-start !important;
  flex-wrap:wrap !important;
  margin-top:14px !important;
}

.search-row .search-actions{
  margin-top:0 !important;
}

.search-info{
  margin-top:12px !important;
}

@media(max-width:900px){
  .search-row,
  .search-row:has(.search-actions){
    grid-template-columns:1fr !important;
  }

  .search-row .search-actions{
    margin-top:12px !important;
  }
}

/* ==================================================
   FIX BUSCADORES: SIN MOSTRAR, SIN CONTADOR, BOTONES EN LÍNEA
================================================== */

.search-panel{
  padding:18px 20px !important;
}

.search-row{
  display:grid !important;
  grid-template-columns:minmax(360px,1fr) 220px !important;
  gap:12px !important;
  align-items:end !important;
}

.search-row input,
.search-row select{
  width:100% !important;
}

.search-actions,
.user-search-actions{
  display:flex !important;
  flex-direction:row !important;
  gap:10px !important;
  align-items:center !important;
  justify-content:flex-start !important;
  flex-wrap:wrap !important;
  margin-top:14px !important;
}

.search-row .search-actions,
.user-search-row .user-search-actions{
  margin-top:0 !important;
}

.search-actions .btn,
.user-search-actions .btn{
  height:46px !important;
  min-width:96px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}

.user-search-row{
  display:grid !important;
  grid-template-columns:minmax(360px,1fr) auto !important;
  gap:14px !important;
  align-items:end !important;
}

@media(max-width:900px){
  .search-row,
  .user-search-row{
    grid-template-columns:1fr !important;
  }

  .search-row .search-actions,
  .user-search-row .user-search-actions{
    margin-top:12px !important;
  }
}

/* PAGINACIÓN VISIBLE BAJO TABLAS CON SCROLL */
.pagination{
  width:100% !important;
  display:flex !important;
  justify-content:flex-end !important;
  align-items:center !important;
  gap:8px !important;
  flex-wrap:wrap !important;
  margin:16px 0 24px !important;
  padding:0 !important;
  clear:both !important;
}

.pagination a,
.pagination strong,
.pagination span{
  min-width:38px !important;
  padding:10px 13px !important;
  border-radius:12px !important;
  text-align:center !important;
  font-weight:900 !important;
  font-size:13px !important;
}

.pagination a{
  background:#ffffff !important;
  border:1px solid #d8e4ec !important;
  color:#26364d !important;
}

.pagination strong{
  background:#0099c9 !important;
  color:#ffffff !important;
  border:1px solid #0099c9 !important;
}

.pagination a:hover{
  background:#e8f8fd !important;
  color:#007fa8 !important;
}

/* Botones Buscar / Limpiar siempre alineados */
.user-search-row{
  display:grid !important;
  grid-template-columns:minmax(360px,1fr) auto !important;
  gap:14px !important;
  align-items:end !important;
}

.user-search-actions{
  display:flex !important;
  flex-direction:row !important;
  gap:10px !important;
  align-items:center !important;
  justify-content:flex-end !important;
  white-space:nowrap !important;
  margin-top:0 !important;
}

.user-search-actions .btn{
  height:46px !important;
  min-width:96px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}

@media(max-width:900px){
  .user-search-row{
    grid-template-columns:1fr !important;
  }

  .user-search-actions{
    justify-content:flex-start !important;
    margin-top:12px !important;
  }
}

/* BASE DE DATOS - BUSCADOR CORREGIDO */
.user-search-panel{
  width:100% !important;
  padding:20px !important;
}

.user-search-row{
  display:grid !important;
  grid-template-columns:minmax(360px,1fr) auto !important;
  gap:14px !important;
  align-items:end !important;
  width:100% !important;
}

.user-search-actions{
  display:flex !important;
  flex-direction:row !important;
  gap:10px !important;
  align-items:center !important;
  justify-content:flex-end !important;
  white-space:nowrap !important;
  margin:0 !important;
}

.user-search-actions .btn{
  height:46px !important;
  min-width:96px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}

@media(max-width:900px){
  .user-search-row{
    grid-template-columns:1fr !important;
  }

  .user-search-actions{
    justify-content:flex-start !important;
    margin-top:12px !important;
  }
}

/* ==================================================
   DASHBOARD MEJORADO
================================================== */

.dashboard-hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  padding:4px 0 20px;
}

.dashboard-hero h2{
  margin:0 0 6px;
  font-size:38px;
  line-height:1;
  font-weight:950;
  color:#07111f;
}

.dashboard-hero p{
  margin:0;
  color:#64748b;
  font-weight:700;
  max-width:620px;
}

.hero-kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#0099c9;
  font-size:12px;
  font-weight:950;
  letter-spacing:.14em;
  text-transform:uppercase;
  margin-bottom:8px;
}

.hero-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.btn-dark{
  background:#07111f !important;
  color:#ffffff !important;
  border:none !important;
  box-shadow:0 10px 22px rgba(7,17,31,.18);
}

.dash-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(180px,1fr));
  gap:16px;
  margin-bottom:18px;
}

.dash-card{
  display:flex;
  align-items:center;
  gap:16px;
  background:#ffffff;
  border:1px solid #d8e4ec;
  border-radius:20px;
  padding:20px;
  min-height:116px;
  box-shadow:0 10px 28px rgba(15,23,42,.05);
  text-decoration:none;
  color:#07111f;
  transition:.18s ease;
  overflow:hidden;
  position:relative;
}

.dash-card::after{
  content:"";
  position:absolute;
  right:-40px;
  top:-40px;
  width:120px;
  height:120px;
  border-radius:999px;
  background:rgba(0,153,201,.08);
}

.dash-card:hover{
  transform:translateY(-3px);
  box-shadow:0 18px 34px rgba(15,23,42,.09);
  border-color:#b9d8e7;
}

.dash-icon{
  width:54px;
  height:54px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  color:#ffffff;
  background:#0099c9;
  box-shadow:0 12px 24px rgba(0,153,201,.20);
  flex:none;
}

.dash-card p{
  margin:0 0 8px;
  font-size:14px;
  font-weight:950;
  color:#132033;
}

.dash-card h3{
  margin:0;
  font-size:36px;
  line-height:1;
  font-weight:950;
  color:#07111f;
}

.dash-card small{
  display:block;
  margin-top:7px;
  color:#64748b;
  font-weight:700;
  line-height:1.25;
}

.dash-card-blue .dash-icon{background:#0099c9}
.dash-card-green .dash-icon{background:#00a884}
.dash-card-purple .dash-icon{background:#6d5dfc}
.dash-card-cyan .dash-icon{background:#00b8d9}
.dash-card-orange .dash-icon{background:#f59e0b}
.dash-card-dark .dash-icon{background:#07111f}

.dashboard-panels{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  margin-bottom:18px;
}

.dashboard-panel{
  background:#ffffff;
  border:1px solid #d8e4ec;
  border-radius:20px;
  padding:20px;
  box-shadow:0 10px 28px rgba(15,23,42,.05);
}

.panel-title{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

.panel-title h3,
.dashboard-panel h3{
  margin:0 0 4px;
  font-size:19px;
  font-weight:950;
  color:#07111f;
}

.panel-title p,
.dashboard-panel p{
  margin:0;
  color:#64748b;
  font-weight:700;
}

.bar-row{
  margin-bottom:15px;
}

.bar-info{
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-weight:900;
  color:#132033;
  font-size:13px;
  margin-bottom:7px;
}

.bar-track{
  height:12px;
  border-radius:999px;
  background:#e8f3f8;
  overflow:hidden;
}

.bar-fill{
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#0099c9,#00b8d9);
  min-width:8px;
}

.hour-chart{
  height:180px;
  display:flex;
  align-items:flex-end;
  gap:8px;
  padding-top:12px;
  overflow-x:auto;
}

.hour-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  min-width:34px;
}

.hour-bar{
  width:26px;
  min-height:12px;
  border-radius:10px 10px 4px 4px;
  background:linear-gradient(180deg,#00b8d9,#0099c9);
  display:flex;
  align-items:flex-start;
  justify-content:center;
  color:#ffffff;
  font-size:10px;
  font-weight:900;
  padding-top:4px;
}

.hour-item small{
  color:#64748b;
  font-weight:900;
  font-size:11px;
}

.info-panel{
  min-height:150px;
}

.info-list{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.info-list span{
  background:#e8f8fd;
  color:#007fa8;
  border:1px solid #c8ecf6;
  padding:9px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
}

.empty-chart{
  background:#f4f9fc;
  border:1px dashed #c9dbe7;
  color:#64748b;
  font-weight:800;
  padding:18px;
  border-radius:16px;
}

@media(max-width:1200px){
  .dash-grid{
    grid-template-columns:repeat(2,minmax(180px,1fr));
  }

  .dashboard-panels{
    grid-template-columns:1fr;
  }
}

@media(max-width:700px){
  .dashboard-hero{
    flex-direction:column;
  }

  .hero-actions{
    justify-content:flex-start;
  }

  .dash-grid{
    grid-template-columns:1fr;
  }
}

/* TOP ALUMNOS DASHBOARD */
.top-student-row{
  margin-bottom:16px;
}

.top-student-main{
  display:grid;
  grid-template-columns:42px 1fr auto;
  gap:12px;
  align-items:center;
  margin-bottom:8px;
}

.student-avatar{
  width:42px;
  height:42px;
  border-radius:15px;
  background:linear-gradient(135deg,#0099c9,#00b8d9);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  box-shadow:0 10px 20px rgba(0,153,201,.18);
}

.top-student-main b{
  display:block;
  color:#07111f;
  font-size:13px;
  font-weight:950;
  line-height:1.2;
}

.top-student-main small{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:11px;
  font-weight:800;
}

.top-student-main strong{
  font-size:20px;
  font-weight:950;
  color:#0099c9;
}

.student-fill{
  background:linear-gradient(90deg,#07111f,#0099c9) !important;
}

/* TOP ALUMNOS DASHBOARD */
.top-student-row{
  margin-bottom:16px;
}

.top-student-main{
  display:grid;
  grid-template-columns:42px 1fr auto;
  gap:12px;
  align-items:center;
  margin-bottom:8px;
}

.student-avatar{
  width:42px;
  height:42px;
  border-radius:15px;
  background:linear-gradient(135deg,#0099c9,#00b8d9);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  box-shadow:0 10px 20px rgba(0,153,201,.18);
}

.top-student-main b{
  display:block;
  color:#07111f;
  font-size:13px;
  font-weight:950;
  line-height:1.2;
}

.top-student-main small{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:11px;
  font-weight:800;
}

.top-student-main strong{
  font-size:20px;
  font-weight:950;
  color:#0099c9;
}

.student-fill{
  background:linear-gradient(90deg,#07111f,#0099c9) !important;
}

/* ==================================================
   DASHBOARD LIMPIO Y ORDENADO
================================================== */

.clean-dashboard{
  width:100%;
}

.clean-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:20px;
}

.clean-header span{
  display:block;
  color:#0099c9;
  font-size:12px;
  font-weight:950;
  letter-spacing:.16em;
  text-transform:uppercase;
  margin-bottom:6px;
}

.clean-header h2{
  margin:0 0 6px;
  font-size:38px;
  line-height:1;
  color:#07111f;
  font-weight:950;
}

.clean-header p{
  margin:0;
  max-width:620px;
  color:#64748b;
  font-weight:700;
  line-height:1.35;
}

.clean-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.btn-dark{
  background:#07111f !important;
  color:#ffffff !important;
  border:none !important;
  box-shadow:0 10px 22px rgba(7,17,31,.18);
}

.clean-main-cards{
  display:grid;
  grid-template-columns:repeat(4, minmax(180px,1fr));
  gap:16px;
  margin-bottom:16px;
}

.clean-card{
  background:#ffffff;
  border:1px solid #d8e4ec;
  border-radius:18px;
  padding:22px;
  text-decoration:none;
  color:#07111f;
  min-height:135px;
  box-shadow:0 8px 22px rgba(15,23,42,.045);
  transition:.18s ease;
}

.clean-card:hover{
  transform:translateY(-2px);
  border-color:#b9d8e7;
  box-shadow:0 14px 30px rgba(15,23,42,.075);
}

.clean-card p{
  margin:0 0 12px;
  font-size:14px;
  color:#334155;
  font-weight:950;
}

.clean-card h3{
  margin:0;
  font-size:40px;
  line-height:1;
  color:#07111f;
  font-weight:950;
}

.clean-card small{
  display:block;
  margin-top:10px;
  color:#64748b;
  font-weight:700;
  line-height:1.25;
}

.clean-mini-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(160px,1fr));
  gap:12px;
  margin-bottom:16px;
}

.clean-mini{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:#ffffff;
  border:1px solid #d8e4ec;
  border-radius:16px;
  padding:16px 18px;
  color:#07111f;
  text-decoration:none;
  box-shadow:0 6px 18px rgba(15,23,42,.035);
}

.clean-mini:hover{
  border-color:#b9d8e7;
  background:#fbfdfe;
}

.clean-mini span{
  font-size:13px;
  color:#475569;
  font-weight:850;
}

.clean-mini b{
  font-size:26px;
  color:#0099c9;
  font-weight:950;
}

.clean-panels{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.clean-panel{
  background:#ffffff;
  border:1px solid #d8e4ec;
  border-radius:18px;
  padding:20px;
  box-shadow:0 8px 22px rgba(15,23,42,.045);
  min-height:320px;
}

.clean-panel-head{
  margin-bottom:18px;
}

.clean-panel-head h3{
  margin:0 0 5px;
  font-size:19px;
  color:#07111f;
  font-weight:950;
}

.clean-panel-head p{
  margin:0;
  color:#64748b;
  font-weight:700;
  line-height:1.35;
}

.clean-bar-item{
  margin-bottom:16px;
}

.clean-bar-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}

.clean-bar-top span{
  color:#132033;
  font-size:13px;
  font-weight:850;
}

.clean-bar-top b{
  color:#07111f;
  font-size:14px;
  font-weight:950;
}

.clean-bar-bg{
  width:100%;
  height:9px;
  border-radius:999px;
  background:#e8f3f8;
  overflow:hidden;
}

.clean-bar-fill{
  height:100%;
  border-radius:999px;
  background:#0099c9;
  min-width:7px;
}

.clean-bar-fill.dark{
  background:#07111f;
}

.clean-student{
  margin-bottom:17px;
}

.clean-student-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:8px;
}

.clean-student-row b{
  display:block;
  color:#07111f;
  font-size:13px;
  font-weight:950;
  line-height:1.25;
}

.clean-student-row small{
  display:block;
  margin-top:3px;
  color:#64748b;
  font-size:11px;
  font-weight:750;
}

.clean-student-row strong{
  color:#0099c9;
  font-size:20px;
  font-weight:950;
}

.clean-empty{
  background:#f5fafc;
  border:1px dashed #c9dbe7;
  color:#64748b;
  font-weight:800;
  padding:16px;
  border-radius:14px;
}

@media(max-width:1200px){
  .clean-main-cards,
  .clean-mini-grid{
    grid-template-columns:repeat(2, minmax(180px,1fr));
  }

  .clean-panels{
    grid-template-columns:1fr;
  }
}

@media(max-width:700px){
  .clean-header{
    flex-direction:column;
  }

  .clean-actions{
    justify-content:flex-start;
  }

  .clean-main-cards,
  .clean-mini-grid{
    grid-template-columns:1fr;
  }
}

/* DASHBOARD GRÁFICOS EN TIEMPO REAL */
.chart-panel{
  min-height:390px !important;
}

.chart-box{
  position:relative;
  width:100%;
  height:300px;
  padding:8px 4px 0;
}

.panel-title small{
  color:#64748b;
  font-weight:800;
  font-size:11px;
  white-space:nowrap;
}

@media(max-width:900px){
  .chart-box{
    height:280px;
  }

  .panel-title{
    flex-direction:column;
  }
}

/* BASE DE DATOS CON SCROLL INTERNO */
.base-table-box{
  height:520px !important;
  max-height:520px !important;
  min-height:520px !important;
  overflow:auto !important;
  position:relative !important;
}

.base-table-box table{
  min-width:1550px !important;
}

.base-table-box thead th{
  position:sticky !important;
  top:0 !important;
  z-index:10 !important;
  background:#f2f8fb !important;
}

.base-table-box td,
.base-table-box th{
  white-space:nowrap !important;
}

.base-table-box td:first-child,
.base-table-box td:nth-child(8){
  white-space:normal !important;
  min-width:220px !important;
  max-width:360px !important;
}

/* ==================================================
   FIX BASE DE DATOS: COLUMNAS RESPETADAS + SCROLL LATERAL
================================================== */

.base-table-box{
  width:100% !important;
  max-width:100% !important;
  height:520px !important;
  max-height:520px !important;
  min-height:520px !important;
  overflow-x:auto !important;
  overflow-y:auto !important;
  background:#ffffff !important;
  border:1px solid #d8e4ec !important;
  border-radius:18px !important;
  box-shadow:0 8px 22px rgba(15,23,42,.045) !important;
}

/* Forzar ancho grande para que aparezca scroll horizontal */
.base-table-box table{
  width:auto !important;
  min-width:1900px !important;
  table-layout:fixed !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
}

/* Encabezado fijo al bajar */
.base-table-box thead th{
  position:sticky !important;
  top:0 !important;
  z-index:20 !important;
  background:#f2f8fb !important;
  border-bottom:1px solid #d8e4ec !important;
}

/* Todas las columnas respetan su espacio */
.base-table-box th,
.base-table-box td{
  padding:14px 16px !important;
  vertical-align:middle !important;
  white-space:normal !important;
  word-break:normal !important;
  overflow-wrap:normal !important;
  line-height:1.25 !important;
}

/* Anchos por columna */
.base-table-box th:nth-child(1),
.base-table-box td:nth-child(1){
  width:260px !important;
  min-width:260px !important;
}

.base-table-box th:nth-child(2),
.base-table-box td:nth-child(2){
  width:130px !important;
  min-width:130px !important;
}

.base-table-box th:nth-child(3),
.base-table-box td:nth-child(3){
  width:150px !important;
  min-width:150px !important;
}

.base-table-box th:nth-child(4),
.base-table-box td:nth-child(4){
  width:150px !important;
  min-width:150px !important;
}

.base-table-box th:nth-child(5),
.base-table-box td:nth-child(5){
  width:110px !important;
  min-width:110px !important;
}

.base-table-box th:nth-child(6),
.base-table-box td:nth-child(6){
  width:110px !important;
  min-width:110px !important;
}

.base-table-box th:nth-child(7),
.base-table-box td:nth-child(7){
  width:130px !important;
  min-width:130px !important;
}

.base-table-box th:nth-child(8),
.base-table-box td:nth-child(8){
  width:420px !important;
  min-width:420px !important;
}

.base-table-box th:nth-child(9),
.base-table-box td:nth-child(9){
  width:190px !important;
  min-width:190px !important;
  white-space:nowrap !important;
}

.base-table-box th:nth-child(10),
.base-table-box td:nth-child(10){
  width:130px !important;
  min-width:130px !important;
  text-align:center !important;
}

/* Scroll visible y bonito */
.base-table-box::-webkit-scrollbar{
  width:12px !important;
  height:12px !important;
}

.base-table-box::-webkit-scrollbar-thumb{
  background:#9fb7c7 !important;
  border-radius:999px !important;
}

.base-table-box::-webkit-scrollbar-track{
  background:#eef6fa !important;
  border-radius:999px !important;
}

/* Que la paginación no se monte encima */
.pagination{
  margin-top:16px !important;
  position:relative !important;
  z-index:1 !important;
}

/* Tarjeta dashboard sin enlace */
.dash-card-dev{
  cursor:default !important;
  opacity:.92;
}

.dash-card-dev:hover{
  transform:none !important;
}

.dash-card-dev .dash-icon{
  background:#94a3b8 !important;
  box-shadow:0 12px 24px rgba(100,116,139,.16) !important;
}

/* FOTO ALUMNO */
.alumno-foto-preview{
  display:flex;
  justify-content:center;
  margin:14px 0 18px;
}

.alumno-foto-preview img{
  width:120px;
  height:120px;
  object-fit:cover;
  border-radius:24px;
  border:4px solid #ffffff;
  box-shadow:0 12px 26px rgba(15,23,42,.18);
  background:#eef6fa;
}

input[type="file"]{
  width:100%;
  padding:12px;
  border:1px solid #d8e4ec;
  border-radius:14px;
  background:#f8fbfd;
}

/* FOTO ALUMNO - CARD VISUAL */
.foto-alumno-card{
  display:flex;
  align-items:center;
  gap:18px;
  width:100%;
  padding:16px;
  margin:16px 0 20px;
  border:1px solid #d8e4ec;
  border-radius:20px;
  background:linear-gradient(135deg,#ffffff,#f6fbfd);
  box-shadow:0 8px 22px rgba(15,23,42,.055);
}

.foto-alumno-preview{
  width:120px;
  height:120px;
  min-width:120px;
  border-radius:24px;
  overflow:hidden;
  background:#eef6fa;
  border:3px solid #ffffff;
  box-shadow:0 12px 24px rgba(15,23,42,.14);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.foto-alumno-preview img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.foto-empty{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#64748b;
  font-weight:900;
  font-size:13px;
  border:2px dashed #cbd5e1;
  border-radius:22px;
}

.foto-alumno-info{
  flex:1;
}

.foto-alumno-info label{
  display:block;
  font-weight:900;
  color:#0f172a;
  margin-bottom:8px;
}

.foto-alumno-info label small{
  color:#64748b;
}

.foto-alumno-info input[type="file"]{
  width:100%;
  padding:12px;
  border:1px solid #d8e4ec;
  border-radius:14px;
  background:#ffffff;
}

.foto-alumno-info small{
  display:block;
  margin-top:8px;
  color:#64748b;
  font-weight:700;
}

.foto-modal{
  position:fixed;
  inset:0;
  z-index:99999;
  display:none;
  align-items:center;
  justify-content:center;
}

.foto-modal.is-open{
  display:flex;
}

.foto-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.72);
  backdrop-filter:blur(4px);
}

.foto-modal-content{
  position:relative;
  z-index:2;
  max-width:90vw;
  max-height:90vh;
  background:#ffffff;
  padding:14px;
  border-radius:28px;
  box-shadow:0 30px 80px rgba(0,0,0,.35);
}

.foto-modal-content img{
  display:block;
  max-width:82vw;
  max-height:82vh;
  object-fit:contain;
  border-radius:20px;
}

.foto-modal-close{
  position:absolute;
  top:-16px;
  right:-16px;
  width:42px;
  height:42px;
  border:none;
  border-radius:50%;
  background:#0f172a;
  color:#ffffff;
  font-size:28px;
  font-weight:900;
  cursor:pointer;
}

@media(max-width:700px){
  .foto-alumno-card{
    flex-direction:column;
    align-items:flex-start;
  }

  .foto-alumno-preview{
    width:110px;
    height:110px;
    min-width:110px;
  }
}

/* Ajuste foto alumno arriba */
.foto-alumno-card-top{
  margin-top:0 !important;
  margin-bottom:24px !important;
}

/* En detalle QR no mostrar cuadro vacío si no hay foto */
.detail-header-center .alumno-foto-empty{
  display:none !important;
}
