:root {
  --ops-ink: #172b2a;
  --ops-muted: #667774;
  --ops-brand: #12675e;
  --ops-brand-dark: #0b4b45;
  --ops-brand-soft: #e5f2ef;
  --ops-bg: #f3f6f4;
  --ops-panel: #fff;
  --ops-line: #dbe3df;
  --ops-danger: #a13939;
  --ops-warning: #8a5b14;
  --ops-shadow: 0 12px 32px rgb(26 55 51 / 8%);
  --ops-radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ops-ink);
  background: var(--ops-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.5;
}

body {
  margin: 0;
}

a {
  color: var(--ops-brand-dark);
  text-underline-offset: 0.18em;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid #e0a53d;
  outline-offset: 3px;
}

.visually-hidden,
.ops-skip:not(:focus) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ops-skip {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  background: var(--ops-brand-dark);
  border-radius: 8px;
}

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

.ops-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2rem 1.25rem;
  color: #fff;
  background: #123f3b;
  flex-direction: column;
  overscroll-behavior: contain;
  scrollbar-color: rgb(219 233 230 / 55%) transparent;
  scrollbar-width: thin;
}

.ops-sidebar::-webkit-scrollbar {
  width: 0.45rem;
}

.ops-sidebar::-webkit-scrollbar-thumb {
  background: rgb(219 233 230 / 45%);
  border: 0.12rem solid #123f3b;
  border-radius: 999px;
}

.ops-brand {
  display: flex;
  color: inherit;
  text-decoration: none;
  flex-direction: column;
}

.ops-brand span {
  font-family: Georgia, serif;
  font-size: 1.55rem;
  letter-spacing: 0.13em;
}

.ops-brand strong {
  color: #b8d5cf;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.ops-nav {
  display: grid;
  gap: 0.28rem;
  margin-top: 3rem;
}

.ops-nav a {
  padding: 0.72rem 0.8rem;
  color: #dbe9e6;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.ops-nav a:hover,
.ops-nav a[aria-current="page"] {
  color: #fff;
  background: rgb(255 255 255 / 11%);
}

.ops-site-link {
  margin-top: auto;
  color: #dbe9e6;
  font-size: 0.88rem;
}

.ops-workspace {
  min-width: 0;
}

.ops-header {
  display: flex;
  min-height: 68px;
  padding: 0.8rem clamp(1rem, 3vw, 2.5rem);
  background: rgb(255 255 255 / 92%);
  border-bottom: 1px solid var(--ops-line);
  align-items: center;
  justify-content: flex-end;
}

.ops-user,
.ops-action-group,
.ops-row-actions,
.ops-form-actions,
.ops-filter-actions {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
}

.ops-user > span {
  font-size: 0.9rem;
  font-weight: 700;
}

.ops-link-button {
  padding: 0.35rem 0.4rem;
  margin: -0.35rem -0.4rem;
  color: var(--ops-brand-dark);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.ops-link-button--danger {
  color: var(--ops-danger);
}

.ops-row-actions a {
  padding: 0.35rem 0.4rem;
  margin: -0.35rem -0.4rem;
  border-radius: 6px;
}

.ops-mobile-nav {
  display: none;
}

.ops-main {
  width: min(1440px, 100%);
  min-height: calc(100vh - 68px);
  padding: clamp(1.25rem, 3vw, 2.7rem);
  margin: 0 auto;
}

.ops-page-heading {
  margin-bottom: 1.6rem;
}

.ops-page-heading--actions,
.ops-panel__heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.ops-page-heading h1 {
  margin: 0.1rem 0 0.35rem;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  line-height: 1.08;
}

.ops-page-heading p,
.ops-panel__heading p {
  margin: 0;
  color: var(--ops-muted);
}

.ops-eyebrow {
  margin: 0;
  color: var(--ops-brand) !important;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ops-panel {
  padding: clamp(1rem, 2.4vw, 1.6rem);
  margin-bottom: 1.25rem;
  background: var(--ops-panel);
  border: 1px solid var(--ops-line);
  border-radius: var(--ops-radius);
  box-shadow: var(--ops-shadow);
}

.ops-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.ops-panel--primary h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.ops-panel--quiet {
  box-shadow: none;
}

.ops-panel--quiet h2 {
  font-size: 1.05rem;
}

.ops-panel__heading {
  margin-bottom: 1rem;
  align-items: center;
}

.ops-panel__heading h2,
.ops-panel__heading h3 {
  margin: 0;
}

.ops-notice {
  display: grid;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  color: #63430e;
  background: #fff8e9;
  border: 1px solid #ead39e;
  border-radius: var(--ops-radius);
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
}

.ops-notice > div:first-child span {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  color: #fff;
  background: var(--ops-warning);
  border-radius: 50%;
  font-weight: 900;
  place-items: center;
}

.ops-notice h2,
.ops-notice p,
.ops-notice ul {
  margin-top: 0;
}

.ops-notice h2 {
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.ops-notice ul {
  padding-left: 1.2rem;
  margin-bottom: 0;
}

.ops-kpis {
  display: grid;
  margin-bottom: 1.25rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}

.ops-kpis article {
  display: flex;
  min-height: 132px;
  padding: 1.1rem;
  background: var(--ops-panel);
  border: 1px solid var(--ops-line);
  border-radius: var(--ops-radius);
  box-shadow: var(--ops-shadow);
  flex-direction: column;
}

.ops-kpis span,
.ops-kpis small {
  color: var(--ops-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.ops-kpis strong {
  margin: auto 0 0;
  font-family: Georgia, serif;
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1;
}

.ops-kpis__primary strong {
  font-size: 2.6rem;
  font-weight: 600;
}

.ops-two-column,
.ops-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.ops-two-column .ops-panel,
.ops-detail-grid .ops-panel {
  min-width: 0;
}

.ops-table-wrap {
  /* Contains absolutely positioned descendants (such as visually hidden
     header labels) so they scroll with the table instead of widening the page. */
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--ops-line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 0.82rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--ops-line);
}

th {
  color: #51625f;
  background: #f6f8f7;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

.ops-table-wrap tbody tr {
  position: relative;
}

.ops-row-link::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
}

td small {
  color: var(--ops-muted);
}

code {
  padding: 0.12rem 0.25rem;
  background: #eff3f1;
  border-radius: 4px;
  font-size: 0.82em;
}

.ops-status {
  display: inline-flex;
  padding: 0.25rem 0.5rem;
  color: #205d50;
  background: #e2f3ed;
  border: 1px solid #b9ded3;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.ops-status--cancelled {
  color: #783d3d;
  background: #faeaea;
  border-color: #e8c1c1;
}

.ops-status--pending,
.ops-status--requested,
.ops-status--unknown {
  color: #715116;
  background: #fff3d7;
  border-color: #ead49e;
}

/* Payment statuses; the badge text always names the status. */
.ops-status--processing,
.ops-status--submitted {
  color: #1d4f73;
  background: #e6f0f8;
  border-color: #b7d0e4;
}

.ops-status--refunded {
  color: #4a5250;
  background: #eef1f0;
  border-color: #cdd5d2;
}

.ops-status--failed {
  color: #7f1d1d;
  background: #fde2e2;
  border-color: #e3a4a4;
}

.ops-payment-flag {
  margin-left: 0.4rem;
  font-size: 0.82rem;
}

/* Refund history: one card per refund operation, newest first. */
.ops-refund-history__heading {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
}

.ops-refund-history {
  display: grid;
  padding: 0;
  margin: 0;
  gap: 0.75rem;
  list-style: none;
}

.ops-refund-history > li {
  padding: 0.85rem 1rem 0.2rem;
  border: 1px solid var(--ops-line);
  border-radius: 10px;
}

.ops-refund-history__summary {
  display: flex;
  margin: 0 0 0.6rem;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.ops-booking-list,
.ops-rule-list,
.ops-compact-list,
.ops-metric-grid ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.ops-booking-list li + li,
.ops-rule-list li + li,
.ops-compact-list li + li,
.ops-metric-grid li + li {
  border-top: 1px solid var(--ops-line);
}

.ops-booking-list a {
  display: grid;
  padding: 0.75rem 0;
  color: inherit;
  grid-template-columns: 72px 1fr;
  gap: 0.8rem;
  text-decoration: none;
}

.ops-booking-list a:hover strong {
  color: var(--ops-brand);
}

.ops-booking-list time,
.ops-booking-list a > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.ops-booking-list small {
  overflow: hidden;
  color: var(--ops-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.ops-metric-grid h3 {
  margin: 0 0 0.55rem;
  font-size: 0.9rem;
}

.ops-metric-grid li,
.ops-compact-list li {
  display: flex;
  flex-wrap: wrap;
  padding: 0.45rem 0;
  gap: 0.25rem 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.ops-definition-list {
  margin: 0;
}

.ops-definition-list div {
  display: grid;
  padding: 0.7rem 0;
  border-top: 1px solid var(--ops-line);
  grid-template-columns: minmax(130px, 0.4fr) 1fr;
  gap: 1rem;
}

.ops-definition-list dt {
  color: var(--ops-muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.ops-definition-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ops-prose {
  max-width: 72ch;
  white-space: normal;
}

.ops-button {
  display: inline-flex;
  min-height: 42px;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.2;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.ops-button--primary {
  color: #fff;
  background: var(--ops-brand);
}

.ops-button--primary:hover {
  background: var(--ops-brand-dark);
}

.ops-button--secondary {
  color: var(--ops-brand-dark);
  background: #fff;
  border-color: #9dbbb5;
}

.ops-button--danger {
  color: #fff;
  background: var(--ops-danger);
}

.ops-button--full {
  width: 100%;
}

.ops-back-link {
  display: inline-block;
  margin-bottom: 1.1rem;
}

.ops-login-card .ops-back-link {
  margin-bottom: 0;
}

.ops-quick-filters {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.ops-quick-filters a {
  padding: 0.48rem 0.75rem;
  color: var(--ops-muted);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.ops-quick-filters a[aria-current="page"] {
  color: var(--ops-brand-dark);
  background: var(--ops-brand-soft);
}

.ops-filter-form {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, minmax(125px, 0.8fr));
  gap: 0.8rem;
  align-items: end;
}

.ops-filter-form .ops-field--wide {
  grid-column: 1 / 2;
  grid-row: 1;
}

.ops-filter-actions {
  grid-column: 1 / -1;
}

.ops-form-panel {
  max-width: 780px;
}

.ops-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ops-form > * {
  grid-column: 1 / -1;
}

.ops-field {
  min-width: 0;
}

/* Known logical field pairs (start/end time, effective date range) sit side
   by side instead of each taking a full-width row on its own. */
.ops-field:has(> label[for="id_start_time"]),
.ops-field:has(> label[for="id_end_time"]),
.ops-field:has(> label[for="id_effective_from"]),
.ops-field:has(> label[for="id_effective_until"]) {
  grid-column: span 1;
}

.ops-field > label {
  display: block;
  margin-bottom: 0.32rem;
  color: #344b48;
  font-size: 0.82rem;
  font-weight: 750;
}

.ops-field input:not([type="checkbox"], [type="radio"]),
.ops-field select,
.ops-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.62rem 0.72rem;
  color: var(--ops-ink);
  background: #fff;
  border: 1px solid #aebdb9;
  border-radius: 7px;
}

.ops-field textarea {
  min-height: 110px;
  resize: vertical;
}

.ops-field input:disabled {
  color: #5f6a68;
  background: #edf1ef;
}

.ops-field--check > label {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.ops-field--check input {
  width: 1.1rem;
  height: 1.1rem;
}

/* Radio groups rendered as fieldset + legend by includes/form_fields.html. */
fieldset.ops-field {
  padding: 0;
  margin: 0;
  border: 0;
}

.ops-field > legend {
  padding: 0;
  margin-bottom: 0.32rem;
  color: #344b48;
  font-size: 0.82rem;
  font-weight: 750;
}

.ops-field--choices label {
  display: flex;
  min-height: 44px;
  gap: 0.55rem;
  align-items: center;
}

.ops-field--choices input {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}

.ops-field-inline {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ops-field-inline input {
  max-width: 8rem;
}

.ops-field-suffix {
  color: var(--ops-muted);
  font-size: 0.85rem;
}

.ops-help,
.ops-muted {
  color: var(--ops-muted);
}

.ops-help {
  margin: 0.28rem 0 0;
  font-size: 0.76rem;
}

.ops-field-errors,
.ops-error-summary {
  color: #7f2525;
}

.ops-field-errors ul,
.ops-error-summary ul {
  padding-left: 1.2rem;
  margin: 0.35rem 0 0;
}

/* Invalid fields (STAFF-UX-01). The :not() keeps this rule as specific as the
   base input rule above, so the red border actually wins over it. */
.ops-field--error input:not([type="checkbox"], [type="radio"]),
.ops-field--error select,
.ops-field--error textarea {
  border-color: var(--ops-danger);
  box-shadow: 0 0 0 3px rgb(161 57 57 / 12%);
}

.ops-field--error > label,
.ops-field--error > legend {
  color: #7f2525;
}

.ops-field-errors {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.ops-field-errors ul {
  padding-left: 0;
  margin: 0;
  list-style: none;
}

/* Scroll targets for the first error (operations.js) and for the browser's
   own focus on an invalid control: clear of the sticky mobile header. */
.ops-field,
.ops-field :is(input, select, textarea),
.ops-error-summary {
  scroll-margin-top: 1.5rem;
}

.ops-field--error:focus,
.ops-error-summary:focus {
  outline: none;
}

@media (max-width: 860px) {
  .ops-field,
  .ops-field :is(input, select, textarea),
  .ops-error-summary {
    scroll-margin-top: 5.5rem;
  }
}

.ops-error-summary {
  padding: 0.8rem 1rem;
  background: #fff0f0;
  border: 1px solid #e4bcbc;
  border-radius: 8px;
}

.ops-error-summary h2 {
  margin: 0;
  font-size: 1rem;
}

.ops-empty {
  padding: 1.2rem;
  margin: 0;
  color: var(--ops-muted);
  text-align: center;
  background: #f7f9f8;
  border-radius: 8px;
}

.ops-pagination {
  display: flex;
  padding-top: 1rem;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.ops-week-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.ops-week-grid > .ops-day-card:last-child {
  grid-column: 1 / -1;
}

.ops-rule-list li {
  display: flex;
  padding: 0.75rem 0;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.ops-rule-list li > div:first-child {
  display: flex;
  gap: 0.35rem 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.ops-rule-list small {
  width: 100%;
  color: var(--ops-muted);
}

.ops-messages {
  margin-bottom: 1rem;
}

.ops-message {
  padding: 0.72rem 0.9rem;
  margin: 0 0 0.5rem;
  background: var(--ops-brand-soft);
  border-left: 4px solid var(--ops-brand);
  border-radius: 6px;
}

.ops-message--error {
  color: #782828;
  background: #fff0f0;
  border-color: var(--ops-danger);
}

.ops-login-body {
  display: grid;
  min-height: 100vh;
  padding: 1rem;
  background:
    radial-gradient(circle at 85% 10%, rgb(56 136 123 / 18%), transparent 30%),
    #eef4f1;
  place-items: center;
}

.ops-login-card {
  display: grid;
  width: min(440px, 100%);
  padding: clamp(1.5rem, 5vw, 2.6rem);
  background: #fff;
  border: 1px solid var(--ops-line);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgb(17 62 56 / 14%);
  gap: 1.7rem;
}

.ops-brand--login {
  color: var(--ops-brand-dark);
}

.ops-brand--login strong {
  color: var(--ops-brand);
}

.ops-login-card h1 {
  margin: 0.2rem 0 0.35rem;
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
}

.ops-login-card p {
  margin: 0;
  color: var(--ops-muted);
}

@media (max-width: 1100px) {
  .ops-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ops-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-filter-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ops-kpis article:last-child {
    grid-column: 2 / -1;
  }
}

@media (max-width: 860px) {
  .ops-shell {
    display: block;
  }

  .ops-sidebar {
    display: none;
  }

  .ops-header {
    position: sticky;
    z-index: 20;
    top: 0;
    justify-content: space-between;
  }

  .ops-mobile-nav {
    position: relative;
    display: block;
  }

  .ops-mobile-nav summary {
    display: flex;
    gap: 0.55rem;
    cursor: pointer;
    align-items: baseline;
    list-style: none;
  }

  .ops-mobile-nav summary small {
    color: var(--ops-muted);
  }

  .ops-mobile-nav__panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: min(340px, calc(100vw - 1rem));
    padding: 1rem;
    color: #fff;
    background: #123f3b;
    border-radius: 0 0 12px;
    box-shadow: var(--ops-shadow);
  }

  .ops-mobile-nav__panel .ops-nav {
    margin: 0 0 1rem;
  }

  .ops-two-column,
  .ops-detail-grid,
  .ops-week-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .ops-header {
    min-height: 60px;
  }

  .ops-user > span {
    display: none;
  }

  .ops-main {
    padding: 1rem;
  }

  .ops-page-heading--actions,
  .ops-panel__heading {
    flex-direction: column;
  }

  .ops-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-kpis article {
    min-height: 112px;
  }

  .ops-kpis article:last-child {
    grid-column: 1 / -1;
  }

  .ops-metric-grid,
  .ops-filter-form {
    grid-template-columns: 1fr;
  }

  .ops-filter-form .ops-field--wide {
    grid-column: auto;
    grid-row: auto;
  }

  .ops-filter-actions {
    grid-column: auto;
  }

  .ops-definition-list div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .ops-field:has(> label[for="id_start_time"]),
  .ops-field:has(> label[for="id_end_time"]),
  .ops-field:has(> label[for="id_effective_from"]),
  .ops-field:has(> label[for="id_effective_until"]) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 390px) {
  .ops-main {
    padding: 0.8rem;
  }

  .ops-panel {
    padding: 0.9rem;
    border-radius: 10px;
  }

  .ops-page-heading h1 {
    font-size: 2rem;
  }

  .ops-kpis {
    gap: 0.55rem;
  }

  .ops-kpis article {
    padding: 0.85rem;
  }

  .ops-action-group,
  .ops-action-group form,
  .ops-action-group .ops-button,
  .ops-panel__heading .ops-button,
  .ops-form-actions .ops-button {
    width: 100%;
  }

  .ops-rule-list li {
    flex-direction: column;
  }
}

.ops-kpis--finance {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ops-chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.ops-chip {
  padding: 0.35rem 0.85rem;
  color: var(--ops-muted);
  cursor: pointer;
  background: var(--ops-panel);
  border: 1px solid var(--ops-line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.ops-chip[aria-pressed="true"] {
  color: #fff;
  background: #123f3b;
  border-color: #123f3b;
}

.ops-chart {
  margin-bottom: 0.4rem;
}

.ops-chart-svg {
  width: 100%;
  height: auto;
}

.ops-chart-axis {
  stroke: var(--ops-line);
  stroke-width: 1;
}

.ops-chart-line {
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ops-chart-point {
  cursor: pointer;
}

.ops-chart-point:focus {
  outline: 2px solid #123f3b;
  outline-offset: 2px;
}

.ops-chart-tick {
  fill: var(--ops-muted);
  font-size: 10px;
}

.ops-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.ops-chart-legend li {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--ops-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.ops-chart-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
}

.ops-chart-empty {
  padding: 2rem 1rem;
  color: var(--ops-muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .ops-kpis--finance {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ops-kpis--finance article:last-child {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .ops-kpis--finance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-kpis--finance article:last-child {
    grid-column: auto;
  }
}
.ops-review-photo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
}

.ops-review-photo--preview {
  width: 5rem;
  height: 5rem;
}

/* Agency students on phones: each row becomes a stacked card so the row
   actions (Book consultation, Edit) are visible without sideways scrolling. */
@media (max-width: 680px) {
  .ops-table-wrap--stack {
    overflow-x: visible;
  }

  .ops-table-wrap--stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .ops-table-wrap--stack table,
  .ops-table-wrap--stack tbody,
  .ops-table-wrap--stack tr,
  .ops-table-wrap--stack td {
    display: block;
  }

  .ops-table-wrap--stack tr {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--ops-line);
  }

  .ops-table-wrap--stack tr:last-child {
    border-bottom: 0;
  }

  .ops-table-wrap--stack td {
    padding: 0.2rem 0.9rem;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .ops-table-wrap--stack .ops-row-actions {
    flex-wrap: wrap;
    padding-top: 0.4rem;
  }
}

/* Toasts (FE-FINAL-02A, compact in STAFF-UX-01): Django messages. Without
   JavaScript they sit in the page flow above the content; operations.js adds
   .ops-toasts--floating so they float in a corner without shifting the page.
   Bootstrap's Toast JS toggles .show; Staff loads no Bootstrap CSS. */
.ops-toasts {
  display: grid;
  max-width: 20rem;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.ops-toasts--floating {
  position: fixed;
  z-index: 1040;
  right: 1rem;
  bottom: 1rem;
  width: min(20rem, calc(100vw - 2rem));
  max-width: none;
  margin: 0;
  pointer-events: none;
}

.ops-toasts--floating .ops-toast {
  pointer-events: auto;
}

.ops-toast {
  display: grid;
  padding: 0.55rem 0.35rem 0.55rem 0.7rem;
  color: var(--ops-ink);
  background: #fff;
  border: 1px solid var(--ops-line);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgb(26 55 51 / 10%);
  font-size: 0.875rem;
  line-height: 1.4;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.55rem;
}

.ops-toast.show {
  animation: ops-toast-in 160ms ease-out;
}

.ops-toast:not(.show) {
  display: none;
}

@keyframes ops-toast-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ops-toast.show {
    animation: none;
  }
}

.ops-toast__icon {
  display: flex;
  margin-top: 0.1rem;
  color: var(--ops-brand);
}

.ops-toast__icon svg {
  display: block;
}

.ops-toast__body {
  margin: 0;
  overflow-wrap: anywhere;
}

.ops-toast__close,
.ops-modal__close {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  margin: -0.45rem 0;
  padding: 0;
  color: var(--ops-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  place-items: center;
}

.ops-toast__close:hover,
.ops-modal__close:hover {
  color: var(--ops-ink);
  background: var(--ops-bg);
}

/* Toast close only: smaller with a mouse, still a full tap target on touch.
   The modal close button keeps the shared rule above. */
.ops-toast__close {
  width: 1.9rem;
  height: 1.9rem;
  margin: -0.25rem 0;
  border-radius: 6px;
  font-size: 1.15rem;
}

@media (pointer: coarse) {
  .ops-toast__close {
    width: 2.5rem;
    height: 2.5rem;
    margin: -0.5rem 0 -0.5rem -0.3rem;
  }
}

.ops-toast--info .ops-toast__icon {
  color: #2f5f8a;
}

.ops-toast--warning {
  border-color: #e7d3a6;
}

.ops-toast--warning .ops-toast__icon {
  color: var(--ops-warning);
}

.ops-toast--error {
  border-color: #ecc5c5;
}

.ops-toast--error .ops-toast__icon {
  color: var(--ops-danger);
}

@media (max-width: 680px) {
  .ops-toasts {
    max-width: none;
  }

  .ops-toasts--floating {
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    left: 0.75rem;
    width: auto;
  }
}

/* Confirmation modal (FE-FINAL-02A): only the state rules Bootstrap's Modal JS
   needs (it sets display and adds the backdrop), in the Staff visual style. */
.ops-modal {
  position: fixed;
  z-index: 1055;
  display: none;
  inset: 0;
  padding: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal-backdrop {
  position: fixed;
  z-index: 1050;
  inset: 0;
  background: rgb(15 33 31 / 55%);
}

.ops-modal__dialog {
  width: min(32rem, 100%);
  margin: min(12vh, 6rem) auto 1rem;
}

.ops-modal__content {
  padding: 1.25rem;
  background: #fff;
  border: 1px solid var(--ops-line);
  border-radius: var(--ops-radius);
  box-shadow: 0 24px 60px rgb(17 62 56 / 22%);
}

.ops-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.ops-modal__title {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
  line-height: 1.3;
}

.ops-modal__body p {
  margin: 0.8rem 0 0;
  overflow-wrap: anywhere;
}

.ops-modal__question {
  font-weight: 650;
}

.ops-modal__detail {
  color: var(--ops-muted);
}

.ops-modal__actions {
  display: flex;
  margin-top: 1.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem;
}

.ops-modal__actions .ops-button {
  min-height: 44px;
}

@media (max-width: 480px) {
  .ops-modal {
    padding: 0.75rem;
  }

  .ops-modal__dialog {
    margin-top: 0.75rem;
  }

  .ops-modal__actions .ops-button {
    flex: 1 1 100%;
  }
}

/* Staff quick search (STAFF-UX-02): an icon in the header opens a compact
   panel. Without JavaScript the icon is a link to the search page. The panel
   sits below the confirmation modal (1050) and above the toasts (1040). */
.ops-search {
  position: relative;
  margin-right: 1.1rem;
  margin-left: auto;
}

.ops-search__toggle {
  display: inline-flex;
  min-height: 2.25rem;
  padding: 0.3rem 0.55rem;
  color: var(--ops-muted);
  background: #fff;
  border: 1px solid var(--ops-line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  text-decoration: none;
  align-items: center;
  gap: 0.45rem;
}

.ops-search__toggle:hover,
.ops-search__toggle[aria-expanded="true"] {
  color: var(--ops-ink);
  border-color: #aebdb9;
}

.ops-search__toggle svg {
  display: block;
}

.ops-search__hint {
  padding: 0.05rem 0.3rem;
  color: var(--ops-muted);
  background: var(--ops-bg);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.7rem;
}

.ops-search__panel {
  position: absolute;
  z-index: 1045;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(26rem, calc(100vw - 2rem));
  padding: 0.6rem;
  background: #fff;
  border: 1px solid var(--ops-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgb(26 55 51 / 14%);
}

.ops-search__panel[hidden] {
  display: none;
}

.ops-search__form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* 1rem keeps iOS from zooming in when the input takes focus. */
.ops-search__input {
  min-width: 0;
  min-height: 2.5rem;
  padding: 0.45rem 0.65rem;
  color: var(--ops-ink);
  background: #fff;
  border: 1px solid #aebdb9;
  border-radius: 8px;
  font-size: 1rem;
  flex: 1 1 auto;
}

.ops-search__close {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: var(--ops-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  flex: none;
  place-items: center;
}

.ops-search__close:hover {
  color: var(--ops-ink);
  background: var(--ops-bg);
}

.ops-search__status {
  margin: 0.45rem 0.2rem 0;
  color: var(--ops-muted);
  font-size: 0.8rem;
}

.ops-search__results {
  max-height: min(60vh, 26rem);
  margin-top: 0.35rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.ops-search__results[hidden] {
  display: none;
}

.ops-search__group + .ops-search__group {
  padding-top: 0.3rem;
  margin-top: 0.3rem;
  border-top: 1px solid var(--ops-line);
}

.ops-search__group-label {
  margin: 0.3rem 0.5rem 0.15rem;
  color: var(--ops-muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ops-search__option {
  display: block;
  padding: 0.45rem 0.55rem;
  color: var(--ops-ink);
  border-radius: 7px;
  line-height: 1.3;
  text-decoration: none;
}

.ops-search__option strong,
.ops-search__option span {
  display: block;
  overflow-wrap: anywhere;
}

.ops-search__option strong {
  font-size: 0.875rem;
  font-weight: 650;
}

.ops-search__option span {
  color: var(--ops-muted);
  font-size: 0.78rem;
}

.ops-search__option:hover,
.ops-search__option[aria-selected="true"] {
  background: var(--ops-brand-soft);
}

.ops-search-page__heading {
  margin: 1.1rem 0 0.4rem;
  color: var(--ops-muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ops-search-page__heading:first-child {
  margin-top: 0;
}

.ops-search-page__list {
  display: grid;
  padding: 0;
  margin: 0;
  list-style: none;
  gap: 0.2rem;
}

.ops-search-page__list a {
  display: block;
  padding: 0.4rem 0.2rem;
  overflow-wrap: anywhere;
}

@media (max-width: 680px) {
  .ops-search {
    margin-right: 0.75rem;
  }

  .ops-search__hint {
    display: none;
  }

  .ops-search__toggle {
    min-width: 2.5rem;
    min-height: 2.5rem;
    justify-content: center;
  }

  /* A full-width sheet at the top of the screen, clear of the edges. */
  .ops-search__panel {
    position: fixed;
    top: 0.6rem;
    right: 0.6rem;
    left: 0.6rem;
    width: auto;
    max-height: calc(100vh - 1.2rem);
    overflow-y: auto;
  }

  .ops-search__results {
    max-height: none;
  }
}

/* Staff quick actions (STAFF-UX-03): a <details> disclosure beside the
   search, so it works without JavaScript. Same layer as the search panel. */
.ops-search:has(+ .ops-actions) {
  margin-right: 0.4rem;
}

.ops-actions {
  position: relative;
  margin-right: 1.1rem;
}

.ops-actions__toggle {
  display: inline-flex;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.3rem;
  color: var(--ops-muted);
  background: #fff;
  border: 1px solid var(--ops-line);
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
  align-items: center;
  justify-content: center;
}

.ops-actions__toggle::-webkit-details-marker {
  display: none;
}

.ops-actions__toggle:hover,
.ops-actions[open] > .ops-actions__toggle {
  color: var(--ops-ink);
  border-color: #aebdb9;
}

.ops-actions__toggle svg {
  display: block;
}

.ops-actions__menu {
  position: absolute;
  z-index: 1045;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(17rem, calc(100vw - 2rem));
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--ops-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgb(26 55 51 / 14%);
}

.ops-actions__label {
  margin: 0.35rem 0.5rem 0.15rem;
  color: var(--ops-muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.ops-actions__list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.ops-actions__list + .ops-actions__label {
  padding-top: 0.35rem;
  margin-top: 0.3rem;
  border-top: 1px solid var(--ops-line);
}

.ops-actions__list a {
  display: block;
  padding: 0.5rem 0.55rem;
  color: var(--ops-ink);
  border-radius: 7px;
  font-size: 0.875rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.ops-actions__list a:hover,
.ops-actions__list a:focus-visible {
  background: var(--ops-brand-soft);
}

@media (max-width: 680px) {
  .ops-actions {
    margin-right: 0.75rem;
  }

  .ops-actions__toggle {
    min-width: 2.5rem;
    min-height: 2.5rem;
  }

  /* A full-width sheet under the sticky header, clear of the edges. */
  .ops-actions__menu {
    position: fixed;
    top: 4.1rem;
    right: 0.6rem;
    left: 0.6rem;
    width: auto;
    max-height: calc(100vh - 4.7rem);
    overflow-y: auto;
  }

  .ops-actions__list a {
    padding: 0.65rem 0.6rem;
  }
}

/* Staff notification bell (STAFF-UX-04B): the quick-actions <details> menu
   with a small count of pending actions. Nothing is tracked as unread. */
.ops-actions:has(+ .ops-actions) {
  margin-right: 0.4rem;
}

.ops-bell .ops-actions__toggle {
  position: relative;
}

.ops-bell__badge {
  position: absolute;
  top: -0.45rem;
  right: -0.45rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  color: #fff;
  background: var(--ops-danger);
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 750;
  line-height: calc(1.15rem - 4px);
  text-align: center;
}

.ops-bell__empty {
  margin: 0.2rem 0.55rem 0.45rem;
  color: var(--ops-muted);
  font-size: 0.85rem;
}

.ops-bell__empty + .ops-actions__label {
  padding-top: 0.35rem;
  margin-top: 0.3rem;
  border-top: 1px solid var(--ops-line);
}

/* Narrow phones: three header icons, the menu button and "Log out" must
   fit in 320px, so the menu button keeps only its icon and name. */
@media (max-width: 400px) {
  .ops-mobile-nav summary small {
    display: none;
  }

  .ops-bell {
    margin-right: 0.6rem;
  }
}
