:root {
  color-scheme: light;
  --ink: #18202b;
  --muted: #667085;
  --line: #d9e0ea;
  --main: #f4f7fb;
  --panel: #ffffff;
  --sidebar: #101723;
  --accent: #d93232;
  --accent-dark: #b82424;
  --blue: #2563eb;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--main); }
a { color: inherit; text-decoration: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--sidebar); color: white; padding: 22px; }
.brand { font-weight: 800; font-size: 20px; margin-bottom: 22px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a, .org-switcher select { border-radius: 8px; padding: 10px 12px; color: #e7edf6; background: transparent; border: 1px solid transparent; }
.sidebar a:hover { background: #1b2636; }
.org-switcher select { width: 100%; margin-bottom: 18px; border-color: #334155; }
.shell { margin-left: 248px; min-height: 100vh; padding: 24px; }
.public-shell { min-height: 100vh; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 28px; margin-bottom: 0; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0; }
.panel, .auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; box-shadow: 0 8px 24px rgba(16, 23, 35, 0.06); }
.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.span2 { grid-column: span 1; }
.hero { min-height: 56vh; display: grid; align-items: center; background: linear-gradient(135deg, rgba(16,23,35,0.92), rgba(24,32,43,0.72)), url("https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?auto=format&fit=crop&w=1600&q=80"); background-size: cover; background-position: center; color: white; border-radius: 8px; padding: 48px; margin-bottom: 18px; }
.hero h2 { max-width: 820px; font-size: 44px; line-height: 1.05; }
.hero p { max-width: 680px; color: #dbe4ef; }
.actions, .public-nav, .topbar-actions, .actions-cell, .inline-form { display: flex; align-items: center; gap: 12px; }
.actions-cell { flex-wrap: wrap; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.button, button.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent); color: white; font-weight: 700; cursor: pointer; }
.button:hover { background: var(--accent-dark); }
.ghost, .ghost-link { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.danger { border: 0; background: #991b1b; color: white; border-radius: 8px; padding: 10px 14px; cursor: pointer; font-weight: 700; }
.success { color: #047857; font-weight: 700; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 1040px; }
.auth-card { max-width: 460px; margin: 40px auto; display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; color: #344054; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; min-height: 40px; padding: 10px 12px; font: inherit; background: white; }
textarea { min-height: 100px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.wide { grid-column: 1 / -1; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: #eaf1ff; color: var(--blue); font-weight: 700; font-size: 12px; }
.muted { color: var(--muted); }
.error { color: var(--accent); font-weight: 700; }

@media (max-width: 860px) {
  .sidebar { position: static; width: auto; }
  .shell { margin-left: 0; }
  .topbar, .actions, .public-nav { align-items: flex-start; flex-direction: column; }
  .two, .three, .dashboard-grid, .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 28px; }
  .hero h2 { font-size: 32px; }
}
