.app-header{
  position:sticky;top:0;z-index:20;
  min-height:60px;
  display:flex;align-items:center;justify-content:space-between;
  padding:9px 14px 8px;
  background:rgba(247,249,248,.97);
  backdrop-filter:blur(14px);
  border-bottom:1px solid rgba(224,232,230,.7)
}
.app-title{
  margin:0;
  color:var(--primary-dark);
  font-size:1.42rem;
  font-weight:600;
  line-height:1;
  letter-spacing:-.01em
}
.header-actions{display:flex;align-items:center;gap:7px}
.icon-button{
  width:40px;height:40px;padding:0;
  border:1px solid var(--border);border-radius:13px;
  background:#fff;color:var(--primary);
  display:flex;align-items:center;justify-content:center
}
.icon-button svg{display:block}

.bottom-nav{
  position:fixed;left:50%;bottom:0;transform:translateX(-50%);
  width:100%;max-width:var(--max);height:var(--nav-h);
  background:rgba(255,255,255,.98);
  border-top:1px solid var(--border);
  display:grid;grid-template-columns:repeat(5,1fr);
  align-items:end;padding:7px 4px 7px;z-index:60
}
.nav-item{
  height:54px;
  padding:0;border:0;background:transparent;color:#778582;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-end;
  gap:5px;font-size:.66rem;line-height:1
}
.nav-item.active{color:var(--primary);font-weight:850}
.nav-icon{
  width:26px;height:26px;
  display:flex;align-items:center;justify-content:center
}
.nav-icon svg{display:block}
.nav-label{display:block;white-space:nowrap}
.nav-add{
  width:54px;height:54px;margin-top:-30px;
  border-radius:50%;
  background:var(--coral);color:#fff;
  display:flex;align-items:center;justify-content:center;
  position:relative;
  font-size:0;
  line-height:0;
  box-shadow:0 6px 14px rgba(255,111,89,.35);
  border:4px solid #fff
}
.nav-add::before,
.nav-add::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:19px;
  height:2.2px;
  border-radius:999px;
  background:currentColor;
  transform:translate(-50%,-50%)
}
.nav-add::after{
  transform:translate(-50%,-50%) rotate(90deg)
}


/* ==========================================================
   Layout de escritorio — sidebar en vez de bottom-nav.
   Solo se monta en el DOM cuando SSV.isDesktop es true, pero
   se acota también por media query como refuerzo defensivo.
   ========================================================== */
@media(min-width:1024px){
  .app-shell--desktop{
    display:flex;
    align-items:flex-start;
    min-height:100vh
  }

  .app-sidebar{
    position:sticky;
    top:0;
    flex-shrink:0;
    width:var(--sidebar-w);
    height:100vh;
    display:flex;
    flex-direction:column;
    padding:22px 14px;
    background:var(--surface);
    border-right:1px solid var(--border)
  }

  .app-sidebar-brand{
    display:flex;
    align-items:center;
    gap:10px;
    padding:0 8px 22px;
    color:var(--primary-dark);
    font-family:var(--font-display);
    font-weight:600;
    font-size:1.08rem
  }

  .app-sidebar-mark{
    width:34px;height:34px;
    border-radius:10px;
    background:var(--primary-soft);
    color:var(--primary);
    display:flex;align-items:center;justify-content:center;
    flex-shrink:0
  }

  .app-sidebar-items{
    display:flex;
    flex-direction:column;
    gap:4px
  }

  .sidebar-item{
    display:flex;
    align-items:center;
    gap:14px;
    padding:12px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:var(--muted);
    font-size:.92rem;
    font-weight:650;
    text-align:left
  }

  .sidebar-icon{
    width:22px;height:22px;
    display:flex;align-items:center;justify-content:center;
    flex-shrink:0
  }

  .sidebar-item.active{
    background:var(--primary-soft);
    color:var(--primary-dark)
  }

  .sidebar-item--report .sidebar-icon{
    color:var(--coral)
  }

  .app-content{
    flex:1;
    min-width:0
  }
}

html[data-theme="dark"] .app-sidebar{
  background:var(--surface);
  border-color:var(--border)
}

html[data-theme="dark"] .app-sidebar-mark{
  background:var(--theme-accent-soft);
  color:var(--theme-accent)
}

html[data-theme="dark"] .sidebar-item.active{
  background:var(--theme-accent-soft);
  color:var(--theme-accent)
}


.sheet-backdrop{
  position:fixed;
  inset:0;
  z-index:100;
  background:rgba(18,35,33,.30);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:12px
}

.sheet{
  width:100%;
  max-width:430px;
  background:#fff;
  border:1px solid rgba(220,229,227,.9);
  border-radius:24px;
  box-shadow:0 18px 48px rgba(20,55,51,.20)
}

.sheet-handle{
  width:38px;
  height:4px;
  margin:8px auto 6px;
  background:#d5dddb;
  border-radius:999px
}


/* ==========================================================
   Filtro único compacto para Inicio + Mapa — V29
   ========================================================== */

.report-filter-popover-layer{
  position:fixed;
  inset:0;
  z-index:5000;
  pointer-events:none
}

.report-filter-dismiss{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  padding:0;
  border:0;
  background:transparent;
  pointer-events:auto
}

.report-filter-popover{
  position:fixed;
  z-index:5001;
  width:min(270px,calc(100vw - 20px));
  padding:9px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.99);
  box-shadow:0 12px 28px rgba(18,50,46,.18);
  backdrop-filter:blur(10px);
  pointer-events:auto
}

.report-filter-popover-header{
  min-height:29px;
  padding:0 2px 6px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px
}

.report-filter-popover-header strong{
  font-size:.72rem
}

.report-filter-x{
  width:28px;
  height:28px;
  padding:0;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--muted);
  font-size:1rem
}

.report-filter-options{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:5px
}

.report-filter-chip{
  min-height:34px;
  padding:6px 7px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  display:grid;
  grid-template-columns:7px minmax(0,1fr) 13px;
  align-items:center;
  gap:5px;
  text-align:left;
  font-size:.6rem
}

.report-filter-chip:first-child{
  grid-column:1 / -1
}

.report-filter-chip.selected{
  border-color:var(--primary);
  background:var(--primary-soft);
  color:var(--primary-dark);
  font-weight:850
}

.report-filter-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#aebbb8
}

.report-filter-chip.lost .report-filter-dot{background:var(--coral)}
.report-filter-chip.found .report-filter-dot{background:var(--found)}
.report-filter-chip.abandoned .report-filter-dot{background:var(--gold)}
.report-filter-chip.adoption .report-filter-dot{background:var(--purple)}
.report-filter-chip.sighting .report-filter-dot{background:var(--blue)}
.report-filter-chip.sheltered .report-filter-dot{background:var(--sheltered)}

.report-filter-chip.all .report-filter-dot{
  background:linear-gradient(
    135deg,
    var(--coral) 0 33%,
    var(--primary) 33% 66%,
    var(--purple) 66%
  )
}

.report-filter-check{
  color:var(--primary);
  font-size:.68rem;
  font-weight:900
}

.report-filter-apply{
  width:100%;
  min-height:37px;
  margin-top:7px;
  border:0;
  border-radius:11px;
  background:var(--primary);
  color:#fff;
  font-size:.65rem;
  font-weight:900;
  box-shadow:0 5px 12px rgba(20,122,114,.12)
}

.icon-button[data-action="filters"]{
  position:relative
}

.icon-button[data-action="filters"].has-active-filter::after{
  content:"";
  position:absolute;
  right:5px;
  top:5px;
  width:7px;
  height:7px;
  border:2px solid #fff;
  border-radius:50%;
  background:var(--coral)
}

@media(max-width:330px){
  .report-filter-popover{
    width:calc(100vw - 16px)
  }
}
