:root {
    color-scheme: light;
    --ink: #30283a;
    --muted: #716a7b;
    --green: #7046a0;
    --green-dark: #57347d;
    --green-pale: #f1ebf8;
    --gold: #c89b4b;
    --line: #e7e1eb;
    --surface: #fff;
    --background: #faf9fc;
    --sidebar: #332541;
    --sidebar-foreground: #f3eef8;
    --sidebar-accent: #443252;
    --danger: #aa3333;
    font-family: "Rubik", system-ui, sans-serif;
    color: var(--ink);
    background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--background); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, h4 { font-family: "Merriweather", Georgia, serif; letter-spacing: -.025em; }
.muted { color: var(--muted); }
.eyebrow { display: block; color: var(--green); font-size: .77rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .45rem; min-height: 2.7rem; padding: .65rem 1rem; border: 1px solid var(--green); border-radius: .65rem; background: var(--green); color: #fff; font-weight: 650; }
.button:hover { background: var(--green-dark); border-color: var(--green-dark); }
.button-small { min-height: 2.25rem; padding: .4rem .75rem; font-size: .9rem; }
.button-light { border-color: var(--line); background: #fff; color: var(--ink); }
.button-light:hover { background: var(--green-pale); border-color: #d0c0e1; color: var(--green-dark); }
.button-danger { border-color: #efd2d2; background: #fff; color: var(--danger); }
.button-danger:hover { background: #fff3f3; border-color: #e6b9b9; }
.button-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.text-link { color: var(--green); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.site-header { position: sticky; top: 0; z-index: 4; display: flex; height: 4rem; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 0 max(1.5rem, calc((100vw - 1200px) / 2)); border-bottom: 1px solid rgb(73 49 95 / 12%); background: rgb(250 249 252 / 88%); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--green-dark); font-weight: 750; line-height: 1.25; }
.brand img { width: 2.8rem; height: 2.8rem; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 1.5rem; color: var(--muted); font-weight: 600; }
.site-nav a:hover { color: var(--green); }
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr); align-items: center; gap: clamp(2rem, 6vw, 5rem); max-width: 1200px; min-height: 650px; margin: auto; padding: 5rem 1.5rem; }
.hero::before { position: absolute; z-index: -1; inset: 0; background: linear-gradient(130deg, rgb(112 70 160 / 10%), rgb(200 155 75 / 12%) 52%, transparent 82%); content: ""; }
.hero h1 { max-width: 680px; margin: 1.4rem 0 1rem; font-size: clamp(2.7rem, 5.4vw, 4.4rem); line-height: 1.17; }
.hero h1 span { color: var(--green); }
.hero-copy > p { max-width: 650px; margin-bottom: 1.75rem; color: var(--muted); font-size: 1.13rem; }
.hero-badge { display: inline-flex; align-items: center; padding: .38rem .8rem; border: 1px solid rgb(112 70 160 / 22%); border-radius: 999px; background: rgb(112 70 160 / 6%); color: var(--green-dark); font-size: .8rem; font-weight: 600; }
.hero-stats { display: grid; grid-template-columns: repeat(3, max-content); gap: clamp(1.5rem, 4vw, 3rem); margin: 2rem 0; }
.hero-stats dt { color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.hero-stats dd { margin: .2rem 0 0; color: var(--green); font-family: "Merriweather", Georgia, serif; font-size: 2rem; font-weight: 700; }
.hero-art { position: relative; aspect-ratio: 1; overflow: hidden; border: 1px solid rgb(112 70 160 / 13%); border-radius: 1.35rem; background: linear-gradient(145deg, #52366f, #342542 65%, #292037); box-shadow: 0 24px 70px rgb(47 31 62 / 22%); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
.hero-art-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgb(112 70 160 / 33%), rgb(200 155 75 / 10%) 50%, transparent); }
.features-section { padding: 4.5rem max(1.5rem, calc((100vw - 1200px) / 2)); border-top: 1px solid rgb(73 49 95 / 12%); background: rgb(255 255 255 / 55%); }
.features-heading { max-width: 620px; margin: auto; text-align: center; }
.features-heading h2 { margin: .75rem 0 .5rem; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.features-heading p { color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; margin-top: 2.5rem; }
.feature-card { padding: 1.4rem; border: 1px solid rgb(73 49 95 / 12%); border-radius: .9rem; background: white; box-shadow: 0 5px 22px rgb(55 39 71 / 7%); transition: transform .18s ease, box-shadow .18s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 13px 32px rgb(55 39 71 / 13%); }
.feature-icon { display: grid; width: 2.7rem; height: 2.7rem; place-items: center; border-radius: .7rem; background: rgb(200 155 75 / 19%); color: var(--green); font-size: 1.25rem; font-weight: 700; }
.feature-card h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.feature-card p, .site-content p { margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.site-content { max-width: 900px; min-height: 70vh; margin: auto; padding: 4rem 1.5rem; }
.site-content h1 { margin: .75rem 0; font-size: clamp(2.4rem, 5vw, 3.6rem); }
.site-content .lead { max-width: 720px; margin-bottom: 2rem; font-size: 1.2rem; }
.content-card { margin: 1.5rem 0; }
.content-card h2 { margin-bottom: .4rem; }
.content-card p { margin-bottom: 0; }
.site-footer { max-width: 1200px; margin: auto; padding: 1.25rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-footer-grid { display: grid; max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; padding: 3rem max(1.5rem, calc((100vw - 1200px) / 2)) 1rem; background: #fff; }
.site-footer h3 { margin-bottom: .5rem; color: var(--green-dark); font-size: 1.1rem; }
.site-footer h4 { margin-bottom: .4rem; color: var(--ink); font-family: "Rubik", sans-serif; font-size: .9rem; }
.site-footer p { margin-bottom: 0; font-size: .85rem; }
.site-copyright { grid-column: 1 / -1; padding: 1rem 0; border-top: 1px solid var(--line); text-align: center; font-size: .75rem; }

.auth-page { display: flex; min-height: 100vh; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; padding: 2rem 1rem; background: linear-gradient(135deg, #f8f5fb, #f1ebf8 48%, #f9f3e9); }
.auth-brand { margin-bottom: .5rem; }
.auth-card { width: min(100%, 440px); padding: 2rem; border: 1px solid rgb(73 49 95 / 12%); border-radius: 1rem; background: #fff; box-shadow: 0 16px 48px rgb(47 31 62 / 11%); }
.auth-card h1 { margin-bottom: .35rem; font-size: 1.8rem; }
.auth-card > .muted { margin-bottom: 1.5rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-bottom: 1.25rem; padding: .25rem; border-radius: .7rem; background: var(--background); }
.auth-tabs button { padding: .55rem; border: 0; border-radius: .5rem; background: transparent; color: var(--muted); font-weight: 650; }
.auth-tabs button.active { background: white; color: var(--green-dark); box-shadow: 0 1px 4px rgb(0 0 0 / 10%); }
.form-stack { display: grid; gap: 1rem; }
.form-stack[hidden] { display: none; }
.form-stack label, .field { display: grid; gap: .35rem; color: #38483f; font-size: .9rem; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 2.65rem; padding: .6rem .7rem; border: 1px solid #d8d0df; border-radius: .55rem; background: #fff; color: var(--ink); }
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgb(112 70 160 / 15%); border-color: var(--green); }
.password-input { position: relative; display: block; }
.password-input input { padding-right: 4.5rem; }
.password-toggle { position: absolute; top: 50%; right: .5rem; min-width: 3.5rem; padding: .25rem .4rem; transform: translateY(-50%); border: 0; border-radius: .35rem; background: transparent; color: var(--green); font-size: .82rem; font-weight: 600; }
.password-toggle:hover { background: var(--green-pale); }
.password-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.auth-forgot { display: block; margin-top: 1rem; font-size: .9rem; }
.auth-back { margin: 1.5rem 0 0; text-align: center; }

.dashboard-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 2; display: flex; width: 260px; height: 100vh; height: 100dvh; flex-direction: column; overflow: hidden; padding: .9rem .8rem .8rem; border-right: 1px solid #49345c; background: radial-gradient(ellipse at 0 0, rgb(200 155 75 / 10%), transparent 35%), linear-gradient(180deg, #382849, #30213d 72%, #2a1e36); color: var(--sidebar-foreground); box-shadow: 8px 0 28px rgb(38 25 49 / 8%); }
.sidebar-brand { position: relative; flex: 0 0 auto; gap: .75rem; margin: 0 -.05rem .3rem; padding: .65rem .55rem 1rem; border-bottom: 1px solid rgb(226 205 166 / 15%); color: #f7f2fa; }
.sidebar-brand:hover { color: #fff; }
.sidebar-logo { display: grid; width: 2.65rem; height: 2.65rem; flex: 0 0 auto; place-items: center; border: 1px solid rgb(226 205 166 / 45%); border-radius: .7rem; background: #fff; box-shadow: 0 3px 12px rgb(0 0 0 / 16%); }
.sidebar-brand img { width: 2.4rem; height: 2.4rem; object-fit: contain; }
.sidebar-brand-copy { display: grid; gap: .12rem; }
.sidebar-brand-copy strong { color: #fff; font-size: .92rem; font-weight: 700; letter-spacing: .01em; }
.sidebar-brand-copy small { color: #cdbfda; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; }
.sidebar-scroll { min-height: 0; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto; padding: .8rem .1rem .6rem; overscroll-behavior: contain; scrollbar-color: rgb(224 205 171 / 32%) transparent; scrollbar-width: thin; }
.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { border-radius: 99px; background: rgb(224 205 171 / 32%); }
.sidebar-label { margin: .25rem .7rem .6rem; color: #ad9bbb; font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.dashboard-nav { display: grid; gap: .28rem; }
.dashboard-nav a { position: relative; display: flex; min-height: 2.65rem; align-items: center; gap: .8rem; padding: .57rem .72rem; border: 1px solid transparent; border-radius: .65rem; color: #ded4e7; font-size: .86rem; font-weight: 500; transition: background .16s, color .16s, border-color .16s, transform .16s; }
.dashboard-nav a:hover { transform: translateX(2px); border-color: rgb(233 218 190 / 10%); background: rgb(255 255 255 / 6%); color: #fff; }
.dashboard-nav a.active { border-color: rgb(208 168 86 / 18%); background: linear-gradient(90deg, rgb(200 155 75 / 19%), rgb(255 255 255 / 5%)); color: #f0d396; box-shadow: inset 3px 0 #d0a856, 0 3px 12px rgb(0 0 0 / 8%); }
.nav-icon { display: grid; width: 1.45rem; height: 1.45rem; flex: 0 0 auto; place-items: center; color: #b8a8c8; }
.nav-icon svg, .sidebar-bottom .button svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-nav a:hover .nav-icon, .dashboard-nav a.active .nav-icon { color: #e7c477; }
.sidebar-bottom { display: grid; flex: 0 0 auto; gap: .7rem; margin-top: auto; padding: .85rem .25rem .2rem; border-top: 1px solid rgb(226 205 166 / 16%); }
.sidebar-account { display: flex; min-width: 0; align-items: center; gap: .65rem; padding: .35rem .3rem; }
.sidebar-avatar { display: grid; width: 2rem; height: 2rem; flex: 0 0 auto; place-items: center; border: 1px solid rgb(226 205 166 / 45%); border-radius: 50%; background: rgb(200 155 75 / 17%); color: #f0d396; font-family: "Merriweather", Georgia, serif; font-size: .8rem; font-weight: 700; }
.sidebar-user { min-width: 0; overflow: hidden; color: #d0c4d9; font-size: .72rem; line-height: 1.45; text-overflow: ellipsis; }
.sidebar-bottom .button { min-height: 2.45rem; justify-content: flex-start; gap: .7rem; border-color: rgb(236 225 246 / 13%); background: rgb(255 255 255 / 5%); color: #e6dceb; font-size: .84rem; }
.sidebar-bottom .button:hover { border-color: rgb(208 168 86 / 35%); background: rgb(200 155 75 / 13%); color: #f4dba6; }
.dashboard-main { min-height: 100vh; margin-left: 250px; padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 3rem; }
.dashboard-topbar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: -1.5rem calc(clamp(1rem, 3vw, 2.5rem) * -1) 1.5rem; padding: 1rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid rgb(73 49 95 / 10%); background: rgb(250 249 252 / 91%); backdrop-filter: blur(14px); }
.dashboard-topbar h1 { margin: .2rem 0 0; font-size: clamp(1.65rem, 3vw, 2.3rem); }
.topbar-actions { display: flex; align-items: center; gap: .7rem; }
.notification-button { position: relative; width: 2.5rem; height: 2.5rem; border: 1px solid var(--line); border-radius: .65rem; background: #fff; color: var(--green-dark); font-size: 1.2rem; }
.notification-button span:not([hidden]) { position: absolute; top: -.3rem; right: -.3rem; display: grid; min-width: 1.1rem; height: 1.1rem; place-items: center; border-radius: 99px; background: #bd4545; color: white; font-size: .65rem; }
.page-intro { margin-bottom: 1.25rem; color: var(--muted); }
.panel { margin-bottom: 1rem; padding: 1.2rem; border: 1px solid rgb(73 49 95 / 10%); border-radius: .9rem; background: #fff; box-shadow: 0 3px 16px rgb(47 31 62 / 4%); }
.panel h2 { margin-bottom: .25rem; font-size: 1.1rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.panel-head p { margin-bottom: 0; color: var(--muted); font-size: .9rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .85rem; margin-bottom: 1rem; }
.stat-card { display: flex; min-height: 118px; flex-direction: column; align-items: flex-start; padding: 1rem 1.1rem; border: 1px solid rgb(73 49 95 / 10%); border-radius: .85rem; background: white; box-shadow: 0 3px 14px rgb(47 31 62 / 4%); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.stat-card:hover, .stat-card:focus-visible { transform: translateY(-2px); border-color: rgb(112 70 160 / 35%); box-shadow: 0 9px 24px rgb(47 31 62 / 12%); }
.stat-card:focus-visible { outline: 3px solid rgb(112 70 160 / 25%); outline-offset: 2px; }
.stat-card span { color: var(--muted); font-size: .85rem; }
.stat-card strong { display: block; margin-top: .25rem; color: var(--green); font-family: "Merriweather", Georgia, serif; font-size: 1.7rem; }
.stat-card .stat-card-action { margin-top: auto; padding-top: .4rem; color: var(--green); font-size: .75rem; font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; margin-bottom: 1rem; }
.toolbar .field { min-width: 145px; }
.permission-fieldset { flex: 1 0 100%; min-width: 0; margin: .25rem 0 .5rem; padding: 1rem; border: 1px solid var(--line); border-radius: .7rem; }
.permission-fieldset legend { padding: 0 .35rem; color: var(--ink); font-weight: 700; }
.permission-fieldset p { margin-bottom: .75rem; font-size: .88rem; }
.role-matrix-wrap { overflow-x: auto; }
.role-matrix { min-width: 720px; }
.role-matrix th, .role-matrix td { padding: .55rem .65rem; text-align: center; }
.role-matrix th:first-child, .role-matrix td:first-child { width: 25%; text-align: left; }
.role-matrix input[type="checkbox"] { width: 1.1rem; min-height: 1.1rem; margin: 0; accent-color: var(--green); vertical-align: middle; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .7rem .65rem; border-bottom: 1px solid #ece7f0; text-align: left; vertical-align: top; }
th { color: #62576d; font-size: .78rem; font-weight: 700; letter-spacing: .03em; }
td .button { margin: 0 .25rem .2rem 0; }
.empty-state { padding: 2rem 1rem; color: var(--muted); text-align: center; }
.notice { padding: .85rem 1rem; border-radius: .6rem; background: #fff3e4; color: #7e4814; }
.notice.error { background: #fff0f0; color: #912f2f; }
.notice.success { background: var(--green-pale); color: var(--green-dark); }
.record-dialog { width: min(92vw, 650px); max-height: 90vh; padding: 1.2rem; border: 1px solid var(--line); border-radius: .9rem; background: #fff; color: var(--ink); box-shadow: 0 20px 80px rgb(0 0 0 / 22%); }
.record-dialog::backdrop { background: rgb(16 36 25 / 48%); }
.record-dialog h2 { margin: .2rem 2rem 1rem 0; }
.dialog-dismiss { position: absolute; top: .6rem; right: .7rem; }
.dialog-dismiss button { width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: var(--background); font-size: 1.4rem; }
.record-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.record-fields .wide { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: end; gap: .5rem; margin-top: 1.1rem; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.toast-region { position: fixed; z-index: 10; top: 1rem; right: 1rem; display: grid; gap: .5rem; width: min(90vw, 380px); }
.toast { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border: 1px solid #cdb9df; border-left: 4px solid var(--green); border-radius: .65rem; background: #fff; color: var(--ink); box-shadow: 0 8px 24px rgb(47 31 62 / 16%); animation: toast-enter .18s ease-out; }
.toast.success { border-left-color: #55835c; }
.toast.error { border-color: #e8c5c5; border-left-color: var(--danger); color: var(--danger); }
.toast.info { border-left-color: var(--gold); }
.toast-dismiss { flex: 0 0 auto; margin: -.3rem -.35rem 0 0; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.2rem; line-height: 1; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.notification-button { display: grid; place-items: center; cursor: pointer; }
.notification-icon { width: 1.2rem; height: 1.2rem; }
.notification-panel { position: fixed; top: 4.6rem; right: 1.5rem; z-index: 3; width: min(90vw, 340px); max-height: min(70vh, 420px); overflow-y: auto; padding: 0; border: 1px solid var(--line); border-radius: .8rem; background: #fff; box-shadow: 0 12px 36px rgb(47 31 62 / 18%); }
.notification-panel[hidden] { display: none; }
.notification-panel h2 { position: sticky; top: 0; margin: 0; padding: .9rem 1rem; border-bottom: 1px solid var(--line); background: #fff; font-family: "Rubik", sans-serif; font-size: .95rem; }
.notification-item { position: relative; display: flex; width: 100%; flex-direction: column; gap: .25rem; padding: .9rem 1rem; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.notification-item:hover { background: var(--green-pale); }
.notification-item.read { opacity: .62; }
.notification-item strong { font-size: .86rem; }
.notification-item span { color: var(--muted); font-size: .8rem; }
.notification-item small { align-self: flex-start; padding: .1rem .35rem; border-radius: 99px; background: var(--green); color: white; font-size: .65rem; font-weight: 600; }
.notification-empty { margin: 0; padding: 1.5rem 1rem; color: var(--muted); font-size: .9rem; text-align: center; }
.filter-field { min-width: 180px; }
.report-shell { max-width: 1200px; margin: auto; padding: 2rem 1.25rem; }
.report-header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.report-header h1 { margin: .25rem 0; font-size: 2rem; }
.report-header p { margin-bottom: 0; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.report-muted { color: var(--muted); }
.report-shell > section { margin-bottom: 2rem; }
.report-shell h2 { margin-bottom: .5rem; font-size: 1.15rem; }
.report-card { margin-bottom: 1rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: #fff; }
.report-table-wrap { overflow-x: auto; }
.report-table th, .report-table td { border-bottom: 1px solid #e9efeb; padding: .7rem; vertical-align: top; }
.report-nav { display: flex; flex-wrap: wrap; gap: .45rem; margin: .9rem 0; }
.report-tab { padding: .5rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: white; cursor: pointer; }
.report-tab[aria-selected="true"] { border-color: var(--green); background: var(--green); color: white; }
.report-link { color: var(--green); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.report-notice { padding: .85rem 1rem; border-radius: .6rem; background: #fff3e4; color: #7e4814; }

@media (max-width: 760px) {
    .site-header { padding: 0 1rem; }
    .site-nav { flex-wrap: wrap; justify-content: end; gap: .6rem 1rem; }
    .hero { grid-template-columns: 1fr; gap: 1rem; padding-top: 2.3rem; }
    .hero-art { aspect-ratio: 4 / 3; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sidebar { position: static; width: auto; height: auto; overflow: visible; padding: .65rem 1rem; border-right: 0; border-bottom: 1px solid #49345c; box-shadow: 0 5px 18px rgb(38 25 49 / 9%); }
    .sidebar-brand { margin: 0; padding: .1rem .2rem .65rem; border-bottom: 0; }
    .sidebar-logo { width: 2.35rem; height: 2.35rem; }
    .sidebar-brand img { width: 2.1rem; height: 2.1rem; }
    .sidebar-brand-copy strong { font-size: .84rem; }
    .sidebar-scroll { min-height: auto; flex: 0 0 auto; overflow: visible; padding: .1rem 0; }
    .sidebar-label { display: none; }
    .dashboard-nav { display: flex; overflow-x: auto; gap: .25rem; padding-bottom: .3rem; }
    .dashboard-nav a { min-height: 2.5rem; flex: 0 0 auto; gap: .45rem; padding: .45rem .6rem; white-space: nowrap; }
    .nav-icon { width: 1.2rem; height: 1.2rem; }
    .nav-icon svg { width: 1rem; height: 1rem; }
    .sidebar-bottom { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .35rem; padding: .55rem 0 0; }
    .sidebar-account { padding: 0; }
    .sidebar-bottom .button { width: auto; min-height: 2.25rem; padding: .45rem .65rem; }
    .dashboard-main { margin-left: 0; padding-top: 1rem; }
    .dashboard-topbar { top: 0; margin-top: -1rem; }
}
@media (max-width: 520px) {
    .site-header { height: auto; min-height: 4rem; padding: .6rem 1rem; }
    .site-header .brand { max-width: 55%; font-size: .82rem; }
    .site-header .brand img { width: 2.3rem; height: 2.3rem; }
    .site-nav { gap: .5rem; font-size: .85rem; }
    .site-nav .button { min-height: 2rem; padding: .3rem .55rem; }
    .sidebar { padding-right: .65rem; padding-left: .65rem; }
    .dashboard-nav a { gap: .35rem; padding-right: .5rem; padding-left: .5rem; font-size: .78rem; }
    .hero { padding-right: 1rem; padding-left: 1rem; }
    .hero h1 { font-size: clamp(2.35rem, 11vw, 3.3rem); }
    .hero-stats { grid-template-columns: repeat(3, 1fr); gap: .75rem; }
    .hero-stats dd { font-size: 1.55rem; }
    .hero-art { aspect-ratio: 1 / 1; }
    .features-section { padding: 3rem 1rem; }
    .feature-grid { grid-template-columns: 1fr; }
    .site-footer-grid { grid-template-columns: 1fr; gap: 1.4rem; padding: 2rem 1rem 1rem; }
    .site-copyright { grid-column: auto; }
    .auth-card { padding: 1.4rem; }
    .record-fields { grid-template-columns: 1fr; }
    .record-fields .wide { grid-column: auto; }
    .dashboard-topbar { align-items: flex-start; }
}
@media print {
    .sidebar, .dashboard-topbar > a, .topbar-actions, .toolbar, .panel-head button, .toast-region { display: none !important; }
    .dashboard-main { margin: 0; padding: 0; }
    .panel, .stat-card { break-inside: avoid; box-shadow: none; }
    body, .dashboard-main { background: #fff; }
}
