@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');
*{box-sizing:border-box;margin:0;padding:0}html,body{min-height:100%}body{font-family:'DM Sans','Segoe UI',sans-serif;background:#eef3f9;color:#1e3a5f;line-height:1.4}body.auth-locked{overflow:hidden}
a{color:#2e75b6;text-decoration:none}a:hover{text-decoration:underline}
button{cursor:pointer;font-family:inherit;transition:transform .15s ease,box-shadow .15s ease,opacity .15s ease}button:hover{opacity:.96;transform:translateY(-1px)}
input,select,textarea{font-family:inherit;outline:none}
input:focus,textarea:focus,select:focus{border-color:#2e75b6!important;box-shadow:0 0 0 3px rgba(46,117,182,.1)!important}
::-webkit-scrollbar{width:6px}::-webkit-scrollbar-thumb{background:#d0d5dd;border-radius:3px}
@keyframes spin{to{transform:rotate(360deg)}}@keyframes fadeUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.login-bg{position:fixed;inset:0;min-height:100dvh;width:100%;display:flex;align-items:center;justify-content:center;padding:16px;background:linear-gradient(135deg,#0f2640,#1a3f66 50%,#2e75b6);z-index:4000;overflow:auto}
.login-box{width:420px;background:#fff;border-radius:16px;padding:40px;box-shadow:0 20px 60px rgba(0,0,0,.3);animation:fadeUp .5s ease}
.login-logo{width:64px;height:64px;border-radius:16px;background:linear-gradient(135deg,#1e3a5f,#2e75b6);display:flex;align-items:center;justify-content:center;margin:0 auto 16px;font-size:24px;font-weight:700;color:#fff}
.field{margin-bottom:14px}.field label{display:block;font-size:12px;font-weight:600;color:#4a5568;margin-bottom:5px}
.field input,.field select,.field textarea{width:100%;padding:9px 12px;border-radius:8px;border:1px solid #e0e4ea;font-size:13px;color:#1e3a5f;background:#fff}.field textarea{resize:vertical;min-height:60px}
.password-field{position:relative;display:flex;align-items:center}
.password-field input{padding-right:96px!important}
.password-toggle{position:absolute;right:8px;top:50%;transform:translateY(-50%);border:1px solid #d8dee7;background:#fff;color:#2e75b6;border-radius:999px;padding:5px 10px;font-size:11px;font-weight:600;box-shadow:none}
.password-toggle:hover{transform:translateY(-50%);opacity:1}
.field-help{font-size:11px;color:#7a8797;margin-top:6px}
.btn-login{width:100%;padding:12px;border-radius:8px;border:none;background:linear-gradient(135deg,#1e3a5f,#2e75b6);color:#fff;font-size:14px;font-weight:600}
.error-box{padding:10px 14px;border-radius:8px;background:#fef2f2;border:1px solid #fecaca;color:#dc2626;font-size:12px;margin-bottom:16px;display:none}
.app{display:flex;height:100vh;overflow:hidden;display:none}
.sidebar{width:220px;background:linear-gradient(180deg,#0f2640,#1a3f66);display:flex;flex-direction:column;flex-shrink:0}
.sidebar-head{padding:20px 18px;border-bottom:1px solid rgba(255,255,255,.08)}.sidebar-head .logo{font-size:14px;font-weight:700;color:#fff}.sidebar-head .sub{font-size:10px;color:#6b9cc8}
.sidebar-nav{padding:16px 12px;flex:1;display:flex;flex-direction:column;gap:4px}
.nav-item{display:flex;align-items:center;gap:10px;padding:10px 14px;border-radius:8px;border:none;width:100%;font-size:13px;color:#8fabc7;background:transparent;text-align:left}
.nav-item:hover{background:rgba(255,255,255,.06)}.nav-item.active{background:rgba(255,255,255,.13);color:#fff;font-weight:600}
.main{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0}
.topbar{padding:12px 28px;background:rgba(255,255,255,.98);border-bottom:1px solid #e8ecf1;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;flex-shrink:0;backdrop-filter:blur(10px)}
.topbar-brand{display:flex;align-items:center;gap:10px;min-width:0;flex:1 1 260px}
.topbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap;min-width:0;flex:1 1 420px}
.topbar-search{position:relative;flex:1 1 280px;min-width:220px;max-width:520px}
.topbar-search input{width:100%!important}
.content{flex:1;overflow:auto;padding:28px;background:linear-gradient(180deg,#eef3f9 0%,#f7f9fc 100%)}.content>div{animation:fadeUp .4s ease}
.card{background:#fff;border-radius:14px;border:1px solid rgba(224,228,234,.85);padding:20px;margin-bottom:16px;box-shadow:0 10px 28px rgba(15,38,64,.06);min-width:0}
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:16px;margin-bottom:28px}
.stat-card{display:flex;gap:14px;align-items:flex-start}
.stat-icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:18px}
.stat-label{font-size:12px;color:#8896a6;font-weight:500;margin-bottom:2px}.stat-value{font-size:26px;font-weight:700;line-height:1.1}.stat-sub{font-size:11px;color:#8896a6;margin-top:3px}
table{width:100%;border-collapse:collapse}th{text-align:left;padding:12px 14px;font-size:11px;font-weight:600;color:#8896a6;text-transform:uppercase;border-bottom:2px solid #e8ecf1;background:#f8fafc}
td{padding:12px 14px;border-bottom:1px solid #f3f4f6;font-size:13px}tr.clickable{cursor:pointer}tr.clickable:hover{background:#f8fafc}
.badge{display:inline-flex;padding:2px 10px;border-radius:20px;font-size:11px;font-weight:600;white-space:nowrap}
.b-green{color:#16a34a;background:#f0fdf4}.b-yellow{color:#d97706;background:#fffbeb}.b-red{color:#dc2626;background:#fef2f2}.b-blue{color:#2e75b6;background:#eef4fb}.b-purple{color:#7c3aed;background:#f5f3ff}
.pa{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex-shrink:0}
.search-wrap{position:relative;margin-bottom:16px}.search-wrap input{width:100%;padding:10px 10px 10px 38px;border-radius:8px;border:1px solid #e0e4ea;font-size:13px;color:#1e3a5f;background:#fff}.search-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:#8896a6}
.filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.filters label{font-size:11px;font-weight:600;color:#8896a6;text-transform:uppercase;margin-bottom:4px;display:block}
.filters select{width:100%;padding:7px 8px;border-radius:6px;border:1px solid #e0e4ea;font-size:12px;color:#1e3a5f;background:#fff}
.btn{padding:8px 16px;border-radius:10px;font-size:12px;font-weight:500;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid #d8dee7;background:#fff;color:#4a5568;box-shadow:0 2px 6px rgba(15,38,64,.04);min-height:38px}
.btn-p{border:none;background:#2e75b6;color:#fff;font-weight:600}.btn-g{border:none;background:#16a34a;color:#fff;font-weight:600}
.pages{display:flex;justify-content:center;align-items:center;gap:12px;padding:16px;border-top:1px solid #e8ecf1}
.pages button{padding:6px 14px;border-radius:6px;border:1px solid #e0e4ea;background:#fff;font-size:12px}.pages button:disabled{color:#ccc}
.spinner{display:flex;justify-content:center;padding:60px}.spinner::after{content:'';width:32px;height:32px;border:3px solid #e8ecf1;border-top-color:#2e75b6;border-radius:50%;animation:spin 1s linear infinite}
.ficha-grid{display:grid;grid-template-columns:minmax(280px,340px) minmax(0,1fr);gap:20px}
.ficha-avatar{width:90px;height:90px;border-radius:50%;background:linear-gradient(135deg,#1e3a5f,#2e75b6);display:flex;align-items:center;justify-content:center;margin:0 auto 14px;font-size:28px;font-weight:700;color:#fff;overflow:hidden}.ficha-avatar img{width:100%;height:100%;object-fit:cover}
.info-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid #f3f4f6}.info-row:last-child{border:none}
.ff{padding:12px;background:#f8fafc;border-radius:8px}.ff .fl{font-size:11px;color:#8896a6;margin-bottom:4px}.ff .fv{font-size:13px;font-weight:500;color:#1e3a5f}.ff .fv.empty{color:#ccc;font-weight:400}
.chart-row{display:grid;gap:16px;margin-bottom:16px}.chart-row-2{grid-template-columns:minmax(0,2fr) minmax(320px,1fr)}.chart-row-half{grid-template-columns:repeat(2,minmax(0,1fr))}
.chart-title{font-size:14px;font-weight:600;color:#1e3a5f;margin-bottom:16px}
.timeline{position:relative;padding-left:20px}.timeline-line{position:absolute;left:5px;top:6px;bottom:6px;width:2px;background:#e8ecf1}
.timeline-item{position:relative;padding-bottom:20px;padding-left:16px}.timeline-dot{position:absolute;left:-3px;top:6px;width:10px;height:10px;border-radius:50%;border:2px solid #fff}
.empty-state{padding:24px;text-align:center;color:#8896a6;font-size:12px;background:#f9fafb;border-radius:8px}
.toast{position:fixed;top:20px;right:20px;padding:14px 24px;border-radius:10px;color:#fff;font-size:13px;font-weight:500;z-index:10000;opacity:0;transform:translateY(-10px);transition:all .3s;box-shadow:0 4px 16px rgba(0,0,0,.15)}.toast.show{opacity:1;transform:translateY(0)}.toast-ok{background:#16a34a}.toast-err{background:#dc2626}.toast-warn{background:#d97706}
th.sortable{cursor:pointer;user-select:none}th.sortable:hover{color:#2e75b6}th.sortable::after{content:' ↕';font-size:10px;color:#8896a6}
.log-action{display:inline-flex;padding:2px 8px;border-radius:4px;font-size:10px;font-weight:600}
.log-LOGIN{color:#2e75b6;background:#eef4fb}.log-CREAR{color:#16a34a;background:#f0fdf4}.log-ACTUALIZAR{color:#d97706;background:#fffbeb}.log-ELIMINAR{color:#dc2626;background:#fef2f2}.log-LEER{color:#6b7280;background:#f3f4f6}.log-EXPORTAR{color:#7c3aed;background:#f5f3ff}.log-CARGAR_DOC{color:#0891b2;background:#ecfeff}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;z-index:1000}
.modal{background:#fff;border-radius:16px;padding:28px;width:520px;max-width:min(92vw,980px);max-height:80vh;overflow:auto;box-shadow:0 20px 60px rgba(0,0,0,.3);animation:fadeUp .3s ease}
.device-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:999px;background:#eef4fb;color:#2e75b6;font-size:11px;font-weight:600;white-space:nowrap}
.mobile-menu-btn{display:none}
.mobile-nav-overlay{display:none}
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.responsive-stack{display:grid;gap:14px}
.modal-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;border-top:1px solid #eef4fb;margin-top:18px;padding-top:16px}
.modal-actions .modal-actions-right{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.wizard-steps{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.wizard-step{flex:1 1 150px;min-width:130px;padding:10px 12px;border-radius:12px;border:1px solid #d8dee7;background:#f8fafc}
.wizard-step-num{font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
.wizard-step-label{font-size:12px;font-weight:600;margin-top:4px}
.config-card-grid,.about-card-grid,.help-card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.config-record-list{display:grid;gap:10px}
.config-record{padding:14px;border:1px solid #e6edf5;border-radius:12px;background:#fbfdff}
.config-record-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.config-record-title{font-size:13px;font-weight:700;color:#1e3a5f}
.config-record-meta{font-size:12px;color:#4a5568;line-height:1.6}
.config-record-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.status-note{padding:12px 14px;border-radius:10px;font-size:12px;line-height:1.6}
.status-note.info{background:#eef4fb;border:1px solid #d0e3f5;color:#1e3a5f}
.status-note.warn{background:#fffbeb;border:1px solid #fde68a;color:#92400e}
.status-note.err{background:#fef2f2;border:1px solid #fecaca;color:#991b1b}
.shell-actions{display:flex;gap:8px;flex-wrap:wrap}
.shell-actions .btn{flex:0 0 auto}
.content h1,.content h2,.content h3,.content p,.content li,.content .ff,.content .record-card,.content .config-record{overflow-wrap:anywhere}
body.is-mobile .login-box{width:min(92vw,420px);padding:28px}
body.is-mobile .login-bg{min-height:100dvh;align-items:flex-start;padding:24px 14px 32px}
body.is-mobile .app{height:auto;min-height:100vh}
body.is-mobile .sidebar{position:fixed;top:0;left:0;bottom:0;width:min(84vw,310px);max-width:310px;transform:translateX(-108%);transition:transform .25s ease;z-index:1200;box-shadow:0 18px 48px rgba(15,38,64,.28)}
body.is-mobile .app.nav-open .sidebar{transform:translateX(0)}
body.is-mobile .sidebar-nav{padding:16px 12px;overflow:auto}
body.is-mobile .nav-item{white-space:nowrap;min-height:44px;font-size:14px}
body.is-mobile .main{width:100%;min-width:0;min-height:100vh}
body.is-mobile .topbar{padding:12px 14px;position:sticky;top:0;z-index:150;background:rgba(255,255,255,.96);backdrop-filter:blur(10px);flex-direction:column;align-items:stretch;gap:12px}
body.is-mobile .topbar-brand{display:flex;align-items:center;gap:10px;min-width:0;flex:1 1 auto;font-size:11px}
body.is-mobile .topbar-actions{justify-content:flex-start;gap:10px}
body.is-mobile .topbar-search{flex:1 1 100%;max-width:none;min-width:0}
body.is-mobile #topUser{display:none}
body.is-mobile #topAv{width:34px!important;height:34px!important}
body.is-mobile .mobile-menu-btn{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;border:1px solid #d0d5dd;background:#fff;color:#1e3a5f;font-size:18px;flex-shrink:0}
body.is-mobile .mobile-nav-overlay{display:block;position:fixed;inset:0;background:rgba(15,23,42,.34);opacity:0;pointer-events:none;transition:opacity .25s ease;z-index:1100}
body.is-mobile .app.nav-open .mobile-nav-overlay{opacity:1;pointer-events:auto}
body.is-mobile #globalSearch{width:100%!important}
body.is-mobile .content{padding:16px 14px 28px}
body.is-mobile .stats-grid,body.is-mobile .chart-row-2,body.is-mobile .chart-row-half,body.is-mobile .filters,body.is-mobile .form-grid,body.is-mobile .ficha-grid{grid-template-columns:1fr}
body.is-mobile table{display:block;overflow-x:auto}
body.is-mobile .card table{min-width:720px}
body.is-mobile .card{padding:16px}
body.is-mobile .modal{width:min(96vw,760px);max-height:calc(100dvh - 24px);padding:18px;border-radius:14px}
body.is-mobile .pages{flex-wrap:wrap}
body.is-mobile .toolbar{align-items:stretch}
body.is-mobile .inline-actions{width:100%;display:flex;gap:8px;flex-wrap:wrap}
body.is-mobile .inline-actions .btn{flex:1 1 calc(50% - 8px);justify-content:center}
body.is-mobile .shell-actions{width:100%}
body.is-mobile .shell-actions .btn{flex:1 1 calc(50% - 8px)}
body.is-mobile .info-row{padding:10px 0}
body.is-mobile .timeline-item>div{flex-direction:column;gap:8px}
body.is-mobile .timeline-item .btn{padding:8px 12px;font-size:11px}
body.is-mobile .ff{padding:10px}
body.is-mobile .field input,body.is-mobile .field select,body.is-mobile .field textarea,body.is-mobile .search-wrap input,body.is-mobile #globalSearch{font-size:16px!important;min-height:44px}
body.is-mobile .field textarea{min-height:92px}
body.is-mobile .btn{min-height:44px;padding:10px 14px;font-size:13px}
body.is-mobile .password-toggle{min-height:34px;padding:6px 10px}
body.is-mobile .record-card .record-head,body.is-mobile .config-record-head{flex-direction:column;align-items:flex-start}
body.is-mobile .config-card-grid,body.is-mobile .about-card-grid,body.is-mobile .help-card-grid,body.is-mobile .responsive-stack{grid-template-columns:1fr}
body.is-mobile .content [style*="grid-template-columns:1fr 1fr"]{grid-template-columns:1fr!important}
body.is-mobile .content [style*="grid-template-columns:1fr 1fr 1fr"]{grid-template-columns:1fr!important}
body.is-mobile .content [style*="grid-template-columns:1fr 1fr 1fr 1fr"]{grid-template-columns:1fr!important}
body.is-mobile .modal-actions{align-items:stretch}
body.is-mobile .modal-actions .modal-actions-right{width:100%}
body.is-mobile .modal-actions .modal-actions-right .btn{flex:1 1 calc(50% - 8px)}
body.is-mobile .wizard-step{flex:1 1 100%}
body.is-mobile .config-record-actions .btn{flex:1 1 calc(50% - 8px)}
body.is-mobile .device-chip{order:3}
.toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.inline-actions{display:flex;gap:8px;flex-wrap:wrap}
.record-card{padding:14px;background:#f8fafc;border:1px solid #eef2f7;border-radius:12px;margin-bottom:10px}
.record-card .record-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:8px}
.record-card .record-title{font-size:13px;font-weight:700;color:#1e3a5f}
.record-card .record-meta{font-size:11px;color:#4a5568}
.stats-grid>*,.chart-row>*,.ficha-grid>*,.form-grid>*{min-width:0}
@media (max-width:1280px){.content{padding:22px}.chart-row-2,.chart-row-half,.ficha-grid{grid-template-columns:1fr}.topbar{padding:12px 20px}.topbar-actions{justify-content:flex-start}}
@media (max-width:1100px){table{display:block;overflow-x:auto;white-space:nowrap}.card table{min-width:720px}.topbar{padding:12px 16px}.topbar-brand{flex:1 1 100%}.topbar-actions{width:100%;justify-content:flex-start}.topbar-search{min-width:260px}.content{padding:18px}}
@media (max-width:767px){body:not(.is-mobile) .topbar{padding:12px 14px;flex-direction:column;align-items:stretch}.topbar-search{min-width:0}.content{padding:16px 14px 28px}}
