:root {
  --accent: #9B59B6;
  --accent-light: #C99FDD;
  --accent-dark: #6E3A82;
  --bg: #FAF8FC;
  --surface: #FFFFFF;
  --text: #2A2530;
  --text-muted: #7A7283;
  --border: #E8E1ED;
  --danger: #D9534F;
  --radius: 14px;
  --account-1: #9B59B6;
  --account-2: #5BA3D0;
  --account-3: #5FB88A;
  --account-4: #D9A24B;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

a { color: var(--accent-dark); }

header.topbar {
  padding: calc(env(safe-area-inset-top) + 14px) 18px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-dark);
}

main {
  flex: 1;
  padding: 16px;
}

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

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  width: 100%;
}

.btn:active { background: var(--accent-dark); }

.btn-secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent-light);
}

input, textarea, select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 1rem;
  margin-bottom: 12px;
  background: var(--surface);
  color: var(--text);
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent-light);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 6px;
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 8px;
  color: #fff;
  margin-right: 6px;
}

nav.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}

nav.tabbar a {
  flex: 1;
  text-decoration: none;
  color: var(--text-muted);
  text-align: center;
  padding: 10px 0 8px;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

nav.tabbar a svg { width: 22px; height: 22px; }

nav.tabbar a.active {
  color: var(--accent-dark);
}

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  text-align: center;
}

.login-box h1 {
  color: var(--accent-dark);
  margin-bottom: 4px;
}

.login-box p {
  color: var(--text-muted);
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.error-text {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-bottom: 8px;
}

.muted { color: var(--text-muted); font-size: 0.85rem; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
