:root {
  --ink: #17211d;
  --muted: #68746f;
  --paper: #f4f6f3;
  --surface: #ffffff;
  --line: #dfe5e1;
  --green: #176b4a;
  --green-dark: #0f5037;
  --green-soft: #e8f4ee;
  --gold: #c59a4b;
  --shadow: 0 16px 40px rgba(23, 43, 34, .08);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
.btn { border-radius: .7rem; font-weight: 700; }
.btn-primary { --bs-btn-bg: var(--green); --bs-btn-border-color: var(--green); --bs-btn-hover-bg: var(--green-dark); --bs-btn-hover-border-color: var(--green-dark); --bs-btn-active-bg: var(--green-dark); }
.btn-outline-primary { --bs-btn-color: var(--green); --bs-btn-border-color: #92b9a7; --bs-btn-hover-bg: var(--green); --bs-btn-hover-border-color: var(--green); }
.btn-light { --bs-btn-bg: #eef1ef; --bs-btn-border-color: #e4e8e5; --bs-btn-hover-bg: #e2e7e3; }
.form-control, .form-select { min-height: 44px; border-radius: .65rem; border-color: #cfd7d2; padding: .65rem .8rem; }
.form-control:focus, .form-select:focus { border-color: #5a9f80; box-shadow: 0 0 0 .22rem rgba(23, 107, 74, .13); }
.form-label { color: #33423b; font-weight: 700; font-size: .9rem; }
.eyebrow { margin: 0 0 .4rem; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.topbar { position: fixed; z-index: 1030; top: 0; right: 0; left: 0; height: 72px; display: flex; align-items: center; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: .72rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; background: var(--green); color: #fff; font-weight: 900; letter-spacing: -.04em; box-shadow: 0 7px 16px rgba(23, 107, 74, .2); }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-size: 1rem; }
.brand small { margin-top: .18rem; color: var(--muted); font-size: .69rem; font-weight: 600; letter-spacing: .04em; }
.admin-pill { align-items: center; gap: .5rem; background: #f1f4f2; color: #48564f; border-radius: 999px; padding: .42rem .72rem; font-size: .8rem; font-weight: 700; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2aa36f; box-shadow: 0 0 0 3px rgba(42, 163, 111, .12); }
.app-frame { padding-top: 72px; min-height: 100vh; }
.sidebar { position: fixed; top: 72px; bottom: 0; left: 0; width: 16.6667%; padding: 1.8rem 1.1rem; flex-direction: column; background: #13231c; color: #fff; }
.sidebar .nav { flex: 1; gap: .3rem; }
.sidebar .nav-label { padding: .6rem .8rem .3rem; color: #85a095; font-size: .65rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar .nav-link { display: flex; align-items: center; justify-content: space-between; padding: .72rem .8rem; color: #d6e2dc; border-radius: .68rem; font-size: .9rem; font-weight: 650; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link-primary { margin: .25rem 0 .55rem; background: #e6f3ed; color: #124e37; }
.sidebar .nav-link-primary:hover { background: #fff; color: #124e37; }
.sidebar .nav-link-primary b { font-size: 1.25rem; line-height: 1; }
.privacy-note { display: flex; flex-direction: column; gap: .25rem; padding: 1rem; border: 1px solid rgba(255,255,255,.1); border-radius: .8rem; background: rgba(255,255,255,.045); }
.privacy-note strong { font-size: .78rem; color: #e9f5ef; }
.privacy-note span { color: #95aca1; font-size: .7rem; line-height: 1.45; }
.main-content { margin-left: 16.6667%; padding: 2.3rem 2.4rem 4rem; min-height: calc(100vh - 72px); }
.mobile-nav { position: sticky; top: 72px; z-index: 1020; display: flex; gap: .4rem; overflow-x: auto; padding: .55rem .8rem; background: #13231c; }
.mobile-nav a { color: #dce8e2; white-space: nowrap; padding: .45rem .7rem; font-size: .8rem; font-weight: 700; }

.page-heading { margin-bottom: 1.6rem; }
.page-heading h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); font-weight: 780; letter-spacing: -.035em; }
.page-heading p:last-child { margin: .5rem 0 0; color: var(--muted); }
.card-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 5px 18px rgba(21, 42, 32, .035); padding: 1.45rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.section-heading > div { display: flex; align-items: center; gap: .75rem; }
.section-heading h2 { margin: 0; font-size: 1.15rem; font-weight: 780; }
.section-heading small { color: var(--muted); }
.step-number { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--green-soft); color: var(--green); font-weight: 850; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.stat-card { min-height: 148px; display: flex; flex-direction: column; padding: 1.25rem; border-radius: 1rem; border: 1px solid var(--line); background: #fff; box-shadow: 0 5px 18px rgba(21,42,32,.03); }
.stat-card > span { color: var(--muted); font-size: .8rem; font-weight: 750; }
.stat-card > strong { margin: .45rem 0 auto; font-size: 2rem; letter-spacing: -.04em; }
.stat-card a, .stat-card small { font-size: .78rem; font-weight: 700; }
.stat-card-accent { border-color: #245e46; background: linear-gradient(140deg, #173d2e, #176b4a); color: #fff; }
.stat-card-accent > span, .stat-card-accent small { color: #b9d7c9; }
.stat-card-accent > strong { font-size: 1.35rem; letter-spacing: -.02em; }
.app-table { margin: 0; }
.app-table thead th { padding-top: .8rem; padding-bottom: .8rem; color: #6a7771; border-bottom-color: var(--line); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.app-table tbody td { padding-top: .9rem; padding-bottom: .9rem; border-bottom-color: #edf0ee; font-size: .88rem; }
.compact-empty { padding: 2.2rem; text-align: center; color: var(--muted); }
.quick-start ol { margin: 1.4rem 0 0; padding: 0; list-style: none; display: grid; gap: 1rem; }
.quick-start li { display: flex; align-items: flex-start; gap: .8rem; }
.quick-start li > span { width: 29px; height: 29px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-weight: 800; font-size: .78rem; }
.quick-start li div { display: flex; flex-direction: column; }
.quick-start li small { margin-top: .15rem; color: var(--muted); }
.status-badge { display: inline-flex; border-radius: 999px; padding: .32rem .6rem; font-size: .68rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.status-draft { background: #fff4dd; color: #8b6416; }
.status-completed { background: #e5f5ed; color: #176b4a; }

.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.profile-card { padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: #fff; box-shadow: 0 5px 18px rgba(21,42,32,.03); }
.profile-archived { opacity: .68; }
.profile-card-head { display: flex; align-items: center; gap: .8rem; }
.profile-card-head .avatar { width: 45px; height: 45px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--green-soft); color: var(--green); font-weight: 900; font-size: 1.1rem; }
.profile-card-head > div:nth-child(2) { min-width: 0; flex: 1; }
.profile-card h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.profile-card p { margin: .15rem 0 0; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.2rem; margin: 1.25rem 0; padding: 1rem; background: #f7f9f7; border-radius: .75rem; }
.profile-details div { min-width: 0; }
.profile-details dt { color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .06em; }
.profile-details dd { margin: .15rem 0 0; font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.profile-actions form { margin-left: auto; }
.form-section { padding: 1.5rem; }
.sticky-summary { position: sticky; top: 96px; }
.check-list { padding: 0; margin: 1.2rem 0 1.6rem; list-style: none; display: grid; gap: .72rem; }
.check-list li { position: relative; padding-left: 1.6rem; color: #4f5c56; font-size: .86rem; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }

.step-rail { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.step-rail span { display: flex; align-items: center; gap: .35rem; color: #87908c; font-size: .72rem; font-weight: 750; white-space: nowrap; }
.step-rail span b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #edf0ee; font-size: .67rem; }
.step-rail span.active, .step-rail span.complete { color: var(--green); }
.step-rail span.active b, .step-rail span.complete b { background: var(--green); color: #fff; }
.step-rail i { width: 24px; height: 1px; background: var(--line); }
.bond-editor { padding: 0; overflow: hidden; }
.bond-editor > .section-heading { padding: 1.35rem 1.45rem 0; }
.editor-actions { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.bond-table-wrap { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bond-table { min-width: 1120px; }
.bond-table th { background: #f5f7f5; color: #56635d; border-bottom: 1px solid var(--line); padding: .65rem .45rem; font-size: .67rem; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.bond-table td { padding: .38rem .28rem; border-color: #edf0ee; }
.bond-table input, .bond-table select { min-height: 37px; width: 100%; border: 1px solid transparent; background: transparent; border-radius: .45rem; padding: .35rem .45rem; font-size: .78rem; }
.bond-table input:focus, .bond-table select:focus { outline: none; border-color: #69a98b; background: #fff; box-shadow: 0 0 0 3px rgba(23,107,74,.1); }
.bond-table tr.row-duplicate { background: #fff0f0; }
.bond-table tr.row-normalized { background: #fff9e8; }
.bond-table .row-number { width: 40px; text-align: center; color: #89928e; font-weight: 700; }
.bond-table th:nth-child(2) { width: 125px; }.bond-table th:nth-child(3) { width: 85px; }.bond-table th:nth-child(4) { width: 125px; }.bond-table th:nth-child(5) { width: 135px; }.bond-table th:nth-child(6) { width: 90px; }.bond-table th:nth-child(7) { width: 160px; }.bond-table th:nth-child(8) { width: 125px; }.bond-table th:nth-child(9) { width: 96px; }
.fill-button { border: 0; border-radius: 4px; background: #e5ebe7; color: #526159; font-weight: 900; }
.row-actions { display: flex; gap: .2rem; }
.row-action { width: 26px; height: 28px; border: 0; border-radius: 6px; background: #edf1ee; color: #54625b; font-size: .7rem; }
.row-action.delete { color: #a53d3d; background: #fff0f0; }
.bond-empty { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 2.6rem; text-align: left; }
.bond-empty > div { display: flex; flex-direction: column; }
.bond-empty span { color: var(--muted); font-size: .8rem; }
.claim-summary-bar { display: flex; align-items: center; gap: 1.8rem; padding: 1rem 1.35rem; background: #fbfcfb; }
.claim-summary-bar > div { display: flex; flex-direction: column; }
.claim-summary-bar span { color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .05em; }
.claim-summary-bar strong { font-size: .92rem; }
.claim-summary-bar small { color: var(--muted); }
.legend-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--green); }
.import-feedback { margin: 0 1.45rem 1rem; padding: .8rem 1rem; border-radius: .65rem; background: #fff7df; color: #6d551b; font-size: .8rem; }
.checklist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.check-card { display: flex; align-items: flex-start; gap: .7rem; padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; cursor: pointer; }
.check-card:has(input:checked) { border-color: #85b79f; background: #f1f8f4; }
.check-card input { margin-top: .2rem; accent-color: var(--green); }
.check-card span { display: flex; flex-direction: column; }
.check-card strong { font-size: .84rem; }
.check-card small { margin-top: .2rem; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.form-actions, .review-actions { display: flex; justify-content: flex-end; align-items: center; gap: .7rem; margin-top: 1.4rem; }
.column-guide { display: block; padding: .8rem; border-radius: .55rem; background: #f1f4f2; color: #355345; white-space: normal; }
.paste-area { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.import-preview-summary { padding: .85rem 1rem; border-radius: .7rem; background: var(--green-soft); color: var(--green-dark); font-size: .84rem; font-weight: 700; }
.import-preview-summary.has-errors { background: #fff0f0; color: #8a3333; }
.import-preview-table { min-width: 1050px; }
.import-preview-table th { color: var(--muted); font-size: .67rem; letter-spacing: .04em; text-transform: uppercase; }
.import-preview-table td { font-size: .76rem; }
.import-preview-table tr.preview-error > * { background: #fff5f5; }
.preview-notes { display: flex; flex-direction: column; gap: .18rem; min-width: 210px; }
.preview-note { color: #82641e; }
.preview-error-text { color: #a13d3d; font-weight: 700; }
.preview-ok { color: var(--green); font-weight: 800; }

.review-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.review-summary-grid article { padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: #fff; display: flex; flex-direction: column; }
.review-summary-grid span { color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .06em; }
.review-summary-grid strong { margin: .35rem 0 .15rem; font-size: 1rem; }
.review-summary-grid small { color: var(--muted); font-size: .72rem; }
.batch-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.batch-card { padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #fbfcfb; }
.batch-card.batch-warning { border-color: #e0bd6c; background: #fffaf0; }
.batch-number { color: var(--muted); font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.batch-card h3 { margin: .3rem 0 .7rem; font-size: 1.05rem; }
.batch-card dl { margin: 0; display: grid; gap: .35rem; }
.batch-card dl div { display: flex; justify-content: space-between; gap: .4rem; font-size: .75rem; }
.batch-card dt { color: var(--muted); font-weight: 500; }.batch-card dd { margin: 0; font-weight: 750; text-align: right; }
.batch-card > small { display: block; margin-top: .7rem; color: #82641e; font-size: .68rem; }
.review-checklist { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.review-checklist h2 { margin: 0; font-size: 1.1rem; }
.review-checklist ul { margin: 0; padding: 0; list-style: none; display: flex; gap: .6rem; flex-wrap: wrap; }
.review-checklist li { padding: .45rem .65rem; border-radius: 999px; background: #f1f3f2; color: #747d79; font-size: .72rem; font-weight: 700; }
.review-checklist li.checked { background: var(--green-soft); color: var(--green); }
.review-checklist li.checked::before { content: "✓ "; }
.download-group { display: flex; gap: .7rem; }
.filter-panel { padding: 1rem 1.2rem; }
.security-strip { display: flex; align-items: center; gap: .6rem; margin-top: 1rem; padding: .75rem; border-radius: .65rem; background: var(--green-soft); color: var(--green-dark); font-size: .78rem; }

.guest-shell { min-height: 100vh; background: #0f2d20; }
.guest-main { min-height: 100vh; }
.guest-alert { position: fixed; z-index: 10; top: 1rem; left: 50%; transform: translateX(-50%); max-width: 640px; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(480px, .95fr); }
.auth-story { min-height: 100vh; padding: clamp(2rem, 6vw, 5rem); display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(circle at 20% 20%, rgba(197,154,75,.2), transparent 28%), radial-gradient(circle at 90% 75%, rgba(53,144,101,.26), transparent 35%), linear-gradient(140deg, #102c20 0%, #164c36 100%); }
.brand-light { color: #fff; }.brand-light:hover { color: #fff; }.brand-light small { color: #b6cec2; }.brand-light .brand-mark { background: #f0d697; color: #173e2d; }
.auth-story h1 { max-width: 650px; margin: .6rem 0 1rem; font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: .98; letter-spacing: -.055em; font-weight: 780; }
.auth-story > div > p:last-child { max-width: 580px; margin: 0; color: #c7dacf; font-size: 1.05rem; line-height: 1.65; }
.auth-story .eyebrow { color: #e7c87d; }
.auth-features { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.auth-features li { padding: .65rem .8rem; border: 1px solid rgba(255,255,255,.15); border-radius: .7rem; color: #d9e8e0; font-size: .74rem; font-weight: 700; background: rgba(255,255,255,.05); }
.auth-panel { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background: #f4f6f3; }
.auth-card { width: min(440px, 100%); padding: 2.2rem; border: 1px solid var(--line); border-radius: 1.15rem; background: #fff; box-shadow: var(--shadow); }
.auth-card h2 { margin: 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; }
.secure-caption { margin: 1rem 0 0; color: #7b8681; text-align: center; font-size: .7rem; }
.empty-state { max-width: 720px; margin: 3rem auto; padding: 3rem; text-align: center; }
.empty-icon { width: 54px; height: 54px; margin: 0 auto 1rem; display: grid; place-items: center; border-radius: 16px; background: var(--green-soft); color: var(--green); font-weight: 900; font-size: 1.4rem; }

@media (max-width: 1199.98px) {
  .batch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .review-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .main-content { margin-left: 0; padding: 1.5rem 1rem 3rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: auto; padding: 2rem; gap: 4rem; }
  .auth-story h1 { font-size: 2.7rem; }
  .auth-panel { min-height: auto; padding: 3rem 1rem; }
}
@media (max-width: 767.98px) {
  .stats-grid, .review-summary-grid, .batch-grid, .checklist-grid { grid-template-columns: 1fr; }
  .claim-summary-bar { align-items: flex-start; flex-wrap: wrap; gap: .8rem 1.5rem; }
  .claim-summary-bar .ms-auto { margin-left: 0 !important; width: 100%; }
  .review-checklist { align-items: flex-start; flex-direction: column; }
  .review-actions, .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .review-actions > *, .form-actions > *, .download-group, .download-group .btn { width: 100%; }
  .download-group { flex-direction: column; }
  .step-rail { width: 100%; justify-content: center; }
  .step-rail span { font-size: 0; }.step-rail span b { font-size: .67rem; }
  .auth-features { flex-direction: column; }
  .auth-card { padding: 1.4rem; }
}
