*{box-sizing:border-box}:root{--bg:#f2f5f9;--card:#fff;--ink:#152033;--muted:#667085;--line:#dfe5ee;--blue:#1959a6;--blue2:#11437f;--green:#18864b;--red:#b42318;--amber:#b54708}body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.45 Inter,Segoe UI,Arial,sans-serif}.topbar{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px;position:sticky;top:0;z-index:20}.brand,.userbox{display:flex;align-items:center;gap:12px}.brandmark{width:42px;height:42px;border-radius:12px;background:var(--blue);color:#fff;display:grid;place-items:center;font-weight:800;font-size:18px}.brand small,.userbox small{display:block;color:var(--muted);font-size:12px}.userbox{text-align:right}.shell{display:grid;grid-template-columns:230px 1fr;min-height:calc(100vh - 72px)}.sidebar{background:#fff;border-right:1px solid var(--line);padding:20px 14px;display:flex;flex-direction:column;justify-content:space-between}.sidebar nav{display:grid;gap:6px}.sidebar a{display:flex;gap:11px;align-items:center;padding:11px 13px;border-radius:10px;text-decoration:none;color:#344054;font-weight:600}.sidebar a.active,.sidebar a:hover{background:#eaf2fc;color:var(--blue)}.version{color:var(--muted);font-size:12px;padding:10px}.content{padding:26px;min-width:0}.pagehead{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.pagehead h1{margin:0;font-size:26px}.grid{display:grid;gap:18px}.stats{grid-template-columns:repeat(4,minmax(0,1fr))}.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:20px;box-shadow:0 4px 18px rgba(16,24,40,.04)}.stat span{display:block;color:var(--muted)}.stat strong{font-size:30px;display:block;margin-top:8px}.hero{background:linear-gradient(135deg,#2868b8,#17477f);color:#fff}.hero h2{margin:0 0 8px;font-size:28px}.hero p{margin:0;color:#dbeafe}.two{grid-template-columns:1.5fr 1fr}.btn{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:9px;padding:10px 14px;background:var(--blue);color:#fff;text-decoration:none;font-weight:700;cursor:pointer}.btn.secondary{background:#eef4fb;color:var(--blue)}.btn.danger{background:#fee4e2;color:var(--red)}.btn.ghost{background:transparent;color:var(--blue);border:1px solid var(--line)}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}.tablewrap{overflow:auto}.table{width:100%;border-collapse:collapse}.table th,.table td{padding:12px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}.table th{font-size:12px;text-transform:uppercase;color:var(--muted);letter-spacing:.04em}.badge{display:inline-block;border-radius:999px;padding:4px 9px;font-size:12px;background:#eef2f6}.badge.activo,.badge.contratado{background:#dcfae6;color:#067647}.badge.vencido,.badge.cancelado{background:#fee4e2;color:#b42318}.badge.en_contratacion,.badge.por_vencer,.badge.pendiente_firma{background:#fef0c7;color:#93370d}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.field label{display:block;font-weight:700;margin-bottom:6px}.field input,.field select,.field textarea{width:100%;padding:10px 12px;border:1px solid #cfd7e3;border-radius:9px;background:#fff}.field textarea{min-height:90px;resize:vertical}.span2{grid-column:span 2}.alert{padding:12px 14px;border-radius:10px;margin-bottom:16px}.alert.success{background:#dcfae6;color:#067647}.alert.error{background:#fee4e2;color:#b42318}.empty{padding:35px;text-align:center;color:var(--muted)}#map{height:620px;border-radius:16px;border:1px solid var(--line)}.login{min-height:100vh;display:grid;place-items:center;background:linear-gradient(145deg,#eef4fb,#fff)}.loginbox{width:min(460px,92vw);text-align:center}.loginbox .brandmark{margin:auto;width:64px;height:64px;font-size:24px}.loginbox h1{margin:16px 0 8px}.loginbox p{color:var(--muted)}@media(max-width:950px){.shell{grid-template-columns:1fr}.sidebar{display:none}.stats,.two{grid-template-columns:1fr 1fr}}@media(max-width:650px){.content{padding:16px}.stats,.two,.formgrid{grid-template-columns:1fr}.span2{grid-column:auto}.userbox small{display:none}}

/* V1.2 - Administracion */
.filters-card{margin-bottom:18px}.filter-grid{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:14px;align-items:end}.filter-actions{display:flex;gap:8px;align-items:center}.user-admin-list{display:grid;gap:16px}.user-admin-card{padding:0;overflow:hidden}.user-admin-head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px;border-bottom:1px solid var(--line)}.user-identity{display:flex;align-items:center;gap:13px}.user-identity h2{font-size:18px;margin:0}.user-identity p{margin:3px 0 0;color:var(--muted)}.avatar-large{width:48px;height:48px;border-radius:14px;background:#eaf2fc;color:var(--blue);display:grid;place-items:center;font-size:20px;font-weight:800}.switch-line{display:inline-flex;align-items:center;gap:8px;font-weight:700}.switch-line input{width:18px;height:18px}.user-meta-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;border-bottom:1px solid var(--line)}.user-meta-grid>div{padding:14px 20px;border-right:1px solid var(--line)}.user-meta-grid>div:last-child{border-right:0}.user-meta-grid span,.system-info-list span{display:block;color:var(--muted);font-size:12px;margin-bottom:4px}.user-meta-grid strong{font-size:13px}.roles-panel{padding:20px}.roles-panel h3{margin:0 0 12px}.role-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.role-option{display:flex;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--line);border-radius:11px;background:#fbfcfe;cursor:pointer}.role-option:has(input:checked){border-color:#9fc0eb;background:#eef5ff}.role-option input{width:18px;height:18px;margin-top:2px}.role-option strong,.role-option small{display:block}.role-option small{color:var(--muted);margin-top:3px;line-height:1.3}.card-actions{display:flex;justify-content:flex-end;padding:16px 20px;border-top:1px solid var(--line);background:#fafbfd}.audit-filter-grid{grid-template-columns:1fr 2fr auto}.muted-text{color:var(--muted);margin-top:-4px}.config-grid{align-items:start}.system-info-list{display:grid;gap:0}.system-info-list>div{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:12px 0;border-bottom:1px solid var(--line)}.system-info-list>div:last-child{border-bottom:0}.system-info-list span{margin:0}.system-info-list strong{text-align:right}
@media(max-width:1050px){.filter-grid,.audit-filter-grid{grid-template-columns:1fr 1fr}.filter-actions{grid-column:span 2}.role-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.user-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.user-meta-grid>div:nth-child(2){border-right:0}.user-meta-grid>div:nth-child(-n+2){border-bottom:1px solid var(--line)}}
@media(max-width:650px){.filter-grid,.audit-filter-grid,.role-grid,.user-meta-grid{grid-template-columns:1fr}.filter-actions{grid-column:auto}.user-admin-head{align-items:flex-start;flex-direction:column}.user-meta-grid>div{border-right:0;border-bottom:1px solid var(--line)}.user-meta-grid>div:last-child{border-bottom:0}.card-actions .btn{width:100%}}

/* =========================================================
   V1.3.1 - Identidad visual CRH, sin modificar la lógica
   ========================================================= */
:root{
  --crh-navy:#123f59;
  --crh-navy-deep:#0d3147;
  --crh-blue:#184b68;
  --crh-gold:#fdbb22;
  --crh-gold-soft:#fff3cc;
  --crh-bg:#f3f6f8;
  --crh-ink:#102437;
  --crh-muted:#687988;
}
body.crh-app{background:var(--crh-bg);color:var(--crh-ink)}
.crh-topbar{height:78px;padding:0 28px;border-bottom:1px solid #dce4ea;box-shadow:0 2px 12px rgba(16,36,55,.05)}
.crh-brand{min-width:0}.topbar-logo{width:170px;max-height:54px;object-fit:contain;object-position:left center}.product-name{padding-left:16px;border-left:1px solid #d8e0e7}.product-name strong,.product-name small{display:block}.product-name strong{font-size:16px}.product-name small{font-size:12px;color:var(--crh-muted)}
.crh-userbox{gap:10px}.user-avatar{width:38px;height:38px;border-radius:12px;background:var(--crh-gold);color:var(--crh-navy-deep);display:grid;place-items:center;font-weight:900}.logout-button{border-color:#cbd6de!important;color:var(--crh-navy)!important}
.crh-shell{grid-template-columns:255px minmax(0,1fr);min-height:calc(100vh - 78px)}
.crh-sidebar{background:linear-gradient(180deg,var(--crh-navy-deep),var(--crh-navy));border-right:0;padding:22px 16px;color:#fff;box-shadow:5px 0 20px rgba(13,49,71,.08)}
.sidebar-logo-wrap{padding:2px 8px 23px;border-bottom:1px solid rgba(255,255,255,.12);margin-bottom:18px}.sidebar-logo-wrap img{width:190px;max-height:66px;object-fit:contain;object-position:left center}.sidebar-logo-wrap strong,.sidebar-logo-wrap small{display:block}.sidebar-logo-wrap strong{margin-top:12px;font-size:16px}.sidebar-logo-wrap small{color:rgba(255,255,255,.64);font-size:12px}
.crh-sidebar nav{display:grid;gap:7px}.crh-sidebar a{color:rgba(255,255,255,.82);padding:12px 13px;border-radius:11px;transition:.18s ease}.crh-sidebar a:hover{background:rgba(255,255,255,.08);color:#fff}.crh-sidebar a.active{background:var(--crh-gold);color:var(--crh-navy-deep);box-shadow:0 8px 20px rgba(0,0,0,.12)}.nav-icon{width:22px;display:inline-grid;place-items:center;font-size:15px}.crh-sidebar .version{color:rgba(255,255,255,.55);line-height:1.55}
.crh-content{padding:30px;max-width:1600px;width:100%}.crh-pagehead{margin-bottom:22px}.crh-pagehead h1{font-size:28px;color:var(--crh-ink)}.eyebrow{display:block;color:#9a6a00;text-transform:uppercase;letter-spacing:.12em;font-size:11px;font-weight:800;margin-bottom:4px}
.card{border-color:#dce4ea;box-shadow:0 8px 25px rgba(16,36,55,.05)}.hero{background:linear-gradient(120deg,var(--crh-navy),var(--crh-blue));border:0;position:relative;overflow:hidden}.hero:after{content:"";position:absolute;width:180px;height:180px;border-radius:50%;right:-45px;top:-70px;background:rgba(253,187,34,.18)}.hero h2,.hero p{position:relative;z-index:1}.hero h2{font-size:30px}.stat{border-top:4px solid var(--crh-gold)}.stat strong{color:var(--crh-navy);font-size:32px}.btn{background:var(--crh-navy);border-radius:10px}.btn:hover{filter:brightness(.96);transform:translateY(-1px)}.btn.secondary{background:var(--crh-gold-soft);color:#765100}.btn.ghost{background:#fff;color:var(--crh-navy)}
.table th{background:#eef3f6;color:var(--crh-navy)}.table tr:hover td{background:#fbfcfd}.field input:focus,.field select:focus,.field textarea:focus{outline:0;border-color:var(--crh-gold);box-shadow:0 0 0 3px rgba(253,187,34,.18)}
.mobile-nav-button{display:none;border:0;background:transparent;font-size:22px;color:var(--crh-navy);cursor:pointer}.mobile-nav-overlay{display:none}

/* Login CRH */
.crh-login{display:block;background:#eef3f6}.login-layout{min-height:100vh;display:grid;grid-template-columns:minmax(420px,46%) 1fr}.login-brand-panel{padding:54px 68px;background:linear-gradient(145deg,#0d3147,#184b68);color:#fff;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}.login-brand-panel:after{content:"";position:absolute;width:420px;height:420px;border-radius:50%;right:-180px;bottom:-180px;background:rgba(253,187,34,.16)}.login-brand-panel>div,.login-brand-panel>small{position:relative;z-index:1}.login-logo{width:min(360px,82%);max-height:125px;object-fit:contain;object-position:left center;margin-bottom:54px}.login-kicker{display:inline-flex;padding:7px 12px;border:1px solid rgba(253,187,34,.55);border-radius:999px;color:var(--crh-gold);font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}.login-brand-panel h1{font-size:54px;line-height:1.03;margin:24px 0 16px}.login-brand-panel p{max-width:560px;color:rgba(255,255,255,.76);font-size:16px;line-height:1.7}.login-brand-panel small{color:rgba(255,255,255,.58)}.login-form-panel{display:grid;place-items:center;padding:36px}.login-card-crh{width:min(430px,92vw);background:#fff;border:1px solid #dce4ea;border-top:5px solid var(--crh-gold);border-radius:18px;padding:38px;text-align:center;box-shadow:0 22px 60px rgba(16,36,55,.12)}.login-symbol{width:76px;height:76px;object-fit:contain;margin-bottom:8px}.login-card-crh h2{font-size:28px;margin:8px 0}.login-card-crh>p{color:var(--crh-muted);margin:0 0 24px}.crh-primary-button{width:100%;background:var(--crh-gold);color:var(--crh-navy-deep);padding:13px 18px;font-size:15px}.login-security{margin-top:22px;padding-top:20px;border-top:1px solid #e4eaef;color:var(--crh-muted);font-size:12px;line-height:1.5}

@media(max-width:950px){
  .crh-shell{grid-template-columns:1fr}.crh-sidebar{display:flex;position:fixed;left:-280px;top:78px;bottom:0;width:255px;z-index:45;transition:left .2s ease}.crh-sidebar.open{left:0}.mobile-nav-button{display:block}.mobile-nav-overlay{position:fixed;inset:78px 0 0;background:rgba(5,23,35,.46);z-index:40}.mobile-nav-overlay.open{display:block}.topbar-logo{width:135px}.product-name{display:none}.login-layout{grid-template-columns:1fr}.login-brand-panel{min-height:310px;padding:38px}.login-brand-panel h1{font-size:40px}.login-logo{width:280px;margin-bottom:28px}.login-form-panel{padding:28px}
}
@media(max-width:650px){.crh-topbar{padding:0 14px}.topbar-logo{width:105px}.crh-userbox>div{display:none}.logout-button{padding:8px 10px}.crh-content{padding:18px}.login-brand-panel{padding:30px 24px}.login-brand-panel h1{font-size:36px}.login-form-panel{padding:18px}.login-card-crh{padding:28px 22px}}

/* V1.4 - Mapa profesional y expediente */
.map-toolbar{display:flex;gap:12px;flex-wrap:wrap;align-items:end;margin-bottom:16px}.map-toolbar .field{min-width:180px;flex:1}.map-layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:18px}.map-canvas{height:650px;border-radius:18px;overflow:hidden;border:1px solid #d9e2ea}.map-side{display:flex;flex-direction:column;gap:14px}.legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.legend-item{display:flex;align-items:center;gap:8px;font-size:13px}.legend-dot{width:12px;height:12px;border-radius:50%}.dot-activo{background:#21a366}.dot-por_vencer{background:#f5b700}.dot-vencido{background:#d64242}.dot-en_contratacion{background:#2f73d9}.dot-renovacion{background:#f08c2e}.dot-cancelado,.dot-dado_de_baja{background:#8b96a3}.map-result-list{max-height:470px;overflow:auto;display:grid;gap:8px}.map-result{padding:12px;border:1px solid #e2e8ef;border-radius:12px;background:#fff;cursor:pointer}.map-result:hover{border-color:#f2b21a;box-shadow:0 5px 18px rgba(17,61,86,.08)}.map-result strong,.map-result small{display:block}.map-result small{color:#667585;margin-top:4px}.doc-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.doc-card{border:1px solid #e2e8ef;border-radius:14px;padding:14px;background:#fff}.doc-card h3{margin:0 0 6px}.doc-meta{font-size:12px;color:#687487}.doc-actions{display:flex;gap:8px;margin-top:12px}.upload-box{border:2px dashed #cbd7e2;border-radius:16px;padding:20px;background:#f8fafc}.status-chip{display:inline-flex;align-items:center;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:700}.status-chip.activo{background:#e7f7ef;color:#14734a}.status-chip.por_vencer{background:#fff4d5;color:#7b5b00}.status-chip.vencido{background:#fde7e7;color:#9a2525}.status-chip.en_contratacion{background:#e8f0ff;color:#2458a6}.status-chip.renovacion{background:#fff0df;color:#8b4d0b}.status-chip.cancelado,.status-chip.dado_de_baja{background:#edf0f3;color:#596674}@media(max-width:980px){.map-layout{grid-template-columns:1fr}.map-canvas{height:520px}}

/* V1.4.1 - refinamiento visual y menú retráctil */
:root{
  --topbar-h:58px;
  --sidebar-w:220px;
  --sidebar-collapsed-w:72px;
  --radius-sm:8px;
  --radius-md:11px;
  --shadow-soft:0 5px 18px rgba(16,36,55,.045);
}
.crh-topbar{
  height:var(--topbar-h);
  min-height:var(--topbar-h);
  padding:0 18px;
  gap:14px;
  box-shadow:0 1px 0 rgba(16,36,55,.06);
}
.topbar-logo{width:96px;max-height:34px}
.crh-brand{gap:14px}
.product-name{padding-left:14px}
.product-name strong{font-size:13px;line-height:1.15}
.product-name small{font-size:11px;margin-top:2px}
.crh-userbox{gap:9px}
.crh-userbox strong{font-size:12.5px}
.crh-userbox small{font-size:10.5px}
.user-avatar{width:34px;height:34px;border-radius:10px;font-size:12px}
.logout-button{min-height:34px;padding:7px 11px;border-radius:8px;font-size:12px}
.crh-shell{
  grid-template-columns:var(--sidebar-w) minmax(0,1fr);
  min-height:calc(100vh - var(--topbar-h));
  transition:grid-template-columns .2s ease;
}
.crh-sidebar{
  width:var(--sidebar-w);
  padding:16px 12px 12px;
  top:var(--topbar-h);
  position:relative;
  overflow:visible;
  transition:width .2s ease,padding .2s ease;
}
.sidebar-toggle{
  position:absolute;
  top:16px;
  right:-13px;
  z-index:4;
  width:27px;
  height:27px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:999px;
  background:#fff;
  color:var(--crh-navy);
  box-shadow:0 4px 12px rgba(16,36,55,.14);
  display:grid;
  place-items:center;
  cursor:pointer;
  font-size:19px;
  line-height:1;
  transition:transform .2s ease,background .2s ease;
}
.sidebar-toggle:hover{background:#fff8e6}
.sidebar-logo-wrap{gap:10px;padding:4px 6px 16px;margin-bottom:12px}
.sidebar-logo-wrap img{width:42px;height:42px;object-fit:contain;flex:0 0 auto}
.sidebar-logo-wrap strong{font-size:13px}
.sidebar-logo-wrap small{font-size:10px}
.crh-sidebar nav{gap:3px}
.crh-sidebar a{
  min-height:38px;
  padding:9px 10px;
  border-radius:8px;
  gap:9px;
  font-size:12.5px;
  position:relative;
  box-shadow:none;
}
.crh-sidebar a.active{
  background:rgba(253,187,34,.13);
  color:#fff;
  box-shadow:none;
}
.crh-sidebar a.active:before{
  content:"";
  position:absolute;
  left:-12px;
  top:8px;
  bottom:8px;
  width:3px;
  border-radius:0 3px 3px 0;
  background:var(--crh-gold);
}
.crh-sidebar a:hover{background:rgba(255,255,255,.07)}
.nav-icon{width:20px;min-width:20px;font-size:13px}
.nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crh-sidebar .version{font-size:10px;padding:8px 6px;line-height:1.35}
.crh-content{padding:22px 26px 28px;transition:padding .2s ease}
.crh-pagehead{margin-bottom:14px}
.crh-pagehead h1{font-size:24px;line-height:1.15}
.eyebrow{font-size:9.5px;margin-bottom:3px}
.card{border-radius:12px;padding:16px;box-shadow:var(--shadow-soft)}
.hero{border-radius:12px;padding:17px 18px}
.hero h2{font-size:25px;margin-bottom:5px}
.hero p{font-size:12.5px}
.grid{gap:14px}
.stats{gap:14px}
.stat{border-top-width:3px;padding:15px 17px}
.stat span{font-size:11.5px}
.stat strong{font-size:27px;margin-top:4px}
.toolbar{gap:8px;margin-bottom:13px}
.btn{min-height:36px;padding:8px 12px;border-radius:8px;font-size:12px;transition:transform .16s ease,box-shadow .16s ease,filter .16s ease}
.btn:hover{box-shadow:0 5px 12px rgba(16,36,55,.09)}
.table th,.table td{padding:10px 9px}
.table th{font-size:10.5px}
.field label{font-size:12px;margin-bottom:5px}
.field input,.field select,.field textarea{padding:8px 10px;border-radius:8px;font-size:13px}
.alert{padding:10px 12px;border-radius:8px;margin-bottom:12px;font-size:12.5px}
.map-toolbar{gap:10px;margin-bottom:12px}.map-toolbar .field{min-width:160px}
.map-layout{gap:14px}.map-canvas{border-radius:12px}.map-side{gap:10px}
.map-result{padding:10px;border-radius:9px}

body.sidebar-collapsed .crh-shell{grid-template-columns:var(--sidebar-collapsed-w) minmax(0,1fr)}
body.sidebar-collapsed .crh-sidebar{width:var(--sidebar-collapsed-w);padding-left:8px;padding-right:8px}
body.sidebar-collapsed .sidebar-toggle{transform:rotate(180deg)}
body.sidebar-collapsed .sidebar-logo-wrap{justify-content:center;padding-left:0;padding-right:0}
body.sidebar-collapsed .sidebar-logo-wrap img{width:38px;height:38px}
body.sidebar-collapsed .sidebar-logo-wrap>div,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .crh-sidebar .version{display:none}
body.sidebar-collapsed .crh-sidebar a{justify-content:center;padding-left:8px;padding-right:8px}
body.sidebar-collapsed .crh-sidebar a.active:before{left:-8px}
body.sidebar-collapsed .nav-icon{width:24px;min-width:24px;font-size:14px}
body.sidebar-collapsed .crh-sidebar a[title]:hover:after{
  content:attr(title);
  position:absolute;
  left:58px;
  top:50%;
  transform:translateY(-50%);
  padding:7px 9px;
  border-radius:7px;
  background:#0d3147;
  color:#fff;
  white-space:nowrap;
  font-size:11px;
  box-shadow:0 7px 22px rgba(0,0,0,.18);
  z-index:20;
}
@media(max-width:950px){
  .crh-topbar{height:var(--topbar-h);padding:0 14px}
  .crh-shell,body.sidebar-collapsed .crh-shell{grid-template-columns:1fr}
  .crh-sidebar,body.sidebar-collapsed .crh-sidebar{top:var(--topbar-h);width:240px;left:-250px;padding:16px 12px}
  .crh-sidebar.open,body.sidebar-collapsed .crh-sidebar.open{left:0}
  .sidebar-toggle{display:none}
  body.sidebar-collapsed .sidebar-logo-wrap>div,body.sidebar-collapsed .nav-label,body.sidebar-collapsed .crh-sidebar .version{display:block}
  body.sidebar-collapsed .crh-sidebar a{justify-content:flex-start}
  .mobile-nav-overlay{inset:var(--topbar-h) 0 0}
  .crh-content{padding:18px}
}
@media(max-width:650px){
  .topbar-logo{width:86px}
  .crh-content{padding:14px}
  .crh-pagehead h1{font-size:21px}
  .card{padding:14px}
}

/* V1.4.2 - continuidad visual entre encabezado y navegación */
:root{
  --topbar-h:54px;
  --sidebar-w:214px;
  --sidebar-collapsed-w:64px;
}
html,body{min-height:100%}
.crh-topbar{
  height:var(--topbar-h);
  min-height:var(--topbar-h);
  padding:0 16px;
  border-bottom:1px solid rgba(16,36,55,.09);
  box-shadow:0 1px 5px rgba(16,36,55,.035);
}
.topbar-logo{width:88px;max-height:30px}
.product-name{padding-left:12px}
.product-name strong{font-size:12.5px}
.product-name small{font-size:10px}
.user-avatar{width:32px;height:32px;border-radius:9px}
.logout-button{min-height:32px;padding:6px 10px}
.crh-shell{
  grid-template-columns:var(--sidebar-w) minmax(0,1fr);
  min-height:calc(100vh - var(--topbar-h));
  align-items:stretch;
}
.crh-sidebar{
  position:sticky;
  top:var(--topbar-h);
  align-self:start;
  width:var(--sidebar-w);
  height:calc(100vh - var(--topbar-h));
  min-height:calc(100vh - var(--topbar-h));
  padding:14px 10px 10px;
  margin:0;
  border-radius:0;
  overflow-y:auto;
  overflow-x:visible;
  box-shadow:3px 0 14px rgba(13,49,71,.07);
}
.sidebar-toggle{
  top:14px;
  right:-12px;
  width:25px;
  height:25px;
  font-size:17px;
  border-color:#d8e1e8;
  box-shadow:0 3px 9px rgba(16,36,55,.13);
}
.sidebar-logo-wrap{
  min-height:62px;
  padding:2px 6px 13px;
  margin-bottom:9px;
}
.sidebar-logo-wrap img{width:38px;height:38px}
.sidebar-logo-wrap strong{font-size:12.5px}
.sidebar-logo-wrap small{font-size:9.5px}
.crh-sidebar nav{gap:2px}
.crh-sidebar a{
  min-height:36px;
  padding:8px 9px;
  border-radius:7px;
  font-size:12px;
}
.crh-sidebar a.active{
  background:rgba(255,255,255,.095);
  color:#fff;
}
.crh-sidebar a.active:before{
  left:-10px;
  top:7px;
  bottom:7px;
  width:3px;
}
.crh-content{padding:17px 24px 24px}
.crh-pagehead{margin-bottom:10px}
.crh-pagehead h1{font-size:23px}
.eyebrow{font-size:9px}
.card{border-radius:10px;box-shadow:0 3px 13px rgba(16,36,55,.035)}
.hero{border-radius:10px}
.tablewrap,.map-canvas,.map-side .card{border-radius:10px}
body.sidebar-collapsed .crh-shell{grid-template-columns:var(--sidebar-collapsed-w) minmax(0,1fr)}
body.sidebar-collapsed .crh-sidebar{
  width:var(--sidebar-collapsed-w);
  padding-left:7px;
  padding-right:7px;
}
body.sidebar-collapsed .sidebar-logo-wrap img{width:34px;height:34px}
body.sidebar-collapsed .crh-sidebar a.active:before{left:-7px}
body.sidebar-collapsed .crh-sidebar a[title]:hover:after{left:52px}
@media(max-width:950px){
  .crh-shell,body.sidebar-collapsed .crh-shell{grid-template-columns:1fr}
  .crh-sidebar,body.sidebar-collapsed .crh-sidebar{
    position:fixed;
    top:var(--topbar-h);
    bottom:0;
    height:calc(100vh - var(--topbar-h));
    min-height:0;
    width:236px;
    left:-246px;
    padding:14px 10px;
  }
  .crh-sidebar.open,body.sidebar-collapsed .crh-sidebar.open{left:0}
  .mobile-nav-overlay{inset:var(--topbar-h) 0 0}
}

/* V1.4.4 - conserva V1.4.2 y corrige solamente el control retractil */
.crh-sidebar{
  overflow-x:hidden;
}
.sidebar-footer{
  display:grid;
  gap:8px;
  width:100%;
  min-width:0;
}
.sidebar-toggle{
  position:static;
  inset:auto;
  width:100%;
  height:34px;
  min-height:34px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:8px;
  background:rgba(255,255,255,.07);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:9px;
  padding:0 10px;
  font-size:12px;
  font-weight:700;
  box-shadow:none;
  transform:none;
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease;
}
.sidebar-toggle:hover{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.22);
}
.sidebar-toggle-icon{
  width:18px;
  min-width:18px;
  display:inline-grid;
  place-items:center;
  font-size:18px;
  line-height:1;
  transition:transform .18s ease;
}
.sidebar-toggle-label{
  overflow:hidden;
  white-space:nowrap;
}
body.sidebar-collapsed .sidebar-toggle{
  width:100%;
  justify-content:center;
  padding:0;
  transform:none;
}
body.sidebar-collapsed .sidebar-toggle-icon{
  transform:rotate(180deg);
}
body.sidebar-collapsed .sidebar-toggle-label{
  display:none;
}
body.sidebar-collapsed .sidebar-footer{
  justify-items:stretch;
}
@media(max-width:950px){
  .sidebar-toggle{display:none!important}
}

/* V1.5.0 - módulo de apertura de domicilios */
.progress{height:8px;background:#e6edf2;border-radius:999px;overflow:hidden;min-width:120px;margin:4px 0}.progress span{display:block;height:100%;background:#1d7596;border-radius:999px}.progress.large{height:14px;width:100%;margin:12px 0}.progress-card strong{display:block;font-size:44px;line-height:1.1;margin-top:8px}.opening-summary{margin-bottom:18px}.detail-list{display:grid;gap:10px;margin:16px 0 0}.detail-list div{display:grid;grid-template-columns:130px 1fr;gap:10px;padding-bottom:9px;border-bottom:1px solid #edf1f4}.detail-list dt{font-weight:700;color:#617382}.detail-list dd{margin:0}.opening-timeline{display:grid;gap:14px}.stage-card{display:grid;grid-template-columns:42px minmax(0,1fr);gap:14px}.stage-number{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#123f59;color:#fff;font-weight:800}.stage-content{min-width:0}.stage-form{margin-top:12px}.stage-card.not-applicable{opacity:.6;background:#f6f8fa}.badge.completada,.badge.completado{background:#dff4e8;color:#17613a}.badge.en_proceso{background:#dceff7;color:#185874}.badge.pendiente{background:#fff0c9;color:#795500}.badge.rechazada,.badge.con_incidencia{background:#fbe0e0;color:#8b2424}.badge.no_iniciada{background:#eceff2;color:#596773}@media(max-width:700px){.stage-card{grid-template-columns:1fr}.stage-number{margin-bottom:-4px}.detail-list div{grid-template-columns:1fr;gap:2px}}

/* V1.5.1 - menu lateral mas compacto y sin barra de desplazamiento */
:root{
  --sidebar-w:202px;
  --sidebar-collapsed-w:58px;
}
.crh-sidebar{
  padding:10px 8px 8px;
  overflow:hidden;
}
.sidebar-logo-wrap{
  min-height:54px;
  padding:0 5px 9px;
  margin-bottom:6px;
}
.sidebar-logo-wrap img{width:34px;height:34px}
.sidebar-logo-wrap strong{font-size:12px;margin-top:7px}
.sidebar-logo-wrap small{font-size:9px}
.crh-sidebar nav{gap:1px}
.crh-sidebar a{
  min-height:32px;
  padding:6px 8px;
  border-radius:7px;
  font-size:11.5px;
}
.nav-icon{width:20px;min-width:20px;font-size:13px}
.sidebar-footer{gap:5px}
.sidebar-toggle{
  height:30px;
  min-height:30px;
  padding:0 8px;
  font-size:11px;
}
.sidebar-toggle-icon{font-size:16px}
.crh-sidebar .version{
  font-size:9px;
  padding:5px 4px 2px;
  line-height:1.25;
}
body.sidebar-collapsed .crh-sidebar{
  padding-left:6px;
  padding-right:6px;
  overflow:hidden;
}
body.sidebar-collapsed .sidebar-logo-wrap{
  min-height:44px;
  padding-bottom:7px;
  margin-bottom:5px;
}
body.sidebar-collapsed .sidebar-logo-wrap img{width:31px;height:31px}
body.sidebar-collapsed .crh-sidebar a{
  min-height:31px;
  padding:5px 6px;
}
body.sidebar-collapsed .nav-icon{width:21px;min-width:21px;font-size:13px}
body.sidebar-collapsed .crh-sidebar a.active:before{left:-6px}
body.sidebar-collapsed .crh-sidebar a[title]:hover:after{left:48px}
@media(max-width:950px){
  .crh-sidebar,body.sidebar-collapsed .crh-sidebar{
    width:226px;
    left:-236px;
    padding:12px 9px;
    overflow-y:auto;
    overflow-x:hidden;
  }
}

/* =========================================================
   DOMICILIOS FISCALES - LAYOUT REFERENCIA 2026-09-15
   ========================================================= */

:root{
    --df-sidebar-width:228px;
    --df-topbar-height:64px;
}

/* Barra superior */
.crh-topbar{
    height:var(--df-topbar-height) !important;
    min-height:var(--df-topbar-height) !important;
    padding:0 20px 0 28px !important;
    display:grid !important;
    grid-template-columns:360px minmax(320px,654px) 1fr auto auto !important;
    align-items:center !important;
    gap:18px !important;
    background:#fff !important;
    border-bottom:1px solid #e4edf5 !important;
    box-shadow:0 1px 8px rgba(20,55,90,.04) !important;
}

.crh-brand{
    display:flex !important;
    align-items:center !important;
    gap:18px !important;
    min-width:0 !important;
}

.topbar-logo{
    width:92px !important;
    max-width:92px !important;
    height:auto !important;
    object-fit:contain !important;
    padding-right:18px !important;
    border-right:1px solid #dce6ef !important;
}

.product-name{
    display:flex !important;
    flex-direction:column !important;
    justify-content:center !important;
    min-width:180px !important;
}

.product-name strong{
    color:#082b5c !important;
    font-size:17px !important;
    line-height:1.15 !important;
    font-weight:800 !important;
}

.product-name small{
    margin-top:3px !important;
    color:#6685a5 !important;
    font-size:12px !important;
}

/* Buscador superior */
.crh-global-search{
    width:100% !important;
    height:40px !important;
    display:flex !important;
    align-items:center !important;
    gap:10px !important;
    padding:0 14px !important;
    border:1px solid #d8e5f0 !important;
    border-radius:9px !important;
    background:#f4f8fc !important;
}

.crh-global-search-icon{
    color:#3f6288 !important;
    font-size:23px !important;
    line-height:1 !important;
    transform:rotate(-20deg);
}

.crh-global-search input{
    width:100% !important;
    height:100% !important;
    border:0 !important;
    outline:0 !important;
    padding:0 !important;
    background:transparent !important;
    color:#244d78 !important;
    font-size:13px !important;
}

.crh-global-search input::placeholder{
    color:#6582a2 !important;
}

/* Campana */
.crh-notification-bell{
    width:38px !important;
    height:38px !important;
    position:relative !important;
    display:grid !important;
    place-items:center !important;
    color:#375e86 !important;
    font-size:23px !important;
    cursor:pointer !important;
}

.crh-notification-bell span{
    position:absolute !important;
    top:5px !important;
    right:5px !important;
    width:10px !important;
    height:10px !important;
    border-radius:50% !important;
    background:#ef4052 !important;
    bor
}

/* Usuario */
.crh-userbox{
    display:flex !important;
    align-items:center !important;
  
}

.crh-userbox .user-avatar{
    width:36px !important;
    height:36px !importa
    min-width:36px !important;
    border-radius:10px !important;
    display:grid !important;
    place-items:center !important;
    background:#f9bc18 !important;
    color:#082e61 !important;
    font-size:15px !important;
    font-weight:800 !important;
}

.crh-userbox strong{
    color:#082b5c !important;
    
    font-weight:800 !important;
}

.crh-userbox small{
    margin-top:2px !important;
    color:#66809d !important;
    font-size:10.5px !important;
}

.logout-button{
    height:38px !important;
    padding:0 14px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    border:1px solid #cad9e7 !important;
    border-radius:8px !important;
    background:#fff !important;
    color:#0a4d8e !imp
    font-size:12px !important;
    font-weight:700 !important;
}

/* Shell */
.crh-shell{
    min-height:calc(100vh - var(--df-topbar-height)) !important;
}

/* Sidebar */
.crh-sidebar{
    width:var(--df-sid
    min-width:var(--df-sidebar-width) !important;
    flex:0 0 var(--df-sidebar-width) !important;
    min-height:calc(100vh - var(--df-topbar-height)) !important;
    background:linear-gradient(180deg,#083c59 0%,#0c4b68 100%) !important;
    padding:18px 12px 12px !important;
}

.sidebar-logo-wrap{
    padding:2px 8px 12px !important;
    margin-bottom:8px !important;
    border-bottom:1px solid rgba(255,255,255,.10) !important;
}

.sidebar-logo-wrap img{
    width:38px !important;
    height:auto !important;
    margin-bottom:10px !important;
}

.sidebar-logo-wrap strong{
    font-size:15px !important;
    line-height:1.2 !important;
}

.sidebar-logo-wrap small{
    margin-top:3px !important;
    font-size:11px !important;
    opacity:.82 !important;
}

.crh-sidebar nav{
    display:flex !important;
    flex-direction:column !important;
    gap:4px !important;
}

.crh-sidebar nav a{
    min-height:42px !important;
    padding:0 12px !important;
    border-radius:8px !important;
    display:flex !important;
    align-items:center !important;
    gap:12px !important;
    font-size:13px !important;
}

.crh-sidebar nav a.active{
    position:relative !important;
    background:rgba(91,170,221,.25) !important;
}

.crh-sidebar nav a.active:before{
    content:"" !important;
    position:absolute !important;
    left:-12px !important;
    top:0 !important;
    bottom:0 !important;
    width:4px !important;
    background:#f7bf21 !important;
}

.nav-icon{
    width:22px !important;
    text-align:center !important;
    font-size:18px !important;
}

.nav-label{
    font-size:13px !important;
}

.sidebar-footer{
    padding-top:12px !important;
}

.sidebar-toggle{
    min-height:38px !important;
    border-radius:8px !important;
}

.sidebar-footer .version{
    padding:12px 10px 0 !important;
    font-size:10px !important;
    line-height:1.45 !important;
}

/* Área principal */
.crh-content{
    width:100% !important;
    min-width:0 !important;
    padding:0 !important;
    background:#f4f9fd !important;
}

.crh-pagehead{
    margin:0 !important;
}

/* Dashboard */
.dashboard-saas{
    padding:24px 24px 28px !important;
}

.ds-head{
    margin-bottom:18px !important;
}

.ds-title{
    font-size:34px !important;
}

.ds-subtitle{
    font-size:15px !important;
}

.ds-kpi-grid{
    gap:12px !important;
    margin-bottom:18px !important;
}

.ds-kpi{
    min-height:118px !important;
    padding:14px !important;
}

.ds-row-three{
    min-height:240px !important;
    gap:12px !important;
    margin-bottom:16px !important;
}

.ds-row-three > .ds-card{
    min-height:240px !important;
}

.ds-bottom-grid{
    gap:12px !important;
}

.ds-bottom-card{
    min-height:276px !important;
}

/* Desktop angosto */
@media (max-width:1200px){
    .crh-topbar{
        grid-template-columns:300px minmax(260px,1fr) auto auto auto !important;
    }

    .crh-global-search{
        min-width:250px !important;
    }
}

/* Móvil/tablet */
@media (max-width:900px){
    .crh-topbar{
        display:flex !important;
        padding:0 12px !important;
    }

    .crh-global-search,
    .crh-notification-bell{
        display:none !important;
    }

    .crh-sidebar{
        width:228px !important;
    }

    .crh-content{
        width:100% !important;
    }
}


/* Dashboard - tarjeta distribución de domicilios */
.ds-map-meta{
    display:flex;
    align-items:center;
    margin:0 0 8px 31px;
}

.ds-map-count{
    font-size:12px;
    font-weight:600;
    color:#315b88;
}

.ds-map-box{
    height:158px !important;
    min-height:158px !important;
    border-radius:9px !important;
}

.ds-map-summary{
    position:absolute !important;
    left:8px !important;
    bottom:8px !important;
    z-index:4 !important;
    margin-top:0 !important;
    display:flex !important;
    gap:14px !important;
    padding:5px 9px !important;
    border-radius:8px !important;
    background:rgba(255,255,255,.94) !important;
    box-shadow:0 2px 8px rgba(25,62,91,.10) !important;
    font-size:10.5px !important;
}

.ds-map-open{
    position:absolute;
    z-index:4;
    right:8px;
    top:8px;
    width:28px;
    height:28px;
    border-radius:7px;
    background:rgba(255,255,255,.94);
    display:grid;
    place-items:center;
    color:#315b88;
    text-decoration:none;
    box-shadow:0 2px 8px rgba(25,62,91,.10);
    font-size:15px;
    font-weight:700;
}

.ds-map-open:hover{
    background:#fff;
    color:#147cf1;
}

.ds-map-point{
    width:14px !important;
    height:14px !important;
}

/* Dashboard - mini mapa Leaflet */
#dashboard-mini-map{
    position:relative;
    z-index:1;
    width:100%;
    height:158px !important;
    min-height:158px !important;
    overflow:hidden;
    border:1px solid #d9e5ed;
    border-radius:9px;
    background:#eef4f7 !important;
}

#dashboard-mini-map:before{
    display:none !important;
    content:none !important;
}

#dashboard-mini-map .leaflet-container{
    font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe 
}

#dashboard-mini-map .leaflet-tile-pane{
    filter:saturate(.72) brightness(1.04);
}

#dashboard-mini-map .leaflet-tooltip{
    border:0;
    border-radius:6px;
    padding:5px 8px;
    color:#173f69;
    font-size:10px;
    box-shadow:0 2px 8px rgba(25,62,91,.16);
}

.ds-map-summary{
    position:relative !important;
    left:auto !important;
    bottom:auto !important;
    z-index:5 !important;
    width:max-content;
    margin:-31px 0 7px 8px !important;
    pointer-events:none;
}


/* Afinado visual dashboard */
.ds-card-title{
    font-weight:700 !important;
}

.ds-donut-value{
    font-weight:600 !important;
}

.ds-coverage-number{
    font-weight:600 !important;
}


/* Campana de notificaciones */
.crh-notification-bell svg{
    width:20px;
    height:20px;
    fill:none;
    stroke:#315b88;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
    display:block;
}

.crh-notification-bell{
    position:relative;
    display:grid;
    place-items:center;
}

/* Campana fina estilo Mensajeria */
.crh-notification-bell{
    width:34px !important;
    height:34px !important;
    position:relative !important;
    display:grid !important;
    place-items:center !important;
    cursor:pointer !important;
    color:#315b88 !important;
    font-size:0 !important;
}

.crh-notification-bell svg{
    width:19px !important;
    height:19px !important;
    display:block !important;
    overflow:visible !important;
}

.crh-notification-bell svg path{
    fill:none !important;
    stroke:#315b88 !important;
    stroke-width:1.7 !important;
    stroke-linecap:round !important;
    stroke-linejoin:round !important;
}

.crh-notification-bell span{
    position:absolute !important;
    top:5px !important;
    right:4px !important;
    width:8px !important;
    height:8px !important;
    border-radius:50% !important;
    background:#ef4052 !important;
    border:2px solid #fff !important;
    box-sizing:content-box !important;
}

/* Campana definitiva */
.crh-notification-bell{
    width:34px !important;
    height:34px !important;
    display:grid !important;
    place-items:center !important;
    cursor:pointer !important;
}

.crh-notification-bell > svg{
    width:22px !important;
    height:22px !important;
}

.crh-notification-bell > span{
    display:none !important;
}

/* =========================================================
   CENTRO DE NOTIFICACIONES
   ========================================================= */

.crh-notification-wrap{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
}

.crh-notification-bell{
    appearance:none !important;
    -webkit-appearance:none !important;
    border:0 !important;
    background:transparent !important;
    padding:0 !important;
    width:34px !important;
    height:34px !important;
    display:grid !important;
    place-items:center !important;
    cursor:pointer !important;
    border-radius:9px !important;
}

.crh-notification-bell:hover,
.crh-notification-bell[aria-expanded="true"]{
    background:#f1f6fb !important;
}

.crh-notification-bell > svg{
    width:22px !important;
    height:22px !important;
    display:block !important;
    overflow:visible !important;
}

.crh-notification-panel{
    position:absolute;
    z-index:1000;
    top:calc(100% + 10px);
    right:-6px;
    width:360px;
    max-width:calc(100vw - 24px);
    background:#fff;
    border:1px solid #dce5ec;
    border-radius:12px;
    box-shadow:0 14px 38px rgba(17,43,68,.16);
    overflow:hidden;
}

.crh-notification-panel[hidden]{
    display:none !important;
}

.crh-notification-panel-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:14px 16px 12px;
    border-bottom:1px solid #e7edf2;
    background:#fff;
}

.crh-notification-panel-head strong{
    display:block;
    color:#092f63;
    font-size:14px;
    line-height:1.2;
}

.crh-notification-panel-head small{
    display:block;
    margin-top:3px;
    color:#73889e;
    font-size:10.5px;
}

.crh-notification-list{
    max-height:390px;
    overflow-y:auto;
}

.crh-notification-item{
    display:grid;
    grid-template-columns:38px minmax(0,1fr) 14px;
    gap:10px;
    align-items:center;
    padding:12px 14px;
    color:inherit;
    text-decoration:none;
    border-bottom:1px solid #edf1f4;
    background:#fff;
}

.crh-notification-item:last-child{
    border-bottom:0;
}

.crh-notification-item:hover{
    background:#f7fafc;
}

.crh-notification-count{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#fff0d5;
    color:#a86400;
    font-size:12px;
    font-weight:700;
}

.crh-notification-content{
    min-width:0;
}

.crh-notification-content strong{
    display:block;
    color:#123f59;
    font-size:11.5px;
    line-height:1.25;
}

.crh-notification-content small{
    display:block;
    margin-top:3px;
    color:#6f8499;
    font-size:10px;
    line-height:1.35;
}

.crh-notification-arrow{
    color:#7390aa;
    font-size:18px;
    line-height:1;
}

.crh-notification-empty{
    display:flex;
    gap:11px;
    align-items:center;
    padding:22px 16px;
}

.crh-notification-empty > span{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:50%;
    background:#e1f7ed;
    color:#15945e;
    font-weight:700;
}

.crh-notification-empty strong{
    display:block;
    color:#123f59;
    font-size:12px;
}

.crh-notification-empty small{
    display:block;
    margin-top:3px;
    color:#73889e;
    font-size:10.5px;
}

@media(max-width:650px){
    .crh-notification-panel{
        position:fixed;
        top:62px;
        left:12px;
        right:12px;
        width:auto;
        max-width:none;
    }
}

/* Correccion visual boton notificaciones */
.crh-notification-bell,
.crh-notification-bell:hover,
.crh-notification-bell:focus,
.crh-notification-bell:focus-visible,
.crh-notification-bell:active{
    appearance:none !important;
    -webkit-appearance:none !important;
    border:0 !important;
    outline:0 !important;
    box-shadow:none !important;
    background:transparent !important;
}

.crh-notification-bell[aria-expanded="true"]{
    background:#f1f6fb !important;
    border:0 !important;
    outline:0 !important;
    box-shadow:none !important;
}

/* =========================================================
   CORRECCION POSICION CENTRO DE NOTIFICACIONES
   ========================================================= */

.crh-notification-wrap{
    position:relative !important;
    flex:0 0 auto !important;
}

.crh-notification-panel{
    position:absolute !important;
    top:calc(100% + 8px) !important;
    right:0 !important;
    left:auto !important;

    width:360px !important;
    max-width:calc(100vw - 24px) !important;

    z-index:10000 !important;

    background:#ffffff !important;
    border:1px solid #dce5ec !important;
    border-radius:12px !important;

    box-shadow:
        0 14px 38px rgba(17,43,68,.16) !important;

    overflow:hidden !important;
}

.crh-notification-panel[hidden]{
    display:none !important;
}

.crh-notification-bell,
.crh-notification-bell:hover,
.crh-notification-bell:focus,
.crh-notification-bell:focus-visible,
.crh-notification-bell:active{
    border:0 !important;
    outline:0 !important;
    box-shadow:none !important;
}

.crh-notification-bell[aria-expanded="true"]{
    border:0 !important;
    outline:0 !important;
    box-shadow:none !important;
    background:#f1f6fb !important;
}


/* =========================================================
   FIX FINAL - PERSISTENCIA MENU CONTRAIDO
   ========================================================= */

@media (min-width:951px){

    body.sidebar-collapsed .crh-shell{
        grid-template-columns:58px minmax(0,1fr) !important;
    }

    body.sidebar-collapsed .crh-sidebar{
        width:58px !important;
        min-width:58px !important;
        flex:0 0 58px !important;

        padding-left:6px !important;
        padding-right:6px !important;
        overflow:hidden !important;
    }

    body.sidebar-collapsed .sidebar-logo-wrap{
        justify-content:center !important;
        padding-left:0 !important;
        padding-right:0 !important;
    }

    body.sidebar-collapsed .sidebar-logo-wrap img{
        width:31px !important;
        height:auto !important;
        margin-left:auto !important;
        margin-right:auto !important;
    }

    body.sidebar-collapsed .sidebar-logo-wrap > div,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .crh-sidebar .version{
        display:none !important;
    }

    body.sidebar-collapsed .crh-sidebar a{
        justify-content:center !important;
        padding-left:6px !important;
        padding-right:6px !important;
    }

    body.sidebar-collapsed .nav-icon{
        width:21px !important;
        min-width:21px !important;
        margin:0 !important;
        font-size:13px !important;
    }

    body.sidebar-collapsed .sidebar-toggle{
        justify-content:center !important;
        padding:0 !important;
    }

    body.sidebar-collapsed .sidebar-toggle-label{
        display:none !important;
    }

    body.sidebar-collapsed .sidebar-toggle-icon{
        transform:rotate(180deg) !important;
    }
}

/* =========================================================
   DENSIDAD VISUAL 90% REAL
   Equivalente visual aproximado a navegador 90%
   SIN zoom / SIN transform / SIN scale
   ========================================================= */

@media (min-width:951px){

    :root{
        --df-sidebar-width:205px !important;
        --df-topbar-height:58px !important;
    }

    /* ===== TOPBAR ===== */

    .crh-topbar{
        height:58px !important;
        min-height:58px !important;
        padding:0 18px 0 25px !important;
        grid-template-columns:324px minmax(288px,589px) 1fr auto auto !important;
        gap:16px !important;
    }

    .crh-brand{
        gap:16px !important;
    }

    .topbar-logo{
        width:83px !important;
        max-width:83px !important;
        padding-right:16px !important;
    }

    .product-name{
        min-width:162px !important;
    }

    .product-name strong{
        font-size:15px !important;
    }

    .product-name small{
        font-size:11px !important;
    }

    .crh-global-search{
        height:36px !important;
        padding:0 13px !important;
        gap:9px !important;
    }

    .crh-global-search-icon{
        font-size:21px !important;
    }

    .crh-global-search input{
        font-size:12px !important;
    }

    .crh-notification-bell{
        width:34px !important;
        height:34px !important;
        font-size:21px !important;
    }

    .crh-userbox .user-avatar{
        width:32px !important;
        height:32px !important;
        min-width:32px !important;
        font-size:14px !important;
    }

    .crh-userbox strong{
        font-size:12px !important;
    }

    .crh-userbox small{
        font-size:9.5px !important;
    }

    .logout-button{
        height:34px !important;
        padding:0 13px !important;
        font-size:11px !important;
    }

    /* ===== SIDEBAR ===== */

    .crh-sidebar{
        width:205px !important;
        min-width:205px !important;
        flex:0 0 205px !important;
        padding:16px 11px 11px !important;
    }

    .sidebar-logo-wrap{
        padding:2px 7px 11px !important;
        margin-bottom:7px !important;
    }

    .sidebar-logo-wrap img{
        width:34px !important;
        margin-bottom:9px !important;
    }

    .sidebar-logo-wrap strong{
        font-size:13.5px !important;
    }

    .sidebar-logo-wrap small{
        font-size:10px !important;
    }

    .crh-sidebar nav{
        gap:3px !important;
    }

    .crh-sidebar nav a{
        min-height:38px !important;
        padding:0 11px !important;
        gap:10px !important;
        font-size:12px !important;
    }

    .nav-icon{
        width:20px !important;
        font-size:16px !important;
    }

    .nav-label{
        font-size:12px !important;
    }

    .sidebar-toggle{
        min-height:34px !important;
    }

    .sidebar-footer .version{
        padding:10px 9px 0 !important;
        font-size:9px !important;
    }

    /* ===== DASHBOARD GENERAL ===== */

    .dashboard-saas{
        padding:22px 22px 25px !important;
        font-size:12px !important;
    }

    .ds-head{
        gap:18px !important;
        margin-bottom:16px !important;
    }

    .ds-title{
        font-size:31px !important;
        letter-spacing:-.7px !important;
    }

    .ds-subtitle{
        font-size:14px !important;
    }

    .ds-date{
        gap:11px !important;
        padding-top:7px !important;
    }

    .ds-date-main{
        font-size:12px !important;
    }

    .ds-date-time{
        font-size:10px !important;
    }

    /* ===== KPI ===== */

    .ds-kpi-grid{
        gap:11px !important;
        margin-bottom:16px !important;
    }

    .ds-kpi{
        min-height:106px !important;
        padding:12px !important;
        gap:11px !important;
        border-radius:10px !important;
    }

    .ds-icon{
        width:43px !important;
        height:43px !important;
        flex:0 0 43px !important;
    }

    .ds-icon svg{
        width:21px !important;
        height:21px !important;
    }

    .ds-kpi-label{
        font-size:11px !important;
    }

    .ds-kpi-value{
        margin-top:4px !important;
        font-size:27px !important;
    }

    .ds-kpi-value.money{
        font-size:24px !important;
    }

    .ds-kpi-sub{
        margin-top:8px !important;
        font-size:10.5px !important;
    }

    .ds-kpi-badge{
        margin-top:5px !important;
        font-size:9px !important;
        padding:2px 5px !important;
    }

    .ds-mini-progress{
        height:6px !important;
        margin-top:9px !important;
    }

    /* ===== TARJETAS INFERIORES ===== */

    .ds-row-three{
        min-height:216px !important;
        gap:11px !important;
        margin-bottom:14px !important;
    }

    .ds-row-three > .ds-card{
        min-height:216px !important;
    }

    .ds-bottom-grid{
        gap:11px !important;
    }

    .ds-bottom-card{
        min-height:248px !important;
    }

    .ds-card{
        border-radius:10px !important;
    }

    .ds-card-inner{
        padding:13px 14px !important;
    }

    .ds-card-head{
        gap:9px !important;
        margin-bottom:11px !important;
    }

    .ds-card-title{
        gap:8px !important;
        font-size:13px !important;
    }

    .ds-card-title-icon{
        width:25px !important;
        height:25px !important;
    }

    .ds-card-title-icon svg{
        width:19px !important;
        height:19px !important;
    }

    .ds-link{
        font-size:10.5px !important;
    }

    /* ===== DONA ===== */

    .ds-coverage{
        grid-template-columns:149px 1fr !important;
        gap:16px !important;
        min-height:158px !important;
    }

    .ds-donut{
        width:128px !important;
        height:128px !important;
    }

    .ds-donut:after{
        inset:17px !important;
    }

    .ds-donut-value{
        font-size:26px !important;
    }

    .ds-donut-label{
        font-size:10px !important;
    }

    .ds-coverage-list{
        gap:12px !important;
    }

    .ds-coverage-number{
        font-size:16px !important;
    }

    .ds-coverage-text{
        font-size:10.5px !important;
    }

    .ds-coverage-percent{
        font-size:10px !important;
    }

    /* ===== GRAFICA ===== */

    .ds-type-chart{
        min-height:158px !important;
    }

    .ds-type-legend{
        gap:16px !important;
        font-size:9.5px !important;
    }

    .ds-chart-area{
        height:136px !important;
        gap:6px !important;
    }

    .ds-bar-stack{
        width:22px !important;
    }

    .ds-bar-label{
        font-size:9px !important;
    }

    /* ===== MAPA ===== */

    .ds-map-box{
        height:142px !important;
        min-height:142px !important;
    }

    .ds-map-count{
        font-size:11px !important;
    }

    .ds-map-summary{
        font-size:10px !important;
        gap:13px !important;
    }
}


/* =========================================================
   KPI SEGUNDA FILA - TITULOS EN UNA SOLA LINEA
   ========================================================= */

@media (min-width:951px){

    body.sidebar-collapsed .ds-kpi-grid > .ds-kpi:nth-child(n+6) .ds-kpi-label{
        white-space:nowrap !important;
        overflow:visible !important;
        text-overflow:clip !important;
        word-break:normal !important;
        overflow-wrap:normal !important;
        font-size:10px !important;
        letter-spacing:-0.15px !important;
    }

}


/* =========================================================
   DETALLE DOMICILIO - VISOR PDF
   ========================================================= */

.domicilio-pdf-card{
    overflow:hidden;
}

.domicilio-pdf-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:10px;
}

.domicilio-pdf-title{
    display:flex;
    align-items:center;
    gap:9px;
    min-width:0;
}

.domicilio-pdf-title h2{
    margin:0 !important;
    font-size:18px !important;
}

.domicilio-pdf-title-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:30px;
    height:30px;
    border-radius:8px;
    background:#fff0f4;
    color:#ef3360;
    font-size:16px;
    font-weight:700;
}

.domicilio-pdf-file{
    display:flex;
    align-items:center;
    gap:7px;
    min-width:0;
    max-width:45%;
    color:#244a69;
    font-size:10.5px;
    font-weight:600;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.domicilio-pdf-file a{
    display:flex;
    align-items:center;
    justify-content:center;
    width:27px;
    height:27px;
    flex:0 0 27px;
    border-radius:7px;
    background:#eef5fb;
    color:#1b6fac;
    text-decoration:none;
}

.domicilio-pdf-meta{
    display:flex;
    align-items:center;
    gap:7px;
    margin-bottom:8px;
    color:#67839b;
    font-size:10px;
}

.domicilio-pdf-meta strong{
    color:#0b3451;
}

.domicilio-pdf-frame{
    display:block;
    width:100%;
    height:405px;
    border:0;
    border-radius:8px;
    background:#313438;
}

.domicilio-pdf-empty{
    min-height:360px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:7px;
    color:#8398aa;
    text-align:center;
    font-size:11px;
}

.domicilio-pdf-empty strong{
    color:#516e83;
    font-size:14px;
}

.domicilio-pdf-empty-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:48px;
    height:48px;
    border-radius:12px;
    background:#f3f6f8;
    color:#ef4867;
    font-size:11px;
    font-weight:800;
}

/* Detalle superior más fino */
@media (min-width:951px){

    .grid.two{
        gap:14px !important;
    }

    .grid.two > .card{
        padding:16px !important;
    }

    .grid.two > .card > h2{
        font-size:18px !important;
        margin-bottom:12px !important;
    }

    .grid.two .table th,
    .grid.two .table td{
        padding-top:8px !important;
        padding-bottom:8px !important;
        font-size:11px !important;
    }

    .grid.two .table th{
        width:30% !important;
        font-size:10px !important;
    }
}

@media(max-width:1050px){

    .domicilio-pdf-frame{
        height:500px;
    }

    .domicilio-pdf-file{
        max-width:55%;
    }
}


/* =========================================================
   DETALLE DOMICILIO - VISOR PDF FIX
   ========================================================= */

@media (min-width:951px){

    /* Información / PDF: proporción más equilibrada */
    section.grid.two{
        grid-template-columns:minmax(0,1.22fr) minmax(0,.78fr) !important;
        align-items:stretch !important;
        gap:14px !important;
    }

    section.grid.two > .card{
        min-width:0 !important;
    }

    section.grid.two > .domicilio-pdf-card{
        display:flex !important;
        flex-direction:column !important;
        width:100% !important;
        min-width:0 !important;
        overflow:hidden !important;
    }

    section.grid.two > .domicilio-pdf-card .domicilio-pdf-head{
        flex:0 0 auto !important;
        width:100% !important;
    }

    section.grid.two > .domicilio-pdf-card .domicilio-pdf-meta{
        flex:0 0 auto !important;
        width:100% !important;
    }

    section.grid.two > .domicilio-pdf-card iframe.domicilio-pdf-frame{
        display:block !important;
        flex:1 1 auto !important;
        width:100% !important;
        max-width:none !important;
        min-width:100% !important;
        height:410px !important;
        min-height:410px !important;
        margin:0 !important;
        padding:0 !important;
        border:0 !important;
        border-radius:8px !important;
        background:#303338 !important;
    }

}

/* Cabecera del visor más fina */
.domicilio-pdf-head{
    min-height:30px !important;
    margin-bottom:5px !important;
}

.domicilio-pdf-title h2{
    font-size:15px !important;
    line-height:1.2 !important;
}

.domicilio-pdf-title-icon{
    width:26px !important;
    height:26px !important;
    flex:0 0 26px !important;
    font-size:14px !important;
}

.domicilio-pdf-meta{
    margin:0 0 7px !important;
    font-size:10px !important;
}


/* =========================================================
   DETALLE DOMICILIO - INFORMACION GENERAL COMPACTA
   ========================================================= */

.domicilio-info-card{
    padding:14px 16px 15px !important;
    overflow:hidden;
}

.domicilio-info-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:10px;
    padding-bottom:9px;
    border-bottom:1px solid #e4ebf1;
}

.domicilio-info-title{
    display:flex;
    align-items:center;
    gap:9px;
    min-width:0;
}

.domicilio-info-title h2{
    margin:0 !important;
    color:#082f57;
    font-size:16px !important;
    line-height:1.2 !important;
    font-weight:700 !important;
}

.domicilio-info-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:30px;
    height:30px;
    flex:0 0 30px;
    border-radius:9px;
    background:#e7f4ff;
    color:#168cf0;
    font-size:16px;
    font-weight:700;
}

.domicilio-info-status{
    display:inline-flex;
    align-items:center;
    gap:6px;
    min-height:27px;
    padding:0 10px;
    border-radius:999px;
    background:#e1f8ea;
    color:#158351;
    font-size:10.5px;
    font-weight:700;
    white-space:nowrap;
}

.domicilio-info-status i{
    width:7px;
    height:7px;
    border-radius:50%;
    background:#1cb36b;
}

.domicilio-info-table{
    border-collapse:collapse !important;
}

.domicilio-info-table th,
.domicilio-info-table td{
    height:35px !important;
    padding:7px 9px !important;
    border-bottom:1px solid #e5ebf0 !important;
    vertical-align:middle !important;
}

.domicilio-info-table th{
    width:29% !important;
    background:#f5f8fa !important;
    color:#234a67 !important;
    font-size:9.5px !important;
    line-height:1.1 !important;
    font-weight:700 !important;
    letter-spacing:.015em !important;
}

.domicilio-info-table td{
    background:#fff !important;
    color:#143653 !important;
    font-size:11.5px !important;
    line-height:1.25 !important;
    font-weight:400 !important;
}

.domicilio-info-table tr:last-child th,
.domicilio-info-table tr:last-child td{
    border-bottom:0 !important;
}

@media (min-width:951px){

    section.grid.two{
        align-items:stretch !important;
    }

    .domicilio-info-card{
        align-self:stretch !important;
    }

}

