/* Guardião — Painel da Família (dark theme) */
:root {
  --bg: #0f1419;
  --bg-card: #292e36;
  --bg-elev: #333944;
  --line: rgba(255, 255, 255, 0.12);
  --text: #e8ebe9;
  --text-muted: #9aa6a0;
  --green: #34c07c;
  --yellow: #eab308;
  --red: #ef4444;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-2xl: 2.5rem;
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.page { max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.error { color: var(--red); margin-top: 12px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-2xl);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 28px; }
.brand h1 { font-size: 1.4rem; font-weight: 700; }

.section-title {
  font-size: 1.5rem; font-weight: 700; color: var(--green);
  margin-bottom: calc(var(--space-lg) - 4px);
}

/* Login */
.login-card {
  max-width: 420px; margin: 10vh auto 0;
  background: var(--bg-card); border-radius: 16px; padding: 32px;
  display: flex; flex-direction: column; gap: 14px;
}
.login-card h2 { font-size: 1.3rem; }
input {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 12px 14px; font-size: 1rem; width: 100%;
  cursor: text;
}
input:focus { outline: 2px solid var(--green); border-color: transparent; }
.btn-primary {
  background: var(--green); color: #08130d; border: none; border-radius: 20px;
  padding: 12px 18px; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-muted {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 7px 18px; font-size: 0.85rem; cursor: pointer;
}

/* Cards de idoso (Type 2 — lista horizontal, gap --space-lg em alto contraste) */
#elders { display: flex; flex-direction: column; gap: var(--space-lg); }
.elder-card {
  background: var(--bg-card); border-radius: 14px; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px; min-height: 64px;
  cursor: pointer;
}
.elder-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; color: #08130d; flex-shrink: 0;
}
.elder-main { flex: 1; min-width: 0; }
.elder-name-row { display: flex; align-items: center; gap: 10px; }
.elder-name {
  font-weight: 600; font-size: 1.05rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Tag sempre inline ao lado do nome; 1 tag por card */
.tag {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 3px 10px; border-radius: 12px; white-space: nowrap;
}
.tag-ok { background: rgba(52, 192, 124, 0.18); color: var(--green); }
.tag-warn { background: rgba(234, 179, 8, 0.18); color: var(--yellow); }
.tag-bad { background: rgba(239, 68, 68, 0.18); color: var(--red); }
.elder-sub { color: var(--text-muted); font-size: 0.85rem; margin-top: 3px; }

.usage-wrap { width: 180px; flex-shrink: 0; }
.usage-bar {
  height: 8px; border-radius: 4px; background: var(--bg-elev); overflow: hidden;
}
.usage-fill { height: 100%; border-radius: 4px; background: var(--green); }
.usage-fill.warn { background: var(--yellow); }
.usage-fill.bad { background: var(--red); }
.usage-label { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }

/* 1 CTA no máximo, pill, seta à direita */
.cta {
  border-radius: 20px; padding: 7px 18px; font-weight: 600; font-size: 0.8rem;
  border: 1px solid; cursor: pointer; margin-left: 60px; flex-shrink: 0;
}
.cta-bad { background: var(--red); color: #fff; border-color: #fff; }
.cta-warn { background: var(--yellow); color: #fff; border-color: #fff; }

/* Painel expandido com instruções (box-shadow como divisor) */
.elder-help {
  background: var(--bg-card); border-radius: 0 0 14px 14px;
  margin-top: -14px; padding: 18px 20px 16px;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
  color: var(--text-muted); font-size: 0.9rem; line-height: 1.6;
}
.empty-state {
  background: var(--bg-card); border-radius: 14px; padding: 40px;
  text-align: center; color: var(--text-muted);
}
