/* Huynh Van Nghe — theme 1.1.0. Presentation only; app.css retains all existing forms and tables. */
:root {
  --navy: #173528; --navy-deep: #104a29; --teal: #17723e; --teal-dark: #10582f;
  --teal-light: #edf7ed; --ink: #24352f; --muted: #6b7973; --line: #e7ece4;
  --bg: #faf9f5; --white: #fff; --orange: #96620d; --red: #cf202c;
  --primary: #d61c28; --primary-dark: #b7101b; --green: #18743f; --gold: #f5c83c;
  --sidebar-width: 248px; --radius: 14px; --shadow: 0 3px 15px #23392307;
}
body { font-size: 14px; background: var(--bg); color: var(--ink); }
body, input, button, select, textarea { font-family: "Segoe UI", Arial, sans-serif; }
* { scrollbar-color: #bbc9b8 transparent; scrollbar-width: thin; }
a { color: var(--green); }
a:hover { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #247343; outline-offset: 3px; }
:focus-visible { scroll-margin-top: 90px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 18px; top: -100px; padding: 11px 16px; border-radius: 9px; background: #fff; z-index: 100; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.btn { border-radius: 9px; min-height: 41px; font-size: 12px; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 3px 7px #ce1c2414; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.outline { color: #365943; border-color: #dce5d8; background: #fff; }
.btn.outline:hover { color: #155a2e; background: #f4f8ed; border-color: #a6c3a0; }
.btn.subtle { background: #edf4e7; color: #2e613e; }
.btn.danger-solid { background: #be1a26; }
.icon-btn { color: #526659; }
.icon-btn:hover { background: #edf4e8; color: var(--green); }
.text-link { color: #c71e29; font-size: 11px; }
.text-link:hover { color: #a20f1d; }
.eyebrow { color: #55765b; letter-spacing: 1.45px; font-size: 10px; }
.pill.teal { background: #eaf6e8; color: #226637; }
.pill.orange { background: #fff4d8; color: #8d5b06; }
.pill.neutral { background: #f1f4ed; color: #62715f; }
.pill.light { background: #fff7d8; color: #765b0f; border-color: #f3dfa6; }
/* School identity, anchored in the top-left corner on every signed-in page. */
.sidebar { width: var(--sidebar-width); padding: 16px 13px 0; background: linear-gradient(170deg,#f3f8e5,#f5f8eb 70%,#edf5dd); border-right: 1px solid #e6eddc; color: #32523b; }
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; color: #126436; margin: 0 0 12px; flex-shrink: 0; }
.brand:hover { color: #126436; }
.brand-mark { background: transparent !important; padding: 0; display: flex; width: 82px; height: 93px; border-radius: 0; flex-shrink: 0; }
.brand-mark img { object-fit: contain; width: 100%; height: 100%; }
.brand-type { display: block; font-size: 15px; line-height: 1.4; letter-spacing: 0; }
.brand-type .brand-prefix { display: block; font-size: 11px; font-weight: 700; letter-spacing: .2px; }
.brand-type strong { display: block; font-weight: 800; }
.brand-type small { font-size: 9px; color: #506749; margin: 3px 0 0; letter-spacing: .6px; font-weight: 500; opacity: 1; }
.sidebar nav { flex: 1; min-height: 0; overflow: auto; padding: 0 0 10px; scrollbar-width: thin; scrollbar-color: #bdceb0 transparent; }
.nav-label { font-size: 8px; color: #76876a; letter-spacing: 1.25px; font-weight: 600; margin: 15px 12px 8px; }
.nav-label:first-child { margin-top: 6px; }
.nav-item { gap: 12px; min-height: 39px; padding: 9px 12px; margin: 3px 0; border: 1px solid transparent; font-size: 12px; color: #354d3c; border-radius: 8px; }
.nav-item .icon { width: 18px; height: 18px; opacity: 1; color: #356044; }
.nav-item:hover { background: #e6f0d8; color: #114c2a; }
.nav-item.active { background: linear-gradient(110deg,#df2029,#ce1722); border-color: #d61c25; color: #fff; box-shadow: 0 3px 9px #c8282510; }
.nav-item.active .icon { color: #fff; }
.nav-item.active::after { display: none; }
.sidebar-bottom { position: relative; overflow: hidden; border-top: 1px solid #e0eacb; padding: 13px 10px 12px; color: #57764b; font-size: 10px; flex-shrink: 0; text-align: center; }
.sidebar-bottom::after { content: ""; position: absolute; width: 125px; height: 80px; border-radius: 100% 0; background: #bad47d24; right: -32px; bottom: -33px; transform: rotate(-25deg); pointer-events: none; }
.sidebar-motto { position: relative; margin-bottom: 8px; font-size: 13px; font-weight: 600; font-style: italic; line-height: 1.55; color: #23643b; }
.sidebar-motto em { color: #d81c29; }
.sidebar-motto .icon { width: 12px; height: 12px; color: #d82029; fill: #d82029; }
.sidebar-bottom small { color: #6e8166; font-size: 9px; margin: 3px 0 0; }
.online-dot { background: #369555; width: 6px; height: 6px; margin-right: 6px; }
.sidebar-close { display: none; }
.workspace { margin-left: var(--sidebar-width); transition: margin-left .15s ease; }
/* Genuine search, school-year switching, and account actions; no decorative fake controls. */
.topbar { height: 66px; padding: 0 25px; gap: 18px; background: #fff; position: relative; border-bottom-color: #ebeee5; z-index: 10; }
.topbar-left { gap: 16px; flex: 1; }
.topbar-actions { gap: 19px; }
.nav-toggle { display: flex; width: 34px; height: 34px; }
.nav-toggle .icon { width: 20px; height: 20px; }
.global-search { display: flex; align-items: center; gap: 8px; max-width: 420px; flex: 1; min-width: 150px; margin: 0; padding: 1px 7px 1px 12px; background: #f7f8f5; border: 1px solid #e9ece4; border-radius: 8px; }
.global-search > .icon { width: 16px; height: 16px; color: #82917a; }
.global-search input[type=search] { background: none; border: 0; box-shadow: none; min-width: 0; margin: 0; font-size: 12px; padding: 9px 0; min-height: 35px; }
.global-search:focus-within { outline: 2px solid #417b46; outline-offset: 1px; }
.global-search input::placeholder { color: #7a887b; font-size: 11px; }
.global-search .icon-btn { width: 27px; height: 27px; }
.year-form { background: #fff; border-color: #e5eadd; padding: 4px 8px; }
.year-form select { font-size: 11px; color: #3a5141; padding: 4px 8px 4px 0; }
.year-form .icon { color: #46694c; }
.avatar { width: 35px; height: 35px; background: #e4f1d9; color: #257641; border: 1px solid #d8e8cf; }
.account-label { color: #2f4538; font-size: 11px; max-width: 140px; }
.account-label small { color: #768470; font-size: 9px; }
.account-menu > summary::after { content: "⌄"; margin-left: 2px; font-size: 14px; color: #51624c; }
.account-dropdown { border-color: #e0e8d7; }
.account-dropdown a, .account-dropdown button { color: #3f5a40; }
.account-dropdown a:hover, .account-dropdown button:hover { background: #f2f7eb; }
.mobile-brand, .search-toggle { display: none; }
.main-content { padding: 25px 25px 28px; max-width: 1740px; outline: none; }
.page-heading { margin-bottom: 22px; align-items: center; }
.page-heading h1 { font-size: 27px; font-weight: 750; letter-spacing: -.6px; color: #23372c; }
.page-heading p { color: #6e7d6e; font-size: 12px; }
.dashboard-heading { margin-bottom: 17px; }
.dashboard-heading .eyebrow { font-size: 8px; margin-bottom: 5px; letter-spacing: 1.55px; }
.dashboard-heading h1 { font-size: 25px; margin-bottom: 4px; line-height: 1.35; overflow-wrap: anywhere; }
.heading-actions { flex-shrink: 0; }
.heading-actions .inline-form input, .heading-actions .inline-form select { width: 148px; min-height: 41px; margin: 0; padding: 9px 10px; font-size: 12px; background: #fff; }
/* Live HTML headings with a locally stored illustration from the selected mockup. */
.hvn-hero { min-height: 180px; padding: 23px 26px; display: flex; align-items: center; margin-bottom: 17px; isolation: isolate; color: #166733; background: linear-gradient(112deg,#fff6cd,#fffbe6 56%,#fff5c1); border-radius: 12px; border: 1px solid #f6eabd; }
.hvn-hero::before { content: ""; position: absolute; z-index: -1; width: 270px; height: 100px; left: -14px; bottom: -58px; border-radius: 50%; background: #ffe26d72; transform: rotate(12deg); }
.hvn-hero::after { content: ""; position: absolute; z-index: -1; width: 240px; height: 80px; right: -44px; bottom: -36px; border-radius: 100% 0; background: linear-gradient(18deg,#22823b 5%,#79ad46 43%,#fbe56f 43%,#fbe56f 72%,#fff1a8 72%); transform: rotate(-12deg); }
.hero-copy { position: relative; z-index: 2; flex: 0 0 48%; padding-right: 8px; }
.hero-kicker { font-size: 9px; letter-spacing: 1.2px; color: #7a7427; font-weight: 650; }
.hvn-hero h2 { color: #0d6b34; font-size: clamp(20px,1.9vw,28px); line-height: 1.3; margin: 7px 0; font-weight: 850; font-style: italic; letter-spacing: -.7px; }
.hvn-hero h2 em { color: #db1e29; font-style: italic; }
.hvn-hero p { color: #536e5b; font-size: 10px; margin: 0; line-height: 1.7; }
.hero-period { display: inline-block; margin-top: 9px; font-size: 9px; color: #7e752e; }
.hero-children { position: absolute; z-index: 1; left: 46%; bottom: -1px; width: 33%; height: auto; max-height: 175px; object-fit: contain; object-position: bottom; }
.hero-motto { position: absolute; right: 3.5%; top: 20%; color: #166538; font-size: 21px; font-style: italic; line-height: 1.35; text-align: center; transform: rotate(-5deg); }
.hero-motto em { color: #d62129; font-weight: 600; }
.hero-motto span { color: #e62a32; }
.hero-star { position: absolute; color: #e8ae00; z-index: 0; font-size: 26px; }
.star-a { top: 17px; left: 44%; }
.star-b { right: 17px; top: 10px; font-size: 21px; }
/* Summary cards are linked to the correct filtered records. */
.stats-grid { gap: 15px; margin-bottom: 18px; }
.stat-card { box-shadow: none; border-color: var(--line); border-radius: 12px; }
.hvn-stats .stat-card { display: flex; flex-direction: row; align-items: center; gap: 13px; padding: 17px 16px; min-height: 105px; transition: border-color .15s, transform .15s; }
.hvn-stats .stat-card:hover { transform: translateY(-2px); border-color: #b7cbaa; }
.hvn-stats .stat-card > div { min-width: 0; }
.tone-red { --tone: #d91e28; --tone-bg: #fff1f1; --tone-border: #ffdddc; --tone-icon: #ffe1e2; }
.tone-gold { --tone: #a96800; --tone-bg: #fffae8; --tone-border: #f6ecc6; --tone-icon: #fff0b9; }
.tone-green { --tone: #19743d; --tone-bg: #f0f8ec; --tone-border: #ddeed5; --tone-icon: #dbf1d6; }
.tone-rose { --tone: #dd2534; --tone-bg: #fff1f1; --tone-border: #ffdddd; --tone-icon: #ffddde; }
.hvn-stats .stat-card, .hvn-quick .quick-action { background: var(--tone-bg); border: 1px solid var(--tone-border); }
.hvn-stats .stat-icon { color: var(--tone); background: var(--tone-icon); border: 1px solid var(--tone-border); border-radius: 50%; width: 47px; height: 47px; flex-shrink: 0; }
.hvn-stats .stat-icon .icon { width: 24px; height: 24px; stroke-width: 1.9; }
.stat-label { display: block; color: #344736; font-size: 11px; font-weight: 600; line-height: 1.4; }
.hvn-stats .stat-value { margin: 3px 0 4px; color: var(--tone); font-size: 29px; font-weight: 800; line-height: 1.15; letter-spacing: -.6px; }
.hvn-stats .tone-gold .stat-value { color: #c92826; }
.stat-card p, .hvn-stats .stat-card p { color: #6b7d6a; font-size: 9px; line-height: 1.5; }
.stat-icon.blue, .stat-icon.purple { background: #ffe9e8; color: #d32830; }
.stat-icon.teal { background: #fff3c9; color: #986800; }
.stat-icon.orange { background: #e6f4de; color: #2b7b39; }
/* Dashboard columns align independently, just like the approved layout. */
.dashboard-columns { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 18px; align-items: start; }
.dashboard-primary, .dashboard-secondary { min-width: 0; }
.card { padding: 19px; box-shadow: 0 2px 6px #122b3a02; margin-bottom: 18px; border-color: #e6ebe2; }
.card-heading { gap: 12px; margin-bottom: 16px; }
.card-heading h2 { display: flex; align-items: center; gap: 9px; color: #293d31; font-size: 14px; margin: 0 0 4px; font-weight: 700; }
.card-heading h2 .icon { color: #d21b28; width: 18px; height: 18px; }
.card-heading p { font-size: 10px; color: #788773; }
.card-heading > .icon { color: #ce1f2b; }
.dashboard-columns .card-heading .text-link { font-size: 10px; }
.card-heading .pill { font-size: 10px; }
.chart-card .card-heading { margin-bottom: 9px; }
.chart-legend { display: flex; gap: 17px; justify-content: flex-end; color: #6a7a67; font-size: 10px; margin: 7px 0 10px; }
.chart-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.green { background: #39955a; }
.legend-dot.red { background: #ef5258; }
.comparison-chart { display: flex; gap: 10px; padding-top: 3px; }
.chart-axis { width: 22px; display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 28px; font-size: 9px; color: #7c8b78; text-align: right; }
.chart-axis span { line-height: 1; }
.chart-plot { display: flex; gap: 10px; flex: 1; min-width: 0; background: repeating-linear-gradient(to top,transparent,transparent calc(25% - 1px),#edf0e9 calc(25% - 1px),#edf0e9 25%); background-repeat: no-repeat; background-size: 100% 160px; }
.chart-month { flex: 1; min-width: 0; }
.chart-pair { height: 160px; display: flex; justify-content: center; align-items: flex-end; gap: 4px; border-bottom: 1px solid #e4e9e0; }
.chart-column { flex: 1; max-width: 18px; border-radius: 3px 3px 0 0; display: block; }
.chart-column.green { background: linear-gradient(#399858,#53ac75); }
.chart-column.red { background: linear-gradient(#f5545d,#f88385); }
.chart-month-label { display: block; text-align: center; font-size: 9px; color: #6e7f6a; line-height: 28px; white-space: nowrap; }
.chart-values { margin-top: 1px; }
.chart-values > summary { color: #6b7d68; cursor: pointer; font-size: 10px; width: fit-content; padding: 3px 0; }
.chart-values table { margin-top: 10px; }
.hvn-grades { padding-top: 3px; }
.hvn-grade-row { display: grid; grid-template-columns: 44px minmax(30px,1fr) 57px 38px; align-items: center; gap: 10px; margin: 16px 0; font-size: 10px; color: #53694d; }
.hvn-grade-row:last-child { margin-bottom: 4px; }
.hvn-grade-row > strong { font-size: 11px; color: #3b5136; white-space: nowrap; }
.hvn-grade-row > span { font-size: 10px; text-align: right; white-space: nowrap; }
.hvn-grade-row small { font-size: 8px; }
.hvn-grade-row > b { font-size: 9px; font-weight: 500; color: #6c8065; text-align: right; }
.hvn-progress { height: 12px; background: #f1f4ee; border-radius: 5px; overflow: hidden; }
.hvn-progress i { display: block; height: 100%; background: #43a16c; border-radius: 5px; }
.grade-7 .hvn-progress i { background: #ffda5b; }
.grade-8 .hvn-progress i { background: #f16b70; }
.grade-9 .hvn-progress i { background: #54a777; }
.hvn-grade-row:hover .hvn-progress { outline: 1px solid #b9cbaa; }
.hvn-quick { gap: 10px; }
.hvn-quick .quick-action { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 13px 10px; border-radius: 11px; min-width: 0; }
.hvn-quick .quick-action > .icon { color: var(--tone); width: 24px; height: 24px; margin: 0; }
.hvn-quick .quick-action strong { display: block; font-size: 10px; color: #344833; margin: 0 0 2px; }
.hvn-quick .quick-action small { color: #73846b; font-size: 8px; display: block; }
.hvn-quick .quick-action:hover { box-shadow: 0 3px 9px #7c995016; border-color: #b9cfa6; transform: translateY(-1px); }
.activity-table { border: 1px solid #edf0e8; border-radius: 9px; }
.activity-table th { border-top: 0; }
.activity-table th, .activity-table td { font-size: 10px; padding: 11px 10px; }
.activity-title { display: block; color: #3f553b; font-size: 10px; font-weight: 550; line-height: 1.6; min-width: 125px; }
.activity-title:hover { color: #ba1926; }
.activity-table .cell-sub { max-width: 260px; font-size: 8px; color: #7c8b75; }
.activity-table .pill { font-size: 8px; padding: 3px 6px; }
.event-list { display: flex; flex-direction: column; gap: 0; }
.event-item { display: flex; align-items: center; gap: 11px; color: #3a5136; padding: 11px 0; border-top: 1px solid #f0f2eb; }
.event-item:first-child { border-top: 0; padding-top: 1px; }
.event-item > span:nth-child(2) { min-width: 0; flex: 1; }
.event-item > span:nth-child(2) > strong { font-size: 11px; line-height: 1.5; display: block; }
.event-item > span:nth-child(2) > small { font-size: 9px; color: #788b71; display: block; margin-top: 3px; }
.event-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 43px; height: 49px; background: #fff0ef; color: #d4242a; border-radius: 8px; flex-shrink: 0; }
.event-date strong { font-size: 20px; font-weight: 750; line-height: 1.1; }
.event-date small { font-size: 8px; font-weight: 700; }
.event-item > .icon { width: 14px; height: 14px; color: #a4b19c; }
.event-item:hover { color: #c31924; }
.dashboard-footnote { display: flex; gap: 8px; color: #788f6c; font-size: 10px; padding: 0 5px; }
.dashboard-footnote .icon { width: 15px; height: 15px; margin-top: 2px; }
.dashboard-footnote p { font-size: 9px; line-height: 1.65; }
/* Existing modules: table tools, Excel import, dialogs, reports and configuration. */
.table-card { padding: 0; }
th { background: #f7f9f3; border-color: #e9eee3; color: #687e5f; }
td { border-color: #edf0e8; color: #54654d; }
td strong { color: #344b34; }
tbody tr:hover { background: #fcfdf8; }
.cell-sub { color: #7a8b73; }
.number-strong { color: #345c36; }
.score { color: #217441 !important; }
.table-caption { color: #768770; }
.table-caption strong { color: #315f38; }
.pagination { border-color: #edf0e4; color: #6b7e63; }
.filter-bar { border-color: #e8eedf; }
.search-field { border-color: #dce5d4; }
.search-field .icon { color: #7f9573; }
label { color: #4b6346; }
input, select, textarea { color: #314a34; border-color: #dce5d6; }
input:focus, select:focus, textarea:focus { border-color: #518958; box-shadow: 0 0 0 3px #72a56a1a; }
input::placeholder, textarea::placeholder { color: #869680; }
input[type=file] { background: #fbfcf7; }
input[type=file]::file-selector-button { color: #38623a; background: #edf4e3; }
input[type=checkbox] { accent-color: #267740; }
.field-note { color: #74866b; }
.record-dialog { border-color: #e4eadd; box-shadow: 0 18px 100px #27351d38; }
.record-dialog::backdrop { background: #1c331e65; }
.dialog-heading { border-bottom-color: #e7eddc; }
.dialog-heading h2 { color: #305132; }
.dialog-footer { background: #f9fbf4; border-color: #e7eddc; }
.detail-grid dt { color: #73876a; }
.detail-grid dd { color: #365d39; }
.notice.info { background: #f1f7e8; color: #4c6c3e; border-color: #e0ebd0; }
.notice.success { background: #edf8e9; color: #2d6f36; border-color: #d8eccd; }
.notice.warning { background: #fff8e7; color: #7a601f; border-color: #f3e7be; }
.notice.error { background: #fff0ef; color: #a32731; border-color: #f4d4d5; }
.empty-icon, .feature-icon { background: #f1f6e9; color: #80a071; }
.empty-state { color: #7c8c71; }
.empty-state h3 { color: #637b54; }
.empty-state p { color: #6e8264; }
.scoring-pills > span { background: #f2f9e9; border-color: #dfeccd; color: #61784e; }
.scoring-pills b { color: #267b3c; }
.scoring-pills .negative { background: #fff0ee; border-color: #f6deda; color: #ac6360; }
.scoring-pills .negative b { color: #b9232c; }
.scoring-pills > a { color: #c2232b; }
.step-number { background: #e9f4df; color: #3b7d3c; }
.import-summary strong { color: #326c38; }
.import-summary span, .instruction-card p, .backup-card p { color: #6f8363; }
.bar { background: linear-gradient(#45a15f,#88bc77); }
.grade-label { background: #edf5e5; color: #417e3b; }
.progress-track { background: #f0f4e9; }
.progress-track i { background: #6aad55; }
.app-footer { padding: 16px 25px; border-color: #e9eee1; font-size: 9px; color: #778a6c; align-items: center; }
.app-footer small { display: block; font-size: 8px; margin-top: 2px; }
.footer-motto { color: #247044; font-style: italic; font-size: 13px; font-weight: 600; white-space: nowrap; }
.footer-motto .icon { color: #d62730; fill: #d62730; width: 14px; height: 14px; margin-left: 4px; }
/* Authentication shares the same identity without adding demo accounts. */
.auth-body { background: #fffdf7; }
.auth-layout { grid-template-columns: minmax(380px,48%) 1fr; }
.auth-story { background: linear-gradient(150deg,#f4f8e4,#fff7ce 70%,#edf4d9); padding: 40px 50px; color: #17592d; }
.auth-story .brand { flex-direction: row; text-align: left; gap: 17px; }
.auth-story .brand-mark { width: 76px; height: 87px; }
.auth-story .brand-type { font-size: 20px; }
.auth-story .brand-prefix { font-size: 13px; }
.auth-story .brand-type small { font-size: 10px; }
.auth-story::before { border-color: #72a6471c; background: #edda6b10; }
.auth-story::after { border-color: #7dad5224; }
.auth-message { padding: 35px 0 10px; }
.auth-message .eyebrow { color: #6b8548; font-size: 9px; letter-spacing: 1.2px; margin-bottom: 16px; }
.auth-message h1 { color: #126737; font-size: 37px; font-weight: 800; line-height: 1.4; letter-spacing: -1.3px; }
.auth-message h1 em { color: #d71e29; font-style: normal; }
.auth-message p { color: #6c8056; font-size: 13px; }
.auth-children { width: min(400px,100%); height: auto; display: block; margin: 28px auto 0; }
.auth-note { color: #6a8156; font-size: 10px; display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.auth-note .icon { width: 15px; height: 15px; }
.auth-panel { background: #fffefb; }
.auth-card h2 { color: #28472e; }
.auth-card > p { color: #6e7f64; }
.auth-card .lock-note { color: #75896d; }
.auth-panel > footer { color: #849378; }
.setup-body { background: #fafbef; }
.setup-wrap > .brand { flex-direction: row; text-align: left; gap: 18px; }
.brand.dark { color: #1d6835; }
.setup-heading h1 { color: #275b32; }
.setup-heading p { color: #6c7f61; }
@media (min-width: 1700px) {
  :root { --sidebar-width: 266px; }
  .main-content { padding: 30px 38px; }
  .topbar { padding: 0 38px; }
  .hvn-hero { min-height: 196px; }
  .hvn-hero h2 { font-size: 30px; }
  .hero-children { max-height: 188px; }
  .hero-motto { font-size: 25px; }
  .hvn-stats .stat-card { padding: 21px; }
  .hvn-stats .stat-value { font-size: 32px; }
}
@media (min-width: 961px) {
  body.sidebar-compact { --sidebar-width: 80px; }
  .sidebar-compact .sidebar { padding: 15px 9px 0; }
  .sidebar-compact .brand-mark { width: 46px; height: 52px; }
  .sidebar-compact .brand-type, .sidebar-compact .nav-item > span, .sidebar-compact .sidebar-bottom { display: none; }
  .sidebar-compact .brand { margin-bottom: 12px; }
  .sidebar-compact .nav-label { font-size: 0; margin: 10px 8px 8px; border-top: 1px solid #dbe6cc; padding-top: 0; }
  .sidebar-compact .nav-item { justify-content: center; padding: 10px; min-height: 41px; }
}
@media (max-width: 1279px) and (min-width: 961px) {
  :root { --sidebar-width: 228px; }
  .main-content { padding: 23px 20px; }
  .topbar { padding: 0 20px; gap: 12px; }
  .topbar-left { gap: 8px; }
  .topbar-actions { gap: 12px; }
  .account-label { max-width: 100px; }
  .global-search { max-width: 320px; }
  .dashboard-heading { align-items: flex-start; }
  .dashboard-heading h1 { font-size: 22px; }
  .hvn-hero { min-height: 181px; padding: 22px; }
  .hero-copy { flex-basis: 60%; }
  .hvn-hero h2 { font-size: 25px; }
  .hero-children { width: 37%; left: auto; right: 0; }
  .hero-motto { display: none; }
  .stats-grid { gap: 11px; }
  .hvn-stats .stat-card { padding: 13px 11px; gap: 9px; align-items: flex-start; }
  .hvn-stats .stat-icon { width: 32px; height: 32px; }
  .hvn-stats .stat-icon .icon { width: 18px; height: 18px; }
  .hvn-stats .stat-value { font-size: 26px; }
  .stat-label { font-size: 10px; }
  .dashboard-columns { gap: 15px; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); }
  .card { padding: 16px; }
  .table-card { padding: 0; }
  .card-heading h2 { font-size: 12px; }
  .dashboard-columns .card-heading .text-link { font-size: 9px; }
  .hvn-grade-row { grid-template-columns: 39px minmax(20px,1fr) 37px 30px; gap: 7px; }
  .hvn-grade-row small { display: none; }
  .hvn-quick .quick-action { padding: 12px 8px; gap: 7px; }
  .hvn-quick .quick-action > .icon { width: 20px; height: 20px; }
  .hvn-quick .quick-action strong { font-size: 9px; }
  .hvn-quick .quick-action small { font-size: 8px; }
  .chart-plot { gap: 6px; }
  .chart-pair { gap: 3px; }
  .chart-month-label { font-size: 8px; }
}
@media (max-width: 1100px) {
  .dashboard-heading { flex-direction: column; align-items: flex-start; gap: 13px; }
  .dashboard-heading .heading-actions { justify-content: flex-start; }
  .auth-story { padding: 30px; }
  .auth-message h1 { font-size: 29px; }
}
@media (max-width: 960px) {
  .sidebar { width: 255px; transform: translateX(-100%); transition: transform .18s ease; z-index: 40; }
  .sidebar-open { overflow: hidden; }
  .sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: #21361875; border: 0; z-index: 39; }
  .sidebar-close { position: absolute; display: flex; right: 8px; top: 8px; width: 31px; height: 31px; }
  .workspace { margin-left: 0; }
  .topbar { height: 64px; padding: 0 20px; }
  .account-label { max-width: 140px; }
  .main-content { padding: 24px 21px; }
  .dashboard-heading { flex-direction: row; align-items: center; }
  .dashboard-heading h1 { font-size: 24px; }
  .dashboard-columns { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 16px; }
  .hvn-grade-row { grid-template-columns: 41px minmax(28px,1fr) 36px 32px; gap: 7px; }
  .hvn-grade-row small { display: none; }
  .hvn-stats .stat-card { padding: 14px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hvn-hero { min-height: 178px; }
  .hvn-hero h2 { font-size: 25px; }
  .hero-copy { flex-basis: 55%; }
  .hero-children { left: auto; right: 1%; width: 39%; }
  .hero-motto { display: none; }
  .card { padding: 17px; }
  .table-card { padding: 0; }
  .card-heading h2 { font-size: 13px; }
  .hvn-quick .quick-action { padding: 12px 9px; gap: 7px; }
  .hvn-quick .quick-action strong { font-size: 10px; }
  .hvn-quick .quick-action small { font-size: 8px; }
  .chart-plot { gap: 6px; }
  .chart-month-label { font-size: 8px; }
  .chart-pair { gap: 3px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-actions { gap: 10px; }
  .topbar-left { gap: 4px; flex: 1; }
  .nav-toggle { width: 29px; }
  .mobile-brand { display: flex; flex-shrink: 0; margin: 0 4px; }
  .mobile-brand img { object-fit: contain; }
  .search-toggle { display: flex; width: 29px; }
  .global-search { display: none; position: absolute; top: 70px; left: 15px; right: 15px; max-width: none; padding: 4px 8px 4px 12px; background: white; box-shadow: 0 4px 15px #36512617; z-index: 35; }
  .search-open .global-search { display: flex; }
  .global-search input[type=search] { min-height: 39px; font-size: 13px; }
  .account-label { display: none; }
  .account-menu > summary::after { display: none; }
  .year-form { padding: 2px 6px; gap: 6px; }
  .year-form select { font-size: 10px; min-width: 0; padding-right: 0; }
  .year-form .icon { width: 14px; height: 14px; }
  .avatar { width: 31px; height: 31px; }
  .main-content { padding: 20px 15px 24px; }
  .page-heading, .dashboard-heading { flex-direction: column; align-items: flex-start; gap: 13px; }
  .page-heading h1, .dashboard-heading h1 { font-size: 23px; }
  .page-heading p { font-size: 11px; }
  .heading-actions { width: 100%; justify-content: flex-start; }
  .heading-actions .btn { font-size: 11px; }
  .dashboard-heading .heading-actions { justify-content: space-between; }
  .hvn-hero { padding: 22px 19px; min-height: 220px; margin-bottom: 15px; align-items: flex-start; }
  .hero-copy { flex-basis: 100%; padding-right: 0; }
  .hvn-hero h2 { font-size: 24px; max-width: 340px; margin: 7px 0; }
  .hvn-hero p { max-width: 235px; font-size: 10px; }
  .hero-children { width: 43%; max-width: 210px; max-height: 95px; right: 3px; bottom: -1px; opacity: 1; }
  .hero-kicker { font-size: 8px; }
  .hero-period { font-size: 8px; max-width: 160px; margin-top: 23px; }
  .star-a { left: auto; right: 21%; top: 13px; font-size: 20px; }
  .star-b { display: none; }
  .stats-grid { gap: 10px; margin-bottom: 16px; }
  .hvn-stats .stat-card { padding: 13px 11px; gap: 8px; min-height: 108px; align-items: flex-start; }
  .hvn-stats .stat-icon { width: 30px; height: 30px; }
  .hvn-stats .stat-icon .icon { width: 17px; height: 17px; }
  .stat-label { font-size: 10px; }
  .hvn-stats .stat-value { font-size: 27px; margin-top: 5px; }
  .hvn-stats .stat-card p { font-size: 8px; }
  .dashboard-columns { display: flex; flex-direction: column; gap: 0; }
  .dashboard-primary, .dashboard-secondary { width: 100%; }
  .dashboard-columns .card { margin-bottom: 16px; }
  .card { padding: 16px; }
  .table-card { padding: 0; }
  .card-heading h2 { font-size: 13px; gap: 7px; }
  .card-heading h2 .icon { width: 17px; height: 17px; }
  .card-heading p { font-size: 9px; }
  .dashboard-columns .card-heading .text-link { font-size: 9px; gap: 2px; }
  .card-heading .pill { font-size: 9px; }
  .chart-plot { gap: 5px; }
  .chart-pair { gap: 3px; height: 146px; }
  .chart-axis { padding-bottom: 28px; width: 18px; }
  .chart-plot { background-size: 100% 146px; }
  .chart-month-label { font-size: 8px; }
  .chart-legend { font-size: 9px; gap: 12px; }
  .comparison-chart { gap: 7px; }
  .hvn-grade-row { grid-template-columns: 43px minmax(30px,1fr) 65px 37px; gap: 9px; }
  .hvn-grade-row small { display: inline; }
  .hvn-quick .quick-action { min-height: 66px; padding: 13px; }
  .hvn-quick .quick-action strong { font-size: 11px; }
  .hvn-quick .quick-action small { font-size: 9px; }
  .activity-table table { min-width: 510px; }
  .filter-bar { padding: 14px; }
  .filter-bar label { min-width: 0; }
  .search-field { min-width: 0; }
  .notice { font-size: 11px; }
  .app-footer { padding: 15px; }
  .app-footer .footer-motto { display: none; }
  .auth-layout { display: block; }
  .auth-story { padding: 24px; }
  .auth-story .brand { margin: 0; gap: 13px; }
  .auth-story .brand-mark { width: 56px; height: 63px; }
  .auth-story .brand-type { font-size: 16px; }
  .auth-story .brand-prefix { font-size: 10px; }
  .auth-story .brand-type small { font-size: 8px; }
  .auth-message, .auth-note { display: none; }
  .auth-panel { min-height: calc(100vh - 111px); padding: 35px 26px 60px; }
  .setup-wrap > .brand .brand-mark { width: 60px; height: 68px; }
}
@media (max-width: 359px) {
  .topbar { padding: 0 9px; }
  .topbar-actions { gap: 6px; }
  .mobile-brand { display: none; }
  .main-content { padding: 18px 12px; }
  .hvn-hero h2 { font-size: 21px; }
  .hvn-stats .stat-card { gap: 6px; padding: 12px 8px; }
  .hvn-stats .stat-icon { width: 25px; height: 25px; }
  .stat-label { font-size: 9px; }
  .hvn-stats .stat-value { font-size: 25px; }
  .hvn-quick .quick-action { padding: 10px 8px; gap: 7px; }
  .hvn-quick .quick-action strong { font-size: 10px; }
  .chart-plot { gap: 3px; }
  .chart-month-label { font-size: 7px; }
  .card-heading { gap: 6px; }
  .hvn-grade-row { grid-template-columns: 42px minmax(25px,1fr) 45px 32px; gap: 7px; }
  .hvn-grade-row small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print {
  .sidebar, .topbar, .sidebar-backdrop, .skip-link, .hero-children, .hero-motto, .hero-star, .quick-card, .dashboard-footnote, .chart-values > summary { display: none !important; }
  body { color: #000; background: #fff; }
  .workspace { margin: 0 !important; }
  .main-content { padding: 0; max-width: none; }
  .dashboard-columns { display: block; }
  .hvn-hero { background: #fff; border: 1px solid #ccc; min-height: auto; padding: 15px; }
  .hvn-hero::before, .hvn-hero::after { display: none; }
  .hero-copy { flex-basis: 100%; }
  .hvn-hero h2, .hvn-hero h2 em, .hvn-hero p, .hero-period, .hero-kicker { color: #000; }
  .stats-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .card, .stat-card { break-inside: avoid; box-shadow: none; }
  .hvn-stats .stat-card { background: #fff; border-color: #ccc; }
  .hvn-stats .stat-value, .stat-label, .hvn-stats .tone-gold .stat-value { color: #000; }
  .chart-column, .hvn-progress i { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .table-wrap { overflow: visible; }
}
