@font-face {
  font-family: "Questrial";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/questrial-latin-ext.f9a462667158.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Questrial";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/questrial-latin.19007b17e56d.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --napo-red: #b80127;
  --napo-red-dark: #960020;
  --napo-navy: #0d0d4f;
  --napo-navy-soft: #24245f;
  --napo-peach: #ffbc7d;
  --napo-lavender: #7f7fa0;
  --napo-bg: #eff2f6;
  --napo-surface: #fff;
  --napo-text: #17172f;
  --napo-muted: #66677c;
  --napo-border: #dfe2ea;
  --napo-success: #19734e;
  --napo-warning: #9b5b00;
  --napo-danger: #b80127;
  --napo-radius: 16px;
  --napo-radius-small: 10px;
  --napo-shadow: 0 12px 35px rgba(13, 13, 79, .07);
  --napo-font: "Questrial", "Segoe UI", sans-serif;
  --header-height: 78px;
  --sidebar-width: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--napo-bg); color: var(--napo-text); font-family: var(--napo-font); font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--napo-red); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--napo-red-dark); }
img, svg { max-width: 100%; }

:focus-visible { outline: 3px solid var(--napo-peach); outline-offset: 3px; }
.sr-only { position: absolute !important; 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; z-index: 100; top: 10px; left: 12px; padding: 10px 14px; border-radius: 8px; background: var(--napo-navy); color: #fff; transform: translateY(-160%); transition: transform .18s ease; }
.skip-link:focus { color: #fff; transform: translateY(0); }

.topbar { position: fixed; z-index: 40; inset: 0 0 auto 0; height: var(--header-height); display: flex; align-items: center; gap: 36px; padding: 0 30px; border-bottom: 1px solid rgba(13,13,79,.09); background: rgba(255,255,255,.96); box-shadow: 0 3px 18px rgba(13,13,79,.04); backdrop-filter: blur(12px); }
.topbar-start { display: flex; align-items: center; gap: 14px; min-width: calc(var(--sidebar-width) - 30px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--napo-navy); font-size: 25px; font-weight: 700; letter-spacing: -.05em; line-height: 1; text-decoration: none; white-space: nowrap; }
.brand:hover { color: var(--napo-navy); }
.brand-logo { display: block; width: auto; height: 42px; }
.brand-product { padding-left: 10px; border-left: 1px solid rgba(13,13,79,.2); color: var(--napo-navy); font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-toggle { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--napo-border); border-radius: 9px; background: #fff; color: var(--napo-navy); cursor: pointer; }
.nav-toggle > span[aria-hidden] { position: relative; width: 20px; height: 2px; background: currentColor; }
.nav-toggle > span[aria-hidden]::before, .nav-toggle > span[aria-hidden]::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; }
.nav-toggle > span[aria-hidden]::before { top: -6px; }
.nav-toggle > span[aria-hidden]::after { top: 6px; }

.global-search { position: relative; flex: 1; display: flex; max-width: 670px; }
.global-search input { width: 100%; min-height: 44px; padding: 10px 96px 10px 42px; border: 1px solid var(--napo-border); border-radius: 99px; background: var(--napo-bg); color: var(--napo-text); }
.global-search::before { content: ""; position: absolute; z-index: 1; left: 17px; top: 14px; width: 11px; height: 11px; border: 2px solid var(--napo-lavender); border-radius: 50%; }
.global-search::after { content: ""; position: absolute; z-index: 1; left: 29px; top: 27px; width: 7px; height: 2px; background: var(--napo-lavender); transform: rotate(45deg); }
.global-search button { position: absolute; top: 5px; right: 5px; min-height: 34px; padding: 0 15px; border: 0; border-radius: 99px; background: var(--napo-navy); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 13px; white-space: nowrap; }
.user-menu a { color: var(--napo-muted); font-size: 13px; font-weight: 700; }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--napo-peach); color: var(--napo-navy); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.user-name { max-width: 180px; overflow: hidden; color: var(--napo-navy); font-weight: 700; text-overflow: ellipsis; }

.sidebar { position: fixed; z-index: 30; inset: var(--header-height) auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 28px 18px 20px; overflow-y: auto; background: var(--napo-navy); color: #fff; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar a { position: relative; padding: 11px 14px 11px 18px; border-radius: 9px; color: rgba(255,255,255,.82); font-weight: 700; text-decoration: none; transition: color .16s ease, background .16s ease, transform .16s ease; }
.sidebar a::before { content: ""; position: absolute; top: 50%; left: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--napo-peach); opacity: 0; transform: translateY(-50%); }
.sidebar a:hover, .sidebar a:focus-visible { background: rgba(255,255,255,.1); color: #fff; transform: translateX(2px); }
.sidebar a:hover::before, .sidebar a:focus-visible::before { opacity: 1; }
.nav-label { padding: 0 14px 13px; color: var(--napo-peach); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-foot { display: grid; gap: 2px; margin-top: auto; padding: 24px 14px 0; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.55); }
.sidebar-foot span { color: rgba(255,255,255,.86); font-weight: 700; }
.sidebar-foot small { font-size: 11px; }
.nav-scrim { display: none; }

.content { width: auto; max-width: 1700px; min-height: 100vh; margin-left: var(--sidebar-width); padding: calc(var(--header-height) + 40px) clamp(22px, 3vw, 48px) 64px; }
.content-centered { max-width: none; margin: 0; display: grid; place-items: center; padding: 110px 24px 48px; background: radial-gradient(circle at 78% 22%, rgba(255,188,125,.34), transparent 25%), linear-gradient(135deg, var(--napo-bg) 0 55%, #e4e7f1 55% 100%); }
h1, h2, h3 { color: var(--napo-navy); line-height: 1.15; }
h1 { margin: 0; font-size: clamp(30px, 3vw, 45px); font-weight: 650; letter-spacing: -.045em; }
h2 { margin: 0 0 20px; font-size: 20px; letter-spacing: -.015em; }
h3 { margin: 0; }
.eyebrow { margin: 0 0 7px; color: var(--napo-red); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--napo-muted); }
.page-head { min-height: 68px; margin-bottom: 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid var(--napo-border); border-radius: 9px; background: #fff; color: var(--napo-navy); font-weight: 750; text-decoration: none; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { color: var(--napo-navy); box-shadow: 0 7px 18px rgba(13,13,79,.11); transform: translateY(-1px); }
.button.primary { border-color: var(--napo-red); background: var(--napo-red); color: #fff; }
.button.primary:hover { background: var(--napo-red-dark); color: #fff; }
.button.full { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(175px, 1fr)); gap: 17px; margin-bottom: 22px; }
.metric { position: relative; min-height: 140px; display: flex; flex-direction: column; justify-content: space-between; padding: 23px; overflow: hidden; border: 1px solid var(--napo-border); border-radius: var(--napo-radius); background: #fff; box-shadow: var(--napo-shadow); }
.metric::after { content: ""; position: absolute; right: -28px; bottom: -38px; width: 92px; height: 92px; border: 14px solid rgba(184,1,39,.07); border-radius: 50%; }
.metric span { position: relative; z-index: 1; color: var(--napo-muted); font-size: 13px; font-weight: 650; }
.metric strong { position: relative; z-index: 1; color: var(--napo-navy); font-size: clamp(25px, 2.4vw, 34px); line-height: 1.05; }
.metric.featured { border-color: var(--napo-navy); background: var(--napo-navy); }
.metric.featured span { color: rgba(255,255,255,.68); }
.metric.featured strong { color: #fff; }
.metric.featured::after { border-color: rgba(255,188,125,.24); }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { margin-bottom: 18px; padding: 25px; border: 1px solid var(--napo-border); border-radius: var(--napo-radius); background: #fff; box-shadow: var(--napo-shadow); }
.warning-panel { border-top: 4px solid var(--napo-peach); }
.rows { display: grid; }
.rows > div, .ranked li { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--napo-border); }
.rows > div:first-child, .ranked li:first-child { border-top: 0; }
.ranked { margin: 0; padding-left: 24px; }
.ranked li { padding-left: 8px; }

.filters { display: flex; gap: 10px; margin-bottom: 18px; }
.filters input { min-width: 300px; }
.filters-wrap { flex-wrap: wrap; }
.filters-wrap input { min-width: 150px; }
input, select, textarea { min-height: 43px; padding: 9px 12px; border: 1px solid #c9cbd6; border-radius: 9px; background: #fff; color: var(--napo-text); }
textarea { min-height: 115px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #858697; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--napo-navy); outline: 3px solid rgba(127,127,160,.2); }

.table-wrap { overflow-x: auto; border: 1px solid var(--napo-border); border-radius: var(--napo-radius); background: #fff; box-shadow: var(--napo-shadow); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 16px; background: #e6e8f0; color: var(--napo-navy-soft); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 16px; border-top: 1px solid var(--napo-border); vertical-align: middle; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f8f8fb; }
td small { display: block; margin-top: 4px; color: var(--napo-muted); }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; background: #e5e6f0; color: var(--napo-navy); font-size: 12px; font-weight: 750; }
.badge.danger { background: #f9e5e9; color: var(--napo-danger); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips span { padding: 5px 10px; border-radius: 999px; background: #f0e4e9; color: var(--napo-red-dark); font-size: 12px; font-weight: 650; }

.form-card { max-width: 780px; }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { color: var(--napo-navy); font-weight: 750; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.field .errorlist { margin: 3px 0; padding-left: 20px; color: var(--napo-danger); }
.field-with-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.field-with-action .button { white-space: nowrap; }
.field-status { color: var(--napo-muted); }
.field-status.error { color: var(--napo-danger); font-weight: 700; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.tabs { display: flex; gap: 8px; margin: 0 0 20px; padding: 2px; overflow-x: auto; }
.tabs a { padding: 9px 14px; border: 1px solid var(--napo-border); border-radius: 9px; background: #fff; color: var(--napo-navy); font-weight: 750; text-decoration: none; white-space: nowrap; }
.tabs a:hover { border-color: var(--napo-lavender); background: #f8f8fb; }

.thread-list { overflow: hidden; border: 1px solid var(--napo-border); border-radius: var(--napo-radius); background: #fff; box-shadow: var(--napo-shadow); }
.thread-row { display: flex; justify-content: space-between; gap: 20px; padding: 18px 20px; border-top: 1px solid var(--napo-border); color: var(--napo-text); text-decoration: none; }
.thread-row:first-child { border-top: 0; }
.thread-row:hover { background: #f8f8fb; }
.thread-row > div { display: grid; gap: 6px; }
.thread-row span { color: var(--napo-muted); font-size: 13px; }
.thread-meta { text-align: right; justify-items: end; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.detail-grid > div { display: grid; align-content: start; gap: 6px; }
.detail-grid span { color: var(--napo-muted); font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.timeline article { position: relative; display: grid; gap: 4px; padding: 0 0 24px 145px; border-left: 2px solid var(--napo-border); }
.timeline article::before { content: ""; position: absolute; top: 4px; left: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--napo-red); }
.timeline time { position: absolute; left: 15px; color: var(--napo-muted); font-size: 12px; }
.timeline span { color: var(--napo-muted); }
.cards-inline { display: flex; flex-wrap: wrap; gap: 12px; }
.mini-card { min-width: 230px; display: grid; gap: 8px; padding: 17px; border: 1px solid var(--napo-border); border-radius: 11px; background: #fff; }
.mini-card span { color: var(--napo-muted); }
.lookup { display: grid; gap: 8px; margin-top: 18px; }
.notice, .empty { padding: 17px 19px; margin-bottom: 18px; border: 1px solid var(--napo-border); border-left: 4px solid var(--napo-red); border-radius: 10px; background: #fff; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.permission-grid label { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.permission-grid span { font-family: ui-monospace, monospace; font-size: 12px; }
.lookup-edit { display: grid; grid-template-columns: 1fr 1.5fr 80px auto auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--napo-border); }
.inline-form { display: inline-block; margin-left: 8px; }

.login-card { position: relative; width: min(450px, calc(100vw - 32px)); padding: 44px; overflow: hidden; border: 1px solid rgba(13,13,79,.09); border-radius: 22px; background: #fff; box-shadow: 0 24px 70px rgba(13,13,79,.14); text-align: center; }
.login-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 7px; background: linear-gradient(90deg, var(--napo-red) 0 62%, var(--napo-peach) 62%); }
.login-card .brand { justify-content: center; font-size: 32px; }
.login-card .brand-logo { height: 62px; }
.login-card .brand-product { font-size: 17px; }
.login-card h1 { margin-top: 34px; }
.login-card p { margin: 13px 0 27px; color: var(--napo-muted); }

@media (max-width: 1220px) {
  :root { --sidebar-width: 210px; }
  .topbar { gap: 22px; padding-inline: 22px; }
  .topbar-start { min-width: calc(var(--sidebar-width) - 22px); }
  .user-name { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}

@media (max-width: 900px) {
  .global-search { max-width: none; }
  .user-avatar { display: none; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lookup-edit { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  :root { --header-height: 68px; }
  body.nav-open { overflow: hidden; }
  .topbar { padding-inline: 16px; gap: 14px; }
  .topbar-start { min-width: auto; }
  .nav-toggle { display: inline-flex; }
  .brand { font-size: 22px; }
  .brand-logo { height: 34px; }
  .global-search { position: absolute; top: calc(var(--header-height) + 10px); left: 16px; right: 16px; }
  .global-search input { box-shadow: 0 7px 22px rgba(13,13,79,.1); }
  .user-menu { gap: 0; }
  .user-menu a { padding: 9px 0 9px 9px; }
  .sidebar { inset: var(--header-height) auto 0 0; width: min(292px, 84vw); transform: translateX(-105%); transition: transform .22s ease; }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-scrim { position: fixed; z-index: 20; inset: var(--header-height) 0 0; width: 100%; height: auto; border: 0; background: rgba(13,13,36,.52); cursor: pointer; }
  body.nav-open .nav-scrim { display: block; }
  .content { margin-left: 0; padding: calc(var(--header-height) + 85px) 18px 50px; }
  .content-centered { padding-top: 100px; }
  .two-columns { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-head .button { width: 100%; }
  .metric-grid, .metric-grid.compact { grid-template-columns: 1fr; }
  .metric { min-height: 124px; }
  .panel { padding: 20px 17px; }
  .filters, .filters-wrap { display: grid; grid-template-columns: 1fr; }
  .filters input, .filters-wrap input, .filters select, .filters button, .filters .button { width: 100%; min-width: 0; }
  .detail-grid, .permission-grid { grid-template-columns: 1fr; }
  .thread-row { flex-direction: column; }
  .thread-meta { text-align: left; justify-items: start; }
  .timeline article { padding-left: 25px; }
  .timeline time { position: static; }
  .login-card { padding: 39px 25px 32px; }
  .lookup-edit { grid-template-columns: 1fr; }
  .form-actions .button { flex: 1 1 100%; }
  .field-with-action { grid-template-columns: 1fr; }
  .field-with-action .button { width: 100%; }
}

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

@media print {
  .topbar, .sidebar, .nav-scrim, .filters, .form-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .content { max-width: none; margin: 0; padding: 0; }
  .panel, .metric, .table-wrap { box-shadow: none; break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
