/* ============================================================================
   ui-refresh.css — the Tasks page look, carried to more of the CRM (2026-10-27)
   White cards on soft grey, black-and-white avatars, regular-weight labels,
   our own dropdowns and calendar, no blur, no gradients.
     1. Form dialogs (showCrmForm: Add Payment, Delivery Schedule, Driver Info,
        Create Agent, Update Email / Phone, delete code, Import VIN)
     2. Our own dropdown (js/ui-select.js)
     3. The shared calendar (CRM_CAL, every data-crm-date box)
     4. Agent Management: seat ring + agent cards
     5. Agent profile window + View Stats ring charts
   Loaded after admin.css and tasks.css. crm-theme.css forces many styles with
   !important; the rules here beat them only inside these components.
   ============================================================================ */

:root {
  --ux-ink: #191c1e;
  --ux-ink-dim: #5c5d67;
  --ux-ink-faint: #8b8d96;
  --ux-line: #e1e3e5;
  --ux-line-soft: #edeef0;
  --ux-hover: #f7f8fa;
  --ux-page: #f2f4f6;
  --ux-blue: #0062ff;
  --ux-blue-dark: #0052d6;
  --ux-blue-ring: rgba(0, 98, 255, .14);
  --ux-red: #d64b40;
  --ux-red-wash: #fdecea;
  --ux-green: #1a9d5f;
  --ux-green-wash: #e6f5ed;
  --ux-black: #111316;
  --ux-shadow: 0 4px 20px -2px rgba(17, 18, 22, .05);
  --ux-shadow-pop: 0 24px 60px -16px rgba(17, 18, 22, .28);
}

/* ── 1. Form dialogs ──────────────────────────────────────────────────────── */
.crm-confirm-overlay:has(.crm-form-modal) { backdrop-filter: none; background: rgba(17, 18, 22, .42); padding: 16px; }
.crm-confirm.crm-form-modal {
  text-align: left; width: 100%; max-width: 640px; padding: 0; border-radius: 14px;
  box-shadow: var(--ux-shadow-pop); max-height: calc(100vh - 32px); display: flex; flex-direction: column; outline: none;
}
.crm-form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 24px 6px; }
.crm-form-head .crm-confirm-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--ux-ink); letter-spacing: -.2px; text-transform: none; }
.crm-form-head .crm-confirm-message { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--ux-ink-dim); }
.crm-form-x { flex: none; width: 34px; height: 34px; min-height: 0 !important; margin: -4px -8px 0 0; border: 0; border-radius: 10px; background: transparent; color: var(--ux-ink-dim); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.crm-form-x:hover { background: #eceef1; color: var(--ux-ink); }
.crm-form-body { padding: 14px 24px 4px; overflow: auto; }
.crm-form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 14px; }
.crm-form-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.crm-form-row.is-wide { grid-column: 1 / -1; }
.crm-form-label { font-size: 12.5px; font-weight: 500; color: var(--ux-ink-dim); letter-spacing: 0; text-transform: none; }
.crm-form-req { color: var(--ux-red); }
.crm-form-modal .crm-form-ctrl {
  width: 100%; box-sizing: border-box; height: 42px; margin: 0; padding: 0 12px;
  border: 1px solid var(--ux-line); border-radius: 10px; background: #fff;
  font-size: 14px; font-weight: 400; color: var(--ux-ink); outline: none; box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.crm-form-modal textarea.crm-form-ctrl { height: auto; min-height: 80px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.crm-form-modal .crm-form-ctrl::placeholder { color: #9a9ca4; font-weight: 400; opacity: 1; }
.crm-form-modal .crm-form-ctrl:focus { border-color: var(--ux-blue); box-shadow: 0 0 0 3px var(--ux-blue-ring); }
/* Date boxes open the shared calendar: show a calendar icon, not a text caret. */
.crm-form-modal .crm-form-date {
  cursor: pointer; padding-left: 38px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8d96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='3'/%3E%3Cpath d='M3 9.5h18M8 3v3M16 3v3'/%3E%3C/svg%3E") no-repeat 12px center / 16px;
}
.crm-form-pass { position: relative; }
.crm-form-pass .crm-form-ctrl { padding-right: 42px; }
.crm-form-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); min-height: 0 !important; background: none; border: 0; cursor: pointer; color: var(--ux-ink-faint); padding: 6px; display: flex; align-items: center; border-radius: 8px; }
.crm-form-eye:hover { color: var(--ux-ink); background: var(--ux-hover); }
.crm-form-err { color: #b42318; font-size: 12px; font-weight: 400; }
.crm-form-row:has(.crm-form-err[style*="block"]) .crm-form-ctrl,
.crm-form-row:has(.crm-form-err[style*="block"]) .ui-select { border-color: var(--ux-red); box-shadow: none; }
.crm-confirm-actions.crm-form-actions { justify-content: flex-end; gap: 8px; padding: 18px 24px 20px; margin: 0; }
.crm-form-actions .crm-confirm-btn { flex: 0 0 auto; height: 40px; min-height: 0 !important; padding: 0 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; }
.crm-form-actions .crm-confirm-cancel { background: #fff; border: 0; box-shadow: inset 0 0 0 1px var(--ux-line); color: var(--ux-ink); }
.crm-form-actions .crm-confirm-cancel:hover { background: var(--ux-hover); }
.crm-form-actions .crm-confirm-ok { background: var(--ux-blue); color: #fff; }
.crm-form-actions .crm-confirm-ok:hover { background: var(--ux-blue-dark); }
.crm-form-actions .crm-confirm-ok.is-danger { background: var(--ux-red); }
.crm-form-actions .crm-confirm-ok.is-danger:hover { background: #b93a30; }
.crm-form-actions .crm-confirm-btn:focus { outline: none; }
.crm-form-actions .crm-confirm-btn:focus-visible { outline: 2px solid var(--ux-blue); outline-offset: 2px; }
@media (max-width: 600px) {
  .crm-confirm-overlay:has(.crm-form-modal) { align-items: flex-end; padding: 0; }
  .crm-confirm.crm-form-modal { border-radius: 14px 14px 0 0; max-height: 92vh; }
  .crm-form-fields { grid-template-columns: 1fr; }
  .crm-form-head, .crm-form-body, .crm-confirm-actions.crm-form-actions { padding-left: 18px; padding-right: 18px; }
  .crm-form-modal .crm-form-ctrl { font-size: 16px; }   /* no zoom-on-focus on iPhone */
}

/* ── 2. Our own dropdown ─────────────────────────────────────────────────── */
select.ui-select-native { display: none !important; }
button.ui-select {
  width: 100%; height: 42px; min-height: 0 !important; margin: 0; padding: 0 12px;
  display: flex; align-items: center; gap: 9px; text-align: left; cursor: pointer;
  border: 1px solid var(--ux-line) !important; border-radius: 10px !important; background: #fff !important;
  font-size: 14px; font-weight: 400; color: var(--ux-ink) !important; box-shadow: none !important; transform: none !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ui-select-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.ui-select.is-empty .ui-select-text { color: #9a9ca4; }
.ui-select-chev { display: inline-flex; color: var(--ux-ink-faint); transition: transform .2s ease; }
.ui-select-chev svg { width: 15px; height: 15px; }
button.ui-select:hover { border-color: #c9ccd3 !important; }
button.ui-select.is-open, button.ui-select:focus-visible { outline: none; border-color: var(--ux-blue) !important; box-shadow: 0 0 0 3px var(--ux-blue-ring) !important; }
button.ui-select.is-open .ui-select-chev { transform: rotate(180deg); }
button.ui-select:disabled { opacity: .6; cursor: not-allowed; }
.ui-select-pop {
  position: fixed; z-index: 16500; background: #fff; border-radius: 12px; padding: 6px;
  box-shadow: 0 18px 40px -14px rgba(17, 18, 22, .28), 0 0 0 1px rgba(17, 18, 22, .07);
  max-width: calc(100vw - 16px); max-height: 300px; overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 1px; font-family: inherit;
  animation: uxPop .16s ease-out;
}
@keyframes uxPop { from { opacity: 0; transform: translateY(-4px); } }
.ui-select-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  min-height: 36px !important; padding: 0 10px; border: 0; border-radius: 8px; background: transparent;
  font: inherit; font-size: 13.5px; font-weight: 400; color: var(--ux-ink); text-align: left; white-space: nowrap; cursor: pointer;
}
.ui-select-opt svg { width: 15px; height: 15px; color: var(--ux-blue); flex: none; }
.ui-select-opt:hover, .ui-select-opt.is-hl { background: var(--ux-hover); }
.ui-select-opt.is-sel { color: var(--ux-blue); font-weight: 500; }
.ui-select-empty { padding: 10px; font-size: 13px; color: var(--ux-ink-faint); }

/* ── 3. The shared calendar (CRM_CAL) ────────────────────────────────────── */
.crm-cal-pop { width: 292px; padding: 12px; border: 0; border-radius: 12px; box-shadow: 0 18px 40px -14px rgba(17, 18, 22, .28), 0 0 0 1px rgba(17, 18, 22, .07); }
.crm-cal-pop button { min-height: 0 !important; font-family: inherit; box-shadow: none !important; transform: none !important; }
.crm-cal-pop .crm-cal-header { margin-bottom: 6px; gap: 2px; }
.crm-cal-pop .crm-cal-title {
  order: -1; flex: 1 1 auto; text-align: left; padding: 6px 8px !important; border: 0 !important; background: transparent !important;
  font-size: 14px; font-weight: 600; color: var(--ux-ink) !important; border-radius: 8px !important;
}
.crm-cal-pop .crm-cal-title:hover { background: var(--ux-hover) !important; }
.crm-cal-pop .crm-cal-nav { width: 30px; height: 30px; border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--ux-ink-dim) !important; font-size: 18px; line-height: 1; }
.crm-cal-pop .crm-cal-nav:hover { background: var(--ux-hover) !important; color: var(--ux-ink) !important; }
.crm-cal-pop .crm-cal-weekday { font-size: 11px; font-weight: 500; color: var(--ux-ink-faint); letter-spacing: 0; }
.crm-cal-pop .crm-cal-grid { gap: 2px; }
.crm-cal-pop .crm-cal-day { aspect-ratio: auto; height: 36px; border: 0 !important; border-radius: 8px !important; background: transparent !important; font-size: 13px; font-weight: 400; color: var(--ux-ink) !important; font-variant-numeric: tabular-nums; }
.crm-cal-pop .crm-cal-day:hover { background: var(--ux-hover) !important; }
.crm-cal-pop .crm-cal-day.is-other-month { color: #b6b9c0 !important; }
.crm-cal-pop .crm-cal-day.is-today { color: var(--ux-blue) !important; font-weight: 600; box-shadow: inset 0 0 0 1px #cfe0ff !important; }
.crm-cal-pop .crm-cal-day.is-selected { background: var(--ux-black) !important; color: #fff !important; font-weight: 500; box-shadow: none !important; }
.crm-cal-pop .crm-cal-actions { justify-content: flex-start; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--ux-line-soft); }
.crm-cal-pop .crm-cal-action { flex: 0 0 auto; height: 30px; padding: 0 12px !important; border: 0 !important; border-radius: 999px !important; background: #fff !important; box-shadow: inset 0 0 0 1px var(--ux-line) !important; font-size: 12.5px; font-weight: 500; color: var(--ux-ink) !important; }
.crm-cal-pop .crm-cal-action:hover { background: var(--ux-hover) !important; }
.crm-cal-pop .crm-cal-action.is-primary { order: -1; }
.crm-cal-pop .crm-cal-action[data-cal-clear] { margin-left: auto; box-shadow: none !important; color: var(--ux-ink-dim) !important; }
.crm-cal-pop .crm-cal-pick { border: 0 !important; border-radius: 8px !important; background: transparent !important; color: var(--ux-ink) !important; font-weight: 400; }
.crm-cal-pop .crm-cal-pick:hover { background: var(--ux-hover) !important; }
.crm-cal-pop .crm-cal-pick.is-current { background: var(--ux-black) !important; color: #fff !important; font-weight: 500; }

/* ── 4. Agent Management ─────────────────────────────────────────────────── */
#tab-agents .agents-toolbar { padding: 20px 22px !important; border-radius: 16px !important; border: 0 !important; background: #fff !important; box-shadow: var(--ux-shadow) !important; }
#tab-agents .agents-toolbar-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
#tab-agents .agents-toolbar-copy { flex: 1 1 320px; min-width: 0; }
#tab-agents .agents-toolbar-copy strong { font-size: 18px; font-weight: 600; color: var(--ux-ink); letter-spacing: -.2px; }
#tab-agents .agents-toolbar-copy span { font-size: 13px; color: var(--ux-ink-dim); }
#tab-agents .btn-create-agent { border-radius: 999px !important; background: var(--ux-blue) !important; box-shadow: none !important; height: 40px; min-height: 0; padding: 0 18px !important; font-weight: 500 !important; }
#tab-agents .btn-create-agent:hover:not(:disabled) { background: var(--ux-blue-dark) !important; transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(0, 98, 255, .6) !important; }

/* Seat ring */
#tab-agents .agent-limit-note { flex: 0 0 auto; flex-basis: auto; gap: 12px; padding: 6px 16px 6px 8px; border: 0; border-radius: 999px; background: var(--ux-hover); box-shadow: inset 0 0 0 1px var(--ux-line-soft); color: var(--ux-ink); }
#tab-agents .agent-limit-note::before { display: none; }
#tab-agents .agl-ring { width: 40px; height: 40px; flex: none; }
#tab-agents .agl-track { fill: none; stroke: #e6e8eb; stroke-width: 5; }
#tab-agents .agl-fill { fill: none; stroke: var(--ux-black); stroke-width: 5; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
#tab-agents .agent-limit-note.is-full .agl-fill { stroke: var(--ux-red); }
#tab-agents .agl-text { display: flex; flex-direction: column; line-height: 1.3; }
#tab-agents .agl-text strong { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
#tab-agents .agl-text span { font-size: 12px; color: var(--ux-ink-dim); }
#tab-agents .agent-limit-note.is-full { background: #fff7f6; box-shadow: inset 0 0 0 1px #f5d2ce; }

/* Agent cards */
#tab-agents .agents-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
#tab-agents .agents-empty { border-radius: 16px; border: 1px dashed var(--ux-line); color: var(--ux-ink-dim); }
#tab-agents .agent-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; min-height: 0;
  background: #fff; border: 0; border-radius: 16px; box-shadow: var(--ux-shadow); font-family: inherit; color: var(--ux-ink);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s cubic-bezier(.22, 1, .36, 1);
}
#tab-agents .agent-card:hover { border: 0; transform: translateY(-2px); box-shadow: 0 14px 28px -12px rgba(17, 18, 22, .16); }
#tab-agents .agent-card:focus-visible { outline: 2px solid var(--ux-blue); outline-offset: 2px; }
#tab-agents .agc-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
#tab-agents .agent-card .agc-av { width: 48px; height: 48px; border: 0; background: var(--ux-black); color: #fff; font-size: 15px; font-weight: 600; }
#tab-agents .agent-card .agc-av:has(img) { background: #f1f2f4; box-shadow: 0 0 0 1px var(--ux-line); }
#tab-agents .agent-card.is-suspended .agc-av { opacity: .45; }
#tab-agents .agent-card-meta { flex: 1; min-width: 0; }
#tab-agents .agent-card-meta strong { font-size: 15px; font-weight: 600; color: var(--ux-ink); }
#tab-agents .agent-card-meta span { font-size: 12.5px; color: var(--ux-ink-dim); }
.agc-pill, .apf-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--ux-green-wash); color: #137a49; }
.agc-pill::before, .apf-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.agc-pill.is-off, .apf-pill.is-off { background: var(--ux-red-wash); color: #9b2c22; }
#tab-agents .agc-foot { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--ux-line-soft); font-size: 12.5px; color: var(--ux-ink-dim); }
#tab-agents .agc-foot > span { display: inline-flex; align-items: center; gap: 6px; }
#tab-agents .agc-foot svg { width: 14px; height: 14px; color: var(--ux-ink-faint); flex: none; }
#tab-agents .agc-open { margin-left: auto; color: var(--ux-ink); font-weight: 500; opacity: 0; transition: opacity .15s ease; }
#tab-agents .agc-open svg { color: var(--ux-ink); }
#tab-agents .agent-card:hover .agc-open, #tab-agents .agent-card:focus-visible .agc-open { opacity: 1; }

/* ── 5. Agent profile window ─────────────────────────────────────────────── */
#agentProfileModal { background: rgba(17, 18, 22, .42); backdrop-filter: none; padding: 16px; box-sizing: border-box; }
#agentProfileModal .agent-profile-modal { max-width: 720px; border-radius: 14px; box-shadow: var(--ux-shadow-pop); max-height: calc(100vh - 32px); background: #fff; }
#agentProfileModal .agent-profile-modal-head { background: #fff; color: var(--ux-ink); padding: 22px 24px 14px; gap: 16px; }
#agentProfileModal .agent-profile-modal-head .agent-profile-avatar { width: 60px; height: 60px; border: 0; background: var(--ux-black); color: #fff; font-size: 19px; font-weight: 600; }
#agentProfileModal .agent-profile-modal-head .agent-profile-avatar:has(img) { background: #f1f2f4; box-shadow: 0 0 0 1px var(--ux-line); }
#agentProfileModal .agent-profile-modal-id { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
#agentProfileModal .agent-profile-modal-id h2 { color: var(--ux-ink); font-size: 19px; font-weight: 600; letter-spacing: -.2px; max-width: 100%; }
#agentProfileModal .agent-profile-modal-id > span:not(.apf-pill) { color: var(--ux-ink-dim); font-size: 13px; }
#agentProfileModal .agent-profile-modal-id .apf-pill { margin-top: 6px; color: #137a49; font-size: 11.5px; }
#agentProfileModal .agent-profile-modal-id .apf-pill.is-off { color: #9b2c22; }
#agentProfileModal .agent-profile-modal-head .aq-close { top: 16px; right: 16px; width: 34px; height: 34px; min-height: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ux-ink-dim); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
#agentProfileModal .agent-profile-modal-head .aq-close:hover { background: #eceef1; color: var(--ux-ink); }
#agentProfileModal .agent-profile-modal-body { padding: 4px 24px 24px; }

/* Tabs: the same segmented control as the Tasks page (List / Calendar). */
#agentProfileModal .apf-tabs { display: inline-flex; gap: 2px; padding: 4px; margin: 0 0 18px; border: 0; border-radius: 999px; background: var(--ux-page); }
#agentProfileModal .apf-tab { display: inline-flex; align-items: center; gap: 6px; height: 34px; min-height: 0; padding: 0 16px; margin: 0; border: 0; border-radius: 999px; background: transparent; font-size: 13px; font-weight: 500; color: var(--ux-ink-dim); cursor: pointer; transition: background .2s ease, color .2s ease; }
#agentProfileModal .apf-tab svg { width: 15px; height: 15px; }
#agentProfileModal .apf-tab:hover { color: var(--ux-ink); }
#agentProfileModal .apf-tab.is-active { background: var(--ux-ink); color: #fff; }

/* Settings pane */
#agentProfileModal .agent-profile-detail-grid { gap: 10px; margin-bottom: 14px; }
#agentProfileModal .agent-profile-detail { padding: 12px 14px; border-radius: 12px; background: var(--ux-hover); box-shadow: inset 0 0 0 1px var(--ux-line-soft); min-width: 0; }
#agentProfileModal .agent-profile-detail label { font-size: 11.5px; font-weight: 500; color: var(--ux-ink-faint); letter-spacing: 0; text-transform: none; margin-bottom: 3px; }
#agentProfileModal .agent-profile-detail span { font-size: 14px; font-weight: 500; color: var(--ux-ink); }
#agentProfileModal .agent-email-card { margin: 0 0 4px; padding: 14px 16px; border: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--ux-line); }
#agentProfileModal .agent-email-head-text h4 { font-size: 14px; font-weight: 600; color: var(--ux-ink); }
#agentProfileModal .agent-email-status { font-size: 12.5px; }

/* Buttons: white pills, grouped into Profile and Access. */
#agentProfileModal .agent-profile-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--ux-line-soft); }
#agentProfileModal .apf-actgroup { display: flex; flex-direction: column; gap: 8px; }
#agentProfileModal .apf-actlabel { font-size: 11.5px; font-weight: 500; color: var(--ux-ink-faint); }
#agentProfileModal .apf-actrow { display: flex; flex-wrap: wrap; gap: 8px; }
#agentProfileModal .btn-action,
#agentProfileModal .btn-danger,
#agentProfileModal .btn-primary,
#agentProfileModal label.upload-button {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; min-height: 0 !important; margin: 0; padding: 0 14px !important;
  border: 0 !important; border-radius: 999px !important; background: #fff !important; box-shadow: inset 0 0 0 1px var(--ux-line) !important;
  font-size: 13px !important; font-weight: 500 !important; color: var(--ux-ink) !important; cursor: pointer; transform: none !important; white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, color .15s ease !important;
}
#agentProfileModal .btn-action svg, #agentProfileModal .btn-danger svg, #agentProfileModal .upload-button svg { width: 15px; height: 15px; flex: none; }
#agentProfileModal .btn-action:hover, #agentProfileModal .upload-button:hover { background: var(--ux-hover) !important; box-shadow: inset 0 0 0 1px #c9ccd3 !important; }
#agentProfileModal .btn-primary { background: var(--ux-blue) !important; color: #fff !important; box-shadow: none !important; }
#agentProfileModal .btn-primary:hover { background: var(--ux-blue-dark) !important; }
#agentProfileModal .btn-danger { color: #b42318 !important; box-shadow: inset 0 0 0 1px #f5d2ce !important; }
#agentProfileModal .btn-danger:hover { background: var(--ux-red-wash) !important; }
#agentProfileModal .apf-suspend { color: #9a5b00 !important; }
#agentProfileModal button.ui-select { height: 40px; }

/* View Stats */
.ast-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.ast-kpi { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--ux-line-soft), var(--ux-shadow); min-width: 0; }
.ast-kpi-label { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 500; color: var(--ux-ink-faint); white-space: nowrap; }
.ast-kpi-label i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.ast-kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.8px; line-height: 1.1; color: var(--ux-ink); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.ast-kpi-sub { font-size: 12px; color: var(--ux-ink-dim); }
.ast-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ast-card { padding: 16px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--ux-line-soft), var(--ux-shadow); min-width: 0; }
.ast-card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--ux-ink); }
.ast-body { display: flex; align-items: center; gap: 16px; }
.ast-ringwrap { position: relative; width: 116px; height: 116px; flex: none; }
.ast-ring { width: 100%; height: 100%; display: block; }
.ast-track { fill: none; stroke: #eef0f2; stroke-width: 12; }
.ast-seg { fill: none; stroke-width: 12; transition: opacity .15s ease; }
.ast-ring:hover .ast-seg { opacity: .55; }
.ast-ring .ast-seg:hover { opacity: 1; }
.ast-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.ast-center strong { font-size: 22px; font-weight: 700; letter-spacing: -.6px; line-height: 1; color: var(--ux-ink); font-variant-numeric: tabular-nums; }
.ast-center span { font-size: 11px; color: var(--ux-ink-faint); margin-top: 3px; }
.ast-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ast-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 38px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ux-ink); }
.ast-legend i { width: 10px; height: 10px; border-radius: 3px; }
.ast-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ast-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.ast-legend em { font-style: normal; text-align: right; color: var(--ux-ink-faint); font-variant-numeric: tabular-nums; }
.ast-empty { display: flex; align-items: center; gap: 16px; }
.ast-empty .ast-ring { width: 72px; height: 72px; flex: none; }
.ast-empty p { margin: 0; font-size: 13px; color: var(--ux-ink-faint); }

@media (max-width: 720px) {
  #tab-agents .agent-limit-note { order: 3; }
  #agentProfileModal { padding: 0; align-items: flex-end; }
  #agentProfileModal .agent-profile-modal { border-radius: 14px 14px 0 0; max-height: 92vh; }
  #agentProfileModal .agent-profile-modal-head, #agentProfileModal .agent-profile-modal-body { padding-left: 18px; padding-right: 18px; }
  /* crm-theme makes .btn-action 100% wide on phones; beside the text it ran off the screen. Stack it. */
  #agentProfileModal .agent-email-head { flex-direction: column; align-items: stretch; }
  .ast-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ast-charts { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  #agentProfileModal .agent-profile-detail-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ui-select-pop, .crm-cal-pop { animation: none; }
  #tab-agents .agent-card, #tab-agents .agl-fill { transition: none; }
}

/* ── Quotes/Orders list: click to copy (order ID, email, phone) ─────────
   Same weight and colour as before; only the pointer and a faint underline on
   hover say it's clickable. admin.js shows the "Copied" bubble. */
#quotesBody [data-copy],
#ordersBody [data-copy] { cursor: pointer; }
#quotesBody .row-copy:hover,
#ordersBody .row-copy:hover {
  text-decoration: underline;
  text-decoration-color: #c3cad6;
  text-underline-offset: 3px;
}
#quotesBody .quote-row-orderid[data-copy]:hover,
#ordersBody .order-row-orderid[data-copy]:hover { background: #1a202c; }
.row-copy-tip {
  position: fixed;
  z-index: 10050;
  padding: 4px 9px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  pointer-events: none;
  white-space: nowrap;
  animation: rowCopyTip 1.1s ease forwards;
}
@keyframes rowCopyTip {
  0% { opacity: 0; transform: translateY(3px); }
  12%, 75% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .row-copy-tip { animation: none; } }

/* Quotes filter: created + pickup dates sit as two from/to pairs (2 × 2),
   instead of the auto-fit grid's 3 + 1 wrap. */
.df-grid.df-grid-2 { grid-template-columns: 1fr 1fr; }

/* Orders list: "View BOL" is now a link to Central Dispatch's saved eBOL
   (shown only when one exists); keep it looking like the old button. */
#tab-orders a.btn-order-bol { display: inline-block; text-decoration: none; text-align: center; box-sizing: border-box; }

/* Quotes toolbar: "Export to CSV" sits first on the right (it takes the
   auto margin), styled like "Import quotes"; the buttons after it follow. */
#tab-quotes .btn-quote-export {
  background: #fff; color: #1a202c; border: 1px solid #cbd5e0;
  padding: 7px 14px; border-radius: 5px; cursor: pointer;
  font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  margin-left: auto;
}
#tab-quotes .btn-quote-export:hover { background: #f7f8fa; }
#tab-quotes .btn-quote-export:disabled { opacity: .6; cursor: default; }
#tab-quotes .btn-quote-export ~ .btn-quote-import,
#tab-quotes .btn-quote-export ~ .btn-add-quote { margin-left: 0; }
/* Agents don't get Export (or Import), so + Add Quote keeps the right edge. */
body.agent-mode #tab-quotes .btn-quote-export ~ .btn-add-quote { margin-left: auto; }

/* showCrmForm: 'choice' fields (radio options, e.g. the Export window) and
   the muted hint line under a field. */
.crm-form-choices { display: flex; flex-direction: column; gap: 8px; }
.crm-form-choice {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid #e3e6ec; border-radius: 10px; background: #fff;
  font-size: 13.5px; font-weight: 400; color: #111827; cursor: pointer;
}
.crm-form-choice:hover { border-color: #c9ced8; }
.crm-form-choice:has(input:checked) { border-color: #111827; }
.crm-form-choice input { width: 16px; height: 16px; margin: 0; accent-color: #111827; flex: none; }
.crm-form-hint { font-size: 12px; line-height: 1.45; color: #6b7280; }
