:root {
  color-scheme: light;
  --ink: #17312f;
  --muted: #687a77;
  --brand: #176b61;
  --brand-dark: #104d46;
  --accent: #e8a94c;
  --paper: #ffffff;
  --canvas: #f3f5f2;
  --line: #dfe6e2;
  --danger: #ad3d3d;
  --shadow: 0 18px 60px rgba(28, 58, 54, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 .45rem; color: var(--brand); font-size: .75rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.brand-mark { display: grid; width: 3.2rem; height: 3.2rem; place-items: center; border-radius: 1rem; background: var(--accent); color: #2d291c; font-size: 1.55rem; font-weight: 900; box-shadow: 0 10px 30px rgba(232,169,76,.3); }
.brand-mark.small { width: 2.15rem; height: 2.15rem; border-radius: .7rem; font-size: 1rem; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); }
.auth-intro { padding: clamp(2rem, 8vw, 7rem); display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 18% 20%, #2a8076, transparent 35%), linear-gradient(145deg, #0f403b, #17322f); color: white; }
.auth-intro .eyebrow { margin-top: 3rem; color: #c9e8e3; }
.auth-intro h1 { max-width: 740px; margin: 0; font-size: clamp(2.5rem, 6vw, 5.8rem); line-height: .98; letter-spacing: -.055em; }
.auth-intro > p:not(.eyebrow) { max-width: 620px; color: #d5e3e0; font-size: 1.15rem; }
.feature-row { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 2rem; }
.feature-row span { padding: .65rem .85rem; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(255,255,255,.07); }
.auth-card { align-self: center; width: min(440px, calc(100% - 2rem)); margin: 2rem auto; padding: 2rem; border: 1px solid var(--line); border-radius: 1.4rem; background: var(--paper); box-shadow: var(--shadow); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; padding: .3rem; margin-bottom: 1.5rem; background: var(--canvas); border-radius: .8rem; }
.auth-tab { padding: .7rem; border: 0; border-radius: .6rem; background: transparent; color: var(--muted); }
.auth-tab.active { background: white; color: var(--ink); box-shadow: 0 3px 12px rgba(20,50,46,.08); font-weight: 750; }
.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .42rem; color: var(--muted); font-size: .88rem; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 2.8rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: .7rem; background: white; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23,107,97,.12); }
.primary, .secondary, .danger { min-height: 2.75rem; padding: .7rem 1rem; border-radius: .72rem; border: 0; font-weight: 750; }
.primary { background: var(--brand); color: white; }
.primary:hover { background: var(--brand-dark); }
.secondary { background: #e9efec; color: var(--ink); }
.danger { background: #fae8e8; color: var(--danger); }
.compact { min-height: 2rem; padding: .35rem .55rem; font-size: .78rem; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
hr { width: 100%; margin: 1rem 0; border: 0; border-top: 1px solid var(--line); }
.form-error { min-height: 1.3rem; color: var(--danger); font-size: .9rem; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 1.2rem; display: flex; flex-direction: column; gap: 1.5rem; background: #123c37; color: white; }
.brand { display: flex; align-items: center; gap: .8rem; font-weight: 850; }
.sidebar nav { display: grid; gap: .35rem; }
.nav-item { width: 100%; padding: .78rem .9rem; border: 0; border-radius: .72rem; background: transparent; color: #cfe1de; text-align: left; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.11); color: white; }
.logout { margin-top: auto; }
.workspace { min-width: 0; }
.topbar { min-height: 88px; padding: 1rem clamp(1rem, 3vw, 2.5rem); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.84); backdrop-filter: blur(12px); }
.topbar h2 { margin: 0; font-size: 1.55rem; }
.org-chip { display: grid; justify-items: end; gap: .15rem; }
.org-chip span { font-weight: 750; }
.org-chip small { color: var(--muted); }
.content { padding: clamp(1rem, 3vw, 2.5rem); }
.grid { display: grid; gap: 1rem; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { padding: 1.15rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--paper); box-shadow: 0 6px 24px rgba(28,58,54,.045); }
.card h3 { margin: 0 0 .8rem; }
.stat strong { display: block; margin-top: .35rem; font-size: 2rem; }
.stat span, .muted { color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 1rem; align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: .65rem; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.toolbar h3 { margin: 0; }
.list { display: grid; gap: .6rem; }
.list-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .85rem; border: 1px solid var(--line); border-radius: .8rem; background: white; }
.list-row strong { display: block; }
.list-row small { color: var(--muted); }
.badge { display: inline-flex; padding: .28rem .55rem; border-radius: 999px; background: #e7f2ef; color: var(--brand-dark); font-size: .76rem; font-weight: 750; }
.progress { height: .65rem; overflow: hidden; border-radius: 999px; background: #e4e9e6; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #35a795); }
.checklist { display: grid; gap: .55rem; margin-top: 1rem; }
.check { display: flex; gap: .55rem; align-items: center; color: var(--muted); }
.check.done { color: var(--ink); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .75rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .77rem; text-transform: uppercase; letter-spacing: .05em; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.toast { position: fixed; z-index: 20; right: 1rem; bottom: 1rem; max-width: min(420px, calc(100% - 2rem)); padding: .8rem 1rem; border-radius: .8rem; background: var(--ink); color: white; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }
.mobile-nav { display: none; }
.link-box { padding: .8rem; border: 1px dashed #9ab8b3; border-radius: .7rem; background: #f4faf8; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-intro { min-height: 44vh; padding: 2rem; }
  .auth-intro h1 { font-size: clamp(2.3rem, 11vw, 4rem); }
  .auth-intro .eyebrow { margin-top: 2rem; }
  .app-shell { display: block; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .mobile-nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(7, 1fr); padding: .45rem .1rem calc(.45rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
  .mobile-nav button { padding: .55rem .05rem; border: 0; background: transparent; color: var(--muted); font-size: .65rem; }
  .mobile-nav button.active { color: var(--brand); font-weight: 800; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .topbar { min-height: 76px; }
  .org-chip { display: none; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .auth-card { padding: 1.25rem; }
  .auth-intro .feature-row { display: none; }
  .list-row { align-items: flex-start; }
}
