:root {
  --forest-950: #0f302d;
  --forest-900: #123b35;
  --forest-700: #245e48;
  --forest-600: #37795f;
  --lime: #cef36d;
  --ink: #193330;
  --muted: #64766d;
  --line: #dce3dc;
  --canvas: #f3f5f0;
  --white: #fff;
  --warning: #9c3427;
  --success: #28572f;
  --shadow: 0 18px 50px rgba(19, 52, 48, .09);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font: 16px/1.5 "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #e9a635; outline-offset: 2px; }

.topbar { height: 72px; padding: 0 max(4vw, 24px); display: flex; align-items: center; gap: 40px; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; min-height: 36px; padding: 5px 15px 7px; border-radius: 8px; background: var(--forest-900); color: var(--white); font-size: 23px; font-weight: 800; letter-spacing: -1.5px; }
.brand-product { font-size: 16px; font-weight: 650; }
.main-nav { align-self: stretch; display: flex; align-items: stretch; gap: 24px; }
.main-nav a { display: flex; align-items: center; border-bottom: 3px solid transparent; color: #49615a; font-weight: 600; text-decoration: none; }
.main-nav a.active { color: var(--forest-700); border-color: var(--forest-600); }
.account-menu { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #e5eee7; color: var(--forest-700); font-weight: 750; }
.account-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.text-button { border: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.page-shell { width: min(1500px, 92vw); margin: 0 auto; padding: 30px 0 48px; }

.eyebrow { margin: 0 0 7px; color: #527364; font-size: 12px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow.light { color: #cbea81; }
.muted { color: var(--muted); }
.welcome { min-height: 210px; padding: 38px 44px; border-radius: 18px; display: flex; align-items: center; justify-content: space-between; gap: 32px; background: var(--forest-900); color: var(--white); box-shadow: var(--shadow); }
.welcome h1 { margin: 0; font-size: clamp(32px, 4vw, 52px); letter-spacing: -.05em; }
.welcome p:not(.eyebrow) { max-width: 660px; margin: 10px 0 0; color: #d5e2d9; font-size: 16px; }
.welcome-badge { width: 150px; height: 130px; border: 1px solid #527268; border-radius: 16px; display: grid; place-content: center; text-align: center; }
.welcome-badge strong { color: var(--lime); font-size: 44px; line-height: 1; }
.welcome-badge span { margin-top: 8px; color: #d5e2d9; font-size: 13px; }
.module-section { margin-top: 30px; }
.section-heading, .panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.section-heading h2, .panel-heading h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.module-card { min-height: 245px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; background: var(--white); color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.module-card:hover { transform: translateY(-3px); border-color: #b8cbbb; box-shadow: var(--shadow); }
.module-icon { width: 46px; height: 46px; margin-bottom: 24px; border-radius: 12px; display: grid; place-items: center; background: #e7f0df; color: var(--forest-700); font-size: 27px; }
.module-card strong { font-size: 22px; letter-spacing: -.03em; }
.module-description { margin-top: 8px; color: var(--muted); }
.module-link { margin-top: auto; padding-top: 18px; color: var(--forest-700); font-weight: 700; }
.module-link b { margin-left: 5px; font-size: 18px; }
.empty-state { padding: 48px 24px; border: 1px dashed #bcc9be; border-radius: 14px; background: rgba(255,255,255,.6); text-align: center; }
.empty-state.large { max-width: 720px; margin: 36px auto 0; padding: 70px 30px; }
.empty-state h1, .empty-state h2, .empty-state h3 { margin: 10px 0 5px; }
.empty-state p { max-width: 570px; margin: 0 auto 22px; color: var(--muted); }
.empty-icon { width: 48px; height: 48px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: #e7eee7; color: var(--forest-700); font-size: 24px; font-weight: 700; }

.login-page { background: var(--white); }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr); }
.login-intro { position: relative; overflow: hidden; padding: clamp(46px, 7vw, 100px); display: flex; flex-direction: column; justify-content: center; background: var(--forest-900); color: var(--white); }
.login-intro::after { content: ""; position: absolute; right: -150px; bottom: -190px; width: 520px; height: 520px; border: 1px solid rgba(206,243,109,.25); border-radius: 50%; box-shadow: 0 0 0 65px rgba(206,243,109,.025), 0 0 0 130px rgba(206,243,109,.02); }
.brand-mark-large { position: absolute; top: 48px; left: clamp(46px, 7vw, 100px); background: var(--white); color: var(--forest-900); }
.login-intro h1 { max-width: 690px; margin: 0; font-size: clamp(42px, 5.7vw, 76px); line-height: .99; letter-spacing: -.06em; }
.login-copy { max-width: 570px; margin: 25px 0 40px; color: #cfddd4; font-size: 17px; }
.login-detail { display: flex; align-items: center; gap: 10px; color: #adc3b8; font-size: 13px; }
.login-detail span { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgba(206,243,109,.12); }
.login-panel { padding: 40px; display: grid; place-items: center; background: #f7f8f4; }
.login-card { width: min(430px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: var(--shadow); }
.login-card h2 { margin: 0; font-size: 34px; letter-spacing: -.05em; }
.form-stack { margin-top: 27px; display: grid; gap: 9px; }
.form-stack label { margin-top: 7px; font-size: 14px; font-weight: 700; }
.form-stack input, .form-stack textarea, .contract-picker select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #b9c6bc; border-radius: 8px; color: var(--ink); background: var(--white); }
.primary-button { display: inline-flex; min-height: 43px; padding: 10px 18px; border: 0; border-radius: 8px; align-items: center; justify-content: center; background: var(--forest-700); color: var(--white); cursor: pointer; font-weight: 700; text-decoration: none; }
.primary-button:hover { background: #194d3a; }
.primary-button.wide { width: 100%; margin-top: 15px; }
.form-error { padding: 10px 12px; border-radius: 7px; background: #fae1db; color: var(--warning); font-size: 12px; }
.login-help { margin: 25px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.breadcrumb { margin-bottom: 18px; display: flex; gap: 9px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--forest-700); }
.cir-hero { min-height: 230px; padding: 33px 40px; border-radius: 17px; display: flex; align-items: center; justify-content: space-between; gap: 40px; background: var(--forest-900); color: var(--white); }
.cir-hero.compact { min-height: 190px; }
.cir-hero h1 { max-width: 870px; margin: 0; font-size: clamp(32px, 4vw, 50px); line-height: 1.02; letter-spacing: -.055em; }
.cir-hero h1 span { white-space: nowrap; }
.cir-hero p:not(.eyebrow) { margin: 10px 0 22px; color: #d2dfd6; }
.person-chip { display: inline-flex; padding: 7px 13px; border: 1px solid #66827a; border-radius: 20px; font-size: 13px; }
.cir-status { min-width: 250px; padding: 22px; border-left: 1px solid #4a6960; display: grid; }
.cir-status span { color: #bed0c4; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.cir-status strong { margin: 4px 0; color: var(--lime); font-size: 25px; }
.cir-status small { color: #bed0c4; }
.contract-picker { max-width: 420px; margin: 16px 0 0 auto; display: flex; align-items: center; gap: 10px; }
.contract-picker label { font-weight: 700; }
.metric-grid { margin: 16px 0 26px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-card { padding: 18px 21px; border: 1px solid var(--line); border-radius: 12px; display: grid; background: var(--white); }
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.metric-card strong { margin: 3px 0; font-size: 30px; letter-spacing: -.05em; }
.metric-card small { color: var(--muted); }
.data-panel { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--white); }
.panel-heading { margin: 0; padding: 20px 23px; }
.permission-actions { display: flex; gap: 7px; }
.access-tag { padding: 5px 8px; border-radius: 6px; background: #e8f0e5; color: var(--forest-700); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.table-scroll { overflow-x: auto; }
.goal-table { width: 100%; border-collapse: collapse; }
.goal-table th, .goal-table td { padding: 13px 14px; border-top: 1px solid #e4e9e3; text-align: left; white-space: nowrap; }
.goal-table th { background: #edf2eb; color: #496056; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.goal-table td:first-child { min-width: 240px; white-space: normal; }
.goal-table td small { display: block; margin-top: 3px; color: var(--muted); }
.goal-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.total-cell { font-weight: 750; }
.result-pill { display: inline-block; min-width: 72px; padding: 4px 7px; border-radius: 6px; text-align: center; font-weight: 700; }
.result-pill.positive { background: #dff0d8; color: var(--success); }
.result-pill.negative { background: #fae1db; color: var(--warning); }
.result-pill.neutral { background: #edf0ed; color: var(--muted); }
.table-empty { padding: 35px !important; color: var(--muted); text-align: center !important; }
.panel-footer { padding: 14px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.contract-picker select { appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, #49615a 50%), linear-gradient(135deg, #49615a 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.message { padding: 12px 15px; border: 1px solid #c9d7c4; border-radius: 8px; background: #edf5e8; }

.proposal-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.proposal-panel { padding: 24px; }
.proposal-panel h2 { margin: 0 0 16px; font-size: 22px; }
.proposal-panel .form-stack { margin: 0; }
.proposal-panel textarea { font: inherit; resize: vertical; }
.proposal-panel .primary-button { justify-self: start; margin-top: 12px; }
.field-help { margin: 0; color: var(--muted); font-size: 13px; }
.proposal-panel .errorlist { margin: 0; padding-left: 20px; color: var(--warning); }
.proposal-item { padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.proposal-item summary { cursor: pointer; font-weight: 700; }
.proposal-item summary + p { margin-top: 8px; }
.proposal-item dt { font-weight: 700; }
.proposal-item dd { margin: 4px 0 12px; white-space: pre-wrap; }

@media (max-width: 980px) {
  .proposal-layout { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 440px; }
  .login-panel { padding: 34px 20px; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { height: auto; min-height: 72px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; gap: 16px 24px; }
  .main-nav { order: 3; width: 100%; height: 42px; overflow-x: auto; }
}

@media (max-width: 650px) {
  .page-shell { width: 92vw; padding-top: 20px; }
  .brand-product, .account-name { display: none; }
  .welcome { padding: 28px 24px; align-items: flex-start; }
  .welcome-badge { display: none; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .module-grid, .metric-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 225px; }
  .cir-hero { padding: 27px 24px; align-items: flex-start; flex-direction: column; }
  .cir-status { width: 100%; padding: 18px 0 0; border-left: 0; border-top: 1px solid #4a6960; }
  .login-intro { min-height: 480px; padding: 110px 32px 55px; }
  .brand-mark-large { top: 35px; left: 32px; }
  .login-card { padding: 30px 24px; }
  .permission-actions { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

