/**
 * AdminWeb shared UI — keep typography / spacing consistent product-wide.
 * Tokens: --font-size-* and --space-* from global.css
 *
 * Spacing system (4-px base):
 *   --space-1  4px   — icon gaps, tight inline
 *   --space-2  8px   — label→input, button gaps
 *   --space-3  12px  — helper-text gap, compact field gap
 *   --space-4  16px  — normal field-to-field gap
 *   --space-5  24px  — section separators
 *   --space-6  32px  — modal outer padding (desktop)
 *
 * Ownership rules:
 *   Modal shell    → outer padding (hs-dialog__body: 20px 24px 24px)
 *   .modal-form    → field-to-field gap (16px via flex gap)
 *   .modal-section → section-to-section separation (24px top border)
 *   .form-actions  → button group top border + gap
 *   label          → label→input gap (8px)
 *   .modal-lead    → subtitle under modal title (12px bottom margin)
 */

/* ============================================================
   MODAL / DIALOG SPACING SYSTEM
   Overrides for the sapvt-ltd Dialog component (.hs-dialog__*)
   These are the ONLY place that sets modal shell spacing.

   Architecture:
     .hs-modal-backdrop  — full-screen overlay, centers the modal
     .hs-modal           — shell: flex column, viewport-capped, no overflow
     .hs-dialog__header  — sticky top, never scrolls away
     .hs-dialog__body    — flex:1, min-height:0, overflow-y:auto  ← ONLY scrolling area
     .hs-dialog__footer  — sticky bottom (when used)
     .modal-actions      — when inside the body and is the last item, sticks to bottom
   ============================================================ */

/* ── Backdrop ─────────────────────────────────────────────── */
.hs-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  /* 20px breathing room top & bottom on desktop */
  padding: 20px 16px;
  /* Prevent the backdrop itself from scrolling */
  overflow: hidden;
}

/* Second nested modal (e.g. deactivate confirmation over edit) */
.hs-modal-backdrop + .hs-modal-backdrop,
.hs-modal-backdrop ~ .hs-modal-backdrop {
  z-index: 1100;
}

/* Lock the background page when any modal is open — prevents double scroll.
   padding-right compensates for the scrollbar width disappearing so the
   fixed sidebar + main content don't jump left when the modal opens. */
body:has(.hs-modal-backdrop) {
  overflow: hidden;
  padding-right: var(--scrollbar-width, 0px);
}

/* Measure scrollbar width once at root level (JS sets it; CSS fallback = 0) */
:root {
  --scrollbar-width: 0px;
}

/* ── Modal shell ──────────────────────────────────────────── */
.hs-modal {
  /* Width: never wider than 480px, never wider than viewport − 32px */
  width: min(calc(100vw - 32px), 480px);
  /* Height: use all available viewport minus backdrop padding (2×20px) */
  max-height: calc(100dvh - 40px);
  display: block;
  /* Shell itself must NOT scroll — each zone handles its own overflow */
  overflow: hidden;
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

/*
 * .hs-dialog is the DIRECT child of .hs-modal injected by the Dialog component.
 * It must stretch to fill .hs-modal completely and itself be a flex column
 * so that .hs-dialog__body can shrink and scroll.
 * Without this, the flex: 1 1 0 on .hs-dialog__body has nothing to constrain
 * its parent height and overflow-y:auto never activates.
 */
.hs-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: inherit;
  overflow: hidden;
  /* Inherit border-radius from the modal shell */
  border-radius: inherit;
}

/* ── Header — sticky, never scrolls away ─────────────────── */
.hs-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  /* Prevent header from shrinking */
  flex-shrink: 0;
  /* Stack above scrolled body content */
  position: relative;
  z-index: 1;
  /* Ensure background covers scrolled content that slides under it */
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
}

.hs-dialog__title {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

.hs-dialog__close {
  flex-shrink: 0;
  min-width: 32px;
  min-height: 32px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
}

.hs-dialog__close:hover {
  background: var(--color-bg);
}

/* ── Body — the ONE scrolling region ─────────────────────── */
.hs-dialog__body {
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(100dvh - 140px);
  overflow-y: auto;
  overflow-x: hidden;
  /* Smooth momentum scroll on iOS */
  -webkit-overflow-scrolling: touch;
  /* Content layout */
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* 16px between every direct child */
}

/* ── Footer (when used as a separate element) ────────────── */
.hs-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
  background: var(--color-surface, #fff);
  border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
}

/* ── Modal lead — subtitle line under title ───────────────── */
.modal-lead {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--color-text-secondary);
}

/* ── Modal form — field stack ─────────────────────────────── */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* 16px between fields */
}

/* Two-column field row inside a modal */
.modal-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-4);
}

/* ── Modal section — account-access / partner-link etc. ───── */
/* Visual section break: top border + 24px padding above content */
.modal-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3); /* 12px between items inside the section */
  padding-top: var(--space-5); /* 24px */
  border-top: 1px solid var(--color-border);
  margin-top: calc(var(--space-5) - var(--space-4)); /* net 24px separation */
}

.modal-section__title {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text);
}

.modal-section__meta {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--color-text-secondary);
}

/* ── Modal actions — button group ─────────────────────────── */
/*
 * Base style: non-sticky button group used mid-modal (e.g. Account Access
 * action buttons inside a section). Has a light top margin only.
 */
.modal-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

/*
 * When .modal-actions is the LAST direct child of .hs-dialog__body,
 * promote it to a sticky footer so Save/Cancel are always reachable.
 *
 * :last-child matches when it is the final element in the body,
 * regardless of preceding siblings.
 *
 * The negative margin trick extends the separator border edge-to-edge
 * across the body's padding area without extra whitespace.
 */
.hs-dialog__body > .modal-actions:last-child {
  margin-top: auto;
  position: sticky;
  bottom: -24px; /* offsets the body's 24px padding-bottom */
  z-index: 2;
  background: var(--color-surface, #fff);
  /* Wall-to-wall top separator */
  margin-left: -24px;
  margin-right: -24px;
  padding: var(--space-4) 24px 0;
  border-top: 1px solid var(--color-border);
}

/* ── Textarea in modals ───────────────────────────────────── */
.hs-dialog__body textarea,
.modal textarea {
  font-size: var(--font-size-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  min-height: 6rem;
  width: 100%;
  resize: vertical;
  background: var(--card);
  color: var(--text);
  line-height: var(--line-height-body);
  font-family: inherit;
}

.hs-dialog__body textarea:focus,
.modal textarea:focus {
  outline: 2px solid var(--primary-color-opacity-35);
  outline-offset: 1px;
}

/* ── Label spacing in modals ─────────────────────────────── */
.hs-dialog__body label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2); /* 8px label→input */
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* ── Tablet: reduce width cap ────────────────────────────── */
@media (max-width: 640px) {
  .hs-modal-backdrop {
    padding: 12px;
    align-items: flex-end; /* sheet slides up from bottom on small screens */
  }

  .hs-modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
  }

  .hs-dialog__header {
    padding: 16px 16px 12px;
    border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
  }

  .hs-dialog__body {
    padding: 16px 16px 20px;
    gap: var(--space-3);
    max-height: calc(100dvh - 116px);
  }

  .modal-form-row {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions .btn,
  .modal-actions .hs-btn {
    width: 100%;
    justify-content: center;
  }

  /* Sticky last-child footer adjusts for smaller body padding on mobile */
  .hs-dialog__body > .modal-actions:last-child {
    bottom: -20px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ── Fallback for browsers without dvh (Safari <15.4) ──────── */
@supports not (height: 100dvh) {
  .hs-modal {
    max-height: calc(100vh - 40px);
  }

  @media (max-width: 640px) {
    .hs-modal {
      max-height: calc(100vh - 24px);
    }

    .hs-dialog__body {
      max-height: calc(100vh - 116px);
    }
  }
}

/* ============================================================
   END MODAL SYSTEM
   ============================================================ */

.admin-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.page-header {
  margin: 0;
}

.page-header h1 {
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-lg);
  font-weight: 700;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.page-header p {
  margin: 0;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--color-text-secondary);
  max-width: 40rem;
}

.panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: clip;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.panel + .panel {
  margin-top: 0;
}

.table-scroll {
  /* Prefer horizontal scroll over crushing columns on narrow screens */
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(70vh, 40rem);
  min-height: 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table th,
.table td {
  text-align: left;
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table th {
  font-size: var(--font-size-md);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 1;
}

.table th:first-child,
.table td:first-child {
  padding-left: var(--space-4);
}

.table th:last-child,
.table td:last-child {
  padding-right: var(--space-4);
}

.table .actions,
.table td:last-child .btn,
.table td:last-child .btn-ghost {
  white-space: nowrap;
}

.table .table-secondary,
.table td .muted,
.table td .btn,
.table td code + .btn,
.table td .btn-ghost {
  font-size: var(--font-size-xs);
}

.table tr:last-child td {
  border-bottom: none;
}

/* VirtualTable — fit wide data; scroll horizontally instead of crushing columns */
.hs-vtable {
  gap: var(--space-3);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.hs-vtable__scroll {
  max-height: min(70vh, 40rem);
  border-color: var(--color-border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: auto;
  width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.panel .hs-vtable__scroll {
  overflow-x: auto !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.hs-vtable__table {
  width: 100%;
  max-width: none;
  min-width: 56rem;
  table-layout: fixed;
}

.hs-vtable__table th,
.hs-vtable__table td {
  padding: var(--space-3);
  font-size: var(--font-size-sm);
  border-bottom-color: var(--color-border);
  overflow-wrap: break-word;
  word-break: normal;
}

.hs-vtable__table th {
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  z-index: 2;
  white-space: nowrap;
  vertical-align: middle;
}

.hs-vtable__table td {
  vertical-align: top;
}

.hs-vtable__th-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.hs-vtable__table th.hs-vtable__th--filter-open {
  z-index: 30;
}

.hs-vtable__search-panel {
  z-index: 1000;
  background: var(--color-surface);
}

.hs-vtable__table th:first-child,
.hs-vtable__table td:first-child {
  padding-left: var(--space-4);
}

.hs-vtable__table th:last-child,
.hs-vtable__table td:last-child {
  padding-right: var(--space-4);
  position: sticky;
  right: 0;
  z-index: 4;
  background: var(--color-card);
  box-shadow: -6px 0 8px -6px rgba(0, 0, 0, 0.12);
}

.hs-vtable__table th:last-child {
  z-index: 5;
  background: var(--color-bg);
}

.hs-vtable__table .cell-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  line-height: var(--line-height-body);
}

.hs-vtable__meta,
.hs-vtable__footer {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  padding: 0 var(--space-1);
}

.hs-select-wrap,
.hs-field-label {
  font-size: var(--font-size-sm);
}

.hs-field-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* Do not put padding on .hs-select — it is an Ant Design root and pads itself */
.hs-select.ant-select,
.hs-multiselect.ant-select {
  width: 100%;
  max-width: 100%;
}

.hs-vtable__table .hs-select,
.hs-vtable__table .hs-select-wrap,
.hs-vtable__table .hs-multiselect,
.table .hs-select,
.table .hs-select-wrap {
  max-width: 100%;
  min-width: 0;
}

.hs-banner {
  margin-bottom: 0;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
}

.hs-banner__title {
  font-size: var(--font-size-md);
}

.hs-banner__detail {
  font-size: var(--font-size-sm);
}

.muted {
  color: var(--color-text-secondary);
  padding: 0;
  font-size: var(--font-size-sm);
  margin: 0;
}

.table .muted,
.table-scroll .muted {
  padding: 0;
}

.error-text {
  color: var(--color-error);
  padding: 0;
  margin: 0;
  font-size: var(--font-size-sm);
}

.success-text {
  color: var(--color-success);
  padding: var(--space-1) 0;
  margin: 0;
  font-size: var(--font-size-sm);
}

.success-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  background: var(--color-success-opacity-12);
  color: var(--color-text);
  border: 1px solid color-mix(in srgb, var(--color-success) 40%, transparent);
  border-left: 4px solid var(--color-success);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin: 0;
  font-size: var(--font-size-sm);
}

.success-banner-body {
  min-width: 0;
  flex: 1;
}

.success-banner-title {
  display: block;
  color: var(--color-success);
  font-size: var(--font-size-md);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.success-banner-detail {
  margin: 0;
  color: var(--color-text-secondary);
  font-weight: 500;
  line-height: var(--line-height-body);
  font-size: var(--font-size-sm);
}

.success-banner-pin {
  margin: var(--space-2) 0 0;
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.success-banner-pin code {
  font-size: var(--font-size-md);
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--color-success);
}

.success-banner .btn {
  flex-shrink: 0;
}

.modal .error-text,
.hs-dialog .error-text,
.hs-modal .error-text {
  padding: var(--space-1) 0;
  margin: 0;
}

.password-field {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}

.password-field input {
  flex: 1;
  min-width: 0;
}

.actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.actions.stack-gap {
  margin-bottom: var(--space-4);
}

.btn,
a.btn,
a.hs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  min-height: var(--control-height);
  font-weight: 600;
  font-size: var(--font-size-sm);
  cursor: pointer;
  pointer-events: auto;
  text-decoration: none;
  line-height: var(--line-height-tight);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--neutral-white);
}

.btn-primary:hover {
  background: var(--primary-color-2);
}

.btn-danger {
  background: transparent;
  color: var(--warning-red);
  border: 1px solid var(--warning-red);
}

.btn-danger:hover {
  background: var(--color-error-opacity-08);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-color-2);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  background: var(--primary-color-opacity-05);
}

.table .btn,
.table .btn-ghost,
.hs-vtable__table .btn,
.hs-vtable__table .btn-ghost,
.hs-vtable__table .hs-btn {
  min-height: auto;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-xs);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  font-family: var(--font-mono);
  background: var(--color-bg);
  color: var(--color-text-secondary);
}

.badge-pending {
  background: var(--color-warning-opacity-12);
  color: var(--color-warning);
}

.badge-approved {
  background: var(--color-success-opacity-12);
  color: var(--color-success);
}

.badge-rejected {
  background: var(--color-error-opacity-12);
  color: var(--color-error);
}

.pin-reveal-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-4);
  margin: 0;
}

.stat-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
}

.stat-card.interactive {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}

.stat-card.interactive:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.stat-card--active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-color-opacity-20);
  background: var(--primary-color-opacity-05);
}

.overview-detail {
  margin-top: 0;
}

.overview-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
  align-items: start;
}

.overview-panels--charts {
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
}

.overview-detail--chart {
  min-width: 0;
}

@media (min-width: 70rem) {
  .overview-panels--charts {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .overview-panels--charts > .overview-detail:not(.overview-detail--chart):not(.overview-detail--trend) {
    grid-column: span 2;
  }

  .overview-detail--chart {
    grid-column: span 3;
  }

  .overview-detail--trend {
    grid-column: 1 / -1;
  }
}

.overview-trend-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-end;
}

.overview-segmented {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
}

.overview-segmented__btn {
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  line-height: 1.2;
}

.overview-segmented__btn + .overview-segmented__btn {
  border-left: 1px solid var(--color-border);
}

.overview-segmented__btn.is-active {
  background: var(--primary-color);
  color: #fff;
}

.overview-trend {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.overview-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
}

.overview-trend-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.overview-trend-legend-item strong {
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.overview-trend-svg-wrap {
  width: 100%;
  overflow-x: auto;
}

.overview-trend-svg {
  width: 100%;
  min-width: 28rem;
  height: auto;
  display: block;
}

.overview-trend-grid {
  stroke: var(--color-border);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.overview-trend-ytick,
.overview-trend-xtick {
  fill: var(--color-text-secondary);
  font-size: 10px;
  font-family: var(--font-sans, inherit);
}

.overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.overview-toolbar-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: 600;
}

.overview-state-select {
  min-width: 14rem;
  max-width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-card);
  color: var(--color-text);
  font: inherit;
}

.overview-chart-empty {
  margin: var(--space-4) 0 0;
}

.overview-vchart {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.overview-vchart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.overview-vchart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.overview-vchart-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2);
  align-items: stretch;
  min-width: 0;
}

.overview-vchart-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  height: 12.5rem;
  margin-bottom: 2.35rem;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  line-height: 1;
}

.overview-vchart-ytick {
  white-space: nowrap;
}

.overview-vchart-plot {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.overview-vchart-grid {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 12.5rem;
  pointer-events: none;
}

.overview-vchart-gridline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--color-border);
  opacity: 0.7;
}

.overview-vchart-groups {
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  min-height: 12.5rem;
  padding: 0 0.25rem;
  width: max-content;
  min-width: 100%;
}

.overview-vchart-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1 0 auto;
  min-width: 3.5rem;
}

.overview-vchart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.3rem;
  height: 12.5rem;
  width: 100%;
}

.overview-vchart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  height: 100%;
  width: 1.1rem;
}

.overview-vchart-value {
  font-size: 0.65rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-secondary);
  line-height: 1;
  min-height: 0.7rem;
}

.overview-vchart-bar-track {
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  border-radius: 4px 4px 0 0;
  background: var(--color-bg);
  overflow: hidden;
}

.overview-vchart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 0;
  transition: height 0.35s ease;
}

.overview-vchart-xlabel {
  max-width: 5.5rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.overview-status-vchart {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  min-height: 11rem;
  padding-top: var(--space-2);
  overflow-x: auto;
}

.overview-status-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 0;
  min-width: 3.25rem;
}

.overview-status-value {
  font-size: var(--font-size-sm);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
  line-height: 1;
}

.overview-status-bar-track {
  width: 1.35rem;
  height: 7.5rem;
  border-radius: 4px 4px 0 0;
  background: var(--color-bg);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.overview-status-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.35s ease;
}

.overview-status-label {
  font-size: 0.68rem;
  text-align: center;
  color: var(--color-text-secondary);
  line-height: 1.2;
  max-width: 4.5rem;
}

.overview-pie {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5);
}

.overview-pie-chart {
  flex: 0 0 auto;
  margin: 0 auto;
}

.overview-pie-total {
  fill: var(--color-text);
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-sans, inherit);
}

.overview-pie-caption {
  fill: var(--color-text-secondary);
  font-size: 0.75rem;
  font-family: var(--font-sans, inherit);
}

.overview-pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 10rem;
  flex: 1 1 10rem;
}

.overview-pie-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: var(--space-2);
  align-items: center;
}

.overview-pie-swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  flex-shrink: 0;
}

.overview-pie-legend-label {
  color: var(--color-text);
}

.overview-pie-legend strong {
  font-variant-numeric: tabular-nums;
}

.overview-detail-lead {
  margin: 0 0 var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
}

.overview-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.overview-bar-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.overview-bar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.overview-bar-meta strong {
  font-size: var(--font-size-md);
  font-variant-numeric: tabular-nums;
}

.overview-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--color-bg);
  overflow: hidden;
}

.overview-bar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 0;
  transition: width 0.35s ease;
}

.overview-bar-fill--pending {
  background: var(--color-warning);
}

.overview-bar-fill--approved {
  background: var(--color-success);
}

.overview-bar-fill--rejected {
  background: var(--color-error);
}

.stat-card span {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-1);
}

.stat-card strong {
  font-size: var(--font-size-xl);
  letter-spacing: -0.02em;
  line-height: var(--line-height-tight);
}

.row-header {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-start;
  flex-wrap: wrap;
}

.row-header > div:first-child {
  min-width: 0;
  flex: 1 1 12rem;
}

.row-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  flex: 0 1 auto;
  margin-left: auto;
}

.breadcrumb {
  margin: 0 0 var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  align-items: flex-end;
  justify-content: flex-start;
}

.filter-row .filter-inline {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.filter-row .filter-inline input {
  min-width: 10rem;
  max-width: 12rem;
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.filter-row .filter-row-spacer {
  margin-left: auto;
}

.filter-row .hs-select-wrap {
  margin: 0;
  min-width: 14rem;
  max-width: 22rem;
}

.form-panel {
  padding: var(--space-4);
}

.panel.form-panel {
  /* Let package Select/MultiSelect dropdowns paint and scroll outside the card */
  overflow: visible;
}

.panel.panel--dropdown-safe {
  overflow: visible;
}

.panel.panel--dropdown-safe .hs-vtable__scroll {
  overflow: auto;
}

.category-section-cell {
  min-width: 14rem;
  max-width: 18rem;
}

.category-section-cell .hs-dd__panel {
  z-index: 50;
}

.category-section-cell .hs-dd__list {
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.category-inline-input {
  display: block;
  width: 100%;
  min-width: 6rem;
  font: inherit;
  font-size: var(--font-size-sm);
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--color-card);
  color: var(--color-text);
}

.category-inline-input:focus {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
  outline-offset: 1px;
}

.category-search-terms-cell {
  display: block;
  width: 100%;
  min-width: 14rem;
  max-width: 20rem;
  min-height: 2.75rem;
  resize: vertical;
  font: inherit;
  font-size: var(--font-size-sm);
  font-weight: 400;
  line-height: 1.35;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--color-card);
  color: var(--color-text);
}

.category-search-terms-cell:focus {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 45%, transparent);
  outline-offset: 1px;
}

.category-search-terms-cell:disabled {
  opacity: 0.65;
}

.category-discovery {
  margin: var(--space-2) 0 var(--space-5);
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.category-discovery > h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text);
}

.category-discovery > .muted {
  margin: 0 0 var(--space-3);
}

/* Ensure section Select list can scroll inside the anchored panel */
.category-discovery .hs-dd__panel {
  overflow: hidden;
}

.category-discovery .hs-dd__list {
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.form-row label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-row input,
.form-row select,
.form-row textarea,
.modal label input,
.modal label select,
.modal label textarea,
.hs-dialog label input,
.hs-dialog label select,
.hs-dialog label textarea,
.hs-modal label input,
.hs-modal label select,
.hs-modal label textarea,
.field input,
.hs-dialog .text-input,
.hs-modal .text-input,
.modal .text-input {
  font-weight: 400;
  font-size: var(--font-size-sm);
  border: 1px solid var(--border, var(--color-border));
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  min-height: var(--control-height);
  background: var(--card);
  color: var(--text);
}

.form-row input::placeholder,
.modal label input::placeholder,
.hs-dialog label input::placeholder,
.hs-modal label input::placeholder,
.field input::placeholder,
.hs-dialog .text-input::placeholder,
.hs-modal .text-input::placeholder,
.modal .text-input::placeholder {
  color: var(--textSecondary);
  opacity: 1;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: var(--space-2) !important;
  margin-top: var(--space-5);
}

.form-actions {
  /* In modals: parent gap (16px) + padding-top (12px) = ~28px section break */
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

/* Stand-alone page form (outside a modal): restore top margin */
.form-panel > .form-actions {
  margin-top: var(--space-4);
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-right: var(--space-2);
  vertical-align: middle;
}

.client-logo-thumb {
  display: inline-block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  margin-right: var(--space-2);
  vertical-align: middle;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
}

.client-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}

.client-logo-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--color-border, #e2e8f0);
  background: #fff;
}

.client-logo-upload {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.modal-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-title-block p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--color-text-secondary);
}

.theme-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.theme-preset-control {
  min-width: 220px;
}

.theme-preset-control span {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.theme-preset-control select {
  width: 100%;
}

.theme-section-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.theme-color-section {
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 16px;
  background: color-mix(in srgb, var(--color-surface) 96%, var(--color-background));
}

.theme-color-section__head {
  margin-bottom: 12px;
}

.theme-color-section__head h5 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.theme-color-section__head p {
  margin: 0;
}

.theme-colors-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.theme-color-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-color-field > span {
  font-weight: 600;
}

.color-input-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.color-input-row input[type='color'] {
  width: 64px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: transparent;
}

.assignment-summary,
.assignment-job-context {
  display: grid;
  gap: 12px;
}

.assignment-summary {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.assignment-job-context {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.assignment-job-context > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assignment-candidate-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  margin-top: 12px;
}

.assignment-candidate-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  background: var(--color-surface);
}

.assignment-candidate-card.is-ineligible {
  opacity: 0.72;
}

.assignment-candidate-card.is-current {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.assignment-candidate-main,
.assignment-candidate-actions {
  min-width: 0;
}

.assignment-candidate-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

@media (max-width: 640px) {
  .theme-section-heading,
  .assignment-summary,
  .assignment-job-context,
  .assignment-candidate-card {
    grid-template-columns: 1fr;
  }

  .theme-section-heading {
    display: grid;
  }

  .theme-colors-grid {
    grid-template-columns: 1fr;
  }

  .assignment-candidate-actions .btn,
  .assignment-candidate-actions .hs-btn {
    width: 100%;
    justify-content: center;
  }
}

.hs-toggle {
  position: relative;
  width: 2.5rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--color-border);
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s ease;
}

.hs-toggle.is-on {
  background: var(--primary-color);
}

.hs-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hs-toggle-thumb {
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  background: var(--neutral-white);
  box-shadow: var(--shadow-sm, 0 1px 2px rgb(0 0 0 / 0.12));
  transition: transform 0.15s ease;
}

.hs-toggle.is-on .hs-toggle-thumb {
  transform: translateX(1.15rem);
}

.questionnaire {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.questionnaire h3,
.questionnaire h4 {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-md);
  font-weight: 600;
}

.question-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.question-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  background: var(--color-bg-opacity-60);
  font-size: var(--font-size-sm);
}

.add-question {
  background: var(--neutral-white);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-sidebar-opacity-45);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: var(--space-4);
  pointer-events: auto;
}

.modal {
  width: min(calc(100vw - 32px), 32rem);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-shrink: 0;
  z-index: 2;
  background: var(--color-card);
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4); /* 16px between fields */
  padding: 20px 24px 24px;
}

.modal h3 {
  margin: 0;
  font-size: var(--font-size-md);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

.modal-close {
  min-width: 32px;
  min-height: 32px;
  padding: var(--space-1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  border: none;
  flex-shrink: 0;
}

.modal-close .material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: 300;
  font-size: 20px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: var(--primary-color-opacity-05);
}

.inline-select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  min-height: var(--control-height);
  background: var(--neutral-white);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.inline-select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.doc-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

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

.partner-service-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.partner-service-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.partner-service-availability {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
}

.partner-service-availability-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-align: right;
  max-width: 8rem;
  line-height: 1.35;
}

.service-availability-toggle {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: none;
  padding: 3px;
  flex-shrink: 0;
  background: #cbd5e0;
  cursor: pointer;
  transition: background 0.15s ease;
}

.service-availability-toggle.is-on {
  background: var(--color-primary, #2563eb);
}

.service-availability-toggle.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.service-availability-toggle-knob {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.service-availability-toggle.is-on .service-availability-toggle-knob {
  transform: translateX(22px);
}

.partner-service-row:last-child {
  border-bottom: none;
}

.service-review-docs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.service-review-docs li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.muted.compact {
  padding: var(--space-1) 0 0;
  margin: 0;
  font-size: var(--font-size-xs);
}

.detail-list {
  margin: 0;
  display: grid;
  gap: var(--space-3);
}

.detail-list div {
  display: grid;
  gap: var(--space-1);
}

.detail-list dt {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-secondary);
}

.detail-list dd {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.table-problem {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 16rem;
  line-height: var(--line-height-body);
}

.table-assign-cell {
  min-width: 12rem;
  max-width: 16rem;
}

.table-assign-cell .hs-select-wrap,
.table-actions-stack .hs-select-wrap,
.table-actions-row .hs-select-wrap {
  margin: 0;
  min-width: 8rem;
  max-width: 11rem;
  flex: 0 1 auto;
}

.table-actions-stack {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  min-width: 16rem;
}

.table-actions-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

.table-actions-stack .btn,
.table-actions-row .btn,
.table-actions-stack .hs-btn,
.table-actions-row .hs-btn {
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.table-date {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.assign-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg-opacity-60, transparent);
}

.modal--wide {
  width: min(calc(100vw - 32px), 36rem);
  /* Inherit the global viewport-relative max-height from .hs-modal */
}

.detail-list--grid {
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3) var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.detail-list--grid .detail-span-2 {
  grid-column: 1 / -1;
}

.modal-section-title {
  margin: 0;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.detail-list dt {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.table-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.pin-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2rem;
  height: 2rem;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: middle;
}

.pin-cell-value {
  display: inline-flex;
  align-items: center;
  min-width: 3.5rem;
  max-width: 4.75rem;
  height: 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--font-size-sm);
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text-secondary);
}

.pin-cell-value code {
  font: inherit;
  color: var(--color-text);
  letter-spacing: 0.04em;
}

.pin-cell-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  margin-left: var(--space-1);
}

.party-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  line-height: 1.25;
}

.party-cell-primary {
  font-weight: 600;
}

.party-cell-meta {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-phone-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
}

.jobs-geo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
  margin-top: var(--space-3);
}

.jobs-geo-filters label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  min-width: 12rem;
}

.btn.icon-only,
.hs-btn.icon-only,
a.hs-btn.icon-only {
  padding: var(--space-1);
  min-width: 2rem;
  height: 2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-edit-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: nowrap;
}

.status-edit-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 8rem;
  padding: var(--space-1);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-edit-option {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font: inherit;
  color: var(--color-text);
}

.status-edit-option:hover,
.status-edit-option.is-active {
  background: var(--color-surface-muted, #f5f5f5);
  color: var(--color-primary);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.detail-header-left {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
}

.detail-back {
  margin-top: 0.35rem;
}

.detail-save {
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.detail-close {
  flex-shrink: 0;
}

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

.pin-create-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  margin: var(--space-3) 0;
}

.pin-create-fieldset legend {
  padding: 0 var(--space-1);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.pin-create-check {
  margin: 0 0 var(--space-2);
}

.phone-input-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.phone-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-2);
  border: 1px solid var(--color-border);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--color-surface-muted, #f5f5f5);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.phone-input-row input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  flex: 1;
}

.password-generate-row {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
}

.password-generate-row input {
  flex: 1;
  min-width: 0;
}

.password-generate-row .btn,
.password-generate-row .hs-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  margin-left: var(--space-3);
}

.phone-verify-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.phone-verify-cell.is-switch {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.phone-number-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
}

.phone-number-text {
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.btn.icon-only.copy-feedback-ok,
.hs-btn.icon-only.copy-feedback-ok {
  color: var(--color-success, #1b7f3a);
}

.btn.icon-only.copy-feedback-ok:hover:not(:disabled),
.hs-btn.icon-only.copy-feedback-ok:hover:not(:disabled) {
  color: var(--color-success, #1b7f3a);
}

.phone-verified-toggle {
  margin-left: 0;
  font-size: 11px;
}

.table-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
}

.admin-action-row {
  max-width: 22rem;
}

.permissions-fieldset {
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, 8px);
  padding: var(--space-3);
  margin: var(--space-3) 0;
}

.permissions-fieldset legend {
  padding: 0 var(--space-1);
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 600;
}

.permissions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.permission-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm, 0.875rem);
  margin: 0;
}


.permissions-matrix {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.9rem;
}
.permissions-matrix th,
.permissions-matrix td {
  border: 1px solid var(--border, #e2e8f0);
  padding: 8px 10px;
  text-align: left;
  vertical-align: middle;
}
.permissions-matrix thead th {
  background: var(--surface-2, #f8fafc);
  font-weight: 700;
}
.permissions-matrix tbody th {
  font-weight: 600;
}
.permissions-matrix td {
  text-align: center;
  width: 5.5rem;
}
.permissions-matrix input[type='checkbox'] {
  width: 18px;
  height: 18px;
}

.permissions-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  max-height: 14rem;
  overflow: auto;
  margin-top: var(--space-2);
  padding: var(--space-2);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, 8px);
}

.admin-profile-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-3);
}

.admin-profile-meta dt {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-secondary, #718096);
}

.admin-profile-meta dd {
  margin: 0;
  font-weight: 600;
}

.wrap-actions {
  flex-wrap: wrap;
}

.invite-link-field input {
  width: 100%;
  min-width: 0;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: var(--font-size-xs);
}

.invite-qr-panel {
  display: flex;
  justify-content: center;
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius);
}

.invite-qr-panel img {
  display: block;
  width: 180px;
  height: 180px;
  background: var(--neutral-white);
  border-radius: var(--radius);
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.invite-actions-secondary {
  margin-top: var(--space-1);
}

.feedback-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feedback-job-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--space-2);
}

.shared-by-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}

.job-party {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.job-party-name {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

.job-party-address {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: var(--line-height-body);
}

.job-party-address .material-symbols-outlined {
  margin-top: 2px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.job-party-label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}

.job-comments {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.job-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 14rem;
  overflow: auto;
}

.job-comment {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  background: var(--color-bg-opacity-60, var(--neutral-white));
  border-left: 3px solid var(--color-border);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.job-comment--customer {
  border-left-color: var(--primary-color, #2563eb);
}

.job-comment--provider {
  border-left-color: var(--color-success, #16a34a);
}

.job-comment--admin {
  border-left-color: var(--color-warning, #ca8a04);
}

.job-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin-bottom: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.job-comment-role {
  font-weight: 600;
  color: var(--color-text);
}

.job-comment-author {
  color: var(--color-text-secondary);
}

.job-comment-time {
  margin-left: auto;
}

.job-comment-text {
  margin: 0;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  line-height: var(--line-height-body);
  white-space: pre-wrap;
}

.actions .btn,
.actions .hs-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}


@media (max-width: 860px) {
  .hs-vtable__table {
    min-width: 48rem;
  }

  .hs-vtable__table th,
  .hs-vtable__table td {
    padding: var(--space-2) var(--space-3);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row > label,
  .form-row > .hs-select-wrap {
    width: 100%;
  }

  .row-header-actions {
    width: 100%;
  }

  .modal {
    width: min(100%, 28rem);
  }

  .modal-body {
    padding: 16px 16px 20px;
    gap: var(--space-3);
  }

  .modal-header {
    padding: 16px 16px 12px;
  }
}

@media (max-width: 520px) {
  .detail-list--grid {
    grid-template-columns: 1fr;
  }

  .page-header h1 {
    font-size: var(--font-size-md);
  }

  .hs-vtable__footer {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .row-header-actions .btn,
  .row-header-actions .hs-btn {
    flex: 1 1 auto;
  }
}

.modal label,
.hs-dialog label,
.hs-modal label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.doc-list {
  margin: 0;
  padding-left: var(--space-5);
  line-height: var(--line-height-body);
  font-size: var(--font-size-sm);
}

.panel form-panel h3,
.panel > h3 {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-md);
  font-weight: 600;
  color: var(--color-text);
}

.panel.form-panel > p {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-sm);
}

.panel-spaced {
  margin-bottom: var(--space-4);
}

.panel-spaced-top {
  margin-top: var(--space-4);
}

.pin-display {
  font-size: var(--font-size-md);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.modal.modal-wide {
  max-width: min(52rem, calc(100vw - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
}

.theme-colors-fieldset {
  margin: var(--space-3) 0;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.theme-colors-fieldset legend {
  padding: 0 var(--space-1);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text);
}

.theme-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: var(--space-3);
}

.theme-color-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.color-input-row input[type='color'] {
  width: 2.25rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
}

.color-input-row input[type='text'] {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}

.contact-privacy-panel,
.policy-card {
  max-width: 40rem;
  padding: var(--space-4);
  gap: var(--space-4);
}

.contact-privacy-panel-head h2,
.policy-card-head h2 {
  margin: 0 0 var(--space-1);
  font-size: var(--font-size-md);
}

.contact-privacy-loading,
.contact-privacy-actions {
  margin-top: var(--space-2);
}

.contact-privacy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.policy-radios {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  border: 0;
}

.policy-radio {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  cursor: pointer;
}

.policy-radio input {
  margin-top: 0.35rem;
}

.role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.2rem;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg);
  text-decoration: none;
  line-height: 1.4;
}

.role-badge--partner {
  color: var(--color-text);
}

.name-with-roles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.provider-services-cell {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.provider-services-cell li {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.account-access-block {
  /* Handled by .modal-section now — keep for backward compat on non-modal uses */
  margin: 0;
  padding: var(--space-5) 0 0;
  border: 0;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.account-access-block legend {
  font-size: var(--font-size-sm);
  font-weight: 700;
  padding: 0;
  float: left;
  width: 100%;
  margin-bottom: var(--space-3);
}

.also-registered {
  margin-top: var(--space-2);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.section-header-row h3 {
  margin: 0;
}

.add-service-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.add-service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.add-service-row span {
  display: flex;
  flex-direction: column;
}

.geo-service-breakdown {
  display: block;
  margin-top: 0.15rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}



.feedback-detail__message {
  margin: 0 0 12px;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}

.feedback-detail .admin-textarea,
.admin-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 72px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
  resize: vertical;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

button.linkish {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.creatable-lookup {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.creatable-lookup__input {
  width: 100%;
}
.emp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-5, 24px);
}

.emp-stat {
  background: var(--crystal-bg, var(--card));
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: var(--crystal-radius-sm, 16px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(var(--crystal-blur, 14px)) saturate(145%);
  box-shadow: var(--crystal-shadow);
}

.emp-stat__label {
  font-size: var(--font-size-sm, 0.8125rem);
  color: var(--textSecondary);
}

.emp-stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.emp-filters {
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-4, 16px);
}

.emp-search {
  flex: 1 1 220px;
  min-width: 0;
}

.emp-search .text-input {
  width: 100%;
}

.emp-cell-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.emp-cell-person__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.emp-name-link {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.emp-name-link:hover {
  color: var(--primary-color, #3182ce);
  text-decoration: underline;
}

.emp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid color-mix(in srgb, var(--color-success, #2f9e44) 35%, white);
}

.emp-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color-opacity-10, #ebf5ff);
  color: var(--primary-color-2, #2c5282);
  font-weight: 700;
  font-size: 0.95rem;
}

.block-muted {
  display: block;
  font-size: 0.75rem;
}

.emp-id-hint {
  margin: 0;
  font-size: 0.8125rem;
}

.emp-mobile-list {
  display: none;
}

.emp-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emp-card {
  width: 100%;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: var(--crystal-radius-sm, 16px);
  background: var(--crystal-bg, var(--card));
  backdrop-filter: blur(var(--crystal-blur, 14px)) saturate(145%);
  box-shadow: var(--crystal-shadow);
  color: var(--text);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emp-card__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.emp-card__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.emp-card__bottom {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-muted, #868e96);
  font-size: 0.875rem;
}

.emp-card__cta {
  font-weight: 600;
  color: var(--primary-color, #3182ce);
  font-size: 0.875rem;
}

.emp-empty {
  padding: 32px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-error {
  display: block;
  color: var(--color-error, #e03131);
  font-size: 0.8125rem;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .emp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .emp-desktop-table {
    display: none;
  }

  .emp-mobile-list {
    display: block;
  }
}

.emp-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-4, 16px);
}

.emp-page-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
}

.emp-page-tab.is-selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.emp-lookup-panel {
  padding: 16px;
}

.emp-lookup-panel__title {
  margin: 0 0 4px;
  font-size: 1.125rem;
}

.emp-lookup-panel__lead {
  margin: 0 0 16px;
  font-size: 0.875rem;
}

.emp-lookup-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.emp-lookup-add .text-input {
  flex: 1 1 220px;
  min-width: 0;
}

.emp-lookup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emp-lookup-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e9ecef);
  border-radius: 10px;
  background: var(--surface, #f8f9fa);
}

.emp-lookup-list__label {
  font-weight: 600;
  min-width: 0;
  word-break: break-word;
}
