@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Manrope:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

:root {
  color-scheme: dark;
  --surface: #131313;
  --surface-2: #171717;
  --surface-3: #1c1b1b;
  --surface-4: #201f1f;
  --surface-5: #2a2a2a;
  --border: rgba(217, 195, 173, 0.12);
  --border-strong: rgba(255, 161, 22, 0.22);
  --text: #e5e2e1;
  --text-soft: #d9c3ad;
  --text-muted: #9b8b7a;
  --accent: #ffa116;
  --accent-soft: #ffc78b;
  --accent-weak: rgba(255, 161, 22, 0.12);
  --blue: #94dbff;
  --blue-weak: rgba(148, 219, 255, 0.12);
  --green: #83d68d;
  --green-weak: rgba(131, 214, 141, 0.12);
  --red: #ff8b8b;
  --red-weak: rgba(255, 139, 139, 0.12);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-soft: 0 24px 48px rgba(0, 0, 0, 0.28);
  --shadow-accent: 0 0 0 1px rgba(255, 161, 22, 0.12), 0 20px 44px rgba(0, 0, 0, 0.32);
  --sidebar-width: 268px;
  --topbar-height: 76px;
  --font-display: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: 180ms ease;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(255, 161, 22, 0.1), transparent 28%),
    radial-gradient(circle at bottom left, rgba(255, 199, 139, 0.05), transparent 24%),
    var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after { box-sizing: border-box; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { border: 0; background: none; cursor: pointer; }
img { max-width: 100%; display: block; }
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 450, 'GRAD' 0, 'opsz' 24; line-height: 1; vertical-align: middle; }

.hidden { display: none !important; }

/* Shell */
.app-shell { display: flex; min-height: 100vh; }
.main, .main-content {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  z-index: 40;
  padding: 22px 18px 18px;
  background: rgba(19, 19, 19, 0.92);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 20px 0 40px rgba(0, 0, 0, 0.22);
}

.sidebar-logo-area, .brand, .topbar-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-brand, .topbar-logo, .brand-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--accent);
}

.sidebar-sub, .topbar-tagline, .brand-copy p {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-section-label, .nav-label, .eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-nav, .nav-group, .topbar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav, .nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav-item a, .nav-item, .topbar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text-soft);
  transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
}

.sidebar-nav-item a:hover, .nav-item:hover, .topbar-nav a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transform: translateX(2px);
}

.sidebar-nav-item a.active, .nav-item.active, .topbar-nav a.active {
  background: linear-gradient(90deg, rgba(255, 161, 22, 0.16), transparent);
  color: var(--accent);
  border: 1px solid rgba(255, 161, 22, 0.15);
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-footer, .sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-user, .sidebar-user-copy, .sidebar-user-copy strong, .sidebar-user-copy span {
  min-width: 0;
}

.sidebar-user, .topbar-avatar, .avatar {
  border-radius: 18px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.avatar, .topbar-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--accent-weak);
  color: var(--accent);
  border: 1px solid rgba(255, 161, 22, 0.18);
  font-weight: 800;
  font-family: var(--font-display);
}

.sidebar-user-copy strong, .profile-name-display {
  display: block;
  color: var(--text);
}
.sidebar-user-copy span, .profile-email-display {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  height: var(--topbar-height);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: rgba(28, 27, 27, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.topbar-copy { display: flex; flex-direction: column; gap: 4px; }
.topbar-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topbar-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  padding: 0 14px;
  height: 44px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.topbar-search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search:focus-within { border-color: rgba(255, 161, 22, 0.26); box-shadow: 0 0 0 4px rgba(255, 161, 22, 0.08); }
.topbar-icon-btn, .icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.topbar-icon-btn:hover, .icon-btn:hover { background: var(--surface-3); color: var(--text); }

/* Cards and page structure */
.page, .auth-page {
  padding: 24px;
}
.page {
  display: none;
}
.page.active { display: block; }
.page-section + .page-section { margin-top: 24px; }
.card, .card-low, .auth-card, .info-card, .metric-card, .hero-card, .highlight-panel {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(32,31,31,0.96), rgba(28,27,27,0.94));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.card, .card-low { padding: 22px; }
.card { position: relative; overflow: hidden; }
.card-low { background: rgba(28,27,27,0.8); }
.highlight-panel { border-color: rgba(255, 161, 22, 0.18); box-shadow: var(--shadow-accent); }

.hero-grid, .content-grid, .metric-grid, .card-grid, .hero-stats {
  display: grid;
  gap: 16px;
}
.hero-grid { grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.95fr); align-items: stretch; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.content-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }

.hero-title, .hero-greeting, .block-title {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}
.hero-title, .hero-greeting { font-size: clamp(2rem, 4vw, 3.45rem); line-height: 0.98; }
.hero-name, .accent, .text-primary-container { color: var(--accent); }
.hero-text, .hero-sub, .block-subtitle, .muted { color: var(--text-muted); }
.hero-text, .hero-sub { font-size: 1rem; max-width: 60ch; }
.block-title { font-size: 1.15rem; }
.block-subtitle { font-size: 0.92rem; }

.eyebrow, .stat-label, .metric-label, .input-label { color: var(--text-muted); }
.stat-value, .metric-value { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 900; letter-spacing: -0.05em; line-height: 1; }
.stat-value.accent, .metric-value.accent { color: var(--accent); }
.metric-value.blue { color: var(--blue); }
.metric-value.green { color: var(--green); }
.metric-sub, .stat-sub, .text-muted { color: var(--text-muted); font-size: 0.82rem; }

.btn, .button, .social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 16px;
  font-weight: 700;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #2b1700;
  box-shadow: 0 18px 30px rgba(255, 161, 22, 0.22);
}
.btn-outline, .btn-secondary, .btn-ghost, .social-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(255,139,139,0.12); color: var(--red); border: 1px solid rgba(255,139,139,0.18); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.85rem; }
.btn-lg { min-height: 52px; padding: 0 20px; font-size: 1rem; }

.input-group { display: grid; gap: 8px; }
.input-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.input-field, .select-field, textarea {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
}
.select-field {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.input-icon { color: var(--text-muted); }

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
}

.empty-state {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(217, 195, 173, 0.18);
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  text-align: center;
}
.empty-state .material-symbols-outlined { font-size: 2rem; color: var(--accent); }

/* Auth / login */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.auth-page::before, .auth-page::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(70px);
  z-index: 0;
}
.auth-page::before {
  width: 28rem; height: 28rem; left: -8rem; top: -8rem; background: rgba(255,161,22,0.07);
}
.auth-page::after {
  width: 22rem; height: 22rem; right: -6rem; bottom: -6rem; background: rgba(148,219,255,0.05);
}
.auth-card {
  width: min(1120px, calc(100vw - 32px));
  min-height: 760px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.88fr);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.auth-left, .auth-right {
  padding: 32px;
}
.auth-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at top right, rgba(255,161,22,0.1), transparent 30%),
    radial-gradient(circle at bottom left, rgba(148,219,255,0.05), transparent 34%),
    linear-gradient(180deg, rgba(24,24,24,0.95), rgba(18,18,18,0.95));
  border-right: 1px solid var(--border);
}
.auth-left-glow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,161,22,0.06);
  pointer-events: none;
}
.auth-right { background: rgba(28,27,27,0.98); }
.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  color: var(--text-soft);
  width: fit-content;
}
.auth-tab { color: var(--text-muted); }
.auth-tab.active { color: var(--accent); border-bottom: 2px solid var(--accent); }
.auth-tab:not(.active) { border-bottom: 2px solid transparent; }
.error-msg {
  background: rgba(147,0,10,0.15);
  border: 1px solid rgba(147,0,10,0.3);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--red);
  margin-bottom: 16px;
}
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
.eye-btn {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.eye-btn:hover { color: var(--text); }

/* Utilities used across current templates */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.text-sm { font-size: 0.875rem; }
.font-semibold { font-weight: 600; }

/* Mobile responsiveness */
@media (max-width: 1100px) {
  .auth-card { grid-template-columns: 1fr; min-height: auto; }
  .auth-left { display: none; }
  .hero-grid, .content-grid, .metric-grid, .card-grid { grid-template-columns: 1fr; }
  .topbar-search { min-width: 0; width: 100%; }
  .topbar { left: 0; padding: 0 16px; }
  .sidebar { transform: translateX(-100%); }
  .main, .main-content { margin-left: 0; }
}

@media (max-width: 720px) {
  .topbar-nav { display: none; }
  .topbar { height: 70px; }
  .page, .auth-page { padding: 16px; }
  .card, .card-low { padding: 18px; }
}
