/* ── Login screen ───────────────────────────────────────────────────────────── */

#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-d) 0%, var(--accent) 100%);
}
.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.login-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.75rem;
}
.login-logo span {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.15rem;
}
#login-error {
  display: none;
  font-size: 0.8rem;
  color: var(--danger);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--r);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

/* ── App shell ──────────────────────────────────────────────────────────────── */

#app {
  display: none;
}

/* ── Topbar — contains brand, nav tabs, and sign-out ────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  display: grid;
  /* brand | tabs (grows to fill) | sign-out */
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  padding: 0 1.75rem;
  height: 56px;
  gap: 1.5rem;
}

.topbar-brand {
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

/* Nav tabs live inside the topbar, centered in the middle column */
.topbar-tabs {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
}

.tab {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2.5px solid transparent;
  font-family: inherit;
  transition:
    color 0.15s,
    border-color 0.15s;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ── Main content area ──────────────────────────────────────────────────────── */

.main {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.75rem;
}

.panel {
  display: none;
}
.panel.active {
  display: block;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}
.page-subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid var(--border);
  color: var(--primary-d);
}

/* ── Count badge ─────────────────────────────────────────────────────────────── */

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 20px;
  padding: 0.1rem 0.55rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* ── Password strength bar ───────────────────────────────────────────────────── */

.pw-strength {
  margin-top: 0.4rem;
  display: none;
}
.pw-strength-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 0.25rem;
}
.pw-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition:
    width 0.3s,
    background 0.3s;
  width: 0%;
}
.pw-strength-label {
  font-size: 0.7rem;
  color: var(--muted);
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .topbar {
    padding: 0 1rem;
    gap: 0.75rem;
  }
  .topbar-tabs {
    overflow-x: auto;
  }
  .tab {
    padding: 0 0.875rem;
    font-size: 0.8rem;
  }
}
