:root{--navy:#062a55;--navy2:#0b3d73;--orange:#f59a16;--ink:#172033;--muted:#6c7888;--bg:#f3f6f9;--line:#dfe5eb}*{box-sizing:border-box}body{margin:0;font-family:Segoe UI,Inter,Arial,sans-serif;background:var(--bg);color:var(--ink)}a{color:var(--navy2);text-decoration:none}aside{position:fixed;inset:0 auto 0 0;width:245px;background:linear-gradient(180deg,#031f40,#062a55);padding:22px 16px;display:flex;flex-direction:column;color:#fff}.side-logo{width:160px;height:100px;object-fit:contain;margin:0 auto 20px}nav{display:grid;gap:6px}nav a{color:#dbe8f6;padding:11px 13px;border-radius:8px}nav a:hover{background:#ffffff14;color:#fff}.aside-user{margin-top:auto;border-top:1px solid #ffffff20;padding:16px 8px;display:grid;gap:4px}.aside-user small{color:#f8b34b}.aside-user a{color:#fff;margin-top:8px}.app{margin-left:245px;padding:0 30px 30px}.app>header{height:100px;display:flex;align-items:center;justify-content:space-between}.app h1{margin:3px 0 0;color:var(--navy);font-size:26px}.eyebrow{font-size:10px;letter-spacing:1.6px;color:var(--orange);font-weight:800}.avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:var(--navy);color:#fff;font-weight:700}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-bottom:20px}.stat,.panel,.card{background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 5px 18px #18324c0b}.stat{padding:20px;border-top:3px solid var(--navy)}.stat.accent{border-top-color:var(--orange)}.stat span,.stat small{display:block;color:var(--muted)}.stat strong{display:block;font-size:25px;color:var(--navy);margin:7px 0}.panel{padding:20px;margin-bottom:20px}.panel h2{margin:0 0 16px;color:var(--navy);font-size:18px}.panel-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.panel-head h2{margin:0}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:13px}th{background:#edf2f7;color:var(--navy);text-align:left;padding:11px 10px;white-space:nowrap}td{padding:11px 10px;border-bottom:1px solid var(--line)}tr:hover td{background:#fafcfe}.badge{display:inline-block;background:#eaf1f8;color:var(--navy);padding:4px 8px;border-radius:99px;font-size:11px;font-weight:700}.btn{display:inline-block;border:0;border-radius:8px;background:var(--navy);color:#fff;padding:10px 15px;font-weight:700;cursor:pointer}.btn:hover{background:var(--navy2)}.btn.ghost{background:#edf2f7;color:var(--navy)}.wide{width:100%}.grid2{display:grid;grid-template-columns:1fr 1.5fr;gap:20px}.form,.form-grid{display:grid;gap:14px}.form-grid{grid-template-columns:repeat(4,1fr)}label{display:grid;gap:6px;font-size:12px;font-weight:650;color:#4a5666}input,select,textarea{width:100%;border:1px solid #cfd7e1;border-radius:7px;padding:10px;background:#fff;font:inherit;color:var(--ink)}textarea{min-height:95px;resize:vertical}input:focus,select:focus,textarea:focus{outline:2px solid #f59a1635;border-color:var(--orange)}.quote-form table input,.quote-form table select{min-width:90px}.quote-form table td:nth-child(2) input{min-width:280px}.icon-btn{border:0;background:#fee;color:#a22;border-radius:5px;font-size:18px}.detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;background:#f6f8fa;padding:16px;border-left:4px solid var(--orange);margin-bottom:20px}.detail-grid div{display:grid;gap:4px}.detail-grid small{color:var(--muted)}.totals{max-width:390px;margin:20px 0 0 auto}.totals p{display:flex;justify-content:space-between;padding:8px 12px;margin:0;border-bottom:1px solid var(--line)}.totals .grand{background:var(--orange);color:#fff;border-radius:8px;font-size:18px}.center{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top right,#f59a1620,transparent 35%),#eef3f7;padding:20px}.card{padding:30px}.login{width:min(420px,100%);display:grid;gap:16px}.login-logo{display:block;width:220px;height:135px;object-fit:contain;margin:0 auto}.login h1{text-align:center;color:var(--navy);margin:0}.muted,.login small{text-align:center;color:var(--muted)}.alert{background:#fff0f0;color:#9c2525;padding:10px;border-radius:7px}.notice{background:#eef8ef;padding:10px;border-radius:7px;margin-bottom:12px}footer{text-align:center;color:var(--muted);font-size:11px;padding:15px}@media(max-width:900px){aside{width:76px;padding:15px 8px}.side-logo{width:60px;height:60px}nav a{font-size:0}nav a::first-letter{font-size:18px}.aside-user b,.aside-user small{display:none}.app{margin-left:76px;padding:0 15px 20px}.stats,.grid2,.form-grid,.detail-grid{grid-template-columns:1fr}.app>header{height:82px}}.inline{display:inline}.link{border:0;background:none;padding:0;color:var(--navy2);cursor:pointer;font:inherit}.danger{color:#a22}.danger-bg{background:#a93232}.block{display:block;color:var(--muted);margin-top:3px}.low-stock td{background:#fff5e8!important}.decision-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:18px 0}.decision{border:1px solid var(--line);border-radius:12px;padding:20px;display:grid;gap:13px}.decision h3{margin:0;color:var(--navy)}.decision.approve{border-top:4px solid #23845a}.decision.reject{border-top:4px solid #b83b3b}.docbox{max-width:620px;background:#f7fafc;padding:18px;border-radius:10px}.doc-strip{display:flex;gap:15px;flex-wrap:wrap;align-items:center;background:#f7fafc;border:1px solid var(--line);padding:12px 15px;border-radius:9px;margin-bottom:18px}.doc-strip a{font-weight:700}.alert.error{margin-bottom:16px}@media(max-width:900px){.decision-grid{grid-template-columns:1fr}}
/* Fase 7: menu, validaciones, notificaciones y visor PDF */
aside{overflow:hidden}.side-nav{display:block;overflow-y:auto;overflow-x:hidden;padding-right:4px;min-height:0}.side-nav::-webkit-scrollbar{width:6px}.side-nav::-webkit-scrollbar-thumb{background:#ffffff35;border-radius:10px}.nav-group{border-top:1px solid #ffffff16;padding-top:5px;margin-top:5px}.nav-group summary{cursor:pointer;color:#f8b34b;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.8px;padding:8px 12px;list-style:none}.nav-group summary::-webkit-details-marker{display:none}.nav-group summary::after{content:'▾';float:right}.nav-group:not([open]) summary::after{content:'▸'}.nav-group a{margin-left:8px}.aside-user{margin-top:0}.header-actions{display:flex;align-items:center;gap:12px}.bell{position:relative;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#fff;border:1px solid var(--line);font-size:20px}.bell span{position:absolute;right:-3px;top:-5px;background:#dc2626;color:#fff;border-radius:99px;font-size:11px;min-width:19px;height:19px;display:grid;place-items:center;font-weight:800}input,select,textarea{text-transform:uppercase}input[type=email],input[type=password],input[type=file],input[type=url],input.no-upper,textarea.no-upper{text-transform:none}.pdf-modal{position:fixed;inset:0;background:#07182acc;z-index:1000;padding:4vh 4vw}.pdf-box{background:#fff;height:92vh;border-radius:10px;display:grid;grid-template-rows:auto 1fr;overflow:hidden}.pdf-bar{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--line)}.pdf-box iframe{width:100%;height:100%;border:0}.mini-panel{border:1px solid var(--line);background:#f8fafc;border-radius:10px;padding:14px;margin:10px 0}.pill-list{display:flex;gap:8px;flex-wrap:wrap}.pill{border:1px solid var(--line);border-radius:999px;padding:6px 10px;background:#fff}@media(max-width:900px){aside{width:82px}.app{margin-left:82px}.nav-group summary{font-size:0}.nav-group summary::before{content:'▸';font-size:18px;color:#f8b34b}.nav-group[open] summary::before{content:'▾'}.pdf-modal{padding:0}.pdf-box{height:100vh;border-radius:0}}
aside{overflow:hidden}.side-nav a{display:flex!important;align-items:center;gap:10px;width:100%;min-height:38px;font-size:14px!important;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.side-nav a span{width:22px;min-width:22px;text-align:center;font-size:17px;color:#dbe8f6}.nav-group a{margin-left:0}.nav-group summary{display:flex;align-items:center;justify-content:space-between}.aside-user b,.aside-user small,.aside-user a{overflow-wrap:anywhere}.notify-good{background:#dcfce7!important;color:#14532d}.notify-bad{background:#fee2e2!important;color:#7f1d1d}.notify-neutral{background:#eef8ef}.pager-controls{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin:10px 0;flex-wrap:wrap}.pager-controls button,.pager-controls select{width:auto;padding:7px 10px}.pager-info{font-size:12px;color:var(--muted)}@media(max-width:900px){.side-nav a{justify-content:center;padding:10px 4px}.side-nav a span{font-size:20px}.side-nav a{font-size:0!important}.side-nav a span{width:auto}.nav-group summary{justify-content:center}.nav-group summary::after{display:none}}
/* Fase 11: menu vertical robusto y detalles tecnicos compactos */
aside .side-nav{display:flex!important;flex-direction:column!important;gap:4px!important}
aside .side-nav .nav-group{display:block!important;width:100%!important}
aside .side-nav .nav-group[open]{display:block!important}
aside .side-nav a,aside .side-nav .nav-group>a{display:flex!important;flex-direction:row!important;align-items:center!important;width:100%!important;float:none!important;clear:both!important;margin:3px 0!important;white-space:nowrap!important;text-align:left!important}
aside .side-nav a span{display:inline-block!important}
aside .side-nav summary{float:none!important;width:100%!important}
aside .side-nav summary::after{float:none!important;margin-left:auto}
.quote-detail-btn{margin-top:8px;width:100%;text-align:center}
.technical-flags{display:block;margin-top:6px;color:var(--muted);font-size:11px}
@media(max-width:900px){aside .side-nav a{justify-content:center!important;text-align:center!important}aside .side-nav a span{display:block!important}aside .side-nav .nav-group>a{margin:4px 0!important}}
@media(max-width:900px){aside{width:245px!important}.app{margin-left:245px!important}.side-logo{width:130px!important;height:76px!important}.nav-group summary{font-size:11px!important}.nav-group summary::before{content:none!important}aside .side-nav a,aside .side-nav .nav-group>a{justify-content:flex-start!important;text-align:left!important;font-size:13px!important;padding:9px 10px!important}aside .side-nav a span{display:inline-block!important;width:22px!important;min-width:22px!important;font-size:16px!important}.aside-user b,.aside-user small{display:block!important}}
@media(max-width:560px){aside{position:relative!important;width:100%!important;max-height:48vh!important}.app{margin-left:0!important}.app>header{height:auto!important;padding:18px 0}.side-nav{max-height:30vh!important}}
/* Fase 13: portal, gantt, tareas y experiencia movil */
.menu-toggle{display:none;border:0;background:var(--navy);color:#fff;border-radius:8px;width:42px;height:42px;font-size:20px}.mobile-backdrop{display:none}.portal-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.portal-tabs a{background:#edf2f7;color:var(--navy);border-radius:999px;padding:8px 12px;font-weight:700}.section-title{color:var(--navy);margin:18px 0 10px}.gantt-head{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:10px;color:var(--muted);font-size:12px;font-weight:700;text-transform:uppercase}.gantt-list{display:grid;gap:10px}.gantt-row{display:grid;grid-template-columns:220px 1fr;gap:14px;align-items:center}.gantt-row small{display:block;color:var(--muted);margin-top:3px}.gantt-track{position:relative;height:30px;border-radius:999px;background:#eef2f7;overflow:hidden}.gantt-track i{position:absolute;top:5px;height:20px;border-radius:999px;min-width:28px;color:#fff;font-style:normal;font-size:11px;font-weight:800;display:flex;align-items:center;justify-content:center}.gantt-track span{padding:0 8px}.progress{height:8px;background:#e8eef5;border-radius:999px;overflow:hidden}.progress i{display:block;height:100%;border-radius:999px}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.toolbar input{max-width:360px}.toolbar select{width:auto}.invalid{border-color:#dc2626!important;outline-color:#dc262633!important}
@media(max-width:760px){
  body{background:#f6f8fb}
  aside{position:fixed!important;inset:0 auto 0 0!important;width:min(86vw,320px)!important;max-height:none!important;transform:translateX(-105%);transition:transform .22s ease;z-index:1200;padding:18px 14px!important}
  body.nav-open aside{transform:translateX(0)}
  .mobile-backdrop{display:none;position:fixed;inset:0;background:#06172aaa;z-index:1100}
  body.nav-open .mobile-backdrop{display:block}
  .side-logo{width:130px!important;height:76px!important}
  .side-nav{max-height:calc(100vh - 190px)!important;overflow-y:auto!important}
  .app{margin-left:0!important;padding:0 12px 22px!important}
  .app>header{position:sticky;top:0;z-index:800;height:auto!important;min-height:72px;background:#f6f8fb;padding:10px 0!important;gap:10px}
  .menu-toggle{display:grid;place-items:center;flex:0 0 42px}
  .app h1{font-size:20px}
  .header-actions{gap:8px}
  .stats,.grid2,.form-grid,.detail-grid{grid-template-columns:1fr!important}
  .panel,.card,.stat{border-radius:8px;padding:14px;margin-bottom:14px}
  .panel-head{align-items:flex-start;gap:10px;flex-direction:column}
  .toolbar{width:100%;display:grid;grid-template-columns:1fr;gap:8px}
  .toolbar input,.toolbar select,.btn,.btn.ghost,button.btn{width:100%;max-width:none}
  input,select,textarea{font-size:16px}
  .table-wrap{margin:0 -4px;padding-bottom:6px;overflow-x:auto}
  table{min-width:720px}
  .login{width:100%}
  .pdf-modal{padding:0!important}
  .pdf-box{height:100vh!important;border-radius:0!important}
  .pdf-bar{gap:8px;align-items:flex-start;flex-direction:column}
  .pdf-bar span{display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
  .gantt-row{grid-template-columns:1fr;gap:6px}
  .gantt-head{font-size:10px}
  .portal-tabs a{flex:1;text-align:center}
}
/* Fase 14: dashboard accionable, matriz CRUD y menu movil ubicuo */
.stat-action{display:block;color:inherit;text-decoration:none;transition:transform .15s ease,box-shadow .15s ease}
.stat-action:hover{transform:translateY(-1px);box-shadow:0 10px 24px #18324c16;background:#fff}
.permission-matrix{overflow:auto;border:1px solid var(--line);border-radius:8px}
.permission-matrix table{min-width:620px;margin:0}
.check-cell{display:grid;place-items:center;margin:0}
.check-cell input{width:20px;height:20px}
@media(max-width:1100px){
  html,body{max-width:100%;overflow-x:hidden}
  .menu-toggle{display:grid!important;place-items:center!important}
  aside{
    position:fixed!important;
    inset:0 auto 0 0!important;
    width:min(84vw,318px)!important;
    max-height:none!important;
    padding:18px 14px!important;
    z-index:1200!important;
    transform:translateX(-105%)!important;
    transition:transform .22s ease!important;
    visibility:hidden!important;
    pointer-events:none!important;
    box-shadow:18px 0 40px #00172f38!important;
  }
  body.nav-open aside{transform:translateX(0)!important;visibility:visible!important;pointer-events:auto!important}
  .mobile-backdrop{position:fixed!important;inset:0!important;background:#06172aaa!important;z-index:1100!important}
  body:not(.nav-open) .mobile-backdrop{display:none!important}
  body.nav-open .mobile-backdrop{display:block!important}
  .app{margin-left:0!important;width:100%!important;max-width:100vw!important;padding:0 14px 24px!important}
  .app>header{position:sticky!important;top:0!important;z-index:900!important;background:var(--bg)!important;height:auto!important;min-height:74px!important;padding:10px 0!important;gap:10px!important;align-items:center!important}
  .app>header>div:first-of-type{min-width:0!important}
  .app h1{font-size:28px!important;line-height:1.08!important;overflow-wrap:anywhere!important}
  .eyebrow{font-size:11px!important;letter-spacing:3px!important}
  .header-actions{margin-left:auto!important;gap:8px!important}
  .bell,.avatar{width:42px!important;height:42px!important;flex:0 0 42px!important}
  .side-logo{width:132px!important;height:82px!important;margin:0 auto 12px!important}
  aside .side-nav{display:flex!important;flex-direction:column!important;gap:3px!important;max-height:calc(100vh - 190px)!important;overflow-y:auto!important;padding-right:6px!important}
  aside .side-nav summary{font-size:12px!important;letter-spacing:1.6px!important;padding:10px 8px!important;justify-content:space-between!important;color:#f8b34b!important}
  aside .side-nav summary::before{content:none!important}
  aside .side-nav summary::after{display:inline!important;margin-left:auto!important}
  aside .side-nav a,aside .side-nav .nav-group>a{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    min-height:38px!important;
    margin:2px 0!important;
    padding:9px 8px!important;
    font-size:15px!important;
    line-height:1.15!important;
    white-space:normal!important;
    text-align:left!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }
  aside .side-nav a span{display:inline-grid!important;place-items:center!important;width:24px!important;min-width:24px!important;font-size:17px!important}
  .aside-user{margin-top:auto!important;padding:14px 8px!important}
  .aside-user b,.aside-user small,.aside-user a{display:block!important;font-size:14px!important;line-height:1.25!important;overflow-wrap:anywhere!important}
  .stats,.grid2,.form-grid,.detail-grid{grid-template-columns:1fr!important}
  .panel-head{align-items:flex-start!important;gap:10px!important;flex-wrap:wrap!important}
  .toolbar{width:100%!important}
  .toolbar input{max-width:none!important}
}
@media(max-width:620px){
  .panel,.card,.stat{border-radius:8px!important;padding:14px!important}
  .app h1{font-size:24px!important}
  .toolbar{display:grid!important;grid-template-columns:1fr!important}
  .toolbar select,.toolbar input,.toolbar .btn,.toolbar button{width:100%!important;max-width:none!important}
  .table-wrap table{min-width:680px}
  .pdf-bar span{display:grid!important;grid-template-columns:1fr!important;width:100%!important}
  }
/* Fase 15: navegación estable, responsiva y sin saltos */
aside{height:100vh;height:100dvh;overflow:hidden!important}
aside .side-nav{flex:1 1 auto!important;min-height:0!important;overscroll-behavior:contain!important;scrollbar-gutter:stable}
aside .side-nav,.nav-group{width:100%!important}
.nav-group[open] a{display:flex!important}
aside .side-nav a{min-width:0!important}
aside .side-nav a span{flex:0 0 24px!important}
@media(max-width:1180px){
  body.nav-open{overflow:hidden!important}
  aside{
    position:fixed!important;
    inset:0 auto 0 0!important;
    width:min(88vw,330px)!important;
    height:100vh!important;
    height:100dvh!important;
    max-height:none!important;
    transform:translateX(-105%)!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  body.nav-open aside{transform:translateX(0)!important;visibility:visible!important;pointer-events:auto!important}
  .app{margin-left:0!important;width:100%!important;max-width:100vw!important}
  .menu-toggle{display:grid!important;place-items:center!important}
  aside .side-nav{
    display:flex!important;
    flex-direction:column!important;
    max-height:calc(100dvh - 178px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  aside .side-nav a,aside .side-nav .nav-group>a{
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    width:100%!important;
    white-space:normal!important;
    font-size:15px!important;
  }
}
@media(max-width:520px){
  aside{width:min(92vw,340px)!important}
  .app{padding:0 12px 22px!important}
  .app h1{font-size:22px!important}
  .eyebrow{letter-spacing:2px!important}
}
/* Fase 17: temas por empresa, CRUD en modal y reportes */
.side-logo-link{display:block;margin:0 auto 14px;width:max-content}.side-logo-link .side-logo{margin:0 auto}
body.theme-claro{--navy:#24415c;--navy2:#365f84;--orange:#c08224;--bg:#f7f8fa;--line:#d9e0e7}
body.theme-verde{--navy:#123f37;--navy2:#1f6b5d;--orange:#d39b28;--bg:#f2f7f4;--line:#d8e6df}
body.theme-grafito{--navy:#232b35;--navy2:#394553;--orange:#d89a2b;--bg:#f4f5f7;--line:#d8dde3}
body.theme-burdeo{--navy:#4a1f2d;--navy2:#6b2d3f;--orange:#c8912f;--bg:#f7f4f5;--line:#e4d8dc}
body.theme-claro aside{background:linear-gradient(180deg,#20384f,#315b80)}
body.theme-verde aside{background:linear-gradient(180deg,#0d332d,#145348)}
body.theme-grafito aside{background:linear-gradient(180deg,#1f252d,#343f4c)}
body.theme-burdeo aside{background:linear-gradient(180deg,#351723,#542438)}
.crud-modal-panel[hidden]{display:none!important}.crud-modal-panel{position:fixed!important;inset:4vh auto 4vh 50%;transform:translateX(-50%);width:min(760px,92vw);max-height:92vh;overflow:auto;z-index:1500;box-shadow:0 24px 80px #00172f45!important}.crud-modal-panel::before{content:"";position:fixed;inset:-6vh -100vw;background:#07182acc;z-index:-1}.crud-modal-close{position:absolute;right:14px;top:12px}.crud-action-bar{display:flex;gap:8px;justify-content:flex-end;margin:0 0 12px;flex-wrap:wrap}.report-print header,.report-print aside,.report-print footer,.report-print .mobile-backdrop{display:none!important}.report-print .app{margin:0!important;padding:0!important}.report-print .panel{box-shadow:none!important;border:0!important}
.chart-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}.chart-card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:16px}.chart-card h3{margin:0 0 12px;color:var(--navy)}.bar-row{display:grid;grid-template-columns:minmax(120px,220px) 1fr auto;gap:10px;align-items:center;margin:9px 0}.bar-track{height:12px;border-radius:999px;background:#edf2f7;overflow:hidden}.bar-track i{display:block;height:100%;background:var(--orange);border-radius:999px}.bar-row small{color:var(--muted)}
@media(max-width:760px){.chart-grid{grid-template-columns:1fr}.crud-modal-panel{inset:0;width:100vw;max-height:100vh;border-radius:0!important}.crud-modal-panel::before{display:none}.crud-action-bar{justify-content:stretch}.crud-action-bar .btn{width:100%}}
/* Fase 18: CRUD operativos, iconos y datos vivos */
.grid2{grid-template-columns:minmax(0,1fr)!important;width:100%;align-items:start}
.panel,.card,.stat{border-radius:10px}
.panel{width:100%;overflow:visible}
.panel-head{gap:12px}
.panel-head .toolbar,.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.toolbar .btn,.toolbar a.btn,.crud-action-bar .btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;line-height:1.1}
.btn i,.link i{font-size:1rem}
.side-nav a i{display:inline-grid;place-items:center;width:24px;min-width:24px;font-size:17px;color:#dbe8f6}
.side-nav a:hover i{color:#fff}
.side-nav a{min-height:42px}
.nav-group summary{border-radius:8px}
.nav-group summary:hover{background:#ffffff10}
.app>header{gap:14px}
.live-chip{display:inline-flex;align-items:center;gap:6px;border:1px solid #cfe1f1;background:#fff;color:var(--navy);border-radius:999px;padding:7px 10px;font-size:12px;font-weight:800}
.live-chip::before{content:"";width:8px;height:8px;border-radius:50%;background:#16a34a;box-shadow:0 0 0 4px #16a34a1c}
.live-chip.syncing::before{background:var(--orange);box-shadow:0 0 0 4px #f59a1625}
.crud-action-bar{position:relative;z-index:2;justify-content:space-between;align-items:center;background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;margin:0 0 14px;box-shadow:0 6px 18px #18324c0b}
.crud-action-bar::before{content:"Gestión de registros";color:var(--navy);font-weight:800}
.crud-modal-panel{
  inset:5vh auto auto 50%!important;
  width:min(980px,94vw)!important;
  max-height:90vh!important;
  overflow:auto!important;
  padding:22px!important;
  border-radius:12px!important;
  border:1px solid #d7e2ee!important;
  border-top:5px solid var(--orange)!important;
  background:#fff!important;
  color:var(--ink)!important;
}
.crud-modal-panel::before{background:#06172acc!important;backdrop-filter:blur(2px)}
.crud-modal-panel h2{padding-right:110px}
.crud-modal-close{top:14px!important;right:14px!important;border:1px solid var(--line)!important;background:#f1f5f9!important;color:var(--navy)!important}
.crud-modal-panel input,.crud-modal-panel select,.crud-modal-panel textarea{background:#fff;color:var(--ink);border-color:#cbd5e1}
.crud-modal-panel label{color:#3f4d5f}
.modal-open-lite{overflow:hidden}
.urba-frame-modal .modal-dialog{max-width:min(1180px,96vw)}
.urba-frame-modal .modal-content{border:0;border-radius:12px;overflow:hidden;box-shadow:0 24px 90px #00172f55}
.urba-frame-modal .modal-header{background:var(--navy);color:#fff;border:0}
.urba-frame-modal .btn-close{filter:invert(1) grayscale(1) brightness(2)}
.urba-frame-modal .modal-body{padding:0;background:#f6f8fb}
.urba-frame-modal iframe{display:block;width:100%;height:78vh;border:0;background:#fff}
.embedded aside,.embedded .app>header,.embedded footer,.embedded .mobile-backdrop{display:none!important}
.embedded .app{margin-left:0!important;padding:18px!important;width:100%!important;max-width:none!important}
.embedded .panel{box-shadow:none}
.embedded .pdf-modal{position:fixed}
.pager-controls{background:#f8fafc;border:1px solid var(--line);border-radius:9px;padding:9px 10px}
.pager-controls button,.pager-controls select{border:1px solid #cbd5e1;border-radius:7px;background:#fff;color:var(--navy);font-weight:700}
.pager-controls button:disabled{opacity:.45;cursor:not-allowed}
.table-wrap{border:1px solid var(--line);border-radius:9px;background:#fff}
.table-wrap table{margin:0}
.table-wrap th:first-child,.table-wrap td:first-child{padding-left:14px}
.notify-good{border-left:5px solid #16a34a}
.notify-bad{border-left:5px solid #dc2626}
.notify-neutral{border-left:5px solid #94a3b8}
@media(max-width:760px){
  .crud-action-bar{display:grid;grid-template-columns:1fr;align-items:stretch}
  .crud-action-bar::before{text-align:center}
  .crud-modal-panel{inset:0!important;width:100vw!important;max-height:100vh!important;height:100vh!important;border-radius:0!important}
  .crud-modal-panel h2{padding-right:96px}
  .urba-frame-modal .modal-dialog{width:100%;height:100%;margin:0;max-width:100%}
  .urba-frame-modal .modal-content{min-height:100vh;border-radius:0}
  .urba-frame-modal iframe{height:calc(100vh - 58px)}
  .live-chip{display:none}
}
/* Fase 19: modales claros y temas visuales */
.crud-modal-panel{
  isolation:isolate!important;
  background:#fff!important;
  color:var(--ink)!important;
  box-shadow:0 0 0 100vmax rgba(6,42,85,.58),0 24px 90px rgba(0,23,47,.32)!important;
}
.crud-modal-panel::before{display:none!important}
.crud-modal-panel h2,.crud-modal-panel h3{color:var(--navy)!important}
.crud-modal-panel label{color:#4a5666!important}
.crud-modal-panel small,.crud-modal-panel .muted{color:var(--muted)!important}
.crud-modal-panel input,.crud-modal-panel select,.crud-modal-panel textarea{background:#fff!important;color:var(--ink)!important;border-color:#cfd7e1!important}
.crud-modal-panel input::placeholder,.crud-modal-panel textarea::placeholder{color:#7d8794!important}
.crud-modal-panel .btn{background:var(--navy)!important;color:#fff!important}
.crud-modal-panel .btn.ghost,.crud-modal-close{background:#edf2f7!important;color:var(--navy)!important}
.modal-backdrop.show{background:var(--navy)!important;opacity:.55!important}
.theme-preview-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.theme-card{border:1px solid var(--line);border-radius:10px;background:#fff;padding:12px;display:grid;gap:10px;cursor:pointer;transition:.15s ease}
.theme-card:hover,.theme-card:has(input:checked){border-color:var(--orange);box-shadow:0 8px 22px #18324c14}
.theme-card input{width:auto}
.theme-swatches{display:flex;gap:6px}
.theme-swatches i{display:block;width:34px;height:24px;border-radius:6px;border:1px solid #0001}
body.theme-cobalto{--navy:#123d7c;--navy2:#1f5ca8;--orange:#ff9f1c;--bg:#f4f8fd;--line:#d8e4f2}
body.theme-bosque{--navy:#153f36;--navy2:#21705f;--orange:#d6a22f;--bg:#f3f8f5;--line:#d7e6df}
body.theme-cobre{--navy:#2f3945;--navy2:#53606e;--orange:#b96b2b;--bg:#f7f6f4;--line:#e0ddd8}
body.theme-minimal{--navy:#1f2937;--navy2:#374151;--orange:#2563eb;--bg:#f8fafc;--line:#dbe3ec}
body.theme-contraste{--navy:#06131f;--navy2:#0f2740;--orange:#facc15;--bg:#f4f7fa;--line:#ccd6e0}
body.theme-cobalto aside{background:linear-gradient(180deg,#0b2d62,#174f91)}
body.theme-bosque aside{background:linear-gradient(180deg,#0d312b,#195a4d)}
body.theme-cobre aside{background:linear-gradient(180deg,#27323e,#47525f)}
body.theme-minimal aside{background:linear-gradient(180deg,#111827,#2f3a4a)}
body.theme-contraste aside{background:linear-gradient(180deg,#020912,#071b2e)}
/* Fase 20: centro de salud del sistema */
.health-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}
.health-card{border:1px solid var(--line);border-radius:10px;background:#fff;padding:14px;display:grid;gap:10px;align-content:start}
.health-card h3{margin:8px 0 0;color:var(--navy);font-size:16px}
.health-card p{margin:0;color:var(--ink);line-height:1.35}
.health-card small{color:var(--muted);font-weight:700}
.health-card.notify-good{border-left:5px solid #16a34a}
.health-card.notify-neutral{border-left:5px solid #f59e0b;background:#fffbeb!important;color:var(--ink)}
.health-card.notify-bad{border-left:5px solid #dc2626}
.stat.danger-bg{background:#991b1b!important;color:#fff!important;border-color:#7f1d1d!important}
.stat.danger-bg span,.stat.danger-bg small,.stat.danger-bg strong{color:#fff!important}
/* Fase 21: observabilidad y seguimiento de errores */
.actions-cell{white-space:nowrap}
.urba-detail-modal .modal-content{border:0;border-radius:12px;overflow:hidden;box-shadow:0 24px 90px #00172f55}
.urba-detail-modal .modal-header{background:var(--navy);color:#fff;border-bottom:4px solid var(--orange)}
.urba-detail-modal .btn-close{filter:invert(1) grayscale(1) brightness(2)}
.urba-detail-modal .modal-body{background:#f6f8fb;color:var(--ink)}
.urba-detail-modal h3{font-size:16px;color:var(--navy);margin:16px 0 8px}
.codebox{background:#07182a;color:#f8fafc;border-radius:10px;padding:14px;max-height:360px;overflow:auto;font-size:12px;line-height:1.45;border:1px solid #18324c}
tr.notify-bad td:first-child,tr.notify-good td:first-child,tr.notify-neutral td:first-child{box-shadow:inset 5px 0 0 currentColor}
tr.notify-bad td:first-child{color:#b91c1c}
tr.notify-good td:first-child{color:#15803d}
tr.notify-neutral td:first-child{color:#b45309}
/* Fase 23: portal cliente profesional */
.portal-tabs a{border:1px solid var(--line);transition:.15s ease}
.portal-tabs a:hover{background:var(--navy);color:#fff}
.portal-doc-row .badge,.portal-quote-row .badge{white-space:nowrap}
#solicitudes td small,#documentos td small{line-height:1.35}
.stat-action:focus-visible,.portal-tabs a:focus-visible{outline:3px solid #f59a1640;outline-offset:2px}
@media(max-width:760px){
  .portal-tabs{display:grid;grid-template-columns:1fr 1fr}
  .portal-tabs a{width:100%}
}
/* Fases 31-42: experiencia móvil, selectores, PWA y centros SaaS */
.smart-select{position:relative;width:100%;min-width:0;text-transform:none}
.toolbar>.smart-select,.toolbar label>.smart-select{width:min(280px,100%);flex:0 1 280px}
.smart-select-native{position:absolute!important;left:0;bottom:0;width:1px!important;height:1px!important;opacity:0!important;padding:0!important;pointer-events:none}
.smart-select-toggle{display:block;width:100%;min-width:0;min-height:42px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:36px!important;background:#fff!important;color:var(--ink)!important;text-transform:uppercase}
.smart-select-toggle.is-placeholder{color:#6b7280!important}
.smart-select-menu{display:none;position:absolute;inset:auto 0 auto 0;width:100%;min-width:240px;max-height:320px;padding:9px;z-index:1800;border:1px solid var(--line);border-top:3px solid var(--orange);box-shadow:0 16px 40px #00172f25;background:#fff}
.smart-select.open .smart-select-menu{display:block}
.smart-select-menu .form-control{margin-bottom:8px;text-transform:none!important}
.smart-select-options{max-height:238px;overflow:auto}
.smart-select-options .dropdown-item{white-space:normal;border-radius:5px;padding:9px 10px;color:var(--ink);text-transform:none}
.smart-select-options .dropdown-item.active,.smart-select-options .dropdown-item:hover{background:var(--navy);color:#fff}
.smart-select-empty{padding:14px;text-align:center;color:var(--muted)}
.install-app-button{position:fixed;right:18px;bottom:18px;z-index:1300;border:0;border-radius:8px;padding:11px 15px;background:var(--navy);color:#fff;font-weight:800;box-shadow:0 12px 32px #00172f35}
.mobile-inline-crud{border-top:4px solid var(--orange)!important;scroll-margin-top:86px}
.mobile-inline-close{margin-bottom:14px}
.server-config-panel .code-config{min-height:190px;background:#07182a;color:#f8fafc;border:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;line-height:1.65;text-transform:none}
.health-card h3{font-size:16px!important;line-height:1.25!important;letter-spacing:0!important}
.health-card p{font-size:14px!important;line-height:1.4!important}
.workflow-steps{display:flex;gap:4px;min-width:330px}
.workflow-steps span{flex:1;padding:5px 7px;border-radius:4px;background:#e5e7eb;color:#64748b;text-align:center;font-size:10px;font-weight:800}
.workflow-steps span.done{background:#dcfce7;color:#166534}
.workflow-timeline{display:grid;gap:0}
.workflow-timeline article{position:relative;display:grid;grid-template-columns:22px 1fr;gap:10px;padding:0 0 18px}
.workflow-timeline article::before{content:"";position:absolute;left:7px;top:14px;bottom:-2px;width:2px;background:var(--line)}
.workflow-timeline article:last-child::before{display:none}
.timeline-dot{width:16px;height:16px;border-radius:50%;background:var(--orange);border:4px solid #fff;box-shadow:0 0 0 2px var(--orange)}
.workflow-timeline b,.workflow-timeline small{display:block}
.workflow-timeline small{color:var(--muted);margin-top:3px}
.workflow-timeline p{margin:7px 0 0}
.mini-progress{height:7px;background:#e2e8f0;border-radius:99px;overflow:hidden;margin-top:5px}
.mini-progress i{display:block;height:100%;background:var(--orange)}
.link-result input{font-size:14px;text-transform:none;background:#f8fafc}
.saas-plan-grid,.quality-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px}
.saas-plan-card,.quality-card{border:1px solid var(--line);border-top:4px solid var(--orange);border-radius:8px;background:#fff;padding:16px}
.quality-card{display:grid;gap:8px}
.quality-card>div{display:flex;justify-content:space-between;align-items:center}
.quality-card strong{font-size:30px;color:var(--navy)}
.quality-card h3{font-size:16px;color:var(--navy);margin:0}
.quality-card p{font-size:13px;margin:0;line-height:1.4}
.repair-actions{display:flex;gap:10px;flex-wrap:wrap}
.compact-form{min-width:270px;padding:10px 0}
.public-portal{background:#eef3f7}
.public-shell{width:min(1100px,calc(100% - 24px));margin:18px auto}
.public-header{padding:24px 4px}.public-header h1{margin:4px 0;color:var(--navy)}
@media(max-width:760px){
  .mobile-inline-crud{position:relative!important;inset:auto!important;transform:none!important;width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;box-shadow:none!important;border-radius:8px!important;background:#fff!important;padding:14px!important}
  .mobile-inline-crud::before{display:none!important}
  body:has(.mobile-inline-crud:not([hidden])) .mobile-action-bar{display:none}
  .mobile-inline-close{width:100%}
  .smart-select-menu{position:fixed;left:10px;right:10px;bottom:10px;top:auto;width:auto;max-height:72vh;border-radius:10px;z-index:1900;padding:12px}
  .smart-select-options{max-height:calc(72vh - 70px)}
  .smart-select-options .dropdown-item{padding:12px 10px;font-size:15px}
  .install-app-button{right:12px;bottom:12px;left:12px;width:calc(100% - 24px)}
  .workflow-steps{min-width:300px}
  .repair-actions{display:grid;grid-template-columns:1fr}
  .repair-actions form,.repair-actions .btn{width:100%}
  .saas-plan-grid,.quality-grid{grid-template-columns:1fr}
  .public-shell{width:100%;margin:0;padding:10px}
}

/* Fase 43: identidad de cliente, tema oscuro y validación uniforme */
.urba-field-error{display:block;color:#b91c1c;font-size:11px;font-weight:700;line-height:1.35;margin-top:2px;text-transform:none}
.client-logo-preview{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px}
.client-logo-preview img,.client-name-cell img{width:42px;height:42px;object-fit:contain;border:1px solid var(--line);border-radius:6px;background:#fff}
.client-name-cell{display:flex;align-items:center;gap:9px;text-align:left}
.request-work-fields{border:1px solid var(--line);border-left:4px solid var(--orange);padding:14px;background:color-mix(in srgb,var(--panel) 88%,var(--orange) 12%);margin:4px 0 12px}
.form-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.form-grid>label{min-width:0}

body.theme-oscuro{color-scheme:dark;background:var(--bg);color:var(--ink)}
body.theme-oscuro aside{background:linear-gradient(180deg,#050b14,#091525)}
body.theme-oscuro .stat,
body.theme-oscuro .panel,
body.theme-oscuro .card,
body.theme-oscuro .chart-card,
body.theme-oscuro .health-card,
body.theme-oscuro .theme-card,
body.theme-oscuro .saas-plan-card,
body.theme-oscuro .quality-card,
body.theme-oscuro .table-wrap,
body.theme-oscuro .crud-action-bar,
body.theme-oscuro .mini-panel,
body.theme-oscuro .docbox,
body.theme-oscuro .doc-strip,
body.theme-oscuro .decision,
body.theme-oscuro .modal-content,
body.theme-oscuro .pdf-box{background:var(--panel)!important;color:var(--ink)!important}
body.theme-oscuro th{background:#1a293d;color:var(--navy)}
body.theme-oscuro td{color:var(--ink)}
body.theme-oscuro tr:hover td{background:#172438}
body.theme-oscuro input,
body.theme-oscuro select,
body.theme-oscuro textarea,
body.theme-oscuro .smart-select-toggle,
body.theme-oscuro .smart-select-menu,
body.theme-oscuro .pager-controls button,
body.theme-oscuro .pager-controls select,
body.theme-oscuro .link-result input{background:#0c1625!important;color:var(--ink)!important;border-color:var(--line)!important}
body.theme-oscuro input::placeholder,
body.theme-oscuro textarea::placeholder{color:#71839a!important}
body.theme-oscuro .smart-select-options .dropdown-item{color:var(--ink);background:transparent}
body.theme-oscuro .smart-select-options .dropdown-item.active,
body.theme-oscuro .smart-select-options .dropdown-item:hover{background:#24405f;color:#fff}
body.theme-oscuro .badge,
body.theme-oscuro .btn.ghost,
body.theme-oscuro .portal-tabs a{background:#20334b;color:#dbeafe}
body.theme-oscuro .btn:not(.ghost),
body.theme-oscuro button.btn:not(.ghost){background:#28517a!important;color:#fff!important}
body.theme-oscuro .btn:not(.ghost):hover,
body.theme-oscuro button.btn:not(.ghost):hover{background:#356b9f!important;color:#fff!important}
body.theme-oscuro .bell,
body.theme-oscuro .live-chip,
body.theme-oscuro .pager-controls{background:#111d2d;color:var(--ink);border-color:var(--line)}
body.theme-oscuro .avatar{background:#28517a;color:#fff}
body.theme-oscuro .detail-grid{background:#0e1928}
body.theme-oscuro .gantt-track,
body.theme-oscuro .bar-track,
body.theme-oscuro .mini-progress{background:#24344a}
body.theme-oscuro .crud-modal-panel,
body.theme-oscuro .mobile-inline-crud{background:var(--panel)!important;color:var(--ink)!important}
body.theme-oscuro .crud-modal-panel input,
body.theme-oscuro .crud-modal-panel select,
body.theme-oscuro .crud-modal-panel textarea{background:#0c1625!important;color:var(--ink)!important;border-color:var(--line)!important}
body.theme-oscuro .crud-modal-panel label{color:#aebed1!important}
body.theme-oscuro .crud-modal-panel .btn.ghost,
body.theme-oscuro .crud-modal-panel .crud-modal-close{background:#20334b!important;color:#dbeafe!important;border-color:var(--line)!important}
body.theme-oscuro .modal-header,
body.theme-oscuro .pdf-bar{border-color:var(--line)}
body.theme-oscuro .btn-close{filter:invert(1) grayscale(1)}
body.theme-oscuro .stat-action:hover{background:#172438}
body.theme-oscuro .timeline-dot{border-color:var(--panel)}
body.theme-oscuro .notify-neutral{background:#18261f!important;color:#d9f5df}
body.theme-oscuro footer{color:var(--muted)}

/* Fase 44: correo profesional y diagnóstico SMTP */
.panel-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}
.panel-title-row h2{margin:0 0 4px}
.panel-title-row p{margin:0;text-align:left}
.mail-status-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.mail-status-grid>div{min-width:0;border-left:4px solid var(--orange);background:color-mix(in srgb,var(--panel) 93%,var(--navy) 7%);padding:13px}
.mail-status-grid span,.mail-status-grid b{display:block}
.mail-status-grid span{color:var(--muted);font-size:11px;font-weight:700;margin-bottom:5px}
.mail-status-grid b{overflow-wrap:anywhere;font-size:13px;color:var(--ink)}
.mail-state-success{color:#15803d!important}.mail-state-error{color:#b91c1c!important}.mail-state-pending{color:#b45309!important}
.mail-choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.mail-choice{display:flex;align-items:flex-start;gap:11px;border:1px solid var(--line);padding:12px;background:color-mix(in srgb,var(--panel) 96%,var(--navy) 4%)}
.mail-choice input{width:19px;height:19px;margin:1px 0 0;flex:0 0 auto}
.mail-choice span,.mail-choice b,.mail-choice small{display:block}
.mail-choice b{color:var(--ink);font-size:13px}.mail-choice small{color:var(--muted);margin-top:3px;line-height:1.35}
.mail-presets{margin:2px 0}
.mail-settings-form .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.mail-test-form{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:10px;align-items:end}
.mail-last-error{margin-top:14px;border-left:4px solid #b91c1c}
.mail-last-error p{overflow-wrap:anywhere;margin:7px 0;color:var(--ink)}
.badge.ok{background:#dcfce7;color:#166534}.badge.warn{background:#fef3c7;color:#92400e}.badge.danger{background:#fee2e2;color:#991b1b}
body.theme-oscuro .mail-status-grid>div,body.theme-oscuro .mail-choice{background:#0e1928}
body.theme-oscuro .mail-state-success{color:#86efac!important}body.theme-oscuro .mail-state-error{color:#fca5a5!important}body.theme-oscuro .mail-state-pending{color:#fcd34d!important}
body.theme-oscuro .badge.ok{background:#123c2b;color:#86efac}body.theme-oscuro .badge.warn{background:#473511;color:#fcd34d}body.theme-oscuro .badge.danger{background:#4c1d1d;color:#fca5a5}
@media(max-width:980px){.mail-status-grid{grid-template-columns:1fr 1fr}}
@media(max-width:700px){.panel-title-row{display:grid}.mail-status-grid,.mail-choice-grid,.mail-test-form,.mail-settings-form .form-grid{grid-template-columns:1fr}.mail-test-form .btn{width:100%}}
