:root {
  --ink: #1a2233;
  --ink-soft: #2a3448;
  --muted: #6b7280;
  --muted-light: #8b93a1;
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e3e8ef;
  --accent: #b78348;
  --accent-hover: #9e6d38;
  --accent-active: #895a2c;
  --accent-light: #fbf4ea;
  --accent-border: #efd5b3;
  --green: #2f9e61;
  --green-light: #edf9f2;
  --blue: #2f7fd3;
  --blue-light: #edf5fd;
  --yellow: #c47d16;
  --yellow-light: #fff6e8;
  --red: #c0392b;
  --red-light: #fdecea;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 8px 28px rgba(26, 34, 51, .07);
  --shadow-md: 0 22px 60px rgba(26, 34, 51, .12);
  --focus: 0 0 0 4px rgba(183, 131, 72, .16);
  --container: 1180px;
  --sidebar: 240px;
  --transition: 160ms ease;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
body.modal-open, body.menu-open { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
img { max-width: 100%; }
svg { display: block; }
[hidden] { display: none !important; }

.container {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}
.narrow { width: min(760px, calc(100% - 32px)); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-center { text-align: center; }

.visually-hidden {
  width: 1px;
  height: 1px;
  position: absolute !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.full { width: 100%; }
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.divider { height: 1px; background: var(--border); }
.no-margin { margin: 0 !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

h1, h2, h3, h4, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.06;
  letter-spacing: -1.8px;
}
h2 {
  margin-bottom: 14px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.13;
  letter-spacing: -1px;
}
h3 {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -.35px;
}
p { color: var(--muted); line-height: 1.7; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.lead { max-width: 720px; font-size: 18px; }
.prose { color: var(--ink); }
.prose h2 { margin-top: 34px; font-size: 28px; }
.prose h3 { margin-top: 24px; }
.prose p, .prose li { color: #4f5868; line-height: 1.75; }
.prose ul, .prose ol { padding-left: 22px; }
.prose a { color: var(--accent); }

.brand {
  display: inline-flex;
  align-items: baseline;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.65px;
  text-decoration: none;
  white-space: nowrap;
}
.brand__product { color: var(--accent); }
.brand--large { font-size: 34px; letter-spacing: -1px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(227, 232, 239, .92);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(14px);
}
.site-header__inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a {
  position: relative;
  padding: 22px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.site-nav a.active::after {
  position: absolute;
  right: 0;
  bottom: 13px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-button {
  width: 42px;
  height: 42px;
  display: none;
  place-items: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}
.menu-button span {
  width: 18px;
  height: 2px;
  display: block;
  border-radius: 2px;
  background: var(--ink);
  transition: transform var(--transition), opacity var(--transition);
}
.menu-button[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-button[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobile-panel {
  padding: 18px 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.mobile-nav { display: grid; }
.mobile-nav a {
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.mobile-panel__actions { display: grid; gap: 8px; margin-top: 18px; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--accent);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition), background var(--transition),
    border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.button:hover { background: var(--accent-hover); }
.button:active { transform: translateY(1px); background: var(--accent-active); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.button--outline { border-color: var(--accent); color: var(--accent); background: transparent; }
.button--outline:hover { color: var(--accent-hover); border-color: var(--accent-hover); background: var(--accent-light); }
.button--ghost { color: var(--muted); background: transparent; }
.button--ghost:hover { color: var(--ink); background: var(--bg); }
.button--dark { color: #fff; background: var(--ink); }
.button--dark:hover { background: var(--ink-soft); }
.button--danger { color: #fff; background: var(--red); }
.button--danger:hover { background: #9f2f24; }
.button--sm { min-height: 38px; padding: 9px 15px; border-radius: 9px; font-size: 12.5px; }
.button--lg { min-height: 52px; padding: 14px 24px; font-size: 14px; }
.button--block { width: 100%; }

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--card);
  cursor: pointer;
}
.icon-button:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-light); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
}
.card--soft { background: #fbfcfd; }
.card--interactive { transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }
.card--interactive:hover { transform: translateY(-2px); border-color: var(--accent-border); box-shadow: var(--shadow-sm); }
.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card__footer { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.empty-state {
  padding: 48px 24px;
  border: 1px dashed #cfd5de;
  border-radius: var(--radius-md);
  text-align: center;
  background: #fbfcfd;
}
.empty-state svg { width: 42px; height: 42px; margin: 0 auto 14px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { max-width: 520px; margin: 0 auto 18px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  color: var(--accent);
  background: var(--accent-light);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}
.badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.badge--plain::before { display: none; }
.badge--green { color: var(--green); background: var(--green-light); }
.badge--blue { color: var(--blue); background: var(--blue-light); }
.badge--yellow { color: var(--yellow); background: var(--yellow-light); }
.badge--red { color: var(--red); background: var(--red-light); }
.badge--gray { color: var(--muted); background: var(--bg); }

.avatar {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 36px; height: 36px; border-radius: 9px; font-size: 11px; }
.avatar--lg { width: 78px; height: 78px; border-radius: 18px; font-size: 20px; }

.form { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-field { display: grid; gap: 7px; }
.form-field--full { grid-column: 1 / -1; }
label { color: var(--ink); font-size: 12.5px; font-weight: 700; }
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--card);
  font-size: 13.5px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.textarea { min-height: 122px; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #c9d0da; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: #a1a8b3; }
.help { color: var(--muted); font-size: 11px; line-height: 1.5; }
.error-text { color: var(--red); font-size: 11px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; }
.checkbox-row input { margin-top: 3px; accent-color: var(--accent); }
.checkbox-row label { color: var(--muted); font-weight: 400; line-height: 1.55; }
.checkbox-row a { color: var(--accent); }

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
}
.segmented button, .segmented a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.segmented .active, .segmented button[aria-selected="true"] { color: #fff; background: var(--accent); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td { padding: 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table a { color: var(--ink); font-weight: 700; text-decoration: none; }
.table a:hover { color: var(--accent); }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  color: #7c542c;
  background: var(--accent-light);
  font-size: 12.5px;
  line-height: 1.6;
}
.notice svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; }
.notice--blue { color: #245e9b; border-color: #cfe2f5; background: var(--blue-light); }
.notice--green { color: #247a4a; border-color: #ccebd8; background: var(--green-light); }
.notice--red { color: #923127; border-color: #f1c8c4; background: var(--red-light); }

.page-loader { min-height: 55vh; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); font-size: 13px; }
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 500;
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  line-height: 1.55;
  pointer-events: auto;
}
.toast--error { border-color: #f1c8c4; background: var(--red-light); }
.toast--success { border-color: #ccebd8; background: var(--green-light); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 27, 40, .58);
  backdrop-filter: blur(4px);
}
.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-md);
}
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.modal__footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }

.site-footer { color: #fff; background: var(--ink); }
.site-footer__top {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  gap: 70px;
  padding-top: 52px;
  padding-bottom: 42px;
}
.site-footer__brand p { max-width: 360px; margin: 17px 0 0; color: #aeb7c4; font-size: 12.5px; }
.site-footer__links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.site-footer__links > div { display: grid; align-content: start; gap: 10px; }
.site-footer__links strong { margin-bottom: 5px; font-size: 12px; }
.site-footer__links a { color: #aeb7c4; font-size: 11.5px; text-decoration: none; }
.site-footer__links a:hover { color: #efd5b3; }
.site-footer__bottom {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(255,255,255,.09);
  color: #8e98a6;
  font-size: 10.5px;
}
.site-footer__bottom div { display: flex; gap: 18px; }
.site-footer__bottom a { text-decoration: none; }

.app-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
.app-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  background: var(--card);
}
.app-nav { display: grid; gap: 5px; }
.app-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}
.app-nav a:hover { color: var(--ink); background: var(--bg); }
.app-nav a.active { color: var(--accent); background: var(--accent-light); }
.app-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-sidebar__section { margin: 20px 12px 8px; color: var(--muted-light); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.app-main { min-width: 0; padding: 34px clamp(20px, 4vw, 48px) 60px; }
.app-main__inner { width: min(1100px, 100%); margin-inline: auto; }
.app-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.app-heading h1 { margin: 0; font-size: 30px; letter-spacing: -.8px; }
.app-heading p { margin: 6px 0 0; font-size: 13px; }
.app-mobile-nav { display: none; margin-bottom: 18px; }
.app-mobile-nav .segmented {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}
.app-mobile-nav .segmented a {
  flex: 0 0 auto;
}

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-card { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.stat-card span { display: block; color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; margin-top: 5px; font-size: 25px; }

@media (max-width: 980px) {
  .site-nav, .desktop-only { display: none; }
  .menu-button { display: grid; }
  .site-footer__top { grid-template-columns: 1fr; gap: 36px; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .app-mobile-nav { display: block; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .container, .narrow { width: min(100% - 20px, var(--container)); }
  .brand { font-size: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field--full { grid-column: auto; }
  .spread, .app-heading { align-items: flex-start; flex-direction: column; }
  .button.mobile-block { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .site-footer__links { grid-template-columns: 1fr 1fr; }
  .site-footer__bottom { align-items: flex-start; flex-direction: column; padding: 18px 0; }
  .site-footer__bottom div { flex-direction: column; gap: 7px; }
  .app-main { padding: 24px 10px 46px; }
  .modal { padding: 20px; }
  .modal__footer { flex-direction: column-reverse; }
  .modal__footer .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
