:root {
  --bg: #0b0d12;
  --bg-soft: #11141b;
  --card: #161a23;
  --card-hover: #1c212d;
  --border: #242a37;
  --text: #e7ebf3;
  --text-muted: #8a94a7;
  --accent: #7c9cff;
  --accent-2: #a28bff;
  --danger: #ff6b6b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7fb;
    --bg-soft: #ffffff;
    --card: #ffffff;
    --card-hover: #fafbff;
    --border: #e6e8ef;
    --text: #1a1f2b;
    --text-muted: #5b6478;
    --shadow: 0 8px 24px rgba(20,30,60,0.08);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.muted { color: var(--text-muted); }
.small { font-size: 12px; }

/* --- Login --- */

.auth-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124,156,255,0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(162,139,255,0.18), transparent 60%);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 26px 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-head { text-align: center; margin-bottom: 18px; }
.auth-head h1 { margin: 8px 0 4px; font-size: 22px; }
.auth-head .muted { font-size: 13px; }

.logo {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 16px rgba(124,156,255,0.35);
}

.form { display: grid; gap: 12px; margin-top: 10px; }

.field { display: grid; gap: 6px; }
.field span { font-size: 12px; color: var(--text-muted); }
.field input {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,156,255,0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: transform .05s ease, background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--card-hover); }

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}
.alert-error {
  color: var(--danger);
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.25);
}

/* --- Hub --- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-title { font-weight: 700; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
}
.user-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 3px rgba(52,199,89,0.2);
}

.content {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
.page-title { margin: 0 0 6px; font-size: 22px; }

.tiles {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: background .15s, transform .05s ease, border-color .15s;
}
.tile:hover {
  background: var(--card-hover);
  border-color: rgba(124,156,255,0.4);
}
.tile:active { transform: translateY(1px); }

.tile-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}
.tile-name { font-weight: 600; }
.tile-desc { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.tile-arrow { color: var(--text-muted); font-size: 18px; }
