/* Shared theme and form styles. The home sections live in css/site.css. */
:root {
    --bs-body-font-family: "Segoe UI", Arial, sans-serif;
    --bs-body-bg: #fff;
    --bs-body-color: #192c26;
    --bs-body-color-rgb: 25, 44, 38;
    --bs-primary: #21744e;
    --bs-primary-rgb: 33, 116, 78;
    --bs-secondary-color: #66716b;
    --bs-secondary-rgb: 102, 113, 107;
    --bs-border-color: #e1e7e2;
    --bs-emphasis-color-rgb: 25, 44, 38;
    --bs-link-color: #21744e;
    --bs-link-color-rgb: 33, 116, 78;
    --bs-link-hover-color: #145336;
    --bs-link-hover-color-rgb: 20, 83, 54;
    color-scheme: light;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}

body { min-width: 0; line-height: normal; }
::selection { color: white; background: var(--bs-primary); }
:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 6px; }
h1:focus { outline: none; }
.site-frame { display: flex; flex-direction: column; min-height: 100vh; }
.site-frame > header, .site-frame > footer { flex-shrink: 0; }
.site-frame > main { flex: 1; }
.footer address { margin: 0; }
.content-page { margin-block: 48px; line-height: 1.6; }
.content-page h1 { letter-spacing: -.045em; }
.display-accent { color: var(--bs-primary); font-style: normal; }

.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: #145336;
    --bs-btn-hover-border-color: #145336;
    --bs-btn-active-bg: #145336;
    --bs-btn-active-border-color: #145336;
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}

.form-control:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .12); }
.form-control.invalid { border-color: var(--bs-danger); }

.nav .nav-portal { display: inline-flex; align-items: center; gap: 9px; padding-left: 24px; border-left: 1px solid #dce6df; color: #21744e; }
.footer-end { flex-wrap: wrap; }
.footer-end .footer-portal { color: #21744e; font-weight: 600; }

.login-page {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 40px 24px 32px;
    min-height: min(860px, calc(100svh - var(--header-height)));
    background: radial-gradient(ellipse at 50% 35%, #edf5ef 0, #f8faf8 40%, #fff 75%);
}
.login-orbit { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.login-orbit span { position: absolute; left: 50%; top: 46%; width: 700px; height: 700px; border: 1px solid #d9e8de80; border-radius: 50%; transform: translate(-50%, -50%); }
.login-orbit span:nth-child(2) { width: 960px; height: 960px; }
.login-orbit span:nth-child(3) { width: 1220px; height: 1220px; opacity: .55; }
.login-card { width: 100%; max-width: 460px; padding: 28px 40px 22px; border: 1px solid #e0e9e2; border-radius: 24px; background: #ffffffed; box-shadow: 0 16px 70px #254e3310, 0 2px 6px #254e3305; }
.login-mark { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; background: #eef5f0; border-radius: 14px; vertical-align: middle; }
.login-card .login-eyebrow { display: inline-block; vertical-align: middle; font-size: 10px; letter-spacing: .15em; color: #607b69; margin: 0 0 0 14px; }
.login-card h1 { font-size: clamp(29px, 3vw, 34px); font-weight: 600; letter-spacing: -.045em; line-height: 1.15; margin: 20px 0 14px; }
.login-card h1 span { color: #21744e; }
.login-intro { color: #66716b; font-size: 14px; line-height: 1.7; margin: 0 0 20px; }
.login-form { display: grid; gap: 14px; }
.login-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.login-field input { width: 100%; min-width: 0; height: 48px; padding: 0 15px; border: 1px solid #dbe3de; border-radius: 11px; background: #fbfcfb; font: inherit; font-size: 15px; color: #192c26; transition: border-color .2s, box-shadow .2s; }
.login-field input::placeholder { color: #8b958f; }
.login-field input:focus { outline: none; border-color: #42855a; box-shadow: 0 0 0 3px #21744e13; background: #fff; }
.password-input { position: relative; }
.password-input input { padding-right: 52px; }
.password-toggle { position: absolute; right: 7px; top: 4px; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: #63766a; display: grid; place-items: center; }
.password-toggle:hover { background: #eaf1ec; }
.password-toggle .eye-slash { display: none; }
.password-toggle[aria-pressed="true"] .eye-slash { display: block; }
.portal-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 54px; margin-top: 5px; padding: 0 9px 0 20px; border: 0; border-radius: 28px; background: #21744e; color: #fff; font-weight: 600; font-size: 15px; transition: background .2s; }
.portal-submit span { width: 36px; height: 36px; border-radius: 50%; background: #d4e9ce; color: #245c39; display: grid; place-items: center; font-size: 23px; font-weight: 400; }
.portal-submit:hover { background: #195e3e; }
.login-help { border-top: 1px solid #edf0ed; margin: 18px 0 0; padding-top: 16px; color: #7a857e; font-size: 12px; text-align: center; line-height: 1.8; }
.login-help a { color: #21744e; font-weight: 600; }
.login-help a:hover, .login-back:hover { text-decoration: underline; text-underline-offset: 4px; }
.login-back { font-size: 13px; color: #66796c; margin-top: 25px; }
.login-error { background: #fff4f1; border: 1px solid #edd4cd; border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.5; color: #8b3c2c; margin: -5px 0 22px; }
.portal-page { padding-block: 64px 80px; }
.portal-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.portal-heading h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; overflow-wrap: anywhere; }
.portal-heading p:last-child { color: #66716b; margin-bottom: 0; }
.portal-signout { border: 1px solid #dce6df; background: white; border-radius: 24px; padding: 12px 20px; font-size: 14px; white-space: nowrap; }
.portal-welcome { border: 1px solid #dce6df; border-radius: 24px; padding: clamp(24px, 5vw, 64px); background: radial-gradient(ellipse at 100% 0, #dcecdf70, transparent 65%), #f6f9f6; }
.portal-status { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; color: #21744e; margin-bottom: 25px; }
.portal-welcome h2 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -.04em; line-height: 1.12; margin-bottom: 20px; }
.portal-welcome p { color: #66716b; line-height: 1.8; font-size: 15px; margin-bottom: 28px; }

.workspace { min-height: 100svh; display: grid; grid-template-columns: 224px minmax(0, 1fr); background: #f7f9f8; }
.workspace-sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; padding: 32px 20px 24px; border-right: 1px solid #e0e8e3; background: #fff; }
.workspace-brand { padding: 0 12px; margin-bottom: 50px; }
.workspace-brand span { font-size: 29px; }
.workspace-label { padding-left: 14px; font-size: 10px; letter-spacing: .14em; color: #849189; margin-bottom: 16px; }
.workspace-nav { display: grid; gap: 8px; }
.workspace-nav a { display: flex; align-items: center; gap: 13px; padding: 14px; min-height: 48px; border-radius: 12px; color: #5c6d63; font-size: 14px; font-weight: 500; transition: background .2s, color .2s; }
.workspace-nav svg { width: 21px; height: 21px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; }
.workspace-nav a:hover { color: #21744e; background: #f0f5f1; }
.workspace-nav a.active, .workspace-nav a.is-active { background: #e6f1e9; color: #1e6846; font-weight: 600; }
.workspace-sidebar-footer { margin-top: auto; padding: 36px 12px 0; }
.workspace-back { display: inline-block; font-size: 12px; color: #6b7c70; margin-bottom: 26px; }
.workspace-identity { display: flex; align-items: center; gap: 10px; padding-top: 22px; border-top: 1px solid #e8ede9; }
.workspace-identity > div { min-width: 0; }
.workspace-identity strong { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.workspace-identity small { display: block; color: #819087; font-size: 11px; margin-top: 3px; }
.workspace-avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; background: #edf4ef; color: #477858; border: 1px solid #dce9df; border-radius: 50%; font-size: 13px; font-weight: 600; }
.workspace-signout { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 20px; padding: 10px 0; background: none; border: 0; color: #6b7c70; font: inherit; font-size: 12px; }
.workspace-signout:hover { color: #1e6846; }
.workspace-main { min-width: 0; padding: 48px clamp(24px, 3.2vw, 56px) 64px; }
.admin-page { width: 100%; max-width: 1400px; margin-inline: auto; }
.workspace .portal-heading h1 { font-size: clamp(29px, 3vw, 38px); }
.workspace .portal-heading p:last-child { font-size: 14px; line-height: 1.6; }
.workspace .portal-heading .eyebrow { font-size: 10px; color: #6a8473; margin-bottom: 17px; }
.admin-page .portal-heading { margin-bottom: 36px; }
.admin-page .portal-heading h1 { margin-bottom: 12px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-create { padding: 32px; background: linear-gradient(145deg, #f2f7f3, #fbfcfb); border: 1px solid #dce6df; border-radius: 22px; }
.admin-section-icon { width: 48px; height: 48px; border: 1px solid #cfe0d4; border-radius: 14px; background: #e7f0e9; color: #21744e; display: grid; place-items: center; margin-bottom: 26px; }
.admin-create h2, .admin-directory h2 { font-size: 20px; font-weight: 600; letter-spacing: -.025em; margin: 0; }
.admin-create > p { font-size: 14px; line-height: 1.65; color: #67786d; margin: 10px 0 26px; }
.admin-form { display: grid; gap: 18px; }
.admin-form .login-field input { background: white; }
.admin-form .login-error { margin: 0; }
.admin-validation { font-size: 12px; line-height: 1.5; color: #9c372e; margin-top: 6px; }
.admin-directory { min-width: 0; border: 1px solid #e1e7e2; border-radius: 22px; overflow: hidden; background: #fff; }
.admin-directory-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 25px 28px; border-bottom: 1px solid #edf0ed; }
.admin-count { background: #f0f5f1; color: #50705b; border-radius: 20px; padding: 7px 11px; font-size: 12px; white-space: nowrap; }
.admin-empty { padding: 55px 24px 65px; text-align: center; }
.admin-empty-mark { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; border: 1px dashed #c1d5c7; background: #f6f9f7; color: #6b9077; font-size: 27px; margin: 0 auto 20px; }
.admin-empty h3 { font-size: 18px; font-weight: 500; letter-spacing: -.02em; margin: 0 0 10px; }
.admin-empty p { color: #78867c; font-size: 14px; line-height: 1.6; margin: 0; }
.admin-customer-list { list-style: none; padding: 0 28px; margin: 0; }
.admin-customer-list li { display: flex; align-items: center; gap: 14px; padding: 20px 0; }
.admin-customer-list li + li { border-top: 1px solid #edf0ed; }
.admin-company-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: #edf4ef; color: #39714a; font-size: 18px; font-weight: 600; }
.admin-company-name { min-width: 0; flex: 1; }
.admin-company-name h3 { font-size: 15px; font-weight: 600; line-height: 1.45; margin: 0 0 3px; overflow-wrap: anywhere; }
.admin-company-name > span { color: #7a877e; font-size: 12px; }
.admin-customer-list time { color: #7a877e; font-size: 12px; white-space: nowrap; }
.admin-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 20px; border-top: 1px solid #edf0ed; padding: 20px; font-size: 13px; }
.admin-pagination span { color: #78867c; }
.admin-pagination a { color: #21744e; padding: 8px 0; }
.admin-success { display: flex; align-items: center; gap: 12px; background: #edf6ef; border: 1px solid #d3e8d8; border-radius: 14px; padding: 15px 20px; color: #24693e; font-size: 14px; margin-bottom: 24px; }
.admin-success > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #d6eadb; }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.admin-row-actions a, .admin-test-link { color: #21744e; font-size: 12px; font-weight: 600; padding-block: 5px; }
.admin-row-actions a:hover, .admin-test-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.admin-test-link { display: table; margin-top: 8px; }
.login-field select, .admin-filter select { width: 100%; min-width: 0; height: 48px; padding: 0 12px; border: 1px solid #dbe3de; border-radius: 11px; background: #fff; font: inherit; font-size: 14px; color: #192c26; }
.login-field select:focus, .admin-filter select:focus { outline: 2px solid #42855a; outline-offset: 2px; }
.admin-field-help { display: block; color: #7a877e; font-size: 12px; line-height: 1.6; margin-top: 8px; }
.admin-optional { font-size: 11px; color: #819087; font-weight: 400; margin-left: 5px; }
.admin-notice { font-size: 13px; line-height: 1.7; color: #697c6f; }
.admin-notice a { color: #21744e; font-weight: 600; }
.portal-submit:disabled { opacity: .5; cursor: not-allowed; }
.admin-role { background: #edf5ef; color: #357148; padding: 6px 10px; border-radius: 18px; font-size: 11px; white-space: nowrap; }
.admin-role.is-demo { background: #eef2f8; color: #546c8b; }
.admin-filter { padding: 20px 28px; border-bottom: 1px solid #edf0ed; background: #fcfdfc; }
.admin-filter label { display: block; color: #6d7c71; font-size: 12px; margin-bottom: 8px; }
.admin-filter > div { display: flex; gap: 10px; }
.admin-filter select { flex: 1; height: 42px; font-size: 13px; }
.admin-filter button { flex: 0 0 auto; padding: 0 16px; border: 1px solid #dce6df; border-radius: 10px; color: #3c6750; background: #fff; font-size: 13px; }
.admin-filter button:hover { background: #edf4ef; }
.admin-filter > a { display: inline-block; padding: 8px 0 0; color: #577563; font-size: 12px; }
.admin-users-grid { grid-template-columns: minmax(0, 1fr); }
.admin-users-grid .admin-section-icon { float: left; width: 38px; height: 38px; margin: 0 12px 0 0; border-radius: 11px; }
.admin-users-grid .admin-create h2 { min-height: 38px; display: flex; align-items: center; }
.admin-users-grid .admin-create > p { margin: 12px 0 24px; }
.admin-users-grid .admin-form { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; }
.admin-users-grid .admin-form > .login-error { grid-column: 1 / -1; }
.admin-users-grid .portal-submit { align-self: end; margin: 0 0 6px; height: 48px; }

@media (max-width: 1180px) {
    .workspace { grid-template-columns: 200px minmax(0, 1fr); }
    .workspace-sidebar { padding-inline: 14px; }
    .admin-grid { grid-template-columns: minmax(0, 290px) minmax(0, 1fr); gap: 20px; }
    .admin-users-grid { grid-template-columns: minmax(0, 1fr); }
    .admin-create { padding: 24px; }
}

@media (max-width: 960px) {
    .admin-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .admin-create { padding: 28px; }
}

@media (max-width: 900px) {
    .workspace { display: block; }
    .workspace-sidebar { position: static; height: auto; padding: 22px 24px 16px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; border-right: 0; border-bottom: 1px solid #e0e8e3; }
    .workspace-brand { padding: 0; margin: 0; }
    .workspace-label, .workspace-identity, .workspace-back { display: none; }
    .workspace-sidebar-footer { grid-column: 2; grid-row: 1; margin: 0; padding: 0; }
    .workspace-signout { margin: 0; gap: 15px; padding: 10px; }
    .workspace-nav { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .workspace-nav a { justify-content: center; font-size: 13px; gap: 10px; padding: 12px 6px; }
    .workspace-main { padding: 32px 24px 48px; }
}

@media (max-width: 680px) {
    .content-page { margin-block: 24px; }
    .nav .nav-portal { padding-left: 0; padding-top: 15px; margin-top: 3px; border-left: 0; border-top: 1px solid #dce6df; }
    .login-page { padding: 30px 18px; min-height: auto; }
    .login-card { padding: 28px 24px 24px; border-radius: 20px; }
    .login-mark { width: 44px; height: 44px; border-radius: 13px; }
    .login-field input { font-size: 16px; }
    .portal-page { padding-block: 38px 50px; }
    .portal-heading { align-items: flex-start; flex-direction: column; }
    .portal-welcome p br { display: none; }
    .admin-create { padding: 24px; }
    .admin-directory-heading { padding: 22px 20px; }
    .admin-customer-list { padding: 0 20px; }
    .admin-customer-list li { gap: 12px; flex-wrap: wrap; }
    .admin-customer-list time { width: 100%; padding-left: 54px; margin-top: -9px; }
    .workspace-main { padding-inline: 16px; }
    .workspace-sidebar { padding-inline: 16px; }
    .workspace-nav a { flex-direction: column; gap: 7px; font-size: 11px; }
    .workspace .portal-heading { margin-bottom: 24px; }
    .workspace .admin-create, .workspace .admin-directory { border-radius: 18px; }
    .login-field select { font-size: 16px; }
    .admin-filter { padding: 18px 20px; }
    .admin-filter select { font-size: 16px; }
    .admin-users-grid .admin-form { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .admin-users-grid .portal-submit { margin: 5px 0 0; height: 54px; }
}

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