@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/InstrumentSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/InstrumentSans-Medium.ttf") format("truetype");
  font-weight: 500 600;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/InstrumentSans-Bold.ttf") format("truetype");
  font-weight: 700 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #10233f;
  --navy-dark: #08182d;
  --orange: #f04b2a;
  --orange-dark: #c73519;
  --orange-focus: #ff765c;
  --surface: #ffffff;
  --canvas: #edf2f3;
  --ink: #142438;
  --muted: #52616e;
  --border: #c7d3d8;
  --success: #17643a;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(8, 24, 45, 0.12);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; overflow-x: hidden; color: var(--ink); background: var(--canvas); font-family: "Instrument Sans", Arial, sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, summary { font: inherit; }
button, summary { cursor: pointer; }
a { color: inherit; }
h1, h2, p { margin-top: 0; }
h1, h2 { color: var(--navy); line-height: 1.12; letter-spacing: -0.035em; }
h1 { margin-bottom: 14px; font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); }
:focus-visible { outline: 3px solid var(--orange-focus); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 1000; top: -100px; left: 16px; min-height: 44px; padding: 10px 16px; border-radius: 8px; color: var(--navy); background: var(--surface); box-shadow: var(--shadow); font-weight: 700; }
.skip-link:focus { top: 16px; }
.eyebrow { margin: 0 0 4px; color: var(--orange-dark); font-size: 11px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 800; letter-spacing: 0.09em; line-height: 1; }
.brand-symbol { width: 36px; height: 36px; flex: none; }
.primary-button, .logout-form button, .mobile-logout-form button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid currentColor; border-radius: 10px; font-weight: 700; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 32px 16px; background: radial-gradient(circle at 15% 0%, #ffffff 0, transparent 42%), linear-gradient(145deg, #edf2f3 0%, #dfe8eb 100%); }
.login-card { width: min(100%, 470px); padding: clamp(28px, 6vw, 48px); border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 38px; padding-bottom: 22px; border-bottom: 1px solid var(--border); gap: 20px; }
.login-brand > span:last-child { color: var(--muted); font-size: 12px; font-weight: 600; text-align: right; }
.login-copy > p:last-child { margin-bottom: 24px; color: var(--muted); }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 4px; color: var(--navy); font-size: 14px; font-weight: 700; }
.login-form input:not([type="hidden"]) { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #9aacb4; border-radius: 10px; color: var(--ink); background: #fff; }
.login-form input[aria-invalid="true"] { border-color: #b42318; }
.login-form .primary-button { width: 100%; margin-top: 10px; padding-inline: 20px; color: #fff; background: var(--navy); }
.login-form .primary-button:hover { background: #183558; }
.form-error { margin-bottom: 20px; padding: 12px 14px; border-left: 4px solid #b42318; border-radius: 6px; color: #751a14; background: #fff0ee; font-size: 14px; }
.access-note { margin: 24px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.access-note span { color: var(--success); }

.dashboard-shell { display: grid; grid-template-columns: 292px minmax(0, 1fr); width: min(100%, 1440px); min-height: 100vh; margin-inline: auto; background: #f8faf9; box-shadow: 0 0 80px rgba(8, 24, 45, 0.08); }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; min-width: 0; height: 100vh; padding: 28px 20px 20px; overflow-y: auto; color: #fff; background: var(--navy-dark); }
.sidebar-brand { display: grid; gap: 12px; padding: 0 12px 28px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); color: #b8c7cf; font-size: 12px; letter-spacing: 0.04em; }
.sidebar nav { padding-block: 22px; }
.nav-list, .nav-group ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.nav-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 48px; padding: 8px 10px; border-radius: 10px; gap: 9px; text-decoration: none; }
.nav-icon { display: grid; width: 18px; place-items: center; color: inherit; font-size: 17px; }
.nav-item-active { color: #fff; background: rgba(255, 255, 255, 0.1); font-weight: 700; }
.nav-item-active .nav-icon { color: #ff876e; }
.nav-item-disabled { border: 0; color: #acbbc4; background: transparent; text-align: left; cursor: not-allowed; }
.nav-label { min-width: 0; overflow-wrap: anywhere; }
.nav-status { color: #c9d5db; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; }
.nav-group { margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.nav-group-label { display: block; padding: 0 10px 7px; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.nav-group .nav-item { padding-left: 18px; }
.logout-form { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.logout-form button { width: 100%; color: #fff; background: transparent; }
.dashboard-content { min-width: 0; }
.dashboard-header { display: flex; align-items: center; min-height: 92px; padding: 18px clamp(24px, 4vw, 56px); border-bottom: 1px solid var(--border); gap: 24px; background: rgba(255, 255, 255, 0.94); }
.header-title { margin: 0; color: var(--navy); font-size: 18px; font-weight: 800; }
.identity { display: flex; align-items: center; min-width: 0; margin-left: auto; gap: 10px; color: var(--navy); font-size: 14px; font-weight: 700; }
.identity span:last-child { min-width: 0; overflow-wrap: anywhere; }
.identity small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; }
.identity-shield { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border-radius: 50%; color: #fff; background: var(--success); }
.dashboard-main { width: min(100% - 48px, 980px); margin-inline: auto; padding-block: clamp(42px, 6vw, 76px); }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 34px; gap: 32px; }
.page-intro { max-width: 620px; margin-bottom: 0; color: var(--muted); font-size: 1.04rem; }
.production-badge { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 13px; border: 1px solid #8ebc9f; border-radius: 999px; gap: 7px; color: var(--success); background: #edf8f1; font-size: 13px; font-weight: 800; white-space: nowrap; }
.status-card, .scope-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.status-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); padding: clamp(26px, 4vw, 44px); gap: 22px; }
.status-card p:last-child { max-width: 660px; margin-bottom: 0; color: var(--muted); }
.status-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 14px; color: var(--success); background: #edf8f1; font-size: 24px; font-weight: 800; }
.scope-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr); margin-top: 20px; padding: clamp(26px, 4vw, 38px); gap: 38px; box-shadow: none; }
.scope-panel h2 { margin-bottom: 0; }
.scope-panel ul { display: grid; align-content: start; gap: 13px; margin: 0; padding: 0; list-style: none; }
.scope-panel li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; color: var(--muted); }
.scope-panel li span { color: var(--orange); font-weight: 800; }
.mobile-navigation { display: none; position: relative; }
.mobile-navigation summary { list-style: none; }
.mobile-navigation summary::-webkit-details-marker { display: none; }
.icon-button { display: inline-grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 1px solid var(--border); border-radius: 10px; color: var(--navy); background: #fff; font-size: 22px; }
.mobile-panel { position: absolute; z-index: 30; top: 52px; left: 0; width: min(88vw, 380px); max-height: calc(100vh - 90px); padding: 20px; overflow-y: auto; border: 1px solid var(--border); border-radius: 18px; color: var(--ink); background: #fff; box-shadow: var(--shadow); }
.mobile-panel-heading { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.mobile-panel nav { padding-top: 16px; }
.mobile-panel .nav-item-disabled { color: var(--muted); }
.mobile-panel .nav-item-active { color: var(--navy); background: #dde8ec; }
.mobile-panel .nav-group { border-color: var(--border); }
.mobile-panel .nav-group-label { color: var(--navy); }
.mobile-panel .nav-status { color: #525f69; }
.mobile-logout-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.mobile-logout-form button { width: 100%; color: #fff; background: var(--navy); }

.state-page { display: grid; width: min(100% - 32px, 680px); min-height: 100vh; margin-inline: auto; padding-block: 64px; place-items: start; align-content: center; }
.state-page p:not(.eyebrow) { color: var(--muted); }
.state-mark { width: 48px; height: 6px; margin-bottom: 28px; border-radius: 999px; background: var(--orange); }

@media (max-width: 900px) {
  .dashboard-shell { display: block; }
  .sidebar { display: none; }
  .mobile-navigation { display: block; }
  .dashboard-header { min-height: 82px; }
  .scope-panel { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 560px) {
  .login-card { padding: 26px 22px; border-radius: 18px; }
  .login-brand { align-items: flex-start; flex-direction: column; margin-bottom: 28px; }
  .login-brand > span:last-child { text-align: left; }
  .dashboard-header { padding-inline: 16px; gap: 12px; }
  .header-copy { display: none; }
  .identity { font-size: 12px; }
  .dashboard-main { width: calc(100% - 32px); padding-block: 38px; }
  .page-heading { display: grid; gap: 20px; }
  .production-badge { justify-self: start; }
  .status-card { grid-template-columns: 1fr; }
  .mobile-panel { position: fixed; top: 74px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 86px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
