:root{
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel2:#fbfcfe;
  --border:#e6e8ef;

  --text:#0f172a;
  --muted:#475569;
  --muted2:#64748b;

  --primary:#2563eb;
  --primary2:#1d4ed8;

  --green:#16a34a;
  --teal:#06b6d4;
  --amber:#f59e0b;
  --purple:#7c3aed;

  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow2: 0 16px 46px rgba(15, 23, 42, .12);

  --r12: 12px;
  --r16: 16px;
  --r20: 20px;
  --r24: 24px;
  --r28: 28px;

  --t: 180ms;
}

[data-theme="dark"]{
  --bg: #0b1220;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.10);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.72);
  --muted2: rgba(255,255,255,.55);

  --shadow: 0 18px 55px rgba(0,0,0,.28);
  --shadow2: 0 26px 76px rgba(0,0,0,.34);
}

*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background var(--t) ease, color var(--t) ease;
}

/* Background FX */
.bgfx{
  position:fixed;
  inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:-1;
}
.orb{
  position:absolute;
  width:520px;
  height:520px;
  border-radius:999px;
  filter: blur(55px);
  opacity:.32;
  animation: floaty 10s ease-in-out infinite;
}
.o1{ left:-150px; top:120px; background: rgba(37,99,235,.65); }
.o2{ right:-200px; top:30px; background: rgba(34,197,94,.55); animation-duration: 12s; }
.o3{ right:120px; bottom:-240px; background: rgba(6,182,212,.55); animation-duration: 14s; }
.noise{
  position:absolute;
  inset:-20%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  opacity:.06;
  transform: rotate(6deg);
}
@keyframes floaty{
  0%,100%{ transform: translate(0,0) scale(1); }
  50%{ transform: translate(18px,-14px) scale(1.03); }
}

/* Layout */
.layout{
  display:grid;
  grid-template-columns: 280px 1fr;
  min-height:100vh;
}
@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{ display:none; }
}

/* Sidebar */
.sidebar{
  background: linear-gradient(180deg, rgba(17,24,39,.95), rgba(17,24,39,.88));
  color: rgba(255,255,255,.92);
  padding:18px 16px;
  position:sticky;
  top:0;
  height:100vh;
  border-right: 1px solid rgba(255,255,255,.08);
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:10px 8px 16px;
}
.brand-logo{
  width:44px; height:44px;
  border-radius: 14px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, #2563eb, #22c55e);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
  position:relative;
  overflow:hidden;
}
.brand-logo::after{
  content:"";
  position:absolute;
  inset:-60%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  transform: rotate(25deg) translateX(-60%);
  animation: sheen 4.5s ease-in-out infinite;
}
@keyframes sheen{
  0%{ transform: rotate(25deg) translateX(-60%); }
  55%{ transform: rotate(25deg) translateX(120%); }
  100%{ transform: rotate(25deg) translateX(120%); }
}
.brand-name{ font-weight:900; letter-spacing:-.3px; }
.brand-sub{ font-size:12.5px; opacity:.75; margin-top:2px; }

.nav{
  display:grid;
  gap:8px;
  padding: 8px 4px 14px;
}
.nav-item{
  width:100%;
  display:flex;
  gap:10px;
  align-items:center;
  padding:12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.90);
  cursor:pointer;
  font-weight:800;
  transition: transform var(--t) ease, background var(--t) ease, box-shadow var(--t) ease;
}
.nav-item:hover{
  background: rgba(255,255,255,.10);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,.20);
}
.nav-item.active{
  background: rgba(37,99,235,.22);
  border-color: rgba(37,99,235,.35);
}

.sidebar-footer{ margin-top:auto; padding: 10px 4px 0; }

.mini-card{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 14px;
}
.mini-title{ font-weight:900; }
.mini-desc{ font-size:12.5px; opacity:.75; margin:6px 0 12px; }

.mini-meta{
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
  margin-top:14px;
  font-size:12px;
  opacity:.7;
}
.dot{ width:4px; height:4px; border-radius:99px; background: rgba(255,255,255,.7); }

.main{ display:flex; flex-direction:column; min-width:0; }

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px 22px;
  background: var(--panel);
  border-bottom:1px solid var(--border);
  box-shadow: var(--shadow);
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter: blur(10px);
}
.topbar-left{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}
.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:999px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  font-weight:900;
  font-size:12.8px;
  white-space:nowrap;
  transition: transform var(--t) ease;
}
.pill:hover{ transform: translateY(-1px); }

.search{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: var(--panel2);
  min-width: 520px;
  max-width: 720px;
  width: 55vw;
  transition: box-shadow var(--t) ease, transform var(--t) ease;
}
.search:focus-within{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
@media (max-width: 980px){
  .search{ min-width: 0; width: 70vw; }
  .pill{ display:none; }
}
.search i{ color: var(--muted2); }
.search input{
  border:none;
  outline:none;
  background: transparent;
  width:100%;
  color: var(--text);
  font-size: 14.6px;
}

.icon-btn{
  width:42px; height:42px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: var(--panel2);
  cursor:pointer;
  display:grid; place-items:center;
  color: var(--text);
  transition: transform var(--t) ease, box-shadow var(--t) ease;
}
.icon-btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 14px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  cursor:pointer;
  font-weight:900;
  text-decoration:none;
  transition: transform var(--t) ease, box-shadow var(--t) ease, filter var(--t) ease;
}
.btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-primary{
  background: linear-gradient(135deg, var(--primary), #22c55e);
  border-color: rgba(255,255,255,.14);
  color:white;
}
.btn-primary:hover{ filter: brightness(1.05); }
.btn-soft{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
}
.btn-ghost{
  background: transparent;
  border-color: var(--border);
}
.btn-sm{
  padding:10px 12px;
  font-size:12.8px;
  border-radius: 12px;
}
.w-full{ width:100%; }

.content{ padding: 22px; }

/* Hero */
.hero{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:14px;
}
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; }
}

.hero-left{
  background: linear-gradient(135deg, var(--panel), var(--panel2));
  border:1px solid var(--border);
  border-radius: var(--r28);
  box-shadow: var(--shadow);
  padding: 22px;
  position:relative;
  overflow:hidden;
}
.hero-left::after{
  content:"";
  position:absolute;
  inset:-60%;
  background: radial-gradient(circle at 30% 30%, rgba(37,99,235,.18), transparent 55%),
              radial-gradient(circle at 70% 40%, rgba(34,197,94,.14), transparent 55%);
  transform: rotate(8deg);
}
.h1{
  position:relative;
  margin:0;
  font-size: 30px;
  letter-spacing:-.6px;
  line-height:1.12;
}
.grad{
  background: linear-gradient(90deg, var(--primary), var(--teal), var(--green));
  -webkit-background-clip:text;
  background-clip:text;
  color: transparent;
}
.lead{
  position:relative;
  margin:10px 0 0;
  color: var(--muted);
  line-height:1.65;
  max-width: 880px;
}

.hero-actions{
  position:relative;
  margin-top:16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.hero-stats{
  position:relative;
  margin-top:16px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.stat{
  flex: 0 0 auto;
  min-width: 170px;
  background: var(--panel2);
  border:1px solid var(--border);
  border-radius: var(--r16);
  padding: 14px;
  transition: transform var(--t) ease, box-shadow var(--t) ease;
}
.stat:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stat-num{ font-weight:900; font-size: 18px; }
.stat-label{ margin-top:4px; font-size:12.7px; color: var(--muted2); }

.hero-right{
  background: linear-gradient(135deg, var(--panel), var(--panel2));
  border:1px solid var(--border);
  border-radius: var(--r28);
  box-shadow: var(--shadow);
  padding: 18px;
}
.spot-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.spot-title{ font-weight:900; display:flex; gap:10px; align-items:center; }
.spot-sub{ color: var(--muted2); font-size:12.8px; margin-top:4px; }
.spot-list{ margin-top:12px; display:grid; gap:10px; }

.spot-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px;
  border-radius: 18px;
  border:1px solid var(--border);
  background: var(--panel2);
  cursor:pointer;
  transition: transform var(--t) ease, box-shadow var(--t) ease;
}
.spot-item:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.spot-left{ display:flex; gap:12px; align-items:center; min-width:0; }
.spot-name{ font-weight:900; }
.spot-meta{ color: var(--muted2); font-size:12.5px; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Section */
.section{ margin-top:18px; }
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin: 18px 2px 12px;
  flex-wrap:wrap;
}
.h2{ margin:0; font-size: 18px; font-weight:900; }
.muted{ margin:6px 0 0; color: var(--muted); }

/* Subsections */
.subsection{
  margin-top: 14px;
}
.subhead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 10px 2px 10px;
  flex-wrap:wrap;
}
.subhead-left{ display:flex; flex-direction:column; gap:4px; }
.subtitle{
  font-weight:950;
  display:flex;
  gap:10px;
  align-items:center;
}
.subhint{ color: var(--muted2); font-size:12.6px; }
.count-pill{
  padding:10px 12px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  font-weight:900;
  font-size:12.8px;
}

/* Chips */
.chips{ display:flex; gap:8px; flex-wrap:wrap; }
.chips-mobile{ display:none; }
@media (max-width: 980px){
  .chips-mobile{ display:flex; }
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  cursor:pointer;
  font-weight:900;
  font-size: 12.8px;
  transition: transform var(--t) ease, box-shadow var(--t) ease;
}
.chip:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.chip.active{
  background: rgba(37,99,235,.14);
  border-color: rgba(37,99,235,.35);
  color: var(--primary);
}

/* Grid */
.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
@media (max-width: 1100px){
  .grid{ grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 680px){
  .grid{ grid-template-columns: repeat(1, 1fr); }
}

/* App cards */
.app-card{
  grid-column: span 3;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid var(--border);
  border-radius: var(--r24);
  box-shadow: var(--shadow);
  padding: 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  transition: transform var(--t) ease, box-shadow var(--t) ease;
  position:relative;
  overflow:hidden;
}
.app-card::before{
  content:"";
  position:absolute;
  inset:-60%;
  background: radial-gradient(circle at 30% 30%, rgba(37,99,235,.16), transparent 55%),
              radial-gradient(circle at 70% 40%, rgba(34,197,94,.12), transparent 55%);
  opacity:.0;
  transition: opacity var(--t) ease;
}
.app-card:hover{
  transform: translateY(-6px);
  box-shadow: var(--shadow2);
}
.app-card:hover::before{ opacity:1; }

@media (max-width: 1100px){
  .app-card{ grid-column: span 3; }
}
@media (max-width: 680px){
  .app-card{ grid-column: span 1; }
}

.app-head{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.app-identity{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.app-ico{
  width:46px; height:46px;
  border-radius: 16px;
  display:grid; place-items:center;
  background: rgba(37,99,235,.10);
  border:1px solid rgba(37,99,235,.18);
  color: var(--primary);
  flex:0 0 auto;
  transition: transform var(--t) ease;
}
.app-card:hover .app-ico{ transform: scale(1.03); }

/* Color by category */
.app-card[data-cat="operacion"] .app-ico{
  background: rgba(245,158,11,.12);
  border-color: rgba(245,158,11,.22);
  color: var(--amber);
}
.app-card[data-cat="ambiental"] .app-ico{
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.22);
  color: var(--green);
}
.app-card[data-cat="residencial"] .app-ico{
  background: rgba(124,58,237,.12);
  border-color: rgba(124,58,237,.22);
  color: var(--purple);
}

.badge{
  position:relative;
  font-size: 12px;
  font-weight:900;
  padding:6px 10px;
  border-radius: 999px;
  background: var(--panel2);
  border:1px solid var(--border);
  color: var(--muted2);
  white-space:nowrap;
}
.badge-fav{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(245,158,11,.35);
  background: rgba(245,158,11,.10);
  color: #b45309;
  font-weight:900;
  font-size:12px;
}

.app-title{
  position:relative;
  margin:0;
  font-weight:900;
  font-size: 14.9px;
  letter-spacing:-.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.app-meta{
  position:relative;
  font-size: 12.5px;
  color: var(--muted2);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  margin-top:2px;
}

.app-desc{
  position:relative;
  margin:0;
  color: var(--muted);
  font-size: 13.2px;
  line-height:1.55;
  min-height: 44px;
}

.tags{
  position:relative;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.tag{
  font-size:12px;
  color: var(--muted2);
  background: var(--panel2);
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius: 999px;
}

.app-actions{
  position:relative;
  margin-top:auto;
  display:flex;
  gap:10px;
}
.app-actions a{ flex:1; }

/* ===== Favoritos: botón estrella ===== */
.fav-btn{
  width:40px;
  height:40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel2);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform var(--t) ease, box-shadow var(--t) ease, filter var(--t) ease;
  color: var(--muted2);
}
.fav-btn:hover{
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.fav-btn.is-fav{
  color: #f59e0b;
  border-color: rgba(245,158,11,.35);
  background: rgba(245,158,11,.10);
}
.fav-btn.is-fav:hover{
  filter: brightness(1.03);
}

/* Footer */
.footer{ margin-top:18px; padding-bottom: 12px; }
.footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 4px;
  color: var(--muted2);
  flex-wrap:wrap;
}
.foot-badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  font-weight:900;
  font-size:12.6px;
}
.foot-muted{ color: var(--muted2); }

/* Modal */
.modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
  display:none;
  align-items:center;
  justify-content:center;
  padding:22px;
  z-index:50;
}
.modal.show{ display:flex; }

.modal-card{
  width:min(860px, 100%);
  background: var(--panel);
  border:1px solid var(--border);
  border-radius: var(--r28);
  box-shadow: var(--shadow2);
  overflow:hidden;
  animation: pop .16s ease;
}
@keyframes pop{
  from{ transform: translateY(10px) scale(.98); opacity:.0; }
  to{ transform: translateY(0) scale(1); opacity:1; }
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  border-bottom:1px solid var(--border);
}
.modal-title{ font-weight:900; }
.modal-body{ padding: 14px; display:grid; gap:10px; }

.quick-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 12px;
  border-radius: 18px;
  border:1px solid var(--border);
  background: var(--panel2);
  cursor:pointer;
  transition: transform var(--t) ease, box-shadow var(--t) ease;
}
.quick-row:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.quick-left{ display:flex; gap:12px; align-items:center; min-width:0; }
.quick-name{ font-weight:900; }
.quick-sub{ color: var(--muted2); font-size:12.5px; margin-top:2px; }

@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; }
}

/* ===============================
   LOGO EN TARJETAS (NUEVO)
   =============================== */

/* Imagen del logo: mismo tamaño y vibe que el ícono */
.app-logo{
  width:46px;
  height:46px;
  border-radius:16px;
  object-fit: cover;
  flex:0 0 auto;
  background: rgba(255,255,255,.85);
  border:1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
  transition: transform var(--t) ease, filter var(--t) ease, box-shadow var(--t) ease;
}

/* Hover igual que el ícono */
.app-card:hover .app-logo{
  transform: scale(1.03);
  box-shadow: var(--shadow2);
}

/* En modo dark el fondo/borde se ajusta */
[data-theme="dark"] .app-logo{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.14);
}

/* Opcional: aro suave por categoría */
.app-card[data-cat="operacion"] .app-logo{ border-color: rgba(245,158,11,.35); }
.app-card[data-cat="ambiental"] .app-logo{ border-color: rgba(34,197,94,.35); }
.app-card[data-cat="residencial"] .app-logo{ border-color: rgba(124,58,237,.35); }





