.staff-app {
  --navy: #14243e;
  --ink: #17263d;
  --muted: #52637c;
  --orange: #f3ad36;
  --line: #dce5f0;
  --staff-paper: #f4f7fb;
  --staff-sidebar: #14243e;
  --staff-highlight: #f9cf8b;
  background: var(--staff-paper);
  min-block-size: 100vh;
}

.staff-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.staff-sidebar {
  position: sticky;
  inset-block-start: 0;
  align-self: start;
  min-block-size: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 27px 14px 20px;
  background: var(--staff-sidebar);
  color: white;
}

.staff-sidebar-brand {
  width: fit-content;
  margin-inline: 7px;
}
.staff-sidebar-brand img { height: auto; }

.staff-sidebar-nav { display: grid; gap: 4px; }
.staff-sidebar-nav a,.staff-view-site {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .91rem;
  font-weight: 700;
  color: #d7e1f1;
}
.staff-sidebar-nav a svg { width: 19px; height: 19px; }
.staff-sidebar-nav a:hover,.staff-view-site:hover { background: #213654; color: white; }
.staff-sidebar-nav a[aria-current="page"] { background: #2d3f5b; color: var(--staff-highlight); }
.staff-view-site { margin-block-start: auto; }

.staff-workspace { min-inline-size: 0; }
.staff-topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px clamp(18px,4vw,48px);
  background: white;
  border-block-end: 1px solid var(--line);
}
.staff-user { display: flex; align-items: center; gap: 10px; min-inline-size: 0; }
.staff-user strong,.staff-user small { display: block; overflow-wrap: anywhere; }
.staff-user small { font-size: .8rem; }
.staff-user-avatar {
  flex: none;
  inline-size: 40px;
  block-size: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8eff9;
  color: #193e72;
  font-weight: 800;
}

.staff-app .button { border-radius: 8px; }
.staff-app .staff-compact { min-height: 40px; padding: 8px 14px; font-size: .86rem; }
.staff-main { width: min(100%,1400px); margin-inline: auto; padding: 32px clamp(18px,4vw,48px) 64px; }
.staff-page-head { margin-block-end: 28px; }
.staff-page-head h1,.staff-login-panel h1 { font-size: clamp(2.05rem,4vw,3rem); }
.staff-page-head p,.staff-section-heading p { margin-block-end: 0; }
.staff-section { margin-block-start: 44px; scroll-margin-top: 18px; }
.staff-section-heading { margin-block-end: 15px; }
.staff-main h2 { font-size: clamp(1.4rem,2.5vw,1.85rem); }
.staff-main h3 { font-size: 1.075rem; line-height: 1.45; }
.staff-main h4 { font-size: .98rem; margin: 0; overflow-wrap: anywhere; }
.staff-panel {
  min-width: 0;
  padding: clamp(16px,2.3vw,24px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: 0 3px 12px #19365809;
}
.staff-panel-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  margin-block-end: 15px;
}
.staff-panel-heading h2,.staff-panel-heading h3 { margin-block-end: 0; }
.staff-muted { color: var(--muted); }
.staff-feedback { margin-block-end: 16px; }
.staff-app ul.error { padding-inline-start: 34px; }

.staff-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,159px),1fr));
  gap: 14px;
  margin-block-end: 25px;
}
.staff-metric {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 18px;
  border-radius: 13px;
  box-shadow: 0 3px 12px #19365809;
}
.staff-metric:hover { border-color: #90add5; }
.staff-metric-icon {
  inline-size: 34px;
  block-size: 34px;
  margin-block-end: 8px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #244d7e;
  background: #eaf1fa;
}
.staff-metric:nth-child(2n) .staff-metric-icon { color: #865600; background: #fff0d3; }
.staff-metric-icon svg { inline-size: 19px; block-size: 19px; }
.staff-metric strong { font-size: 1.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.staff-metric > span:last-child { font-size: .88rem; color: var(--muted); }

.staff-table-wrap { overflow-x: auto; }
.staff-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.staff-table :is(th,td) { padding: 12px 10px; text-align: start; border-block-end: 1px solid var(--line); vertical-align: top; }
.staff-table th { background: #f4f7fb; color: #354b69; font-size: .85rem; }
.staff-table tbody tr:last-child td { border-block-end: 0; }
.staff-table time { white-space: nowrap; }
.staff-table time small { display: block; }
.staff-contact,.staff-package { color: var(--muted); overflow-wrap: anywhere; }
.staff-contact a { text-decoration: underline; text-underline-offset: 3px; }
.staff-package { margin-block-start: 5px; }
.staff-message { margin-block-start: 6px; color: #23518e; font-size: .85rem; }
.staff-message p { margin-block-end: 0; max-inline-size: 380px; }
.staff-status-form { min-inline-size: 142px; gap: 7px; }
.staff-status-form select { min-height: 38px; padding-block: 5px; }

.staff-badge {
  display: inline-flex;
  align-items: center;
  max-inline-size: 100%;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: .79rem;
  font-weight: 800;
  background: #edf2f8;
  color: #415571;
  white-space: nowrap;
}
.staff-state-new { color: #744800; background: #fff0d4; }
.staff-state-contacted { color: #215385; background: #e8f2ff; }
.staff-state-accepted,.staff-badge-success { color: #246447; background: #e4f4eb; }
.staff-state-closed,.staff-badge-neutral { color: #465975; background: #edf2f8; }

.staff-search {
  grid-template-columns: minmax(150px,1fr) minmax(130px,.55fr) auto;
  align-items: end;
  margin-block-end: 15px;
}
.staff-actions,.staff-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 11px;
}
.staff-actions .text-link { font-size: .87rem; }
.staff-empty { margin: 0; padding: 18px 0 9px; color: var(--muted); }
.staff-empty p { margin-block-end: 0; }
.staff-editor-grid { align-items: start; }
.staff-item {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  flex-wrap: wrap;
  padding-block: 13px;
  border-block-end: 1px solid var(--line);
}
.staff-item:last-of-type { border-block-end: 0; }
.staff-item-meta { margin-block-end: 5px; }
.staff-account { padding-block: 12px; border-block-end: 1px solid var(--line); }
.staff-account:last-of-type { border-block-end: 0; }
.staff-account summary { overflow-wrap: anywhere; }
.staff-account summary span { display: block; margin-inline-start: 15px; font-size: .88rem; color: var(--muted); }
.staff-account .form { gap: 6px; padding: 12px 0 4px 15px; }
.staff-permissions { margin: 0; border: 1px solid var(--line); padding: 10px 12px 12px; border-radius: 8px; }
.staff-permissions legend { font-weight: 800; font-size: .9rem; }
.staff-permissions .check + .check { margin-block-start: 4px; }

.staff-content-tabs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-block-end: 16px; }
.staff-content-tabs a[aria-current] { background: var(--navy); color: white; border-color: var(--navy); }
.staff-editor-group { border: 1px solid var(--line); border-radius: 9px; margin-block-end: 12px; }
.staff-editor-group > summary { padding: 12px 14px; font-weight: 750; }
.staff-editor-group[open] > summary { border-block-end: 1px solid var(--line); }
.staff-editor-group > div,.staff-editor-group > form { padding: 14px; }
.staff-editor-fields { display: grid; gap: 13px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.staff-editor-list article { display: flex; gap: 13px; flex-wrap: wrap; justify-content: space-between; align-items: start; }

.staff-auth {
  min-block-size: 100vh;
  display: grid;
  grid-template-columns: minmax(280px,.9fr) minmax(0,1.1fr);
  background: white;
}
.staff-login-visual {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 20px;
  color: white;
  padding: clamp(24px,8vw,100px);
  background: radial-gradient(circle at 18% 12%,#30486b 1.2px,transparent 1.2px) 0 0 / 24px 24px,var(--staff-sidebar);
}
.staff-login-visual img { height: auto; }
.staff-login-visual p { color: #dae6f7; max-inline-size: 370px; font-size: 1.15rem; margin: 0; }
.staff-login-main { display: grid; place-items: center; padding: 32px 22px; }
.staff-login-panel { inline-size: min(100%,420px); }
.staff-login-panel h1 { margin-block-start: 18px; }
.staff-login-panel .form { margin-block-start: 22px; }
.staff-login-panel button { width: 100%; }
.staff-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border-width: 0;
}
.staff-app :focus-visible { outline-offset: 3px; }

@media (max-width: 960px) {
  .staff-shell { grid-template-columns: 185px minmax(0,1fr); }
  .staff-editor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 730px) {
  .staff-shell { grid-template-columns: 1fr; }
  .staff-sidebar {
    min-block-size: 0;
    position: relative;
    gap: 10px;
    padding: 12px 12px 8px;
  }
  .staff-sidebar-brand img { width: 124px; }
  .staff-sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
  }
  .staff-sidebar-nav a,.staff-view-site {
    white-space: nowrap;
    min-height: 36px;
    font-size: .84rem;
  }
  .staff-sidebar-nav a svg { width: 16px; height: 16px; }
  .staff-topbar { justify-content: space-between; min-height: 61px; }
  .staff-auth { grid-template-columns: 1fr; min-height: 0; }
  .staff-login-visual { padding: 22px; }
  .staff-login-visual img { width: 145px; }
  .staff-login-visual p { display: none; }
}

@media (max-width: 530px) {
  .staff-search,.staff-editor-fields { grid-template-columns: 1fr; }
  .staff-requests-table { min-width: 620px; }
}
