:root {
  --bg: #0a0a0f;
  --surface: #13131a;
  --surface2: #1a1a24;
  --border: #1e1e2e;
  --accent: #ff5c35;
  --accent2: #ff8a5c;
  --text: #f0f0f5;
  --muted: #8888aa;
  --success: #22c55e;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --sidebar-w: 220px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

.hidden { display: none !important; }
.screen { min-height: 100vh; }

/* ── AUTH ── */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.auth-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  color: var(--accent);
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-tagline {
  color: var(--muted);
  text-align: center;
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: color 0.2s;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.4rem; }

.form-group input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus { border-color: var(--accent); }
.form-group input::placeholder { color: var(--muted); }

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { transform: scale(0.98); }

.auth-divider {
  text-align: center;
  position: relative;
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.auth-divider::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  background: var(--bg);
  padding: 0 0.75rem;
  position: relative;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.8rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.btn-google:hover { border-color: var(--muted); }

.form-error {
  background: rgba(255,60,60,0.1);
  border: 1px solid rgba(255,60,60,0.3);
  color: #ff6060;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin-top: 1rem;
}

/* ── APP LAYOUT ── */
#app-screen {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0; left: 0; bottom: 0;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent);
  padding: 0 0.5rem;
  margin-bottom: 2rem;
}

.sidebar-nav { flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.75rem;
  background: none;
  border: none;
  border-radius: 0.5rem;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  text-align: left;
  margin-bottom: 0.25rem;
}

.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(255,92,53,0.1); color: var(--text); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-name { font-size: 0.85rem; font-weight: 500; }
.logout-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
}
.logout-btn:hover { color: var(--accent); }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2.5rem;
  max-width: 800px;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.view-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
}

/* STATUS CARDS */
.status-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.status-card.active { border-color: rgba(34,197,94,0.3); }

.status-icon { font-size: 1.5rem; flex-shrink: 0; }
.status-body { flex: 1; }
.status-body h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.2rem; }
.status-body p { color: var(--muted); font-size: 0.85rem; }

.btn-sm {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  color: var(--text);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s;
}

.btn-sm:hover { border-color: var(--accent); color: var(--accent); }

/* ROUTES SUMMARY */
.routes-summary { margin-top: 2rem; }
.routes-summary h2 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 1rem; }

.route-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.route-item-name { font-weight: 500; }
.route-item-meta { color: var(--muted); font-size: 0.8rem; margin-top: 0.2rem; }

.route-item-actions { display: flex; gap: 0.5rem; }

.btn-outline {
  background: none;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s;
  margin-top: 1rem;
  display: inline-block;
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
}

/* TEST SECTION */
.test-section { margin-top: 2rem; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 0.5rem; }

/* ROUTE FORM */
.route-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-top: 1.5rem;
}

.route-form h2 { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 1.5rem; }

.map-instructions { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.75rem; }

#route-map {
  height: 300px;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.coords-display {
  background: var(--surface2);
  border-radius: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-family: monospace;
}

/* SCHEDULE */
.schedule-section h3 { font-family: var(--font-display); font-size: 1rem; margin-bottom: 1rem; }

.schedule-options { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.radio-option input { accent-color: var(--accent); }

.badge {
  background: rgba(255,92,53,0.15);
  color: var(--accent2);
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.manual-schedule {
  background: var(--surface2);
  border-radius: 0.5rem;
  padding: 1.25rem;
}

.time-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.time-row label { width: 100px; color: var(--muted); font-size: 0.9rem; }

.time-row input[type="time"] {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
}

.time-row span { color: var(--muted); }

.days-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.days-row label { width: 100px; color: var(--muted); font-size: 0.9rem; }

.day-toggles { display: flex; gap: 0.4rem; }

.day-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
}

.day-btn.active {
  background: rgba(255,92,53,0.2);
  border-color: var(--accent);
  color: var(--text);
}

.form-actions { display: flex; gap: 1rem; margin-top: 2rem; }
.form-actions .btn-primary { width: auto; padding: 0.75rem 2rem; }

/* SETTINGS */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-section h2 { font-family: var(--font-display); font-size: 1rem; margin-bottom: 1.25rem; }

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.setting-row:last-of-type { border-bottom: none; }
.setting-row span:first-child { color: var(--muted); }

/* Mobile */
@media (max-width: 700px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 1.5rem; }
}
