/* Shared design tokens keep Mission 1:27 color, elevation, spacing, and motion consistent. */
:root {
  --brand-navy: #092839;
  --brand-blue: #5eabd4;
  --pine-950: #092839;
  --pine-900: #0d354a;
  --pine-800: #164d69;
  --pine-700: #337fa6;
  --pine-100: #dceff8;
  --pine-50: #eff8fc;
  --clay-600: #337fa6;
  --clay-500: #5eabd4;
  --clay-100: #deeff8;
  --marigold-500: #7fc1e2;
  --marigold-100: #e6f4fb;
  --ink-900: #092839;
  --ink-700: #294958;
  --ink-500: #617984;
  --ink-300: #a8b7be;
  --paper: #ffffff;
  --canvas: #f2f7f9;
  --white: #ffffff;
  --line: #d9e4e9;
  --line-strong: #bed0d8;
  --danger: #a63b32;
  --danger-bg: #fbe9e5;
  --success: #25664d;
  --success-bg: #e3f1e9;
  --shadow-sm: 0 2px 8px rgba(9, 40, 57, .07);
  --shadow-md: 0 14px 32px rgba(9, 40, 57, .11);
  --shadow-lg: 0 26px 70px rgba(9, 40, 57, .18);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --sidebar-width: 260px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { min-height: 100%; font-size: 16px; scroll-behavior: smooth; }
body { min-height: 100%; margin: 0; color: var(--ink-900); background: var(--canvas); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
body::selection { color: var(--white); background: var(--pine-700); }
a { color: var(--pine-700); text-underline-offset: 3px; }
a:hover { color: var(--pine-950); }
button, input, select, textarea { font: inherit; }
.skip-link { position: fixed; top: -90px; left: 20px; z-index: 2000; padding: .7rem 1rem; border-radius: 0 0 8px 8px; color: var(--white); background: var(--pine-950); }
.skip-link:focus { top: 0; }

/* Application shell */
.app-frame { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 100; display: flex; width: var(--sidebar-width); flex-direction: column; overflow-y: auto; color: rgba(255,255,255,.88); background: var(--pine-950); }
.sidebar::before { content: ""; position: absolute; right: -72px; top: 130px; width: 190px; height: 190px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.025), 0 0 0 70px rgba(255,255,255,.018); pointer-events: none; }
.sidebar-brand { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 1.55rem 1.25rem 1.2rem; }
.sidebar-brand > a, .public-brand { display: flex; align-items: center; gap: .78rem; color: inherit; text-decoration: none; }
.brand-logo { display: block; width: 54px; height: 54px; flex: 0 0 auto; border-radius: 50%; object-fit: contain; filter: drop-shadow(0 7px 16px rgba(0,0,0,.16)); }
.public-brand .brand-logo { width: 64px; height: 64px; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-copy strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; font-weight: 600; letter-spacing: .01em; }
.brand-copy small { color: rgba(255,255,255,.58); font-size: .69rem; letter-spacing: .09em; text-transform: uppercase; }
.sidebar-close { display: none; border: 0; color: var(--white); background: transparent; font-size: 1.8rem; line-height: 1; }
.side-nav { position: relative; display: flex; flex: 1; flex-direction: column; gap: .16rem; padding: .4rem .85rem 1rem; }
.nav-group-label { margin: 1.15rem .72rem .38rem; color: rgba(255,255,255,.38); font-size: .65rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-item { position: relative; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; min-height: 43px; gap: .35rem; padding: .58rem .7rem; border-radius: 12px; color: rgba(255,255,255,.72); font-size: .89rem; font-weight: 650; text-decoration: none; transition: color .2s, background .2s, transform .2s var(--ease); }
.nav-item:hover { color: var(--white); background: rgba(255,255,255,.07); transform: translateX(3px); }
.nav-item.is-active { color: var(--white); background: rgba(255,255,255,.11); box-shadow: inset 3px 0 0 var(--marigold-500); }
.nav-item-featured { color: #fff4d9; background: rgba(219,169,68,.10); }
.nav-glyph { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: var(--marigold-500); background: rgba(255,255,255,.06); font-family: Georgia, serif; font-size: 1rem; }
.nav-pulse { width: 7px; height: 7px; border-radius: 50%; background: #8dd9b3; box-shadow: 0 0 0 0 rgba(141,217,179,.4); animation: nav-pulse 2.2s infinite; }
.sidebar-note { position: relative; display: flex; gap: .65rem; margin: .5rem 1.1rem 1.25rem; padding: .9rem; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; color: rgba(255,255,255,.68); background: rgba(255,255,255,.04); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { color: rgba(255,255,255,.9); font-family: Georgia, serif; font-size: .78rem; font-weight: 600; }
.sidebar-note small { margin-top: .18rem; font-size: .68rem; line-height: 1.4; }
.note-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: .3rem; border-radius: 50%; background: var(--marigold-500); }
.sidebar-scrim { display: none; }
.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 60; display: flex; min-height: 76px; align-items: center; gap: 1rem; padding: .85rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid rgba(190,208,216,.72); background: rgba(242,247,249,.9); backdrop-filter: blur(16px); }
.topbar-context { display: flex; flex: 1; flex-direction: column; }
.topbar-context strong { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 600; }
.context-kicker { color: var(--ink-500); font-size: .64rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.menu-trigger { display: none; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.menu-trigger span { display: block; width: 18px; height: 2px; margin: 3px auto; background: var(--pine-900); }
.account-menu { display: flex; align-items: center; gap: .68rem; }
.account-avatar { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(23,63,57,.16); border-radius: 50%; color: var(--pine-900); background: var(--pine-100); font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.account-copy { display: flex; flex-direction: column; min-width: 0; }
.account-copy strong { max-width: 180px; overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--ink-500); font-size: .68rem; }
.account-signout { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-500); background: transparent; transition: .2s; }
.account-signout:hover { color: var(--white); border-color: var(--clay-500); background: var(--clay-500); transform: rotate(-8deg); }
.page-shell { width: min(100%, 1480px); min-height: calc(100vh - 130px); margin: 0 auto; padding: clamp(1.3rem, 3vw, 2.65rem) clamp(1rem, 3vw, 2.5rem) 4rem; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem clamp(1rem, 3vw, 2.5rem) 1.8rem; border-top: 1px solid var(--line); color: var(--ink-500); font-size: .72rem; }
.site-footer span:first-child { color: var(--pine-800); font-family: Georgia, serif; font-weight: 700; }

/* Public and identity shell */
.public-body { min-height: 100vh; background: var(--pine-950); }
.public-body::before, .public-body::after { content: ""; position: fixed; border-radius: 50%; pointer-events: none; }
.public-body::before { top: -22vw; right: -13vw; width: 52vw; height: 52vw; border: 1px solid rgba(255,255,255,.09); box-shadow: 0 0 0 7vw rgba(255,255,255,.025), 0 0 0 14vw rgba(255,255,255,.018); }
.public-body::after { bottom: -24vw; left: -15vw; width: 50vw; height: 50vw; background: rgba(94,171,212,.12); }
.public-header { position: relative; z-index: 2; padding: 1.5rem clamp(1.2rem, 5vw, 4rem); color: var(--white); }
.public-brand { width: max-content; }
.public-shell { position: relative; z-index: 2; width: min(100% - 3rem, 1240px); min-height: calc(100vh - 160px); margin: 0 auto; padding: clamp(1rem, 3vh, 2.5rem) 0; color: var(--ink-900); }
.public-shell > .row, .public-shell > form, .public-shell > section { max-width: 620px; margin-right: auto; margin-left: auto; padding: clamp(1.4rem, 4vw, 2.6rem); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-lg); }
.public-shell h1 { font-family: Georgia, serif; }
.public-footer { position: relative; z-index: 2; padding: 1.5rem; color: rgba(255,255,255,.52); text-align: center; font-size: .72rem; }

/* Staff sign-in */
.public-shell > .login-page { display: grid; width: 100%; max-width: 1180px; min-height: min(680px, calc(100vh - 190px)); grid-template-columns: minmax(0, 1.08fr) minmax(410px, .92fr); overflow: hidden; margin: 0 auto; padding: 0; border: 1px solid rgba(255,255,255,.22); background: var(--paper); box-shadow: 0 34px 90px rgba(5,25,22,.28); animation: login-enter .7s var(--ease) both; }
.login-story { position: relative; display: flex; min-width: 0; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(2.4rem, 5vw, 5rem); color: var(--white); background: linear-gradient(148deg, #164d69 0%, #0d354a 58%, #092839 100%); }
.login-story::before { content: "1:27"; position: absolute; top: -4rem; right: -1.5rem; color: rgba(255,255,255,.035); font-family: Georgia, serif; font-size: clamp(10rem, 22vw, 19rem); line-height: 1; letter-spacing: -.12em; }
.login-story::after { content: ""; position: absolute; right: -130px; bottom: -140px; width: 390px; height: 390px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 46px rgba(255,255,255,.035), 0 0 0 92px rgba(255,255,255,.02); }
.login-story-inner, .login-quote { position: relative; z-index: 1; }
.eyebrow-light { color: #9bd4ef; }
.eyebrow-light::before { background: #9bd4ef; }
.login-story h1 { max-width: 660px; margin: 1.1rem 0 1.2rem; color: var(--white); font-size: clamp(2.5rem, 4.5vw, 4.6rem); font-weight: 500; letter-spacing: -.055em; line-height: .98; }
.login-intro { max-width: 540px; margin: 0; color: rgba(255,255,255,.7); font-size: clamp(.95rem, 1.3vw, 1.08rem); line-height: 1.65; }
.login-points { display: grid; max-width: 560px; gap: 0; margin-top: clamp(2rem, 5vh, 3.8rem); border-top: 1px solid rgba(255,255,255,.14); }
.login-point { display: grid; grid-template-columns: 38px 1fr; gap: .8rem; padding: .92rem 0; border-bottom: 1px solid rgba(255,255,255,.14); }
.login-point > span { padding-top: .08rem; color: #9bd4ef; font-family: Georgia, serif; font-size: .78rem; }
.login-point strong, .login-point small { display: block; }
.login-point strong { color: var(--white); font-size: .84rem; }
.login-point small { margin-top: .12rem; color: rgba(255,255,255,.55); font-size: .72rem; }
.login-quote { display: flex; align-items: flex-start; gap: .65rem; max-width: 410px; margin-top: 2.5rem; color: rgba(255,255,255,.62); }
.login-quote > span { color: var(--marigold-500); font-family: Georgia, serif; font-size: 2rem; line-height: .8; }
.login-quote p { margin: 0; font-family: Georgia, serif; font-size: .84rem; font-style: italic; }
.login-panel { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; padding: clamp(2.3rem, 5vw, 4.8rem); background: var(--paper); }
.login-form-wrap { width: 100%; max-width: 440px; margin: auto; }
.login-kicker { color: var(--clay-600); font-size: .65rem; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.login-heading h2 { margin: .55rem 0 .5rem; font-family: Georgia, serif; font-size: clamp(2.2rem, 4vw, 3.45rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.login-heading p { max-width: 390px; margin: 0; color: var(--ink-500); font-size: .86rem; }
.login-form { margin-top: clamp(1.8rem, 4vh, 2.7rem); }
.login-field { margin-bottom: 1.15rem; }
.login-control { min-height: 56px; padding: .85rem 1rem; border-radius: 13px; font-size: .93rem; }
.login-label-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.password-toggle { margin-bottom: .36rem; padding: 0; border: 0; color: var(--pine-700); background: transparent; font-size: .69rem; font-weight: 750; }
.password-toggle:hover { color: var(--pine-950); text-decoration: underline; }
.login-remember { display: flex; width: fit-content; align-items: center; gap: .58rem; margin: .3rem 0 1.45rem; color: var(--ink-700); cursor: pointer; font-size: .78rem; }
.login-submit { display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: space-between; padding-right: 1.15rem; padding-left: 1.15rem; }
.login-submit span:last-child { font-family: Georgia, serif; font-size: 1.25rem; transition: transform .2s var(--ease); }
.login-submit:hover span:last-child { transform: translateX(4px); }
.login-alert:empty { display: none; }
.login-alert:not(:empty) { margin-bottom: 1rem; padding: .7rem .85rem; border: 1px solid #e4bcb6; border-radius: 10px; color: var(--danger); background: var(--danger-bg); font-size: .76rem; }
.login-alert ul { margin: 0; padding-left: 1.1rem; }
.login-help { display: grid; grid-template-columns: 30px 1fr; gap: .65rem; margin-top: 1.6rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-500); }
.login-help-mark { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--pine-800); font-family: Georgia, serif; font-weight: 700; }
.login-help p { margin: 0; font-size: .7rem; line-height: 1.5; }
.login-help strong { color: var(--ink-700); }
.login-security { margin-top: 2rem; color: var(--ink-500); font-size: .65rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.login-security span { margin-right: .35rem; color: #54a178; font-size: .58rem; }

/* Type and page headers */
h1, h2, h3, h4, h5, h6 { color: var(--ink-900); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.65rem; animation: enter-up .6s var(--ease) both; }
.page-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.04; }
.page-heading p { max-width: 700px; margin: .55rem 0 0; color: var(--ink-500); font-size: .93rem; }
.eyebrow { display: flex; align-items: center; gap: .5rem; margin-bottom: .48rem; color: var(--clay-600); font-size: .68rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--clay-500); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2, .panel > h2, .panel > .h5 { margin: 0; font-family: Georgia, serif; font-size: 1.12rem; font-weight: 600; }
.section-heading p { margin: .2rem 0 0; color: var(--ink-500); font-size: .78rem; }
.text-muted { color: var(--ink-500) !important; }

/* Surfaces and metrics */
.panel { position: relative; margin-bottom: 1.25rem; padding: clamp(1.1rem, 2vw, 1.45rem); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow-sm); animation: enter-up .55s var(--ease) both; }
.panel::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 1px rgba(255,255,255,.7); }
.panel-accent { overflow: hidden; color: var(--white); border: 0; background: var(--pine-900); }
.panel-accent::before { content: ""; position: absolute; right: -80px; bottom: -100px; width: 240px; height: 240px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 34px rgba(255,255,255,.04), 0 0 0 68px rgba(255,255,255,.025); }
.panel-accent h2, .panel-accent p, .panel-accent a { color: inherit; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; margin-bottom: 1.35rem; }
.stat-card { position: relative; min-height: 150px; overflow: hidden; padding: 1.15rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow-sm); transition: transform .3s var(--ease), box-shadow .3s var(--ease); animation: enter-up .55s var(--ease) both; }
.stat-card:nth-child(2) { animation-delay: .06s; }
.stat-card:nth-child(3) { animation-delay: .12s; }
.stat-card:nth-child(4) { animation-delay: .18s; }
.stat-card:hover { z-index: 2; transform: translateY(-5px); box-shadow: var(--shadow-md); }
.stat-card::before { content: ""; position: absolute; right: -40px; bottom: -62px; width: 130px; height: 130px; border: 18px solid var(--pine-50); border-radius: 50%; transition: transform .5s var(--ease); }
.stat-card:hover::before { transform: scale(1.15) rotate(12deg); }
.stat-card strong { position: relative; display: block; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.stat-card > span:not(.metric-delta) { position: relative; display: block; max-width: 150px; margin-top: .65rem; color: var(--ink-500); font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.stat-card-clay::before { border-color: var(--clay-100); }
.stat-card-gold::before { border-color: var(--marigold-100); }
.metric-delta { position: absolute; top: 1rem; right: 1rem; z-index: 1; padding: .2rem .45rem; border-radius: 999px; color: var(--success); background: var(--success-bg); font-size: .64rem; font-weight: 800; }
.split-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); gap: 1.25rem; align-items: start; }
.three-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }

/* Buttons and links */
.btn { position: relative; overflow: hidden; border-radius: 10px; padding: .58rem .95rem; font-size: .82rem; font-weight: 750; letter-spacing: .01em; transition: transform .18s var(--ease), box-shadow .18s, color .18s, background .18s, border-color .18s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn-primary, .btn-success { border-color: var(--pine-800); background: var(--pine-800); box-shadow: 0 5px 13px rgba(31,81,73,.18); }
.btn-primary:hover, .btn-success:hover { border-color: var(--pine-950); background: var(--pine-950); box-shadow: 0 8px 20px rgba(31,81,73,.24); }
.btn-outline-primary { color: var(--pine-800); border-color: var(--pine-700); }
.btn-outline-primary:hover { color: var(--white); border-color: var(--pine-800); background: var(--pine-800); }
.btn-outline-secondary { color: var(--ink-700); border-color: var(--line-strong); }
.btn-outline-secondary:hover { color: var(--ink-900); border-color: var(--ink-300); background: #eeeae1; }
.btn-outline-danger { color: var(--danger); border-color: #d39b95; }
.btn-outline-danger:hover { border-color: var(--danger); background: var(--danger); }
.btn-lg { border-radius: 12px; padding: .75rem 1.18rem; }
.btn-sm { border-radius: 8px; padding: .36rem .65rem; }
.ripple { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.42); pointer-events: none; transform: translate(-50%,-50%) scale(0); animation: ripple .55s ease-out; }
.quick-links { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.quick-links a { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 13px; color: var(--ink-900); background: var(--white); font-size: .82rem; font-weight: 750; text-decoration: none; transition: .25s var(--ease); }
.quick-links a::after { content: "→"; color: var(--clay-500); font-family: Georgia, serif; font-size: 1.2rem; transition: transform .25s var(--ease); }
.quick-links a:hover { border-color: var(--pine-100); background: var(--pine-50); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.quick-links a:hover::after { transform: translateX(4px); }

/* Forms */
.form-card { max-width: 980px; }
.form-section { min-width: 0; margin: 0 0 1.45rem; padding: 0 0 1.35rem; border: 0; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { margin-bottom: 1rem; border-bottom: 0; }
.form-section legend, .form-section h2 { width: auto; margin: 0; padding: 0; font-family: Georgia, serif; font-size: 1.08rem; font-weight: 600; }
.form-section > p { margin: .28rem 0 1rem; color: var(--ink-500); font-size: .76rem; }
.form-actions { position: sticky; bottom: .75rem; z-index: 8; width: max-content; max-width: 100%; padding: .65rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,248,.92); box-shadow: var(--shadow-md); backdrop-filter: blur(10px); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .2rem 1rem; }
.span-2 { grid-column: 1 / -1; }
.form-label { margin-bottom: .36rem; color: var(--ink-700); font-size: .75rem; font-weight: 780; }
.required::after { content: " *"; color: var(--clay-600); }
.form-control, .form-select { min-height: 43px; border-color: var(--line-strong); border-radius: 10px; color: var(--ink-900); background-color: var(--white); font-size: .86rem; box-shadow: inset 0 1px 2px rgba(31,41,39,.03); transition: border-color .2s, box-shadow .2s, transform .2s; }
.form-control:hover, .form-select:hover { border-color: var(--ink-300); }
.form-control:focus, .form-select:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 4px rgba(94,171,212,.18); }
textarea.form-control { min-height: 90px; }
.form-check-input:checked { border-color: var(--pine-700); background-color: var(--pine-700); }
.form-check-input:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 4px rgba(94,171,212,.18); }
.form-text { color: var(--ink-500); font-size: .72rem; }
.text-danger { color: var(--danger) !important; font-size: .75rem; }
.search-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .7rem; }
details { border-radius: 12px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; float: right; color: var(--clay-600); font-family: Georgia, serif; font-size: 1.4rem; transition: transform .25s; }
details[open] > summary::after { transform: rotate(45deg); }

/* Data tables */
.table-responsive { overflow: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--white); scrollbar-width: thin; scrollbar-color: var(--ink-300) transparent; }
.table { min-width: 680px; margin: 0; color: var(--ink-900); font-size: .81rem; }
.table.table-compact { min-width: 560px; }
.table > :not(caption) > * > * { padding: .82rem .85rem; border-bottom-color: var(--line); }
.table thead th { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line-strong); color: var(--ink-500); background: #eeece5; font-size: .67rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr { transition: background .18s, transform .18s; }
.table tbody tr:nth-child(even) { background: rgba(244,241,233,.45); }
.table tbody tr:hover { background: var(--pine-50); }
.table td { vertical-align: middle; }
.table td a:not(.btn) { color: var(--pine-800); font-weight: 750; text-decoration: none; }
.table td a:not(.btn):hover { text-decoration: underline; }
.table-actions { text-align: right; white-space: nowrap; }
.table-identity { display: flex; align-items: center; gap: .65rem; }
.mini-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--pine-900); background: var(--pine-100); font-family: Georgia, serif; font-size: .8rem; font-weight: 700; }

/* Lists and statuses */
.person-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.person-row:first-child { border-top: 0; }
.person-row strong { font-size: .86rem; }
.status { display: inline-flex; align-items: center; gap: .32rem; padding: .25rem .58rem; border-radius: 999px; color: var(--ink-700); background: #e9e7e0; font-size: .66rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.good { color: var(--success); background: var(--success-bg); }
.status.warn { color: #825c14; background: var(--marigold-100); }
.status.bad { color: var(--danger); background: var(--danger-bg); }
.empty-state { display: grid; min-height: 150px; place-items: center; padding: 2rem; border: 1px dashed var(--line-strong); border-radius: 13px; color: var(--ink-500); background: rgba(244,241,233,.52); text-align: center; font-size: .84rem; }
.meta-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1.15rem; margin: 0; }
.meta-list div { min-width: 0; }
.meta-list dt { margin-bottom: .23rem; color: var(--ink-500); font-size: .65rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.meta-list dd { margin: 0; overflow-wrap: anywhere; font-family: Georgia, serif; font-size: .98rem; font-weight: 600; }
.tablet-shell { width: min(100%, 1120px); margin: auto; }
.tablet-shell .btn { min-height: 48px; }

/* Notices */
.notice { display: grid; grid-template-columns: 32px 1fr 28px; align-items: center; gap: .7rem; margin-bottom: 1rem; padding: .8rem 1rem; border: 1px solid; border-radius: 13px; font-size: .82rem; box-shadow: var(--shadow-sm); }
.notice-success { color: var(--success); border-color: #bcd8ca; background: var(--success-bg); }
.notice-error { color: var(--danger); border-color: #e4bcb6; background: var(--danger-bg); }
.notice-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--white); background: currentColor; font-weight: 850; }
.notice-icon::first-letter { color: var(--white); }
.notice-close { border: 0; color: currentColor; background: transparent; font-size: 1.25rem; }

/* Charts and progress */
.bar-list { display: grid; gap: .9rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px,.7fr) minmax(60px,2fr) 36px; align-items: center; gap: .75rem; font-size: .78rem; }
.bar-label { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 11px; overflow: hidden; border-radius: 999px; background: #e8e5dc; }
.bar-fill { width: var(--bar, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pine-700), var(--brand-blue)); transform-origin: left; animation: grow-bar .9s .2s var(--ease) both; }
.bar-value { color: var(--ink-500); text-align: right; font-variant-numeric: tabular-nums; }
.progress-ring { --value: 0; display: grid; width: 96px; height: 96px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--marigold-500) calc(var(--value) * 1%), rgba(255,255,255,.13) 0); }
.progress-ring::before { content: ""; grid-area: 1/1; width: 72px; height: 72px; border-radius: 50%; background: var(--pine-900); }
.progress-ring strong { z-index: 1; grid-area: 1/1; color: var(--white); font-family: Georgia, serif; font-size: 1.3rem; }

/* Utility */
.filter-strip { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; }
.filter-strip > * { min-width: 150px; }
.filter-strip .filter-grow { flex: 1 1 260px; }
.segmented { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #ece9e1; }
.segmented .btn { border: 0; border-radius: 8px; color: var(--ink-500); background: transparent; box-shadow: none; }
.segmented .btn-primary { color: var(--pine-950); background: var(--white); box-shadow: var(--shadow-sm); }
.data-caption { display: flex; justify-content: space-between; gap: 1rem; margin: .85rem .1rem 0; color: var(--ink-500); font-size: .7rem; }
[data-reveal] { opacity: 0; transform: translateY(14px); }
[data-reveal].is-visible { opacity: 1; transform: none; transition: opacity .55s var(--ease), transform .55s var(--ease); }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; }

/* Motion */
@keyframes enter-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ripple { to { opacity: 0; transform: translate(-50%,-50%) scale(18); } }
@keyframes grow-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes seal-rotate { to { transform: rotate(360deg); } }
@keyframes nav-pulse { 60% { box-shadow: 0 0 0 7px rgba(141,217,179,0); } 100% { box-shadow: 0 0 0 0 rgba(141,217,179,0); } }
@keyframes login-enter { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }

/* Collapse dense dashboard grids before switching the navigation to its mobile drawer. */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .three-grid { grid-template-columns: 1fr 1fr; }
}

/* Tablet layouts use the same content order while freeing the workspace from the fixed sidebar. */
@media (max-width: 900px) {
  .sidebar { width: min(88vw, 310px); transform: translateX(-105%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 90; display: block; visibility: hidden; opacity: 0; background: rgba(16,47,43,.46); backdrop-filter: blur(3px); transition: .3s; }
  .nav-open .sidebar-scrim { visibility: visible; opacity: 1; }
  .app-main { margin-left: 0; }
  .menu-trigger { display: block; }
  .split-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
  .public-shell > .login-page { grid-template-columns: minmax(0, .82fr) minmax(390px, 1.18fr); }
  .login-story { padding: 2.4rem; }
  .login-story h1 { font-size: 2.75rem; }
  .login-points { margin-top: 2rem; }
  .login-point small, .login-quote { display: none; }
  .login-panel { padding: 2.4rem; }
}

/* Phone layouts stack actions and data so controls remain reachable without horizontal scrolling. */
@media (max-width: 640px) {
  .topbar { min-height: 66px; padding: .7rem 1rem; }
  .topbar-context { display: none; }
  .account-menu { margin-left: auto; }
  .account-copy { display: none; }
  .page-shell { padding: 1.25rem .85rem 3rem; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 2.15rem; }
  .page-heading > .btn, .page-heading > div:last-child { width: 100%; }
  .page-heading > .btn { text-align: center; }
  .stat-grid, .three-grid, .form-grid, .meta-list { grid-template-columns: 1fr; }
  .stat-card { min-height: 130px; }
  .span-2 { grid-column: auto; }
  .quick-links { grid-template-columns: 1fr; }
  .search-row { grid-template-columns: 1fr; }
  .person-row { align-items: flex-start; flex-direction: column; }
  .person-row > form, .person-row > form .btn { width: 100%; }
  .bar-row { grid-template-columns: 90px 1fr 36px; gap: .5rem; }
  .filter-strip > * { width: 100%; }
  .segmented { width: 100%; }
  .segmented .btn { flex: 1; }
  .public-shell { width: min(100% - 1.25rem, 980px); padding-top: 1rem; }
  .public-header { padding: 1rem 1.1rem; }
  .public-shell > .login-page { min-height: 0; grid-template-columns: 1fr; border-radius: 22px; }
  .login-story { min-height: 230px; padding: 2rem 1.5rem; }
  .login-story h1 { max-width: 420px; margin: .85rem 0 .7rem; font-size: 2.35rem; }
  .login-intro { font-size: .82rem; line-height: 1.5; }
  .login-points, .login-quote { display: none; }
  .login-panel { padding: 2rem 1.5rem; }
  .login-heading h2 { font-size: 2.45rem; }
  .login-security { margin-top: 1.5rem; }
}

/* Preserve every interaction when the user requests reduced motion; remove only animation. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
