:root {
  --ink: #152722;
  --muted: #66746f;
  --paper: #f4f7f4;
  --surface: #ffffff;
  --line: #dfe7e2;
  --green: #0a6b50;
  --green-dark: #07523e;
  --green-soft: #e7f4ee;
  --amber: #ae6b13;
  --amber-soft: #fff2d9;
  --red: #a93b35;
  --red-soft: #fde9e7;
  --blue: #326da8;
  --blue-soft: #e8f1fa;
  --shadow: 0 18px 45px rgba(22, 50, 42, .08);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.muted { color: var(--muted); }
.form-error { min-height: 20px; margin: 0; color: var(--red); font-size: 13px; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(420px, .9fr); }
.login-story { position: relative; overflow: hidden; padding: clamp(42px, 7vw, 104px); display: flex; flex-direction: column; justify-content: space-between; color: white; background: #0b4e3d; }
.login-story::before { content: ""; position: absolute; inset: 0; opacity: .34; background-image: radial-gradient(circle at 20% 15%, #74c6a5 0 1px, transparent 1px), radial-gradient(circle at 78% 70%, #74c6a5 0 1px, transparent 1px); background-size: 34px 34px, 52px 52px; }
.login-story::after { content: ""; position: absolute; width: 540px; height: 540px; right: -250px; top: 18%; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.03), 0 0 0 150px rgba(255,255,255,.025); }
.login-story > * { position: relative; z-index: 1; }
.login-story .eyebrow { color: #9de1c5; }
.login-story h1 { max-width: 670px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5.8vw, 78px); line-height: .98; font-weight: 500; letter-spacing: -.045em; }
.story-copy { max-width: 580px; margin: 28px 0 0; color: #d5e9e1; font-size: 18px; line-height: 1.65; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 18px 18px 18px 5px; background: rgba(255,255,255,.12); color: white; font-family: Georgia, serif; font-size: 30px; }
.brand-mark.small { width: 42px; height: 42px; border: 0; border-radius: 13px 13px 13px 4px; background: var(--green); font-size: 22px; }
.privacy-note { display: flex; gap: 14px; max-width: 460px; padding: 18px 20px; border: 1px solid rgba(255,255,255,.16); border-radius: 16px; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); color: #dcece6; line-height: 1.5; }
.privacy-note strong { color: white; }
.privacy-icon { font-size: 24px; }
.login-panel { display: grid; place-items: center; padding: 40px; background: #f7f9f7; }
.login-card { width: min(430px, 100%); display: grid; gap: 24px; }
.login-card h2 { margin: 0; font-size: 32px; letter-spacing: -.035em; }
label { display: grid; gap: 8px; color: #34443f; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 13px 14px; border: 1px solid #ccd8d2; border-radius: 11px; outline: none; background: white; color: var(--ink); transition: border .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(10,107,80,.11); }
.button { min-height: 43px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; }
.button.primary { background: var(--green); color: white; box-shadow: 0 8px 20px rgba(10,107,80,.16); }
.button.primary:hover { background: var(--green-dark); }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.full { width: 100%; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 254px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fbfcfb; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.brand > div:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 18px; }
.brand span { margin-top: 5px; color: var(--muted); font-size: 12px; }
nav { display: grid; gap: 4px; }
.nav-item { width: 100%; padding: 11px 12px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 10px; background: transparent; color: #53625d; text-align: left; font-weight: 650; }
.nav-item > span { width: 20px; color: #72817c; font-size: 17px; text-align: center; }
.nav-item:hover { background: #f0f4f1; }
.nav-item.active { background: var(--green-soft); color: var(--green-dark); }
.nav-item.active > span { color: var(--green); }
.admin-nav { margin-top: 22px; display: grid; gap: 4px; }
.admin-nav > p { margin: 0 12px 5px; color: #96a29e; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.sidebar-status { margin-top: auto; padding: 14px 12px; display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--line); color: var(--ink); font-size: 12px; }
.sidebar-status div { display: grid; gap: 3px; }
.sidebar-status small { color: var(--muted); }
.status-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #28a77d; box-shadow: 0 0 0 4px #e3f5ee; }
.profile-button { width: 100%; padding: 12px 10px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); text-align: left; }
.profile-button:hover { background: #f0f4f1; }
.profile-button > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.profile-button strong, .profile-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button small { color: var(--muted); }
.avatar { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: #d9eae3; color: var(--green-dark); font-size: 11px; font-weight: 800; }

.workspace { min-width: 0; padding: 34px clamp(24px, 4vw, 58px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.topbar h1 { margin: 0; font-family: Georgia, serif; font-size: 36px; font-weight: 500; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.pill, .badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; white-space: nowrap; font-size: 12px; font-weight: 750; }
.pill { padding: 8px 11px; }
.pill.neutral { border: 1px solid var(--line); background: white; color: #5f6e69; }
.notice { margin: -12px 0 22px; padding: 13px 16px; border: 1px solid #cbded6; border-radius: 11px; background: #edf7f3; color: var(--green-dark); font-size: 13px; }
.notice.error { border-color: #f0c5c0; background: var(--red-soft); color: var(--red); }
.page-content { display: grid; gap: 24px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.metric-card { min-height: 150px; padding: 20px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 6px 24px rgba(20,48,40,.035); }
.metric-card.featured { color: white; border-color: transparent; background: var(--green); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; }
.featured .metric-label { color: #c7e5d9; }
.metric-value { font-family: Georgia, serif; font-size: 38px; line-height: 1; }
.metric-foot { color: var(--muted); font-size: 12px; }
.featured .metric-foot { color: #c7e5d9; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); gap: 20px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 6px 24px rgba(20,48,40,.035); overflow: hidden; }
.panel-header { padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.panel-header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.text-button { border: 0; background: transparent; color: var(--green); font-weight: 750; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 18px; background: #f8faf8; color: #7a8783; font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 14px 18px; border-top: 1px solid #edf1ee; vertical-align: middle; }
td strong { font-weight: 750; }
.subtext { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.badge { padding: 5px 8px; }
.badge.success { background: var(--green-soft); color: var(--green-dark); }
.badge.warning { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.neutral { background: #edf1ef; color: #60706a; }
.insight-list { padding: 6px 22px 18px; display: grid; gap: 4px; }
.insight { padding: 15px 0; display: grid; grid-template-columns: auto 1fr; gap: 12px; border-bottom: 1px solid #edf1ee; }
.insight:last-child { border-bottom: 0; }
.insight-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.insight strong { display: block; font-size: 13px; }
.insight p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.empty { padding: 46px 24px; color: var(--muted); text-align: center; }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); }

dialog { width: min(650px, calc(100vw - 30px)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 28px 90px rgba(12,40,31,.28); }
dialog::backdrop { background: rgba(13,34,28,.5); backdrop-filter: blur(3px); }
.dialog-card { display: grid; }
.dialog-card > header, .dialog-card > footer { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-card > header { border-bottom: 1px solid var(--line); }
.dialog-card > footer { justify-content: flex-end; border-top: 1px solid var(--line); background: #fafcfa; }
.dialog-card h2 { margin: 0; font-size: 22px; }
.dialog-body { padding: 22px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.dialog-body .wide { grid-column: 1 / -1; }
.dialog-body .checkbox-label { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: #f7faf8; cursor: pointer; }
.dialog-body .checkbox-label input[type="checkbox"] { width: 18px; height: 18px; margin: 1px 0 0; padding: 0; flex: 0 0 auto; accent-color: var(--green); }
.dialog-body .checkbox-label span { line-height: 1.45; }
.dialog-card > .form-error { padding: 0 24px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: #f0f3f1; color: #53635d; font-size: 22px; }
.result-dialog { width: min(980px, calc(100vw - 30px)); }
.result-card { display: grid; max-height: 90vh; }
.result-card > header, .result-card > footer { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.result-card > header { border-bottom: 1px solid var(--line); }
.result-card > footer { border-top: 1px solid var(--line); background: #fafcfa; }
.result-card > footer p { margin: 0; color: var(--muted); font-size: 12px; }
.result-card h2 { margin: 0; }
.result-content { min-height: 220px; padding: 24px; overflow: auto; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.identity-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.identity-photo { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); aspect-ratio: 3/4; }
.identity-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.identity-data { display: grid; gap: 22px; }
.identity-data section { display: grid; gap: 12px; }
.identity-data h3 { margin: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.identity-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.identity-item { min-width: 0; padding: 11px 12px; display: grid; gap: 4px; border-radius: 10px; background: #f7f9f7; }
.identity-item span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.identity-item strong { overflow-wrap: anywhere; font-size: 13px; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { min-height: 42vh; padding: 32px; }
  .login-story h1 { font-size: 44px; }
  .privacy-note { display: none; }
  .login-panel { padding: 42px 24px; }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding-bottom: 10px; }
  .sidebar nav { grid-template-columns: repeat(4, 1fr); overflow-x: auto; }
  .nav-item { justify-content: center; font-size: 0; }
  .nav-item span { font-size: 19px; }
  .admin-nav, .sidebar-status, .profile-button { display: none !important; }
  .brand { padding-bottom: 16px; }
  .workspace { padding: 24px 16px 50px; }
  .topbar { align-items: flex-end; }
  .environment-pill { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .dialog-body { grid-template-columns: 1fr; }
  .dialog-body .wide { grid-column: auto; }
  .identity-layout { grid-template-columns: 1fr; }
  .identity-photo { width: 150px; }
  .identity-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .topbar-actions .pill { display: none; }
}

