@font-face {
  font-family: "Quicksand";
  src: url("/assets/fonts/Quicksand-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --control-height: 42px;
  --ink: #17333a;
  --muted: #6d7d80;
  --paper: #f3f4ef;
  --panel: #fffefa;
  --line: #dfe4de;
  --nav: #123f4a;
  --teal: #247482;
  --mint: #b9d5c7;
  --gold: #e9b85b;
  --violet: #8f7aa5;
  --orange: #d87945;
  --shadow: 0 16px 40px rgba(22, 53, 58, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Quicksand", ui-sans-serif, system-ui, sans-serif; font-weight: 400; }
strong { font-weight: 600; }
a { color: inherit; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; padding: 30px 22px 22px; color: #eaf1ef; background: var(--nav); display: flex; flex-direction: column; z-index: 5; }
.brand { text-decoration: none; display: flex; align-items: center; gap: 13px; margin-bottom: 42px; }
.brand > span:last-child { display: grid; }
.brand strong { color: white; font-size: 21px; font-weight: 700; letter-spacing: -.03em; }
.brand small { color: #9fc0c1; font-size: 12px; letter-spacing: .09em; text-transform: uppercase; }
.brand-mark { width: 47px; display: grid; grid-template-columns: repeat(3, 15px); gap: 1px; }
.brand-mark i { width: 15px; height: 17px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); display: grid; place-items: center; color: white; font: 700 10px "Quicksand", sans-serif; font-style: normal; background: var(--teal); }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(5) { background: var(--violet); }
.brand-mark i:nth-child(3) { background: var(--orange); }
.brand-mark i:nth-child(4), .brand-mark i:nth-child(6) { background: #5c9b83; }
nav { display: grid; gap: 7px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 9px; color: #b9cbca; text-decoration: none; font-size: 14px; font-weight: 600; }
nav a:hover, nav a.active { color: white; background: rgba(255,255,255,.09); }
.nav-dot { width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; }
nav a.active .nav-dot { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233,184,91,.18); }
.sidebar-foot { margin-top: auto; padding: 15px 13px; border-top: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; gap: 10px; }
.sidebar-foot span:last-child { display: grid; }
.sidebar-foot strong { color: white; font-size: 12px; }
.sidebar-foot small { color: #98b3b4; margin-top: 3px; font-size: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #7ec79d; box-shadow: 0 0 0 4px rgba(126,199,157,.15); }
main { min-height: 100vh; margin-left: 244px; padding: 34px 44px 60px; }
.topbar { min-height: 55px; display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.eyebrow, .kicker { margin: 0 0 7px; color: var(--teal); font-size: 10px; line-height: 1; font-weight: 600; letter-spacing: .16em; }
h1 { margin: 0; font-family: "Quicksand", sans-serif; font-size: 31px; font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; }
.profile { display: flex; gap: 10px; align-items: center; }
.profile > span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: white; background: var(--teal); font-size: 12px; font-weight: 700; }
.profile div { display: grid; min-width: 0; }
.profile strong { font-size: 12px; }
.profile small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.profile-links { display: flex; flex-wrap: wrap; gap: 3px 10px; }
.hero { min-height: 286px; padding: 44px 52px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, .7fr); gap: 50px; align-items: center; color: white; border-radius: 18px; background: linear-gradient(125deg, #174c57 0%, #266d75 58%, #649a88 100%); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero:after { content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%; right: -130px; top: -170px; border: 1px solid rgba(255,255,255,.15); box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025); }
.hero > * { position: relative; z-index: 1; }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; background: rgba(255,255,255,.09); }
.hero h2 { max-width: 660px; margin: 19px 0 12px; font: 700 39px/1.08 "Quicksand", sans-serif; letter-spacing: -.035em; }
.hero > div > p { max-width: 630px; margin: 0 0 26px; color: #dce8e5; font-size: 14px; line-height: 1.65; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 18px; min-height: 43px; padding: 0 18px; border-radius: 8px; text-decoration: none; font-size: 12px; font-weight: 600; }
.button.primary { color: #17414b; background: #f5d381; }
.button.secondary { color: white; background: var(--teal); }
.formula-card { min-height: 188px; padding: 26px; border: 1px solid rgba(255,255,255,.24); border-radius: 15px; background: rgba(7,45,53,.32); backdrop-filter: blur(7px); display: flex; flex-direction: column; justify-content: center; }
.formula-card > span { color: #b9d5d1; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.formula-card strong { margin-top: 10px; font: 600 21px "Quicksand", sans-serif; }
.formula-card .division { display: flex; gap: 10px; align-items: baseline; margin: 10px 0 2px; }
.formula-card b { color: var(--gold); font-size: 22px; }
.formula-card em { color: white; font: normal 700 30px "Quicksand", sans-serif; }
.formula-card p { margin: 4px 0 0; color: #b8cfcb; font-size: 11px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.metrics article { min-height: 117px; padding: 20px 21px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: grid; align-content: start; box-shadow: 0 6px 20px rgba(22,53,58,.03); }
.metrics span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.metrics strong { margin: 9px 0 5px; font: 700 25px "Quicksand", sans-serif; }
.metrics small { color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.panel { padding: 27px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 8px 28px rgba(22,53,58,.04); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.panel-head h3 { margin: 0; font: 600 21px "Quicksand", sans-serif; }
.panel-head a { color: var(--teal); font-size: 11px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.step { color: var(--muted); font-size: 11px; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 23px; }
.step-row { min-height: 65px; display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; }
.step-row > b { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: #eef0eb; font-size: 10px; }
.step-row.active { border-color: #9fc8ca; background: #eff7f4; }
.step-row.active > b { color: white; background: var(--teal); }
.step-row span { display: grid; align-content: start; }
.step-row strong { font-size: 11px; font-weight: 600; }
.step-row small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.document-row { min-height: 66px; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; border-top: 1px solid var(--line); }
.doc-icon { width: 34px; height: 39px; display: grid; place-items: center; color: white; background: var(--orange); border-radius: 5px; font-size: 8px; font-weight: 700; }
.document-row div { display: grid; }
.document-row strong { font-size: 11px; }
.document-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.tag { padding: 5px 7px; color: #587074; background: #edf0ec; border-radius: 999px; font-size: 8px; font-weight: 600; text-transform: uppercase; }
.tag.green { color: #327059; background: #e5f2e9; }
.tag.amber { color: #866122; background: #fff1d4; }
.placeholder { min-height: 450px; display: grid; place-items: center; align-content: center; text-align: center; }
.placeholder .pill { color: var(--teal); border-color: var(--line); }
.placeholder h2 { margin: 20px 0 8px; font: 700 36px "Quicksand", sans-serif; }
.placeholder p { color: var(--muted); }
.placeholder .button { margin-top: 15px; }

button { border: 0; cursor: pointer; font: inherit; }
input, select, textarea { width: 100%; min-height: 42px; margin-top: 7px; padding: 0 12px; color: var(--ink); border: 1px solid #cad4ce; border-radius: 7px; background: white; font: inherit; font-size: 13px; }
input:not([type="checkbox"]), select { height: var(--control-height); min-height: var(--control-height); }
textarea { padding: 11px 12px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(36,116,130,.16); border-color: var(--teal); }
label { display: grid; align-content: start; color: var(--ink); font-size: 11px; font-weight: 500; }
label small, .source-note { margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.45; font-weight: 400; }
.form-grid { display: grid; gap: 20px 18px; margin-top: 22px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid > *, .inline > * { min-width: 0; }
.form-grid .wide { grid-column: span 2; }
.inline { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calc-form, .settings-form { display: grid; gap: 18px; }
.calc-form .panel, .settings-form .panel { box-shadow: none; }
.panel h3 { margin: 0 0 18px; font: 600 22px "Quicksand", sans-serif; }
.notice, .warning { margin: 0 0 18px; padding: 14px 16px; color: #305a5e; border: 1px solid #b8d6d1; border-radius: 9px; background: #edf7f3; font-size: 11px; line-height: 1.55; }
.warning { margin-top: 20px; color: #72551f; border-color: #eed59d; background: #fff8e9; }
.check { min-height: 42px; grid-template-columns: 18px 1fr; gap: 10px; align-items: center; align-content: center; }
.check input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--teal); }
.check span { display: grid; }
.sticky-submit { position: static; z-index: 3; padding: 15px 18px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #9bb8b5; border-radius: 12px; background: rgba(18,63,74,.96); color: white; box-shadow: 0 14px 35px rgba(16,49,55,.18); }
.sticky-submit > div { display: grid; }
.sticky-submit strong { font-size: 12px; }
.sticky-submit small { margin-top: 3px; color: #b8cfcb; font-size: 9px; }
.actions { display: flex; justify-content: flex-end; margin: -15px 0 27px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 0 12px 12px; color: var(--muted); text-align: left; text-transform: uppercase; letter-spacing: .07em; font-size: 9px; }
td { padding: 14px 12px; border-top: 1px solid var(--line); }
td a { color: var(--teal); text-decoration: none; }
.table-wrap td strong, .table-wrap td small { display: block; }
.table-wrap td strong + small { margin-top: 4px; }
.negative, .danger-card strong { color: #b13c35; }
.danger-card { border-color: #e7b5b0 !important; background: #fff6f5 !important; }
.empty { padding: 35px; color: var(--muted); text-align: center; }
.flash { margin: 0 0 18px; padding: 13px 16px; border-radius: 8px; font-size: 11px; }
.flash.success { color: #286247; background: #e7f4ea; border: 1px solid #badac4; }
.flash.error { color: #8c2f2b; background: #fff0ef; border: 1px solid #efc1bd; }
.summary-head { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; }
.summary-head h2 { margin: 10px 0 4px; font: 700 29px "Quicksand", sans-serif; }
.summary-head p { margin: 0; color: var(--muted); font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
dl { margin: 0; }
dl div { padding: 11px 0; display: flex; justify-content: space-between; border-top: 1px solid var(--line); font-size: 11px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 600; }
.legal { margin: 17px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.split { display: grid; grid-template-columns: minmax(280px,.65fr) minmax(360px,1.35fr); gap: 18px; align-items: start; }
.split form { display: grid; gap: 14px; }
.card-list { display: grid; gap: 0; }
.card-list article { padding: 16px 0; display: flex; justify-content: space-between; gap: 15px; align-items: center; border-top: 1px solid var(--line); }
.card-list article > span { display: grid; }
.card-list small { margin-top: 5px; color: var(--muted); }
.entity-list > article { display: block; }
.entity-card-head, .entity-card-head > span, .entity-documents-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.entity-card-head > span { align-items: flex-start; flex-direction: column; gap: 0; }
.entity-documents { width: 100%; margin-top: 14px; padding: 13px 14px; border-radius: 9px; background: var(--paper); }
.entity-documents-head { margin-bottom: 5px; }
.entity-documents-head > strong { font-size: 10px; }
.entity-document { min-height: 58px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 10px; align-items: center; border-top: 1px solid var(--line); }
.entity-document .doc-icon { width: 31px; height: 37px; font-size: 7px; }
.entity-document > div { min-width: 0; display: grid; }
.entity-document > div a { min-width: 0; color: var(--ink); text-decoration: none; }
.entity-document > div strong { display: block; overflow-wrap: anywhere; font-size: 10px; }
.entity-document small { overflow-wrap: anywhere; font-size: 8px; line-height: 1.45; }
.entity-document > a { color: var(--teal); font-size: 9px; font-weight: 600; white-space: nowrap; }
.entity-documents .empty { margin: 9px 0 2px; text-align: left; }
.toolbar { max-width: 650px; margin-bottom: 18px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.text-button { padding: 5px; color: #9c4942; background: transparent; font-size: 9px; text-decoration: underline; }
.row-actions, .summary-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.copy-link { color: var(--teal); font-size: 9px; font-weight: 600; }
.summary-actions form { margin: 0; }
.trash-row { padding: 14px 0; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); }
.trash-row > span { display: grid; }
.trash-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
#document-list .document-row { grid-template-columns: 40px 1fr auto 100px; }
#document-list .document-row > a { color: var(--teal); font-size: 10px; font-weight: 600; text-decoration: none; text-align: right; }
.document-row[hidden] { display: none; }
.profile a { margin-top: 3px; color: var(--muted); font-size: 9px; text-decoration: none; }
.admin-access-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; margin-top: 24px; }
.admin-access-grid form { display: grid; align-content: start; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfa; }
.admin-access-grid h4, .admin-access-grid p { margin: 0; }
.password-panel { max-width: 920px; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 22px; background: linear-gradient(140deg,#123f4a,#27727a); }
.auth main { min-height: auto; margin: 0; }
.auth-card { width: min(420px,100%); padding: 40px; border-radius: 17px; background: var(--panel); box-shadow: 0 28px 80px rgba(6,28,32,.3); }
.auth main.auth-card { padding: 40px; }
.auth-card h1 { margin-top: 28px; }
.auth-card > p { color: var(--muted); font-size: 12px; }
.auth-card form { margin-top: 24px; display: grid; gap: 16px; }
.auth-card .button { margin-top: 5px; }
.auth-brand { display: flex; align-items: center; gap: 9px; }
.auth-brand .bee { width: 35px; height: 39px; display: grid; place-items: center; color: white; background: var(--teal); clip-path: polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%); font-weight: 700; }
.auth-brand strong { font-size: 20px; }
.auth-brand small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.subtle-link, .dev-link { display: block; margin-top: 18px; color: var(--teal); font-size: 10px; text-align: center; }
.dev-link { padding: 10px; background: #fff4cf; border-radius: 6px; }

@media (max-width: 1050px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .hero { grid-template-columns: 1fr; }
  .formula-card { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .form-grid.three, .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-access-grid { grid-template-columns: minmax(0,1fr); }
  .form-grid .wide { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: auto; min-height: auto; padding: 24px 18px 20px; }
  .brand { margin-bottom: 28px; }
  .sidebar nav { grid-template-columns: 1fr 1fr; }
  .sidebar-foot { display: none; }
  main { margin: 0; padding: 24px 18px 45px; }
  .topbar { flex-wrap: wrap; gap: 16px; }
  .topbar > div:first-child { min-width: 0; }
  .profile { margin-left: auto; }
  .hero { padding: 32px 25px; }
  .hero h2 { font-size: 31px; }
  .metrics, .steps { grid-template-columns: 1fr; }
  .panel { padding: 20px; }
  .panel-head { flex-wrap: wrap; gap: 12px; }
  .form-grid.three, .form-grid.four, .detail-grid, .split { grid-template-columns: minmax(0, 1fr); }
  .form-grid .wide { grid-column: auto; }
  .inline { grid-template-columns: minmax(0, 1fr); }
  .actions { margin: 0 0 18px; justify-content: flex-start; }
  .summary-head, .sticky-submit { align-items: stretch; gap: 14px; flex-direction: column; }
  .summary-actions { align-items: stretch; flex-direction: column; white-space: normal; }
  .entity-document { grid-template-columns: 31px minmax(0,1fr); padding: 9px 0; }
  .entity-document > a { grid-column: 2; }
  #document-list .document-row { grid-template-columns: 40px 1fr auto; }
  #document-list .document-row > a { grid-column: 2 / -1; text-align: left; }
  .auth { padding: 16px; }
  .auth main.auth-card { padding: 28px 22px; }
}
