/* EyR Cash Fast — interfaz PRO v2.7
   Solo presentación. Conserva colores, logo, datos y lógica del sistema. */
:root{
  --pro-navy:#101f3d;
  --pro-navy-2:#152b52;
  --pro-blue:#285dde;
  --pro-blue-2:#204fb5;
  --pro-gold:#dca94e;
  --pro-gold-soft:#fff4d8;
  --pro-bg:#eef3fb;
  --pro-card:#ffffff;
  --pro-card-soft:#f7f9fd;
  --pro-line:#dfe7f2;
  --pro-line-strong:#d2ddec;
  --pro-text:#172744;
  --pro-muted:#6e7f99;
  --pro-shadow:0 10px 30px rgba(16,47,91,.07);
  --pro-shadow-soft:0 4px 14px rgba(16,47,91,.045);
  --pro-radius:20px;
  --pro-radius-sm:14px;
}

html{background:var(--pro-bg)}
body.app-body{background:
  radial-gradient(circle at 92% 4%,rgba(40,93,222,.055),transparent 24rem),
  linear-gradient(180deg,#f4f7fc 0,#eef3fb 100%);color:var(--pro-text)}
.app-shell{min-height:100dvh}
.main-area{min-width:0;background:transparent}

/* Barra superior */
.topbar{height:76px;padding:0 30px;background:rgba(255,255,255,.92);border-bottom:1px solid rgba(215,225,239,.92);box-shadow:0 1px 0 rgba(19,52,97,.025);backdrop-filter:blur(16px)}
.topbar-title{min-width:0}
.topbar-title span{color:#8795aa;font-size:10px;letter-spacing:1.25px;font-weight:750}
.topbar-title strong{color:#1d355c;font-size:16px;font-weight:720;letter-spacing:-.25px}
.topbar-actions{gap:12px}
.topbar-date{font-weight:550}
.profile-button{width:40px;height:40px;border-radius:13px;background:#edf3ff;color:#244e9f;border:1px solid #dce6f7;box-shadow:0 2px 8px rgba(34,74,139,.05)}

/* Menú lateral — misma identidad, acabado más limpio */
.sidebar{padding:22px 15px 16px;background:
  radial-gradient(circle at -5% 95%,rgba(52,94,166,.45),transparent 42%),
  linear-gradient(165deg,#0d1a31 0%,#112748 55%,#132c51 100%);border-right:1px solid rgba(255,255,255,.06);box-shadow:18px 0 48px rgba(10,30,61,.15)}
.sidebar:after{display:none}
.sidebar-brand{padding:2px 8px 22px;border-bottom-color:rgba(255,255,255,.08)}
.sidebar-brand strong{font-size:16px;font-weight:730}
.sidebar-brand span{color:#91a5c7;font-size:10px}
.sidebar-nav{padding:17px 0 12px;gap:3px}
.nav-section-label{padding:0 13px 9px;color:#7f94ba;font-size:9px;letter-spacing:1.55px}
.nav-section-secondary{padding-top:18px}
.nav-item{min-height:44px;padding:11px 12px;border-radius:11px;color:#bac7dc;gap:11px}
.nav-item span{width:22px}
.nav-item b{font-size:12px;font-weight:590}
.nav-item:hover{background:rgba(255,255,255,.055);color:#fff}
.nav-item.active{background:linear-gradient(90deg,rgba(48,91,190,.38),rgba(48,91,190,.13));box-shadow:inset 3px 0 #edc775;color:#fff}
.nav-item.active span{color:#f3cf86}
.nav-active-dot{background:#f0c96f}
.sidebar-footer{padding-top:10px}
.user-card{border-radius:13px;background:rgba(255,255,255,.055);border-color:rgba(255,255,255,.08)}
.logout-link{display:flex;align-items:center;justify-content:center;gap:7px;color:#9aacca}

/* Superficie de contenido */
.content{width:min(100%,1540px);padding:32px 30px 54px}
.page-heading{align-items:flex-end;margin-bottom:24px;gap:18px}
.page-heading h1{font-size:30px;font-weight:760;letter-spacing:-1.05px;color:#152c50}
.page-heading p{font-size:13px;line-height:1.55;color:#74839a;max-width:760px}
.page-actions{gap:9px}

.btn{min-height:42px;border-radius:11px;font-size:12px;font-weight:670;padding:10px 15px;box-shadow:none;transition:transform .14s ease,box-shadow .14s ease,background .14s ease,border-color .14s ease}
.btn:hover{transform:translateY(-1px)}
.btn-primary{background:linear-gradient(135deg,#2f66df,#214faf);border-color:#2859c5;box-shadow:0 6px 15px rgba(39,88,196,.16)}
.btn-primary:hover{background:linear-gradient(135deg,#285bc9,#1d479e);box-shadow:0 8px 18px rgba(39,88,196,.21)}
.btn-outline{background:#fff;color:#294978;border-color:#d7e1ef}
.btn-outline:hover{background:#f7f9fd;border-color:#bfcfe5}
.btn-ghost{background:#f1f5fc;color:#34598e}
.btn-renew{background:#fff6e5;border-color:#e8d5ad;color:#795812}

/* Tarjetas y paneles */
.panel,.route-card,.record-card,.receipt-card{background:var(--pro-card);border-color:var(--pro-line);box-shadow:var(--pro-shadow-soft)}
.panel{border-radius:var(--pro-radius);padding:24px}
.panel-head{margin-bottom:20px}
.panel-head h2,.panel h2{color:#20385e;font-size:18px;font-weight:720}
.panel-head p,.panel>p{color:#75849b}
.panel-head>a{color:#285abd;font-weight:700}
.dashboard-grid{gap:18px;margin:18px 0 20px}
.details-grid,.profile-grid,.closure-layout{gap:18px}
.content>.panel+.panel{margin-top:18px}

.stats-grid,.stats-grid.compact{gap:14px;margin-bottom:20px}
.stat-card{min-width:0;padding:18px;border:1px solid var(--pro-line);border-radius:18px;box-shadow:var(--pro-shadow-soft);background:linear-gradient(180deg,#fff 0%,#fcfdff 100%)}
.stat-card:after{opacity:.035}
.stat-card>.stat-icon{border-radius:12px}
.stat-card span{color:#78879e;font-size:11px;font-weight:650}
.stat-card strong{color:#193354;font-size:25px;font-weight:760;letter-spacing:-.8px}
.stat-card small{color:#8795aa;font-size:10px;line-height:1.45}
.stats-grid .stat-card:first-child{border-top:3px solid #3567cc}
.stats-grid .stat-card:nth-child(2){border-top:3px solid #dda94d}
.stats-grid .stat-card:nth-child(3){border-top:3px solid #6d8fc7}
.stats-grid .stat-card:nth-child(4){border-top:3px solid #b9626e}

.panel-chart{position:relative;overflow:hidden}
.panel-chart:before{content:"";position:absolute;width:170px;height:170px;border-radius:50%;right:-80px;top:-85px;background:rgba(49,96,193,.045);pointer-events:none}
.metric-lines{gap:17px}
.metric-line>div:first-child{margin-bottom:7px}
.metric-line span{font-size:11px;color:#71829b}
.metric-line strong{font-size:12px;color:#1e3b67}
.progress{height:7px;background:#edf2f8}
.progress b{background:linear-gradient(90deg,#3468d0,#5687e9)}
.mini-summary{gap:9px;margin-top:20px}
.mini-summary div{background:#f5f8fd;border:1px solid #eaf0f7;border-radius:13px;padding:13px}
.mini-summary strong{color:#203c69;font-size:16px}
.mini-summary span{font-size:9px;color:#8090a7}
.live-pill{background:#edf8f4;color:#23745b;border:1px solid #dcefe8}

.alert-list{gap:0}
.alert-row{padding:12px 2px;border-bottom-color:#e9eff7;border-radius:10px;transition:.14s}
.alert-row:hover{background:#f8faff;padding-left:8px;padding-right:8px}
.alert-row small{font-size:10px;color:#8190a6}
.alert-row>b{font-size:12px;color:#263f64}

/* Tablas */
.table-panel{border-radius:var(--pro-radius);box-shadow:var(--pro-shadow-soft)}
.table-panel>.panel-head{padding:22px 22px 0}
.table-wrap{border-radius:0 0 var(--pro-radius) var(--pro-radius)}
.table-wrap thead{background:#f6f8fc}
.table-wrap th{background:#f6f8fc;color:#7788a3;font-weight:700;letter-spacing:.65px;padding:13px 17px}
.table-wrap td{padding:15px 17px;border-color:#edf2f8;color:#405575}
.table-wrap tbody tr:hover{background:#f9fbff}
.table-link strong,.person-cell strong{color:#24456f}

/* Filtros, formularios y pestañas */
.content .filter-bar,.filter-bar{background:#fff;border:1px solid var(--pro-line);border-radius:16px;box-shadow:0 3px 12px rgba(18,49,91,.025)}
.search-box{background:#f7f9fd;border-color:#e4ebf5}
input,select,textarea,.content input:not([type=hidden]):not([type=checkbox]):not([type=radio]),.content select,.content textarea{border-color:#dbe4f0;background:#fcfdff;color:#263e62}
input:focus,select:focus,textarea:focus,.content input:not([type=hidden]):focus,.content select:focus,.content textarea:focus{border-color:#6f93df;box-shadow:0 0 0 3px rgba(46,93,201,.10);background:#fff}
.tabs{background:#edf2f9;border-color:#e1e8f2}
.tabs a{color:#6e809b}
.tabs a.active{color:#244f9e;border-color:transparent;background:#fff;box-shadow:0 2px 7px rgba(33,70,127,.08)}
.period-shortcuts a{border-color:#dce5f2;color:#536b91}
.period-shortcuts a.active{background:#234fae;border-color:#234fae}

/* Resúmenes y detalle */
.summary-banner{background:linear-gradient(125deg,#fff,#f4f7fd);border-color:#dce5f2;box-shadow:var(--pro-shadow-soft)}
.loan-row{border-color:#e1e8f2;background:#fff}
.loan-row:hover{border-color:#c8d7eb;background:#fbfcff}
.loan-balance strong{color:#285abc}
.details-list>div,.profile-card dl div{border-color:#edf2f8}
.profile-avatar{background:linear-gradient(145deg,#315fc4,#142a4f);color:#f0cf86;box-shadow:0 14px 28px rgba(18,49,96,.18)}
.loan-hero{background:radial-gradient(circle at 95% 0,rgba(78,119,208,.42),transparent 44%),linear-gradient(125deg,#132849,#213f6d);border-color:#2a4771;box-shadow:0 14px 32px rgba(17,46,87,.14)}
.loan-hero .balance-box{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.14)}
.loan-hero .progress{background:rgba(255,255,255,.14)}
.loan-hero .progress b{background:linear-gradient(90deg,#d9aa4e,#f4d997)}

/* Estados de listas móviles generadas */
.record-card{border-radius:18px;padding:17px;box-shadow:0 5px 16px rgba(20,52,96,.045)}
.record-title strong{color:#1e3b65;font-weight:730}
.record-title small{color:#8190a6}
.record-amount{background:linear-gradient(135deg,#f2f6fe,#f8faff);border:1px solid #e4ebf6;border-radius:13px}
.record-amount .record-value,.record-amount strong{color:#1d416f}
.record-facts{border-radius:12px}
.record-label{color:#8795aa;font-weight:650}
.record-value{color:#405877}
.record-details{border-color:#e8eef7}
.record-details>summary,.record-more>summary{color:#3562a0}
.record-actions{padding-top:3px}
.record-load{border-color:#d7e2f0;color:#315688;background:#fff}

/* Modales */
.modal{background:rgba(10,27,56,.58);backdrop-filter:blur(4px)}
.modal-dialog{border:1px solid #dbe4f0;box-shadow:0 28px 88px rgba(10,30,65,.26)}
.modal-close{background:#f4f7fb;color:#506887;border-color:#dce5f0}
.sheet-header{border-color:#e4ebf4}
.sheet-submit{border-color:#e7edf5}

/* Ajustes / reportes */
.settings-hero{box-shadow:0 12px 32px rgba(19,48,90,.12)}
.settings-card,.automation-settings,.restart-settings{border-color:#dfe7f2;box-shadow:var(--pro-shadow-soft)}
.setting-rule{background:#f6f8fc;border-color:#e3e9f2}
.setting-icon{background:#edf3ff;color:#315fc3}
.setting-pill{background:#edf3ff;color:#3c5f99}
.bar-track{background:#edf2f8}
.bar-track b{background:#4b76d2}

/* El usuario pidió navegación móvil EXCLUSIVAMENTE por hamburguesa. */
.mobile-nav,.sections-modal{display:none!important}

@media(max-width:1180px){
  .content{padding-left:24px;padding-right:24px}
}

@media(max-width:930px){
  html,body{min-height:100%;background:#eef3fb}
  body.app-body{background:linear-gradient(180deg,#f3f6fb 0,#eef3fb 100%)}
  .app-shell{display:block;min-height:100dvh}
  .main-area{min-height:100dvh}

  /* Drawer principal */
  .sidebar{width:min(84vw,318px);padding:18px 14px 16px;transform:translateX(-105%);transition:transform .22s cubic-bezier(.2,.8,.2,1);border-radius:0 24px 24px 0;box-shadow:22px 0 60px rgba(8,24,53,.32);z-index:80}
  .app-body.sidebar-open .sidebar{transform:translateX(0)}
  .sidebar-brand{padding:3px 7px 18px}
  .sidebar-nav{padding-top:15px}
  .nav-item{min-height:46px;padding:12px 13px}
  .nav-item b{font-size:13px}
  .sidebar-footer{padding-bottom:max(2px,env(safe-area-inset-bottom))}
  .sidebar-overlay{position:fixed;inset:0;background:rgba(10,25,52,.55);backdrop-filter:blur(3px);z-index:75}
  .app-body.sidebar-open .sidebar-overlay{display:block}

  /* Encabezado de app */
  .topbar{height:64px;padding:0 14px;gap:10px;position:sticky;top:0;z-index:60;background:rgba(255,255,255,.96);box-shadow:0 4px 18px rgba(22,51,92,.055)}
  .menu-toggle{display:grid;place-items:center;width:42px;height:42px;min-width:42px;min-height:42px;padding:0;border-radius:12px;background:#f0f4fb;border:1px solid #dae4f2;color:#315993;box-shadow:0 2px 8px rgba(31,70,129,.035)}
  .menu-toggle:active{transform:scale(.97)}
  .topbar-title{flex:1;min-width:0}
  .topbar-title>span{display:none}
  .topbar-title strong{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#1e395f}
  .topbar-date,.system-status{display:none}
  .topbar-actions{margin-left:auto;gap:8px}
  .profile-button{width:38px;height:38px;border-radius:12px}

  /* Contenido móvil sin barra inferior */
  .content{width:100%;max-width:none;padding:20px 14px calc(28px + env(safe-area-inset-bottom));overflow-x:hidden}
  .app-footer{display:none!important}
  .page-heading{display:block;margin-bottom:18px}
  .page-heading h1{font-size:26px;line-height:1.13;letter-spacing:-.75px}
  .page-heading p{font-size:12.5px;line-height:1.55;margin-top:6px}
  .page-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:14px;width:100%}
  .page-actions>*{min-width:0!important;width:100%;margin:0}
  .page-actions>*:only-child{grid-column:1/-1}
  .page-actions .btn{width:100%;min-height:46px;padding:10px 9px;font-size:12.5px;white-space:normal;line-height:1.25}
  .page-actions form>.btn{height:100%}

  .panel{padding:18px 16px;border-radius:18px;margin-bottom:15px;box-shadow:0 4px 16px rgba(20,50,92,.045)}
  .panel-head{gap:10px;margin-bottom:16px;align-items:flex-start}
  .panel-head h2{font-size:17px}
  .panel-head p{font-size:12px;line-height:1.45}
  .panel-head>a{font-size:11px;white-space:nowrap}
  .dashboard-grid,.details-grid,.profile-grid,.closure-layout{grid-template-columns:1fr;gap:15px;margin-top:15px}
  .content>.panel+.panel{margin-top:15px}

  /* Indicadores: dos por fila, legibles y equilibrados */
  .stats-grid,.stats-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:16px}
  .stat-card{display:block!important;min-height:122px;padding:15px 13px 13px;border-radius:16px}
  .stat-card>.stat-icon{display:none!important}
  .stat-card>div:last-child{display:flex!important;flex-direction:column;min-width:0}
  .stat-card span,.stat-card>div:last-child>span{font-size:10.5px;line-height:1.35;color:#71829b}
  .stat-card strong,.stat-card>div:last-child>strong{font-size:21px;line-height:1.22;margin-top:8px;letter-spacing:-.55px;white-space:normal;overflow-wrap:anywhere;color:#173555}
  .stat-card small,.stat-card>div:last-child>small{font-size:9.5px;line-height:1.45;margin-top:6px;color:#8795aa}
  .stat-card:after{display:none}

  .panel-chart{padding-bottom:17px}
  .metric-lines{gap:16px}
  .metric-line>div:first-child{align-items:center}
  .metric-line span{font-size:10.5px}
  .metric-line strong{font-size:11.5px}
  .mini-summary{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:17px}
  .mini-summary div{padding:11px 8px;min-width:0}
  .mini-summary strong{font-size:15px;overflow-wrap:anywhere}
  .mini-summary span{font-size:8.5px;line-height:1.35;margin-top:3px}

  .alert-row{grid-template-columns:38px minmax(0,1fr) auto;gap:9px;padding:11px 0}
  .alert-row>.avatar{width:38px;height:38px}
  .alert-row>.badge{grid-column:3;grid-row:1}
  .alert-row>b{grid-column:2/4;grid-row:2;text-align:right;padding-top:1px}

  /* Listas y filtros */
  .table-panel:has(.records-active){background:transparent;border:0;box-shadow:none;padding:0}
  .table-panel:has(.records-active)>.panel-head{padding:0 1px 8px}
  .record-toolbar{padding-bottom:10px}
  .record-search input{min-height:46px;border-radius:12px}
  .record-list{gap:11px}
  .record-card{padding:16px 14px;border-radius:17px;box-shadow:0 4px 14px rgba(18,49,91,.04)}
  .record-head{margin-bottom:13px}
  .record-title strong{font-size:16px}
  .record-title small{font-size:11px}
  .record-amount{padding:12px 13px;margin-bottom:13px}
  .record-amount .record-value,.record-amount strong{font-size:22px}
  .record-facts{gap:12px 14px}
  .record-label{font-size:10px}
  .record-value{font-size:13px}
  .record-actions .btn,.record-actions .inline-form .btn{min-height:44px;font-size:12px}

  .filter-bar,.content .filter-bar{padding:12px;gap:9px;border-radius:15px;margin-bottom:14px}
  .summary-banner{padding:16px;border-radius:17px;margin-bottom:15px}
  .tabs{margin-bottom:16px}

  .loan-hero{padding:20px 17px;border-radius:19px;gap:18px}
  .loan-hero h2{font-size:28px}
  .loan-hero .balance-box{padding:16px}
  .balance-box strong{font-size:29px}

  /* Formularios / hojas a pantalla completa */
  input,select,textarea,.modal form input,.modal form select,.modal form textarea{min-height:48px;border-radius:11px}
  .modal{z-index:1000;background:rgba(9,24,51,.62)}
  .modal-dialog,.modal-lg,.modal-xl{border:0;border-radius:0;background:#fff;padding:0 16px calc(16px + env(safe-area-inset-bottom))}
  .sheet-header{min-height:70px;margin:0 -16px 17px;padding:13px 16px;background:#fff;border-bottom:1px solid #e4ebf4}
  .sheet-header h2{font-size:21px}
  .sheet-header .modal-close{width:42px;height:42px;border-radius:11px}
  .sheet-submit{background:#fff;padding:12px 0 calc(12px + env(safe-area-inset-bottom));border-top-color:#e7edf5}
  .sheet-submit>.btn{min-height:49px}

  /* Notificaciones ya no necesitan reservar la barra inferior */
  .toast-stack{left:12px;right:12px;bottom:calc(14px + env(safe-area-inset-bottom));top:auto;max-width:none;z-index:2000}

  .bar-item{grid-template-columns:43px minmax(0,1fr) 76px;gap:9px}
  .bar-item>span,.bar-value{font-size:11px}
}

@media(max-width:390px){
  .content{padding-left:12px;padding-right:12px}
  .topbar{padding-left:11px;padding-right:11px}
  .page-heading h1{font-size:24px}
  .page-actions .btn{font-size:12px}
  .stat-card{min-height:118px;padding:14px 11px 12px}
  .stat-card strong,.stat-card>div:last-child>strong{font-size:20px}
  .stat-card span,.stat-card>div:last-child>span{font-size:10px}
  .stat-card small,.stat-card>div:last-child>small{font-size:9px}
  .panel{padding:16px 14px}
  .mini-summary div{padding:10px 7px}
}

@media(max-width:340px){
  .stats-grid,.stats-grid.compact{grid-template-columns:1fr}
  .stat-card{min-height:0}
  .page-actions{grid-template-columns:1fr}
  .page-actions>*{grid-column:1!important}
}

@media print{
  .sidebar,.topbar,.mobile-nav,.sidebar-overlay{display:none!important}
  .main-area{display:block!important}
  .content{padding:0!important;max-width:none!important}
}


/* Trabajadores — PRO v2.7 */
.worker-access-note{display:flex;align-items:flex-start;gap:14px;padding:18px 20px;margin-bottom:18px;background:linear-gradient(135deg,#f8fbff,#fff);}
.worker-access-note .worker-access-icon{display:grid;place-items:center;min-width:42px;width:42px;height:42px;border-radius:13px;background:#edf3ff;color:#2e5db9;border:1px solid #dce7f7}
.worker-access-note strong{display:block;color:#203b63;font-size:14px;margin:2px 0 5px}
.worker-access-note p{margin:0;color:#71819a;font-size:12px;line-height:1.55}
.worker-access-note b{color:#345781}
.worker-actions{display:flex;flex-wrap:wrap;gap:6px;min-width:250px}
.worker-actions .inline-form{margin:0}
[data-worker-route][hidden]{display:none!important}
.page-workers .stats-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:930px){
  .page-workers .stats-grid.compact{grid-template-columns:repeat(2,minmax(0,1fr))}
  .page-workers .stats-grid.compact .stat-card:last-child{grid-column:1/-1;min-height:100px}
  .worker-access-note{padding:15px 14px;margin-bottom:14px;border-radius:16px}
  .worker-actions{min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  .worker-actions>*{width:100%}
  .worker-actions .btn{width:100%}
}
@media(max-width:390px){.worker-actions{grid-template-columns:1fr}.page-workers .stats-grid.compact{grid-template-columns:1fr}.page-workers .stats-grid.compact .stat-card:last-child{grid-column:auto}}
