:root{--teal:#0b7d6d;--dark:#0f2437;--mint:#e6f4f1;--soft:#f7faf9;--line:#dbe7e4;--muted:#667085;--orange:#f59e0b;--coral:#ef6f61;--shadow:0 14px 40px rgba(15,36,55,.08);--r:18px}*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:var(--dark);background:#fff}a{color:inherit;text-decoration:none}img{max-width:100%}.skip-link{position:absolute;left:-999px}.skip-link:focus{left:1rem;top:1rem;background:#fff;padding:.8rem;z-index:9}.public-nav,.app-top{height:74px;display:flex;align-items:center;justify-content:space-between;padding:0 clamp(16px,5vw,64px);border-bottom:1px solid var(--line);background:#fff;position:sticky;top:0;z-index:10}.brand{display:flex;gap:.7rem;align-items:center;font-size:1.35rem;color:var(--teal)}.brand img{width:42px;height:42px}.nav-links{display:flex;gap:1rem;align-items:center}.nav-links a{padding:.7rem}.btn,button,.button{border:0;border-radius:10px;padding:.75rem 1rem;font-weight:700;cursor:pointer;display:inline-flex;gap:.5rem;align-items:center;justify-content:center}.btn-primary,.button.primary{background:var(--teal);color:#fff;box-shadow:0 8px 20px rgba(11,125,109,.22)}.btn-outline,.button.secondary{border:1px solid var(--teal);color:var(--teal);background:#fff}.nav-toggle,.sidebar-toggle{display:none;background:#fff;border:1px solid var(--line);font-size:1.2rem}.hero{display:grid;grid-template-columns:1fr 1fr;gap:3rem;align-items:center;padding:64px clamp(16px,5vw,72px)}.hero h1{font-size:clamp(2.4rem,5vw,4.8rem);line-height:1.02;margin:0 0 1rem}.hero h1 span{color:var(--teal)}.hero p{font-size:1.1rem;color:var(--muted);line-height:1.6}.hero-actions{display:flex;gap:1rem;flex-wrap:wrap;margin:2rem 0}.mini-benefits{display:flex;gap:1rem;flex-wrap:wrap;color:var(--muted)}.mini-benefits span{background:#fff;border:1px solid var(--line);padding:.8rem;border-radius:14px}.dashboard-preview,.card{background:#fff;border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow)}.dashboard-preview{padding:1.2rem;display:grid;grid-template-columns:170px 1fr;gap:1rem}.preview-sidebar{background:var(--soft);border-radius:14px;padding:1rem;display:flex;flex-direction:column;gap:.75rem;min-width:170px}.preview-content{display:grid;gap:1rem}.metric-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:1rem;padding:0 clamp(16px,5vw,72px) 32px}.metric,.kpi{padding:1.2rem}.metric strong,.kpi strong{font-size:1.8rem;color:var(--teal);display:block}.section{padding:38px clamp(16px,5vw,72px)}.section h2{text-align:center;font-size:2rem}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem}.cards.six{grid-template-columns:repeat(6,1fr)}.card{padding:1.2rem}.card-icon{font-size:2rem;color:var(--teal)}.chart{height:130px;display:flex;align-items:end;gap:10px;padding:1rem;border-bottom:1px solid var(--line)}.bar{width:100%;background:linear-gradient(180deg,#22b6a6,#0b7d6d);border-radius:8px 8px 0 0;min-height:20px}.notice{margin:1rem clamp(16px,5vw,72px);padding:1rem 1.2rem;border:1px solid var(--teal);background:var(--mint);border-radius:14px;color:#07594e;font-weight:700}.footer,.app-footer{background:linear-gradient(135deg,#086c60,#0b7d6d);color:#fff;padding:34px clamp(16px,5vw,72px);display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:2rem;align-items:center}.footer img,.app-footer img:not(.footer-cat){width:42px}.footer a,.app-footer a{display:block;color:#dff7f4;margin:.3rem 0}.app-body{background:#fbfdfc}.app-top{padding:0 24px}.user-chip{display:flex;gap:.7rem;align-items:center}.user-chip small{display:block;color:var(--muted)}.avatar{width:42px;height:42px;border-radius:50%;background:var(--teal);color:#fff;display:grid;place-items:center;font-weight:800}.logout{color:var(--teal);font-weight:700}.app-shell{display:grid;grid-template-columns:250px 1fr;min-height:calc(100vh - 74px)}.sidebar{background:#fff;border-right:1px solid var(--line);padding:1rem;position:sticky;top:74px;height:calc(100vh - 74px);overflow:auto}.sidebar nav a{display:flex;gap:.75rem;align-items:center;padding:.9rem 1rem;border-radius:12px;margin:.25rem 0;color:#344054}.sidebar nav a.active{background:var(--mint);color:var(--teal);font-weight:800}.help-card{margin-top:2rem;background:var(--mint);border-radius:18px;padding:1rem;text-align:center}.help-card img{height:110px}.app-main{padding:28px;max-width:1280px;width:100%;margin:0 auto}.page-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1.5rem}.page-head h1{margin:.2rem 0;font-size:2.2rem}.grid{display:grid;gap:1rem}.grid.two{grid-template-columns:2fr 1fr}.grid.three{grid-template-columns:repeat(3,1fr)}.grid.four{grid-template-columns:repeat(4,1fr)}.kpis{display:grid;grid-template-columns:repeat(6,1fr);gap:1rem;margin:1rem 0 1.4rem}.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse;min-width:720px}.table th,.table td{padding:.85rem;border-bottom:1px solid var(--line);text-align:left}.table th{font-size:.85rem;color:var(--muted);background:#fafafa}.badge{display:inline-flex;padding:.35rem .65rem;border-radius:999px;font-size:.8rem;font-weight:800}.badge-buena,.badge-completado{background:#ddf7ed;color:#08705f;max-width: fit-content;}.badge-observacion{background:#fff4d6;color:#9a6200;max-width: fit-content;}.badge-tratamiento,.badge-en_tratamiento{background:#ffe8d6;color:#9a4b00;max-width: fit-content;}.form{display:grid;gap:1rem}.form label{display:grid;gap:.35rem;font-weight:700}.form input,.form select,.form textarea{width:100%;padding:.8rem;border:1px solid var(--line);border-radius:10px;font:inherit}.actions{display:flex;gap:.75rem;flex-wrap:wrap}.flash{padding:1rem;border-radius:12px;margin-bottom:1rem}.flash.ok{background:#ddf7ed;color:#07594e}.flash.err{background:#ffe1df;color:#9d241b}.cat-photo{width:180px;height:180px;object-fit:cover;border-radius:18px;border:1px solid var(--line)}.thumb{width:54px;height:54px;object-fit:cover;border-radius:10px;border:1px solid var(--line)}.timeline{display:grid;gap:1rem}.timeline-item{display:grid;grid-template-columns:100px 1fr;gap:1rem;border-left:3px solid var(--mint);padding-left:1rem}.app-footer{margin-top:2rem;position:relative}.footer-cat{height:120px;justify-self:end}@media(max-width:1100px){.hero{grid-template-columns:1fr}.metric-grid,.cards.six,.kpis{grid-template-columns:repeat(2,1fr)}.grid.two,.grid.three,.grid.four{grid-template-columns:1fr}.dashboard-preview{grid-template-columns:1fr}.preview-sidebar{display:none}.app-shell{grid-template-columns:1fr}.sidebar{position:fixed;left:-280px;top:74px;width:260px;z-index:20;transition:left .2s;box-shadow:var(--shadow)}.sidebar.open{left:0}.sidebar-toggle{display:inline-flex}.app-main{padding:18px}.footer,.app-footer{grid-template-columns:1fr}.footer-cat{display:none}}@media(max-width:720px){.public-nav{padding:0 16px}.nav-toggle{display:inline-flex}.nav-links{position:fixed;top:74px;left:0;right:0;background:#fff;border-bottom:1px solid var(--line);display:none;flex-direction:column;align-items:stretch;padding:1rem;box-shadow:var(--shadow)}.nav-links.open{display:flex}.hero{padding:38px 16px}.metric-grid,.cards,.cards.six,.kpis{grid-template-columns:1fr}.page-head{align-items:flex-start;flex-direction:column}.user-chip span:not(.avatar),.logout{display:none}.app-top{padding:0 12px}.app-main{padding:14px}.timeline-item{grid-template-columns:1fr}.cat-photo{width:100%;height:auto}.table{font-size:.9rem}.section{padding:28px 16px}.notice{margin:1rem 16px}.brand strong{font-size:1rem}}

/* Responsive y accesibilidad */
html,
body{
  max-width:100%;
  overflow-x:hidden;
}
body > *{
  max-width:100%;
}
:focus-visible{outline:3px solid rgba(34,182,166,.45);outline-offset:3px}
.btn:focus-visible,button:focus-visible,.button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid rgba(34,182,166,.45);outline-offset:2px}
@media(max-width:1100px){
  .sidebar{height:calc(100dvh - 74px);max-height:calc(100dvh - 74px);left:-290px;display:block;background:#fff}
  .sidebar.open{left:0}
  body.sidebar-open::after{content:"";position:fixed;inset:74px 0 0 0;background:rgba(15,36,55,.28);z-index:15}
  .sidebar{z-index:30}
  .app-top{z-index:40}
  .sidebar nav a{min-height:48px}
}
@media(max-width:720px){
  .dashboard-preview{display:none}
  .hero h1{font-size:2.2rem}
  .hero p{font-size:1rem}
  .hero-actions .btn{width:100%}
  .mini-benefits span{width:100%}
  .card{padding:1rem}
  .metric strong,.kpi strong{font-size:1.45rem}
  .actions{width:100%}
  .actions .btn,.actions .button{flex:1 1 100%}
  .app-top{height:66px}
  .app-shell{min-height:calc(100vh - 66px)}
  .sidebar{top:66px;height:calc(100dvh - 66px);max-height:calc(100dvh - 66px)}
  body.sidebar-open::after{inset:66px 0 0 0}
  .brand img{width:34px;height:34px}
  .sidebar-toggle{min-width:44px;min-height:44px}
  
}

/* Gráficas y paneles auxiliares */

.chart-canvas{width:100%;height:260px;display:block;border:1px solid var(--line);border-radius:14px;background:linear-gradient(180deg,#fff,#fbfdfc)}
.module-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}.soft-card{background:var(--soft);border:1px solid var(--line);border-radius:14px;padding:1rem}
@media(max-width:920px){.module-grid{grid-template-columns:1fr}.chart-canvas{height:220px}}
/* Papelera administrativa y acciones seguras */
.page-actions{display:flex;gap:.65rem;align-items:center;flex-wrap:wrap}.tabs{display:flex;gap:.65rem;flex-wrap:wrap;margin:0 0 1rem}.tabs a{padding:.75rem 1rem;border:1px solid var(--line);border-radius:999px;background:#fff;font-weight:800;color:var(--dark);text-decoration:none}.tabs a.active{background:var(--teal);color:#fff;border-color:var(--teal)}.inline-danger{display:inline-block;position:relative;margin-left:.35rem}.inline-danger summary{cursor:pointer;color:#9f1239;font-weight:800}.inline-danger[open]{z-index:20}.inline-danger form{position:absolute;right:0;top:1.8rem;width:min(320px,80vw);background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 45px rgba(15,61,58,.18);padding:1rem;display:grid;gap:.55rem}.inline-danger input{width:100%;padding:.7rem .8rem;border:1px solid var(--line);border-radius:10px}.btn.danger,.danger{border-color:#fecdd3!important;color:#9f1239!important;background:#fff1f2!important}.note{background:#f0fdfa;border-color:#ccfbf1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:780px){.inline-danger{display:block;margin:.5rem 0 0}.inline-danger form{position:static;width:100%;box-shadow:none;margin-top:.5rem}.page-actions{width:100%}.page-actions .btn{flex:1;text-align:center}}

/* Vista previa pública */
.public-preview {
  align-items: stretch;
}
.preview-sidebar strong {
  display: block;
  margin: 0 0 .25rem;
  font-size: 1.05rem;
  line-height: 1.15;
  color: var(--dark);
}
.preview-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .25rem;
}
.preview-sidebar li {
  margin: 0;
  padding: 0;
}
.preview-sidebar a {
  display: block;
  width: 100%;
  color: var(--muted);
  text-decoration: none;
  padding: .55rem .6rem;
  border-radius: .65rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: normal;
}
.preview-sidebar a:hover,
.preview-sidebar a:focus-visible {
  color: var(--teal);
  background: var(--mint);
}
.preview-content .grid.four .card {
  display: grid;
  gap: .2rem;
  align-content: center;
}
.preview-content .grid.four .card strong {
  font-size: 1.65rem;
  line-height: 1;
}
.preview-content .grid.four .card small {
  display: block;
  line-height: 1.25;
  color: var(--dark);
}
.public-preview {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
}
.public-preview .preview-sidebar {
  min-width: 0;
  gap: .45rem;
  padding: 1.15rem;
}
.public-preview .preview-sidebar strong {
  font-size: 1.2rem;
  margin-bottom: .35rem;
}
.public-preview .preview-sidebar a {
  padding: .42rem .55rem;
  font-size: .96rem;
  line-height: 1.15;
}
.public-preview .preview-content {
  min-width: 0;
}
.public-preview .preview-content > h3 {
  margin: .25rem 0 .5rem;
  font-size: 1.45rem;
  line-height: 1.15;
}
.public-preview .preview-content .grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.public-preview .preview-content .grid.four .card {
  min-width: 0;
  padding: .85rem;
  min-height: 106px;
  align-content: start;
  justify-items: start;
  grid-template-rows: auto 1fr;
  gap: .45rem;
}
.public-preview .preview-content .grid.four .card strong {
  font-size: 1.85rem;
  line-height: 1;
}
.public-preview .preview-content .grid.four .card small {
  align-self: start;
}
@media(max-width:1100px){
  .dashboard-preview.public-preview {
    grid-template-columns: 1fr;
  }
  .dashboard-preview.public-preview .preview-sidebar {
    display: flex;
    min-width: 0;
  }
  .preview-sidebar ul {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .preview-sidebar a {
    text-align: center;
    font-size: .92rem;
  }
}
@media(max-width:720px){
  .dashboard-preview.public-preview {
    display: none;
  }
}

/* Informes en widgets personalizables */
.reports-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  margin-bottom:1rem;
}
.reports-toolbar h2{margin:.1rem 0 .25rem;text-align:left}
.reports-toolbar p{margin:0;color:var(--muted)}
.reports-grid{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:1rem;
  align-items:start;
}
.report-widget{min-width:0;transition:box-shadow .2s, transform .2s}
.report-widget:hover{box-shadow:0 18px 50px rgba(15,36,55,.11)}
.span-4{grid-column:span 4}.span-5{grid-column:span 5}.span-6{grid-column:span 6}.span-7{grid-column:span 7}.span-8{grid-column:span 8}.span-12{grid-column:1 / -1}
.widget-head{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  align-items:flex-start;
  margin-bottom:.75rem;
}
.widget-head h2{margin:.1rem 0 .2rem;text-align:left;font-size:1.35rem}
.widget-head p{margin:0;color:var(--muted);font-size:.95rem;line-height:1.35}
.widget-actions{display:flex;gap:.35rem;flex-wrap:wrap;justify-content:flex-end;min-width:160px}
.widget-btn{
  border:1px solid var(--line);
  background:#fff;
  color:var(--dark);
  border-radius:999px;
  padding:.45rem .65rem;
  min-height:34px;
  font-size:.82rem;
  font-weight:800;
}
.widget-btn:hover,.widget-btn:focus-visible{border-color:var(--teal);color:var(--teal);background:var(--mint)}
.report-chart{height:330px}
.chart-canvas-xl{height:420px}
.span-12 .report-chart{height:440px}
.span-12 .chart-canvas-xl{height:520px}
.chart-legend{
  display:flex;
  gap:1rem 1.25rem;
  flex-wrap:wrap;
  align-items:center;
  margin:.8rem 0;
  color:var(--muted);
  font-size:.95rem;
  line-height:1.3;
  min-height:24px;
}
.chart-legend span{display:inline-flex;align-items:center;white-space:nowrap}
.legend-dot{width:12px;height:12px;border-radius:4px;display:inline-block;margin-right:.45rem;flex:0 0 12px}
.report-list{display:grid;gap:.65rem}
.report-list a{
  display:grid;
  gap:.2rem;
  padding:.85rem;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--soft);
}
.report-list a:hover,.report-list a:focus-visible{border-color:var(--teal);background:var(--mint)}
.report-list span{color:var(--muted);font-size:.9rem}
@media(max-width:1180px){
  .span-4,.span-5,.span-6,.span-7,.span-8{grid-column:span 6}
  .chart-canvas-xl{height:440px}
}
@media(max-width:760px){
  .reports-toolbar,.widget-head{flex-direction:column;align-items:stretch}
  .widget-actions{justify-content:flex-start;min-width:0}
  .reports-grid{grid-template-columns:1fr}
  .span-4,.span-5,.span-6,.span-7,.span-8,.span-12{grid-column:1 / -1}
  .report-chart,.span-12 .report-chart{height:300px}
  .chart-canvas-xl,.span-12 .chart-canvas-xl{height:420px}
  .chart-legend span{white-space:normal}
}
/* Inventario y gastos */
.table .btn{padding:.45rem .7rem;font-size:.85rem}
.kpis .kpi span{color:var(--muted)}
@media(max-width:720px){.kpis{grid-template-columns:1fr}.grid.two .form.grid.two{grid-template-columns:1fr}}

/* Cuenta de usuario */
.account-link{color:var(--teal);font-weight:800}
.field-help{display:block;color:var(--muted);font-weight:500;font-size:.9rem;line-height:1.35;margin-top:.25rem}
.account-grid{align-items:start}.account-dl{display:grid;grid-template-columns:130px 1fr;gap:.6rem 1rem;margin:0}.account-dl dt{font-weight:800;color:var(--muted)}.account-dl dd{margin:0}.soft-panel{background:linear-gradient(180deg,#fff,#f7faf9)}
.password-form input{max-width:520px}.span-12 .chart-canvas-xl[data-type="hbar_grouped"],.span-12 canvas[data-type="hbar_grouped"]{height:620px}canvas[data-type="hbar_grouped"]{height:500px}
@media(max-width:720px){.account-link{display:none}.account-dl{grid-template-columns:1fr}.password-form input{max-width:none}canvas[data-type="hbar_grouped"]{height:520px}.span-12 canvas[data-type="hbar_grouped"]{height:560px}}

/* Edición de perfil y usuarios */
.user-edit-form{display:grid;gap:1rem}
.user-edit-actions{display:flex;gap:.65rem;flex-wrap:wrap;margin-top:.25rem}
.user-actions{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
canvas[data-type="hbar_grouped"].chart-canvas-xl,
.report-chart.chart-canvas-xl{height:620px}
.span-12 canvas[data-type="hbar_grouped"].chart-canvas-xl,
.span-12 .report-chart.chart-canvas-xl{height:760px}
@media(max-width:1180px){canvas[data-type="hbar_grouped"].chart-canvas-xl,.report-chart.chart-canvas-xl{height:680px}}
@media(max-width:720px){canvas[data-type="hbar_grouped"].chart-canvas-xl,.report-chart.chart-canvas-xl{height:720px}.user-actions{display:grid}.user-actions .btn,.user-actions .button{width:100%}}
/* Mapa interno, solicitudes y reportes */
.map-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(280px,.8fr);gap:1rem;align-items:start}.map-card{padding:0;overflow:hidden;min-height:520px;position:relative}.internal-map{width:100%;height:clamp(520px,68vh,820px);min-height:520px;border-radius:var(--r);background:#e6f4f1;display:block;position:relative;z-index:1}.map-list{display:grid;gap:.75rem}.map-list a{display:grid;gap:.25rem;padding:.8rem;border:1px solid var(--line);border-radius:14px;text-decoration:none;color:inherit;background:#fff}.map-list small{color:var(--muted)}.mini-form{display:grid;gap:.35rem;min-width:220px}.mini-form select,.mini-form input{width:100%;padding:.5rem;border:1px solid var(--line);border-radius:10px}.badge-pendiente{background:#fff7ed;color:#9a3412}.badge-aprobada,.badge-comprada{background:#ecfeff;color:#155e75}.badge-entregada{background:#ecfdf5;color:#065f46}.badge-rechazada{background:#fef2f2;color:#991b1b}.badge-correcto{background:#ecfdf5;color:#065f46;max-width: fit-content;}.badge-necesita_revision{background:#fff7ed;color:#9a3412;max-width: fit-content;}.badge-urgente{background:#fef2f2;color:#991b1b;max-width: fit-content;}@media(max-width:900px){.map-layout{grid-template-columns:1fr}.map-card{min-height:460px}.internal-map{height:460px;min-height:460px}.mini-form{min-width:0}}

/* Leaflet local fallback CSS. */
.leaflet-container{position:relative;overflow:hidden;outline-offset:1px;touch-action:pan-x pan-y;background:#e6f4f1;font-family:inherit;}
.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0;}
.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none;}
.leaflet-tile{filter:inherit;visibility:hidden;border:0;}
.leaflet-tile-loaded{visibility:inherit;}
.leaflet-container img.leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container img.leaflet-image-layer{max-width:none!important;max-height:none!important;width:auto;height:auto;padding:0;}
.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important;}
.leaflet-tile-container{pointer-events:none;}
.leaflet-pane{z-index:400;}
.leaflet-tile-pane{z-index:200;}.leaflet-overlay-pane{z-index:400;}.leaflet-shadow-pane{z-index:500;}.leaflet-marker-pane{z-index:600;}.leaflet-tooltip-pane{z-index:650;}.leaflet-popup-pane{z-index:700;}
.leaflet-map-pane canvas{z-index:100;}.leaflet-map-pane svg{z-index:200;}.leaflet-vml-shape{width:1px;height:1px;}
.leaflet-control{position:relative;z-index:800;pointer-events:auto;float:left;clear:both;}
.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none;}
.leaflet-top{top:0;}.leaflet-right{right:0;}.leaflet-bottom{bottom:0;}.leaflet-left{left:0;}
.leaflet-right .leaflet-control{float:right;}.leaflet-top .leaflet-control{margin-top:12px;}.leaflet-bottom .leaflet-control{margin-bottom:12px;}.leaflet-left .leaflet-control{margin-left:12px;}.leaflet-right .leaflet-control{margin-right:12px;}
.leaflet-control-zoom{border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:var(--shadow);background:#fff;}
.leaflet-control-zoom a{display:block;width:42px;height:42px;line-height:42px;text-align:center;text-decoration:none;color:var(--dark);font-size:24px;font-weight:900;background:#fff;border-bottom:1px solid var(--line);}
.leaflet-control-zoom a:last-child{border-bottom:0;}.leaflet-control-zoom a:hover,.leaflet-control-zoom a:focus{background:#e6f4f1;color:var(--teal);outline:2px solid transparent;}
.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 24px/42px system-ui, sans-serif;}
.leaflet-control-attribution{background:rgba(255,255,255,.86);padding:.25rem .45rem;border-radius:10px;margin:0;color:var(--muted);font-size:.78rem;}
.leaflet-control-attribution a{color:var(--teal);}
.leaflet-interactive{cursor:pointer;}
.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px;}
.leaflet-popup-content-wrapper{background:#fff;border-radius:14px;box-shadow:var(--shadow);border:1px solid var(--line);padding:.25rem;}
.leaflet-popup-content{margin:.75rem .9rem;line-height:1.35;text-align:left;min-width:180px;}
.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;}
.leaflet-popup-tip{width:14px;height:14px;padding:1px;margin:-8px auto 0;background:#fff;transform:rotate(45deg);border:1px solid var(--line);box-shadow:var(--shadow);}
.leaflet-container a.leaflet-popup-close-button{position:absolute;top:4px;right:8px;border:0;text-align:center;width:24px;height:24px;font:18px/24px Tahoma,Verdana,sans-serif;color:var(--muted);text-decoration:none;background:transparent;}
.leaflet-container a.leaflet-popup-close-button:hover{color:var(--dark);}


/* Informes: selector global/por colonia */
.reports-mode-panel { margin-bottom: 1rem; }
.reports-mode-form { display: grid; grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto; gap: 1rem; align-items: end; }
.page-subhead { margin: 1rem 0; }
.page-subhead h2 { margin: 0 0 .35rem; }
.report-detail-grid .soft-card strong { display:block; font-size:1.5rem; color:var(--teal); }
@media (max-width: 820px) {
  .reports-mode-form { grid-template-columns: 1fr; }
}

/* Selector de coordenadas GPS en colonias */
.location-picker{display:grid;gap:1rem;padding:1rem;border:1px solid var(--line);border-radius:var(--r);background:#f8fbfa}
.location-picker-head{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;flex-wrap:wrap}
.location-picker h2{margin:0;font-size:1.25rem}.location-picker p{margin:.2rem 0 0;color:var(--muted)}
.coordinate-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.75rem;align-items:end}
.picker-map{width:100%;height:clamp(380px,54vh,620px);min-height:380px;border:1px solid var(--line);border-radius:18px;overflow:hidden;background:#e6f4f1;box-shadow:inset 0 0 0 1px rgba(255,255,255,.65)}
.picker-map .notice{margin:1rem}.button.ghost{background:#fff;color:var(--teal);border:1px solid var(--line)}
@media(max-width:760px){.coordinate-tools{grid-template-columns:1fr}.picker-map{height:420px}.location-picker{padding:.8rem}.location-picker-head{display:grid}.location-picker-head .button{width:100%}}

/* Indicadores alimentarios e instalación */
.compact-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.feeding-indicator .kpi strong { font-size: clamp(1.25rem, 2.4vw, 1.8rem); }
.badge-correcto, .badge-estable { background: #e6f4f1; color: #0b7d6d; max-width: fit-content;}
.badge-atencion { background: #fff4e5; color: #a15c00; max-width: fit-content;}
.badge-seguimiento { background: #eef4ff; color: #175cd3; max-width: fit-content;}

@media (max-width: 720px){ .compact-kpis { grid-template-columns: 1fr 1fr; } }

/* Soporte, comunicaciones y avisos */
.field-group{border:1px solid var(--line);border-radius:16px;padding:1rem;display:grid;gap:1rem;background:#fbfdfc}.field-group legend{font-weight:900;color:var(--teal);padding:0 .4rem}.notice-board{border-left:6px solid var(--teal)}.timeline-item.unread{background:#f4fbfa;border-radius:14px;padding-top:.75rem;padding-bottom:.75rem}.aud{display:none}.support-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1rem}.support-card h3{margin-top:0}.protocol-list li{margin:.7rem 0}.source-list{font-size:.95rem;color:var(--muted)}

/* Páginas legales públicas */
.legal-page{
  max-width:980px;
  margin:0 auto;
}
.legal-page h1{
  font-size:clamp(2rem,4vw,3rem);
  margin:0 0 .35rem;
}
.legal-page .card{
  margin-top:1rem;
}
.legal-page .card h2{
  text-align:left;
  font-size:1.35rem;
  margin-top:0;
}
.legal-page p,
.legal-page li{
  line-height:1.65;
}
.legal-page a{
  color:var(--teal);
  font-weight:800;
}
.legal-list{
  display:grid;
  grid-template-columns:160px 1fr;
  gap:.65rem 1rem;
  margin:0;
}
.legal-list dt{
  color:var(--muted);
  font-weight:800;
}
.legal-list dd{
  margin:0;
}
@media(max-width:720px){
  .legal-list{
    grid-template-columns:1fr;
    gap:.25rem;
  }
  .legal-list dd{
    margin-bottom:.7rem;
  }
}

/* Ajustes responsive del panel */
.app-top,
.app-shell,
.app-main,
.card,
.table-wrap,
.chart-canvas{
  min-width:0;
}
.table-wrap{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
.kpi{
  display:grid;
  gap:.25rem;
  align-content:start;
}
.kpi > span:not(.card-icon){
  color:var(--muted);
  font-weight:800;
  line-height:1.2;
}
@media(max-width:720px){
  .app-top{
    grid-template-columns:44px minmax(0,1fr) auto;
    display:grid;
    gap:.5rem;
    padding:0 12px;
  }
  .app-top .brand{
    justify-self:center;
    min-width:0;
    gap:.45rem;
  }
  .app-top .brand strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .user-chip{
    justify-self:end;
    gap:.35rem;
    align-items:center;
  }
  .user-chip .avatar,
  .user-chip .account-link[aria-label]{
    display:none;
  }
  .user-chip .account-link,
  .user-chip .logout{
    display:inline-flex;
    min-height:36px;
    align-items:center;
    padding:.35rem .45rem;
    border-radius:10px;
    font-size:.82rem;
    font-weight:900;
    line-height:1;
    white-space:nowrap;
  }
  .user-chip .account-link{
    color:var(--teal);
    background:var(--mint);
  }
  .user-chip .logout{
    color:#9d241b;
    background:#fff1f2;
  }
  .app-main{
    padding:18px 14px;
  }
  .page-head{
    gap:.85rem;
    margin-bottom:1rem;
  }
  .page-head h1{
    font-size:clamp(1.9rem,9vw,2.35rem);
    line-height:1.05;
  }
  .page-head p{
    margin:.35rem 0 0;
  }
  .page-head .btn,
  .page-head .button{
    width:auto;
    max-width:100%;
  }
  .kpis,
  .metric-grid,
  .compact-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.75rem;
  }
  .kpi,
  .metric{
    padding:.9rem;
    min-height:112px;
  }
  .card-icon{
    font-size:1.25rem;
    line-height:1;
  }
  .metric strong,
  .kpi strong{
    font-size:clamp(1.35rem,7vw,1.8rem);
    line-height:1.05;
    overflow-wrap:anywhere;
  }
  .card{
    padding:1rem;
    border-radius:16px;
  }
  .card h2{
    font-size:clamp(1.35rem,7vw,1.85rem);
    line-height:1.1;
    margin-top:0;
  }
  .table{
    min-width:640px;
    font-size:.86rem;
  }
  .table th,
  .table td{
    padding:.7rem .65rem;
  }
  .chart-legend{
    gap:.45rem .75rem;
    font-size:.86rem;
  }
  .chart-canvas{
    height:240px;
  }
  .actions .btn,
  .actions .button{
    min-height:46px;
  }
}
@media(max-width:380px){
  .kpis,
  .metric-grid,
  .compact-kpis{
    grid-template-columns:1fr;
  }
  .page-head .btn,
  .page-head .button{
    width:100%;
  }
}

/* Formularios compactos y códigos autogenerados */
.entity-form{
  max-width:920px;
  margin-inline:auto;
  gap:.85rem;
}
.form-grid-balanced.grid.two{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.form input:not([type="checkbox"]),
.form select{
  min-height:42px;
  height:42px;
  padding:.55rem .7rem;
}
.form textarea{
  min-height:84px;
  padding:.65rem .75rem;
  resize:vertical;
}

.readonly-code{
  display:grid;
  gap:.25rem;
  padding:.75rem .85rem;
  border:1px dashed var(--line);
  border-radius:12px;
  background:var(--soft);
}
.readonly-code strong{color:var(--muted);font-size:.9rem}
.readonly-code span{color:var(--teal);font-weight:900}
.compact-checks label:has(input[type="checkbox"]){
  display:flex;
  align-items:center;
  gap:.55rem;
  min-height:42px;
}
.compact-checks input[type="checkbox"]{
  width:18px;
  height:18px;
}
.general-notes{margin-bottom:1rem}
.general-notes p{margin:.35rem 0 0;line-height:1.5}
.photo-gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:1rem;align-items:start}
.photo-card{display:grid;gap:.65rem}
.photo-card .cat-photo{width:100%;height:120px;border-radius:12px}
.photo-card strong{display:block;font-size:.95rem}
.photo-card .badge{margin-top:.35rem}
.photo-delete{margin-top:1.2rem}
.photo-delete form{margin-top:.8rem}
.photo-edit-preview{width:100%;height:min(520px,55vw);border-radius:14px}
@media(max-width:760px){
  .entity-form{max-width:100%}
  .form-grid-balanced.grid.two{grid-template-columns:1fr}
  .form input:not([type="checkbox"]),
  .form select{height:40px;min-height:40px}
  .form textarea{min-height:76px}
}

/* Login privado: bloque único para evitar solapes y conflictos */
.login-page{
  min-height:100vh;
  min-height:100svh;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at top left, rgba(34,182,166,.12), transparent 34%),
    linear-gradient(135deg,#e6f4f1 0%,#fff 70%);
}
.login-card{
  width:min(520px,100%);
  min-height:auto;
  padding:42px 42px 34px;
  display:grid;
  gap:16px;
  align-content:start;
  justify-content:stretch;
  border:1px solid var(--line);
  border-radius:22px;
  background:#fff;
  box-shadow:0 24px 70px rgba(15,36,55,.12);
}
.login-card img{
  width:58px!important;
  height:auto;
  margin-bottom:6px;
}
.login-card h1{
  margin:0;
  font-size:clamp(2.25rem,4vw,3rem);
  line-height:1.05;
  letter-spacing:-.04em;
}
.login-card p{
  margin:0 0 6px;
  max-width:390px;
  font-size:1.05rem;
  line-height:1.45;
  color:var(--dark);
}
.login-card label{
  margin-top:4px;
  display:grid;
  gap:.4rem;
  font-weight:850;
  font-size:1rem;
}
.login-card input{
  width:100%;
  height:48px;
  min-height:48px;
  padding:.65rem .85rem;
  border:1px solid var(--line);
  border-radius:12px;
  font:inherit;
  background:#fff;
}
.login-card input:focus{
  border-color:var(--teal);
  box-shadow:0 0 0 4px rgba(11,125,109,.12);
  outline:0;
}
.login-card .button,
.login-card button,
.login-card input[type="submit"]{
  justify-self:center;
  width:min(280px,100%);
  min-width:0;
  min-height:52px;
  margin-top:8px;
  border-radius:12px;
  font-weight:850;
}
.login-card > a{
  justify-self:center;
  margin-top:2px;
  color:var(--teal);
  font-weight:850;
  text-align:center;
}
.login-card .muted{
  font-size:.95rem;
}
@media(max-width:720px){
  .login-page{
    padding:18px;
    place-items:center;
  }
  .login-card{
    width:100%;
    max-width:460px;
    padding:30px 24px;
    border-radius:20px;
    box-shadow:0 18px 50px rgba(15,36,55,.10);
  }
  .login-card h1{
    font-size:2.15rem;
  }
  .login-card p{
    font-size:1rem;
  }
  .login-card .button,
  .login-card button,
  .login-card input[type="submit"]{
    width:100%;
  }
}


/* Ajuste final logo Cats Beniel
   Versión pensada para el SVG con trazo más grueso.
   Va al final del CSS para que tenga prioridad sobre reglas anteriores. */

.brand{
  gap: .85rem;
}

.public-nav .brand img,
.app-top .brand img{
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.public-nav .brand strong,
.app-top .brand strong{
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.02em;
}

/* Logo de instalación y login */
.login-card img{
  justify-self: center;
  display: block;
  width: 82px !important;
  height: auto !important;
  object-fit: contain;
  margin-bottom: 8px;
}

/* Ajuste responsive del logo */
@media(max-width:720px){
  .public-nav .brand img,
  .app-top .brand img{
    width: 42px;
    height: 42px;
  }

  .public-nav .brand strong,
  .app-top .brand strong{
    font-size: 1.12rem;
  }

  .login-card img{
    width: 72px !important;
  }
}

/* Tablas y listados: evita lineas cortadas por contenido desbordado. */
.table{
  width:max-content;
  min-width:100%;
}
.table th,
.table td{
  vertical-align:middle;
}
.table th,
.table td:not(.actions){
  max-width:26rem;
  overflow-wrap:anywhere;
}
.table .actions{
  min-width:max-content;
  white-space:nowrap;
}
.table td.actions{
  display:table-cell;
}
.table .actions a,
.table .actions summary{
  display:inline-flex;
  align-items:center;
  min-height:36px;
}
.badge{
  align-items:center;
  line-height:1.1;
  white-space:nowrap;
}

@media(max-width:720px){
  .table{
    min-width:100%;
  }
  .responsive-list-table{
    width:100%;
    min-width:0;
    border-collapse:separate;
    border-spacing:0 .75rem;
  }
  .responsive-list-table tbody,
  .responsive-list-table tr,
  .responsive-list-table td{
    display:block;
    width:100%;
  }
  .responsive-list-table tr:first-child{
    display:none;
  }
  .responsive-list-table tr:not(:first-child){
    padding:.85rem;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fff;
  }
  .responsive-list-table td{
    display:grid;
    grid-template-columns:minmax(94px,.42fr) minmax(0,1fr);
    gap:.65rem;
    align-items:center;
    min-height:40px;
    padding:.55rem 0;
    border-bottom:1px solid var(--line);
  }
  .responsive-list-table td::before{
    content:attr(data-label);
    color:var(--muted);
    font-size:.82rem;
    font-weight:850;
    line-height:1.2;
  }
  .responsive-list-table td:last-child{
    border-bottom:0;
  }
  .responsive-list-table td.actions{
    display:flex;
    flex-wrap:wrap;
    gap:.35rem .65rem;
    white-space:normal;
  }
  .responsive-list-table td.actions::before{
    flex:0 0 100%;
  }
  .responsive-list-table .inline-danger{
    margin:0;
  }
  .responsive-list-table .inline-danger form{
    width:100%;
  }
  .responsive-list-table .thumb{
    width:64px;
    height:64px;
  }
}
