:root {
  --ivpa-navy: #111f38;
  --ivpa-surface: #fff;
  --ivpa-canvas: #f3f6fb;
  --ivpa-border: #dce5f1;
  --ivpa-ink: #172640;
  --ivpa-muted: #4a5d77;
  --ivpa-action: #2458c6;
  --accent: var(--ivpa-action);
  --canvas: var(--ivpa-canvas);
  --ink: var(--ivpa-ink);
  --line: var(--ivpa-border);
  --muted: var(--ivpa-muted);
}
body, input, select, textarea, button {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body { font-size: 16px; line-height: 1.55; }
body.active #sidebar {
  color: #e8efff;
  background: var(--ivpa-navy);
  border-color: #293952;
}
.active #sidebar .ivpa-sidebar-brand { color: #fff; }
.active #sidebar .ivpa-sidebar-brand span { color: #9fc1ff; }
#ivpa-navigation-tools { display: grid; gap: .65rem; padding: .2rem 0 .8rem; }
#ivpa-navigation-tools label { display: grid; gap: .3rem; font-size: .875rem; color: #d9e5fc; }
#module-search {
  width: 100%; min-width: 0; border: 1px solid #597094; border-radius: .6rem;
  color: #fff; background: #1d304e; min-height: 42px;
}
#module-search::placeholder { color: #bccbe1; }
#module-search-results:empty { display: none; }
#module-search-results { display: grid; gap: .25rem; }
.active #sidebar #home-link,
.active #sidebar #module-search-results button,
.active #sidebar #menu :is(button,summary) {
  background: transparent; color: #e4edff; border-color: transparent;
  border-radius: .5rem; font-size: .94rem; line-height: 1.35;
}
.active #sidebar #home-link { background: #213657; text-align: left; padding: .65rem .8rem; }
.active #sidebar #menu details[open] > summary { background: #213657; color: #fff; }
.active #sidebar #menu :is(button,summary):hover,
.active #sidebar #module-search-results button:hover { background: #29446d; color: white; }
.active #sidebar #menu button.selected { background: #284b85; color: #fff; box-shadow: inset 3px 0 #9fc1ff; }
.active #sidebar #menu .admin-nav { background: transparent; border-color: #30415c; }
.active #sidebar #menu #custom-navigation { border-color: #30415c; }
.active #sidebar :is(button,input,summary):focus-visible { outline: 2px solid #b0d1ff; outline-offset: -2px; }
#navToggle { background: #263c60; color: #fff; }
#navToggle:hover { background: #35527c; }

.active #workspace,
.active #workspace.workspace-home { background: var(--ivpa-canvas); }
.active #workspace > .workspace-header {
  background: var(--ivpa-surface); border: 1px solid var(--ivpa-border);
  border-radius: 1rem; box-shadow: 0 2px 8px #1b38540a;
}
#workspace .workspace-header h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.2; color: var(--ivpa-ink); }
#workspace .workspace-header .eyebrow { color: var(--ivpa-muted); font-weight: 650; font-size: .8rem; }
#workspace :is(label,legend,th) { color: var(--ivpa-ink); font-size: .94rem; }
#workspace :is(input,textarea,select,button) { font-size: .95rem; }
#workspace :is(input,textarea,select):not(:disabled) { border-color: #a3b3ca; }
#workspace :is(button,input,textarea,select):focus-visible { outline: 2px solid var(--ivpa-action); outline-offset: 2px; }
#workspace :is(button,input,select,textarea) { max-width: 100%; }
#workspace :is(p,li) { overflow-wrap: anywhere; }
#workspace h2 { line-height: 1.2; }
#workspace h3 { font-size: 1.22rem; line-height: 1.3; }
#workspace h4 { font-size: 1.05rem; line-height: 1.4; }
#workspace small { font-size: .875rem; }
#workspace :is(#records,#moduleForms) table :is(th,td) { padding: .65rem .75rem; }
#workspace .eyebrow { letter-spacing: .055em; }

#workspace .workspace-cover:not([hidden]) {
  display: grid; align-content: start; justify-items: stretch; text-align: left;
  width: 100%; min-height: 0; padding: 0; margin: 1rem 0 0; gap: 1rem; color: var(--ivpa-ink);
}
#workspace .workspace-cover::before,#workspace .workspace-cover::after { display: none; }
.ivpa-home-hero { padding: clamp(1.25rem,4vw,2.15rem); background: #e8effe; border: 1px solid #d2e0fb; border-radius: 1rem; }
#workspace .ivpa-home-hero h2 { font-size: clamp(1.65rem,4vw,2.6rem); margin: .1rem 0 0; color: var(--ivpa-ink); letter-spacing: -.035em; }
.ivpa-home-hero p { margin: 0; color: var(--ivpa-muted); }
.ivpa-home-grid { display: grid; gap: 1rem; grid-template-columns: 1.2fr 1fr; }
.ivpa-home-card { background: var(--ivpa-surface); border: 1px solid var(--ivpa-border); padding: 1.1rem; border-radius: 1rem; }
.ivpa-home-card h3 { margin: 0 0 .8rem; }
.ivpa-home-card:empty { display: none; }
.ivpa-home-card ul { padding-inline-start: 1.15rem; }
.ivpa-home-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr)); gap: .55rem; }
#workspace .ivpa-home-actions button { text-align: left; min-height: 46px; background: #edf3ff; color: #244881; border: 1px solid #d5e1f9; border-radius: .55rem; }
#workspace .ivpa-home-actions button:hover { background: #dbe8ff; }

.performance-navigation { display: flex; gap: .4rem; flex-wrap: wrap; padding: .55rem; margin-bottom: .9rem; background: white; border: 1px solid var(--ivpa-border); border-radius: .75rem; }
#workspace .performance-navigation button { color: #335075; background: #edf3fb; box-shadow: none; border-radius: .5rem; min-height: 42px; }
#workspace .performance-navigation button[aria-pressed="true"] { background: var(--ivpa-action); color: #fff; }
.performance-pane:not([hidden]) { display: grid; gap: .9rem; }
.performance-pane[hidden] { display: none; }
.performance-pane > :is(form,section), .performance-pane article {
  background: white; border: 1px solid var(--ivpa-border); padding: clamp(.85rem,2vw,1.25rem); border-radius: .85rem;
}
.performance-pane fieldset { border-color: var(--ivpa-border); border-radius: .65rem; }
.performance-pane form > :is(label,fieldset) { margin-bottom: .7rem; }
.performance-pane textarea { min-height: 5rem; }
.performance-pane article { margin-block: .6rem; }
@media (min-width:761px) {
  .active #workspace.workspace-home > .workspace-header { display: grid; }
}
@media screen and (max-width:760px) {
  #sidebar #menu { background: var(--ivpa-navy); inset-block-start: calc(100% + 1px); }
  #ivpa-navigation-tools { display: none; }
  #navToggle[aria-expanded="true"] ~ #ivpa-navigation-tools {
    display: grid; position: absolute; inset: calc(100% + 1px) .6rem auto; padding: .65rem;
    z-index: 2; background: var(--ivpa-navy); border-radius: .65rem .65rem 0 0;
  }
  #navToggle[aria-expanded="true"] ~ #ivpa-navigation-tools + #menu { inset-block-start: calc(100% + 7.4rem); max-height: 53dvh; }
  #module-search-results { position: absolute; inset: calc(100% - .2rem) 0 auto; max-height: 46dvh; overflow: auto; background: var(--ivpa-navy); padding: .5rem; }
  .ivpa-home-grid { grid-template-columns: 1fr; }
  #workspace :is(input,textarea,select) { font-size: 16px; }
  .performance-navigation button, #workspace .ivpa-home-actions button { min-height: 44px; }
}
