:root {
  color-scheme: light;
  --ink: #17241d;
  --muted: #62736a;
  --line: #dce5dc;
  --paper: #fff;
  --canvas: #f2f5f1;
  --green: #153d2b;
  --green-soft: #e8f0e9;
  --accent: #c28b45;
  --danger: #a13630;
  font-family: "IBM Plex Sans", Inter, ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: #155e40; }
.skip-link {
  position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px;
  transform: translateY(-160%); color: #fff; background: var(--green);
}
.skip-link:focus { transform: none; }
.auth-shell { min-height: 100svh; display: grid; align-content: center; justify-items: center; padding: 32px 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand span { display: grid; gap: 2px; }
.brand strong { font-size: 19px; letter-spacing: .08em; }
.brand small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.auth-shell > .brand { margin-bottom: 22px; }
.auth-card, .invite-card {
  width: min(100%, 480px); padding: clamp(24px, 5vw, 40px); border: 1px solid var(--line);
  border-radius: 20px; background: var(--paper); box-shadow: 0 16px 48px #183c2b12;
}
.eyebrow { margin: 0 0 9px; color: #57745f; font-size: 11px; font-weight: 800; letter-spacing: .15em; }
h1, h2, h3, p { margin-top: 0; }
.auth-card h1, .invite-card h1 { margin-bottom: 10px; font-size: clamp(28px, 5vw, 38px); line-height: 1.1; }
.intro { color: var(--muted); line-height: 1.65; }
.auth-mode { display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0; padding: 4px; border-radius: 11px; background: var(--canvas); }
.auth-mode button { min-height: 42px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-weight: 700; }
.auth-mode button[aria-pressed="true"] { color: var(--green); background: #fff; box-shadow: 0 1px 5px #17241d18; }
form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #26382c; font-size: 13px; font-weight: 700; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid #cbd7cd; border-radius: 9px;
  color: var(--ink); background: #fff;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid #b78441; outline-offset: 3px;
}
.captcha-box { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafcf9; }
.captcha-box p { margin: 0 0 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.button { min-height: 44px; padding: 11px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; }
.button--primary { color: #fff; background: var(--green); }
.button--primary:hover { background: #20553a; }
.button--secondary { color: var(--green); border-color: #b7c9b9; background: var(--green-soft); }
.button--quiet { min-height: 38px; color: var(--green); border-color: var(--line); background: #fff; }
.button--danger { color: #fff; background: var(--danger); }
.button:disabled { cursor: not-allowed; opacity: .6; }
.status { min-height: 1.25em; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.status[data-error="true"] { color: var(--danger); }
.auth-footnote { margin: 18px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.identity { padding: 12px; border-radius: 8px; background: var(--green-soft); font-weight: 700; }
.mfa-secret { display: grid; gap: 8px; margin: 18px 0; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fafcf9; }
.mfa-secret code { overflow-wrap: anywhere; color: var(--green); font-size: 16px; font-weight: 700; }
.mfa-secret span { color: var(--muted); font-size: 12px; }
.workspace { min-height: 100svh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; width: 260px; flex-direction: column;
  padding: 25px 18px 18px; color: #f4f7f3; background: var(--green);
}
.brand--sidebar { color: #fff; }
.brand--sidebar small { color: #c7d7ca; }
.sidebar-label { margin: 42px 10px 12px; color: #adc5b1; font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.workspace-nav { display: grid; gap: 5px; }
.workspace-nav button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 8px; color: #eaf2eb; background: transparent; text-align: left; }
.workspace-nav button:hover, .workspace-nav button[aria-current="page"] { color: #173a28; background: #f6f7f1; }
.workspace-nav button span { width: 20px; text-align: center; }
.sidebar-bottom { display: grid; grid-template-columns: 12px 1fr; gap: 9px; align-items: center; margin-top: auto; padding: 14px 5px 0; border-top: 1px solid #ffffff2a; color: #d8e6da; font-size: 11px; }
.sidebar-bottom button { grid-column: 2; justify-self: start; padding: 7px 0; border: 0; color: #fff; background: transparent; text-decoration: underline; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #80d5a1; }
.workspace-main { max-width: 1500px; min-height: 100svh; margin-left: 260px; padding: 34px clamp(20px, 4vw, 64px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.topbar .eyebrow { margin-bottom: 6px; }
.topbar h1 { margin: 0; font-size: clamp(27px, 4vw, 38px); }
.role-badge { padding: 8px 11px; border: 1px solid #cad8cc; border-radius: 99px; color: var(--green); background: #fff; font-size: 11px; font-weight: 800; }
.workspace-status { min-height: 1.5em; color: var(--muted); }
.panel { padding: clamp(20px, 3vw, 34px); border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: 0 12px 34px #17241d08; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: clamp(20px, 4vw, 42px); border-radius: 14px; color: #fff; background: linear-gradient(120deg, #153d2b, #276343); }
.welcome .eyebrow { color: #cbdacb; }
.welcome h2 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 34px); }
.welcome p:last-child { margin: 0; color: #e1ece1; }
.welcome-mark { color: #ffffff19; font-size: clamp(42px, 8vw, 90px); font-weight: 900; letter-spacing: -.08em; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 20px 0; }
.overview-card { padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.overview-card strong { display: block; margin-bottom: 7px; color: var(--green); font-size: 17px; }
.overview-card span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.notice { padding: 15px 17px; border-left: 3px solid var(--accent); color: #4a5d50; background: #faf6ef; font-size: 13px; line-height: 1.6; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.section-heading h2 { margin: 0 0 8px; font-size: clamp(24px, 4vw, 32px); }
.section-heading p:last-child { margin: 0; color: var(--muted); line-height: 1.6; }
.section-heading--list { align-items: center; margin: 34px 0 13px; }
.section-heading--list h3 { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid > h3 { margin: 0; }
.check-row { display: flex; grid-template-columns: 18px 1fr; align-items: start; gap: 10px; font-weight: 500; line-height: 1.5; }
.check-row input, .permission-set input { width: 17px; min-height: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--green); }
.permission-set { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 16px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; }
.permission-set legend { padding: 0 6px; color: var(--green); font-size: 13px; font-weight: 800; }
.permission-set label { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; line-height: 1.45; }
.record-list { display: grid; gap: 12px; }
.record-card { padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.record-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.record-card h3 { margin: 0 0 5px; font-size: 16px; overflow-wrap: anywhere; }
.record-card p { margin: 4px 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.record-card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.record-card .permission-set { margin-top: 12px; }
.record-card textarea, .record-card input { margin-top: 6px; }
.pill { display: inline-block; padding: 5px 8px; border-radius: 99px; color: #345b3e; background: var(--green-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.pill--pending { color: #875916; background: #fff4dc; }
.pill--danger { color: #8c2f2a; background: #fbe9e6; }
.empty-state { padding: 20px; color: var(--muted); border: 1px dashed #cbd7cd; border-radius: 10px; text-align: center; }
.form-error { color: var(--danger); }
@media (max-width: 860px) {
  .sidebar { position: static; width: auto; min-height: auto; padding: 13px 18px; }
  .sidebar-label, .sidebar-bottom { display: none; }
  .workspace-nav { display: flex; overflow-x: auto; margin-top: 12px; padding-bottom: 3px; }
  .workspace-nav button { flex: 0 0 auto; min-height: 40px; }
  .workspace-main { margin-left: 0; padding: 24px 16px 48px; }
}
@media (max-width: 560px) {
  .auth-shell { align-content: start; padding: 22px 12px; }
  .auth-shell > .brand { margin: 0 0 18px; }
  .auth-card, .invite-card { padding: 22px 18px; border-radius: 14px; }
  .form-grid { grid-template-columns: 1fr; padding: 14px; }
  .form-grid .wide { grid-column: 1; }
  .welcome-mark { display: none; }
  .section-heading, .record-card__top { align-items: flex-start; flex-direction: column; }
  .topbar { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
