.portal-eyebrow { color: var(--color-primary-light); font: 700 .68rem/1 var(--font-body); letter-spacing: .15em; text-transform: uppercase; }
.portal-wordmark { display: inline-block; color: var(--color-text); font: 700 2.3rem/1 var(--font-display); letter-spacing: -.04em; }
.portal-wordmark span { color: var(--color-primary-light); font-style: italic; }

.portal-auth { position: relative; min-height: 100svh; display: grid; place-items: center; padding: 8rem 1.5rem 4rem; overflow: hidden; }
.portal-auth__atmosphere { position: absolute; inset: 0; background: radial-gradient(ellipse at 22% 30%, rgba(75,132,50,.24), transparent 44%), radial-gradient(ellipse at 80% 70%, rgba(117,71,159,.15), transparent 40%), repeating-linear-gradient(90deg, transparent 0 89px, rgba(130,175,96,.035) 90px); }
.portal-auth__atmosphere::after { content: ""; position: absolute; width: 46vw; aspect-ratio: 1; right: -18vw; top: 18%; border: 1px solid rgba(139,180,105,.14); border-radius: 50%; box-shadow: inset 0 0 0 60px rgba(100,150,70,.02); }
.portal-auth__card { position: relative; width: min(100%, 570px); padding: clamp(2rem, 6vw, 4.2rem); background: rgba(12, 27, 22, .82); border: 1px solid var(--color-border); border-radius: 3px 28px 3px 3px; box-shadow: 0 35px 90px rgba(0,0,0,.32); backdrop-filter: blur(22px); }
.portal-auth__card .portal-wordmark { margin-bottom: 4rem; }
.portal-auth__card h1 { margin: .8rem 0 1rem; font: 600 clamp(2.7rem, 7vw, 4.5rem)/.92 var(--font-display); }
.portal-auth__intro { color: var(--color-text-muted); font-size: .92rem; line-height: 1.7; }
.portal-auth__intro a { color: var(--color-primary-light); text-decoration: underline; text-underline-offset: 3px; }
.portal-auth__footer { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--color-border); color: var(--color-text-subtle); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }

.portal-form { display: grid; gap: 1rem; margin-top: 1.8rem; }
.portal-form label,
.portal-profile-form > label,
.portal-fieldset > label,
.admin-review label { display: grid; gap: .45rem; color: var(--color-text-muted); font-size: .74rem; font-weight: 700; }
.portal-form input,
.portal-form textarea,
.portal-profile-form input,
.portal-profile-form textarea,
.portal-profile-form select,
.portal-fieldset input,
.admin-review textarea,
.admin-search input { width: 100%; min-height: 48px; padding: .75rem .85rem; color: var(--color-text); background: rgba(255,255,255,.035); border: 1px solid var(--color-border); border-radius: 8px; transition: border .2s, box-shadow .2s, background .2s; }
.portal-form input:focus,
.portal-form textarea:focus,
.portal-profile-form input:focus,
.portal-profile-form textarea:focus,
.portal-profile-form select:focus,
.portal-fieldset input:focus,
.admin-review textarea:focus,
.admin-search input:focus { border-color: rgba(115,157,76,.65); box-shadow: 0 0 0 3px rgba(96,142,58,.13); background: rgba(255,255,255,.055); }
.portal-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: .7rem; padding: .72rem 1.1rem; color: #f4f7ef; background: #4f7e35; border: 1px solid #649342; border-radius: 7px; font-size: .75rem; font-weight: 800; cursor: pointer; transition: transform .2s, background .2s, opacity .2s; }
.portal-button:hover:not(:disabled) { transform: translateY(-2px); background: #619344; }
.portal-button:focus-visible,
.portal-text-button:focus-visible { outline: 3px solid rgba(105, 157, 67, .28); outline-offset: 3px; }
.portal-button:disabled { opacity: .5; cursor: wait; }
.portal-button--danger { background: transparent; color: #e5988f; border-color: rgba(187,80,66,.48); }
.portal-button--danger:hover:not(:disabled) { background: rgba(178,70,58,.14); }
.portal-text-button { margin-top: 1.1rem; color: var(--color-text-muted); font-size: .74rem; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.portal-form__message { padding: .75rem .9rem; color: #efaaa2; background: rgba(172,62,49,.1); border-left: 3px solid #a74438; border-radius: 4px; font-size: .76rem; }
.portal-form__message.is-success { color: #a9cb84; background: rgba(91,141,55,.12); border-color: #6f9d4c; }
.portal-password-note { color: var(--color-text-subtle); font-size: .7rem; }
.portal-state { display: grid; gap: .7rem; margin-top: 2rem; }
.portal-state strong { font: 600 2rem var(--font-display); }
.portal-state p { color: var(--color-text-muted); }
.portal-state .portal-button { justify-self: start; margin-top: .5rem; }
.portal-state--error strong { color: #dfa39a; }

.portal-page { min-height: 100svh; padding: 8rem 0 7rem; background: radial-gradient(ellipse at 12% 8%, rgba(78,132,52,.12), transparent 35%), var(--color-bg); }
.portal-header { padding: 2rem 0 3.2rem; border-bottom: 1px solid var(--color-border); }
.portal-header__inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.portal-header h1 { margin-top: .7rem; font: 600 clamp(2.8rem, 5vw, 5rem)/.95 var(--font-display); }
.portal-header__actions { display: flex; align-items: center; gap: 1rem; }
.portal-header__actions .portal-text-button { margin: 0; }
.portal-status { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .65rem; border-radius: 999px; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.portal-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.portal-status--approved { color: #9ac872; background: rgba(95,147,57,.12); border: 1px solid rgba(117,164,78,.25); }
.portal-status--pending { color: #dfbd63; background: rgba(191,148,38,.11); border: 1px solid rgba(193,155,56,.24); }
.portal-status--rejected { color: #db8b82; background: rgba(169,66,53,.1); border: 1px solid rgba(186,77,65,.24); }

.portal-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; padding-top: 3.5rem; }
.portal-sidebar { position: sticky; top: 110px; display: grid; gap: .35rem; }
.portal-sidebar a { padding: .75rem .9rem; color: var(--color-text-muted); border-left: 1px solid var(--color-border); font-size: .78rem; transition: color .2s, border .2s, background .2s; }
.portal-sidebar a:hover,
.portal-sidebar a.is-active { color: var(--color-text); border-left-color: var(--color-primary-light); background: rgba(94,145,57,.07); }
.portal-content { display: grid; gap: 1.5rem; }
.portal-loading { padding: 2rem; color: var(--color-text-muted); border: 1px solid var(--color-border); border-radius: 14px; }
.portal-panel { scroll-margin-top: 110px; padding: clamp(1.5rem, 4vw, 3rem); background: rgba(17,33,28,.68); border: 1px solid var(--color-border); border-radius: 18px; box-shadow: var(--shadow-md); }
.portal-panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1.5rem; margin-bottom: 1.7rem; border-bottom: 1px solid var(--color-border); }
.portal-panel__head h2 { margin-top: .5rem; font: 600 clamp(2rem, 4vw, 3.2rem)/1 var(--font-display); }
.portal-panel__head > span { color: var(--color-text-subtle); font: 600 .68rem var(--font-body); letter-spacing: .08em; }
.portal-profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.portal-profile-form select { appearance: none; }
.portal-field--full { grid-column: 1 / -1; }
.portal-fieldset { min-inline-size: 0; padding: 1.2rem; border: 1px solid var(--color-border); border-radius: 12px; }
.portal-fieldset legend { padding: 0 .4rem; color: var(--color-text); font: 600 1.2rem var(--font-display); }
.portal-check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; margin: .7rem 0 1rem; }
.portal-check-grid label { display: flex; gap: .55rem; align-items: flex-start; color: var(--color-text-muted); font-size: .72rem; cursor: pointer; }
.portal-check-grid input { width: 16px; min-height: 16px; accent-color: var(--color-primary-light); }
.portal-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.portal-explainer { align-self: start; padding: 1.4rem; background: rgba(88,134,55,.08); border: 1px solid var(--color-border); border-radius: 12px; }
.portal-explainer strong { font: 600 1.45rem var(--font-display); }
.portal-explainer p { margin: .6rem 0; color: var(--color-text-muted); font-size: .78rem; line-height: 1.6; }
.portal-explainer a { color: var(--color-primary-light); font-size: .75rem; }
.portal-panel--danger { border-color: rgba(176,70,57,.2); }
.portal-panel--danger > p { color: var(--color-text-muted); }
.portal-delete-form { max-width: 520px; }
.portal-confirm { display: flex !important; grid-template-columns: auto 1fr; align-items: center; }
.portal-confirm input { width: 16px; min-height: 16px; }

.admin-page { min-height: 100svh; padding-bottom: 6rem; background: radial-gradient(ellipse at 80% 0%, rgba(81,126,55,.11), transparent 34%), var(--color-bg); }
.admin-header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1rem clamp(1.2rem, 4vw, 3rem); border-bottom: 1px solid var(--color-border); }
.admin-header > div { display: flex; align-items: center; gap: 1.2rem; }
.admin-header p,
.admin-header span { color: var(--color-text-muted); font-size: .72rem; }
.admin-header .portal-text-button { margin: 0; }
.admin-workspace { width: min(1500px, calc(100% - 2.4rem)); margin: 0 auto; padding-top: 3.5rem; }
.admin-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.admin-titlebar h1 { margin-top: .6rem; font: 600 clamp(3rem, 6vw, 5.5rem)/.9 var(--font-display); }
.admin-filters { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1.1rem; }
.admin-search { width: min(100%, 520px); }
.admin-filter-tabs { display: flex; gap: .35rem; }
.admin-filter-tabs button { padding: .55rem .8rem; color: var(--color-text-muted); border: 1px solid var(--color-border); border-radius: 999px; font-size: .68rem; cursor: pointer; }
.admin-filter-tabs button.is-active { color: #b9d99e; background: rgba(91,141,55,.13); border-color: rgba(112,159,73,.35); }
.admin-table-wrap { overflow-x: auto; background: rgba(17,31,27,.66); border: 1px solid var(--color-border); border-radius: 15px; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.admin-table th { padding: .85rem 1rem; color: var(--color-text-subtle); border-bottom: 1px solid var(--color-border); font-size: .61rem; letter-spacing: .11em; text-align: left; text-transform: uppercase; }
.admin-table td { padding: 1rem; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); font-size: .74rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td:first-child { display: grid; gap: .15rem; color: var(--color-text); }
.admin-table td:first-child span { color: var(--color-text-subtle); font-size: .65rem; }
.admin-table code,
.admin-drawer code { color: #b6cf9f; font-size: .66rem; }
.admin-open { color: var(--color-primary-light); font-size: .7rem; cursor: pointer; white-space: nowrap; }
.admin-empty { padding: 3rem !important; text-align: center !important; color: var(--color-text-subtle) !important; }
.admin-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; color: var(--color-text-subtle); font-size: .68rem; }
.admin-pagination > div { display: flex; align-items: center; gap: .8rem; }
.admin-pagination button { color: var(--color-text-muted); cursor: pointer; }
.admin-pagination button:disabled { opacity: .35; cursor: default; }

.admin-drawer-backdrop { position: fixed; z-index: 1100; inset: 0; background: rgba(2,8,6,.72); backdrop-filter: blur(4px); }
.admin-drawer { position: fixed; z-index: 1101; inset: 0 0 0 auto; width: min(100%, 720px); display: flex; flex-direction: column; color: var(--color-text); background: #0e1b17; border-left: 1px solid var(--color-border); box-shadow: -30px 0 80px rgba(0,0,0,.4); }
.admin-drawer__head { display: flex; align-items: flex-start; justify-content: space-between; padding: 1.6rem 1.8rem; border-bottom: 1px solid var(--color-border); }
.admin-drawer__head h2 { margin-top: .4rem; font: 600 2.4rem/1 var(--font-display); }
.admin-drawer__head > button { color: var(--color-text-muted); font: 300 2rem/1 var(--font-body); cursor: pointer; }
.admin-drawer__body { flex: 1; overflow-y: auto; padding: 1.6rem 1.8rem; }
.admin-drawer__meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.admin-detail-group { padding: 1.4rem 0; border-top: 1px solid var(--color-border); }
.admin-detail-group h3 { margin-bottom: .8rem; color: #a8ca8c; font: 600 1.25rem var(--font-display); }
.admin-detail-group dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.admin-detail-group dl div { min-width: 0; }
.admin-detail-group dt { color: var(--color-text-subtle); font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; }
.admin-detail-group dd { margin-top: .2rem; color: var(--color-text-muted); font-size: .74rem; overflow-wrap: anywhere; }
.admin-audit { display: grid; gap: .8rem; }
.admin-audit li { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding-left: .8rem; border-left: 2px solid rgba(99,148,63,.3); }
.admin-audit span { text-transform: capitalize; font-size: .74rem; }
.admin-audit time { color: var(--color-text-subtle); font-size: .62rem; }
.admin-audit p { grid-column: 1 / -1; color: var(--color-text-muted); font-size: .7rem; }
.admin-review { padding: 1.3rem 1.8rem; background: #12251f; border-top: 1px solid var(--color-border); }
.admin-review textarea { resize: vertical; }
.admin-review__actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: .9rem; }

html[data-theme="light"] .portal-auth__card,
html[data-theme="light"] .portal-panel,
html[data-theme="light"] .admin-table-wrap { background: rgba(255,255,255,.8); }
html[data-theme="light"] .admin-drawer { background: #f3f8f4; }
html[data-theme="light"] .admin-review { background: #e9f2eb; }
html[data-theme="light"] .portal-form input,
html[data-theme="light"] .portal-profile-form input,
html[data-theme="light"] .portal-profile-form textarea,
html[data-theme="light"] .portal-profile-form select,
html[data-theme="light"] .admin-review textarea,
html[data-theme="light"] .admin-search input { background: rgba(255,255,255,.8); }

@media (max-width: 900px) {
  .portal-layout { grid-template-columns: 1fr; }
  .portal-sidebar { position: static; grid-template-columns: repeat(4, 1fr); overflow-x: auto; }
  .portal-sidebar a { white-space: nowrap; border-left: 0; border-bottom: 1px solid var(--color-border); }
  .admin-filters { align-items: stretch; flex-direction: column; }
  .admin-search { width: 100%; }
}

@media (max-width: 700px) {
  .portal-header__inner,
  .admin-titlebar { align-items: flex-start; flex-direction: column; }
  .portal-header__actions { width: 100%; justify-content: space-between; }
  .portal-profile-form,
  .portal-split,
  .portal-check-grid,
  .admin-detail-group dl { grid-template-columns: 1fr; }
  .portal-field--full { grid-column: auto; }
  .admin-header { align-items: flex-start; }
  .admin-header > div:last-child span { display: none; }
  .admin-filter-tabs { overflow-x: auto; }
  .admin-drawer { width: 100%; }
}

@media (max-width: 480px) {
  .portal-auth__card { padding: 1.6rem; border-radius: 3px 18px 3px 3px; }
  .portal-auth__card .portal-wordmark { margin-bottom: 3rem; }
  .portal-sidebar { grid-template-columns: repeat(2, 1fr); }
  .admin-workspace { width: calc(100% - 1.2rem); }
  .admin-drawer__head,
  .admin-drawer__body,
  .admin-review { padding-inline: 1.1rem; }
  .admin-review__actions { flex-direction: column-reverse; }
}

.policy-page { min-height: 100svh; padding: 8rem 0; background: radial-gradient(ellipse at 78% 5%, rgba(84,136,53,.14), transparent 35%), var(--color-bg); }
.policy-hero { padding: 4rem 0 5rem; border-bottom: 1px solid var(--color-border); }
.policy-hero h1 { max-width: 960px; margin: 1rem 0 1.4rem; font: 600 clamp(3.3rem, 7vw, 7rem)/.88 var(--font-display); }
.policy-hero > .container > p:not(.portal-eyebrow) { max-width: 700px; color: var(--color-text-muted); font-size: 1.05rem; line-height: 1.75; }
.policy-hero span { display: block; margin-top: 2rem; color: var(--color-text-subtle); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }
.policy-layout { display: grid; grid-template-columns: 230px minmax(0, 760px); gap: clamp(3rem, 9vw, 9rem); align-items: start; padding-top: 4rem; }
.policy-nav { position: sticky; top: 110px; display: grid; }
.policy-nav a { padding: .7rem .8rem; color: var(--color-text-muted); border-left: 1px solid var(--color-border); font-size: .75rem; }
.policy-nav a:hover { color: var(--color-primary-light); border-color: var(--color-primary-light); }
.policy-copy { display: grid; gap: 4.5rem; }
.policy-copy section { scroll-margin-top: 120px; }
.policy-number { color: var(--color-primary-light); font-size: .65rem; letter-spacing: .14em; }
.policy-copy h2 { margin: .5rem 0 1rem; font: 600 clamp(2.2rem, 4vw, 3.7rem)/1 var(--font-display); }
.policy-copy section > p:not(.policy-number),
.policy-copy li { color: var(--color-text-muted); font-size: .92rem; line-height: 1.85; }
.policy-copy section > p + p { margin-top: 1rem; }
.policy-copy ul { display: grid; gap: .6rem; padding-left: 1.2rem; list-style: disc; }
.policy-copy a { color: var(--color-primary-light); text-decoration: underline; text-underline-offset: 3px; }
.policy-review-note { padding: 1.4rem; color: #dbc67e; background: rgba(198,155,47,.08); border: 1px solid rgba(198,155,47,.24); border-radius: 12px; }
.policy-review-note p { margin-top: .5rem; color: var(--color-text-muted); font-size: .78rem; line-height: 1.6; }
@media (max-width: 760px) { .policy-layout { grid-template-columns: 1fr; } .policy-nav { position: static; grid-template-columns: repeat(2, 1fr); } }
