:root {
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F5;
  --text: #1A1A1E;
  --muted: #6B7280;
  --border: #E5E7EB;
  --primary: #0EA5E9;
  --primary-dark: #0284C7;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --radius-card: 16px;
  --radius-btn: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #121214;
  --surface: #1A1A1E;
  --surface-2: #232329;
  --text: #F8F9FA;
  --muted: #9CA3AF;
  --border: #2F2F35;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

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

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

.nav button {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font: inherit;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav button:hover { background: var(--surface-2); transform: scale(1.01); }
.nav button.active { background: var(--primary); color: #fff; }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ghost-btn, .icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-btn);
  padding: 8px 12px;
  cursor: pointer;
  font: inherit;
}

.icon-btn { padding: 8px 10px; }

.main {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 80;
}

.dropdown.open { display: flex; }

.dropdown button {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font: inherit;
  transition: background 0.2s ease;
}

.dropdown button:hover { background: var(--surface-2); }

.hero {
  text-align: center;
  padding: 40px 24px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .topbar-actions { gap: 6px; }
  .dropdown { right: 0; left: auto; }
  .hero { padding: 24px 16px; }
}


.user-badge {
  color: var(--muted);
  font-size: 14px;
}

.view {
  display: grid;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover { transform: scale(1.01); }

.card h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.bento > * { grid-column: span 12; }

@media (min-width: 768px) {
  .bento > .span-4 { grid-column: span 4; }
  .bento > .span-6 { grid-column: span 6; }
  .bento > .span-8 { grid-column: span 8; }
  .bento > .span-12 { grid-column: span 12; }
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat .value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stat .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge.ok { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge.soon { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.badge.now { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

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

@media (min-width: 768px) {
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

input, select, textarea {
  padding: 10px 12px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

button.primary {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius-btn);
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

button.primary:hover { background: var(--primary-dark); transform: scale(1.02); }

button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th, .table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 500;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--surface-2);
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
  height: 16px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--text);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: var(--radius-btn);
  transition: transform 0.3s ease;
  z-index: 100;
  max-width: 90vw;
}

.toast.show { transform: translateX(-50%) translateY(0); }

.auth-card {
  max-width: 420px;
  margin: 40px auto;
}

@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 12px; gap: 12px; }
  .card { padding: 16px; }
  .topbar { position: sticky; top: 0; background: var(--bg); z-index: 10; padding-bottom: 8px; }
  .topbar h1 { font-size: 18px; }
  .nav button { min-height: 44px; }
  input, select, textarea, button { min-height: 44px; }
  .list-item { padding: 16px; }
  .table { font-size: 13px; }
  .dropdown { right: 0; left: auto; max-width: calc(100vw - 24px); }
}

.app-nav { display: contents; }

@media (min-width: 769px) {
  .app-nav { display: none; }
}

/* Business landing / hero refresh */
.hero {
  text-align: left;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.hero-copy h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.hero-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 6px;
}

.hero-media {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border-radius: 20px;
  background:
    radial-gradient(120% 100% at 85% 15%, rgba(14,165,233,.28), transparent 45%),
    radial-gradient(90% 80% at 15% 85%, rgba(16,185,129,.16), transparent 50%),
    linear-gradient(145deg, #0b1220, #0f172a 55%, #06111f);
  box-shadow: 0 24px 60px rgba(2,6,23,.28);
  border: 1px solid rgba(15,23,42,.08);
}

.hero-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .9;
}

.hero-media-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: #e5e7eb;
  background: linear-gradient(180deg, transparent 30%, rgba(2,6,23,.65));
}

.hero-media-overlay h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.hero-media-overlay p {
  margin: 4px 0 0;
  color: rgba(226,232,240,.88);
  font-size: 14px;
}

.hero-media-overlay small {
  margin-top: 8px;
  color: rgba(148,163,184,.85);
  font-size: 12px;
}

.feature-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.feature-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.stats-strip {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
}

.stats-strip .stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-strip .value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stats-strip .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 500;
}

.stats-strip p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.cta-card p {
  margin: 0;
  color: var(--muted);
}

.contact-form-card .muted {
  margin-top: 0;
  color: var(--muted);
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1.05fr .95fr;
  }
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cta-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  .hero-copy h2 { font-size: 26px; }
  .hero-media { min-height: 220px; }
}

