:root{
  --primary:#2E7D5B;
  --primary-dark:#235f45;
  --bg:#F5F6F5;
  --surface:#FFFFFF;
  --text:#1C1C1E;
  --text-muted:#6B7280;
  --border:#E5E7EB;
  --danger:#DC2626;
  --success:#16A34A;
  --radius:14px;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-tap-highlight-color:transparent;
}

img{max-width:100%;display:block;}

.hidden{display:none !important;}

/* ---- Layout general del SPA ---- */
#app{
  max-width:480px;
  margin:0 auto;
  min-height:100vh;
  background:var(--bg);
  padding-bottom:70px; /* espacio para bottom nav */
  position:relative;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1rem 1.25rem;
  background:var(--surface);
  border-bottom:1px solid var(--border);
}
.topbar h2{font-size:1.05rem;margin:0;}
.topbar .avatar{
  width:36px;height:36px;border-radius:50%;
  background:var(--primary);color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-size:.85rem;font-weight:600;
}

.view-content{padding:1rem 1.25rem;}

.card{
  background:var(--surface);
  border-radius:var(--radius);
  padding:1rem;
  margin-bottom:.9rem;
  box-shadow:0 1px 3px rgba(0,0,0,.04);
  border:1px solid var(--border);
}

.tag{
  display:inline-block;
  font-size:.7rem;
  padding:.2rem .55rem;
  border-radius:999px;
  background:#EAF4EE;
  color:var(--primary-dark);
  font-weight:600;
}
.tag.warn{background:#FEF3E2;color:#B45309;}
.tag.danger{background:#FDEDED;color:var(--danger);}

.progress-bar{
  height:8px;border-radius:999px;background:var(--border);overflow:hidden;
}
.progress-bar span{display:block;height:100%;background:var(--primary);}

/* ---- Bottom nav ---- */
.bottom-nav{
  position:fixed;
  bottom:0;left:50%;
  transform:translateX(-50%);
  width:100%;
  max-width:480px;
  background:var(--surface);
  border-top:1px solid var(--border);
  display:flex;
  padding:.5rem 0 calc(.5rem + env(safe-area-inset-bottom));
}
.bottom-nav button{
  flex:1;
  background:none;
  border:none;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:.2rem;
  font-size:.68rem;
  color:var(--text-muted);
  cursor:pointer;
  padding:.3rem 0;
}
.bottom-nav button.active{color:var(--primary);font-weight:600;}
.bottom-nav .icon{font-size:1.15rem;}

.logout-link{
  font-size:.75rem;color:var(--danger);cursor:pointer;background:none;border:none;
}
