:root {
  color: #1A1A1A;
  background: #F5F5F5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --brand: #FF6B35;
  --brand-hover: #E55A28;
  --brand-soft: #FFF9F5;
  --accent-blue: #3B82F6;
  --ink: #1A1A1A;
  --canvas: #F5F5F5;
  --surface: #FFFFFF;
  --border: #E5E5E5;
  --muted: #666666;
  --success: #10B981;
  --success-soft: #D1FAE5;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --danger: #EF4444;
  --danger-soft: #FEE2E2;
  --info: #3B82F6;
  --info-soft: #DBEAFE;
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, .04);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 960px; min-height: 100vh; background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(255, 107, 53, .3); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { padding: 32px 20px; color: #F5F5F5; background: linear-gradient(180deg, #1E293B, #0F172A); }
.brand { display: flex; align-items: center; gap: 16px; padding: 0 12px 32px; color: #FFFFFF; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border: 0; border-radius: 12px; background: linear-gradient(135deg, #FF6B35, #F97316); box-shadow: 0 4px 16px rgba(255, 107, 53, .4); }
.nav-section { margin: 12px 0 0; }
.nav-section summary { list-style: none; cursor: pointer; }
.nav-section summary::-webkit-details-marker { display: none; }
.nav-group { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 12px 12px; color: #94A3B8; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.nav-group span { display: grid; min-width: 20px; height: 20px; place-items: center; border-radius: 10px; color: #E2E8F0; background: rgba(255, 255, 255, .1); font-size: 11px; letter-spacing: 0; }
.nav-items { padding: 0 0 8px; }
.nav-button { width: 100%; margin: 3px 0; padding: 12px 16px; border: 0; border-radius: 10px; color: #CBD5E1; background: transparent; text-align: left; font-weight: 500; transition: all .2s ease; }
.nav-button:hover { color: #FFFFFF; background: rgba(255, 255, 255, .1); }
.nav-button.active { color: #FFFFFF; background: rgba(255, 107, 53, .15); box-shadow: inset 3px 0 0 #FF6B35; font-weight: 600; }

.main { min-width: 0; }
.topbar { height: 80px; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--surface); }
.top-title { font-size: 24px; font-weight: 700; }
.dev-badge { padding: 8px 16px; border-radius: 999px; color: #FF6B35; background: var(--brand-soft); font-size: 13px; font-weight: 600; }
.content { padding: 40px; }
.page-heading { margin: 0; font-size: 32px; font-weight: 700; }
.page-subtitle { margin: 12px 0 32px; color: var(--muted); font-size: 16px; line-height: 1.6; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 32px; }
.metric, .panel { border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-soft); }
.metric { padding: 28px; }
.metric-label { color: var(--muted); font-size: 14px; font-weight: 500; }
.metric-value { margin-top: 12px; color: var(--ink); font-size: 36px; font-weight: 700; letter-spacing: -.02em; }
.metric-note { margin-top: 8px; color: var(--success); font-size: 13px; font-weight: 500; }
.panel { overflow: hidden; }
.panel-header { padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 18px; font-weight: 700; }
.secondary { padding: 10px 20px; border: 1px solid var(--border); border-radius: 8px; color: #666666; background: var(--surface); font-weight: 500; transition: all .2s ease; }
.secondary:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 20px 28px; border-bottom: 1px solid #F0F0F0; font-size: 14px; text-align: left; }
td:first-child { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.table-media { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px; object-fit: cover; background: #F0F0F0; }
.table-media-list { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.table-media-fallback { display: inline-grid; place-items: center; color: #999999; font-size: 12px; }
th { color: #666666; background: #FAFAFA; font-weight: 600; }
tbody tr { transition: background .2s ease; }
tbody tr:hover { background: #FAFAFA; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 999px; color: var(--warning); background: var(--warning-soft); font-size: 13px; font-weight: 600; }
.status.ok { color: var(--success); background: var(--success-soft); }
.status.muted { color: #999999; background: #F0F0F0; }
.status.danger { color: var(--danger); background: var(--danger-soft); }
.status.info { color: var(--info); background: var(--info-soft); }
.empty { padding: 80px 32px; color: var(--muted); text-align: center; font-size: 15px; }
.boundary { margin-top: 24px; padding: 20px 24px; border-radius: 12px; color: #92400E; background: #FEF3C7; font-size: 14px; line-height: 1.6; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 40px; background: #F5F5F5; }
.login-card { width: 460px; padding: 48px; border: 0; border-radius: 16px; background: #FFFFFF; box-shadow: 0 8px 32px rgba(0, 0, 0, .08); }
.login-title { margin: 0 0 12px; font-size: 32px; font-weight: 700; }
.login-note { margin-bottom: 32px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 600; }
.field input { width: 100%; height: 48px; padding: 0 16px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; transition: border-color .2s ease; }
.field input:focus { border-color: var(--brand); }
.primary { width: 100%; min-height: 52px; border: 0; border-radius: 10px; color: #FFFFFF; background: var(--brand); box-shadow: 0 4px 16px rgba(255, 107, 53, .25); font-weight: 600; font-size: 16px; transition: all .2s ease; }
.primary:hover { background: var(--brand-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255, 107, 53, .3); }
.primary:active:not(:disabled) { transform: translateY(0); }
.login-boundary { margin-top: 24px; color: #92400E; font-size: 13px; line-height: 1.6; }
.login-error { margin: -4px 0 20px; padding: 14px 16px; border: 0; border-radius: 10px; color: #991B1B; background: var(--danger-soft); font-size: 14px; }
.admin-account { display: flex; align-items: center; gap: 16px; }
.admin-account span { display: flex; flex-direction: column; align-items: flex-end; }
.admin-account strong { font-size: 14px; font-weight: 600; }
.admin-account small { margin-top: 4px; color: var(--muted); font-size: 12px; }

.support-title { display: flex; align-items: start; justify-content: space-between; margin-bottom: 24px; }
.support-title h1 { margin: 0; font-size: 32px; font-weight: 700; }
.support-title p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.support-workbench { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(480px, 2fr) minmax(280px, 1fr); min-height: 680px; overflow: hidden; border: 0; border-radius: 16px; background: #FFFFFF; box-shadow: var(--shadow-soft); }
.support-queues, .support-detail { padding: 20px; background: #FAFAFA; }
.support-queues { border-right: 1px solid var(--border); }
.support-queue { width: 100%; display: flex; gap: 12px; align-items: center; margin-bottom: 12px; padding: 14px; border: 0; border-radius: 10px; color: #1A1A1A; background: #FFFFFF; text-align: left; transition: all .2s ease; }
.support-queue:hover, .support-queue.selected { background: #FFF9F5; box-shadow: 0 2px 8px rgba(255, 107, 53, .1); }
.support-source { padding: 5px 10px; border-radius: 6px; color: #FF6B35; background: #FFF3E0; font-size: 11px; font-weight: 600; }
.support-queue-main { min-width: 0; flex: 1; }
.support-queue-main strong, .support-queue-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-queue-main strong { font-size: 14px; font-weight: 600; }
.support-queue-main small { margin-top: 6px; color: var(--muted); font-size: 12px; }
.support-unread { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 10px; color: #FFFFFF; background: var(--brand); font-size: 11px; font-weight: 600; }
.support-thread { min-width: 0; display: flex; padding: 24px; flex-direction: column; }
.support-thread-head { display: flex; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.support-thread-head span { color: var(--muted); font-size: 13px; }
.support-messages { min-height: 0; flex: 1; padding: 24px 4px; overflow: auto; }
.support-message { max-width: 75%; margin: 12px 0; padding: 12px 16px; border-radius: 12px; color: #1A1A1A; background: #F5F5F5; font-size: 14px; line-height: 1.6; }
.support-message.agent { margin-left: auto; color: #FFFFFF; background: var(--brand); }
.support-message small { display: block; margin-top: 8px; opacity: .7; font-size: 11px; }
.support-tools { display: flex; gap: 10px; margin: 12px 0; }
.support-tools .secondary { font-size: 13px; }
.support-suggestion { margin: 12px 0; padding: 14px 16px; border-radius: 12px; color: #92400E; background: #FEF3C7; font-size: 13px; line-height: 1.6; }
.support-suggestion .secondary { display: block; margin-top: 12px; }
.support-thread textarea { min-height: 90px; width: 100%; resize: vertical; padding: 14px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 14px; }
.support-thread .primary { width: 100%; margin-top: 12px; }
.support-detail { border-left: 1px solid var(--border); }
.support-detail h3 { margin: 4px 0 20px; font-size: 16px; font-weight: 700; }
.support-detail p { margin: 12px 0; color: #666666; font-size: 13px; word-break: break-word; line-height: 1.6; }
.support-detail label { display: block; margin-top: 24px; color: #1A1A1A; font-size: 13px; font-weight: 600; }
.support-detail select { width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #FFFFFF; font-size: 14px; }
.support-detail .secondary { width: 100%; margin-top: 12px; }

@media (max-width: 1200px) {
  .shell { grid-template-columns: 240px 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support-workbench { grid-template-columns: 280px minmax(450px, 1fr); }
  .support-detail { display: none; }
}

.aftersale-workbench { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(600px, 2fr); min-height: 680px; overflow: hidden; border: 0; border-radius: 16px; background: #FFFFFF; box-shadow: var(--shadow-soft); }
.aftersale-workbench > aside { padding: 20px; border-right: 1px solid var(--border); background: #FAFAFA; }
.aftersale-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin-bottom: 12px; padding: 16px; border: 0; border-radius: 10px; background: #FFFFFF; text-align: left; transition: all .2s ease; }
.aftersale-row:hover, .aftersale-row.selected { background: #FFF9F5; box-shadow: 0 2px 8px rgba(255, 107, 53, .1); }
.aftersale-row small { grid-column: 1/-1; color: var(--muted); font-size: 12px; }
.aftersale-row span { color: #FF6B35; font-size: 13px; font-weight: 600; }
.aftersale-detail { padding: 28px; }
.aftersale-detail p { color: #666666; font-size: 14px; line-height: 1.6; }
.aftersale-timeline { padding: 0; list-style: none; }
.aftersale-timeline li { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.aftersale-timeline small { grid-column: 1/-1; color: var(--muted); font-size: 12px; }
.aftersale-detail textarea { width: 100%; min-height: 100px; margin-top: 24px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.aftersale-actions { display: flex; gap: 12px; margin-top: 16px; }
.aftersale-actions .primary { width: auto; padding: 0 24px; }

.review-workbench { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 680px; overflow: hidden; border: 0; border-radius: 16px; background: #FFFFFF; box-shadow: var(--shadow-soft); }
.review-workbench > aside { padding: 16px; border-right: 1px solid var(--border); background: #FAFAFA; }
.review-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 12px; padding: 16px; border: 0; border-radius: 10px; background: #FFFFFF; color: #1A1A1A; text-align: left; transition: all .2s ease; }
.review-row.selected { background: #FFF9F5; box-shadow: 0 2px 8px rgba(255, 107, 53, .1); }
.review-row span { display: flex; min-width: 0; flex-direction: column; gap: 8px; }
.review-row small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.review-row em { flex: none; color: #FF6B35; font-size: 13px; font-style: normal; font-weight: 600; }
.review-detail { min-width: 0; padding: 32px; }
.review-score { margin: 20px 0; color: #FF6B35; font-size: 28px; font-weight: 700; }
.review-tags { color: #FF6B35; font-size: 14px; }
.review-timeline { margin: 28px 0; padding: 0; list-style: none; }
.review-timeline li { display: flex; flex-direction: column; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.review-timeline small { color: var(--muted); font-size: 12px; }
.review-detail textarea { box-sizing: border-box; width: 100%; min-height: 120px; margin: 16px 0 20px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; resize: vertical; font-size: 14px; }

.exception-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.exception-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.selected-filter { color: #FFFFFF; background: var(--brand); }
.exception-search { display: flex; gap: 10px; }
.exception-search input { width: 280px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.exception-search button { flex: none; }

@media (max-width: 900px) {
  .review-workbench { grid-template-columns: 1fr; }
  .review-workbench > aside { border-right: 0; border-bottom: 1px solid var(--border); }
}

.drawer { position: relative; margin-top: 24px; padding: 20px 24px; border: 0; border-radius: 12px; background: #FAFAFA; }
.drawer strong { display: block; font-size: 15px; font-weight: 600; }
.drawer p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.dialog { box-shadow: 0 8px 32px rgba(0, 0, 0, .12); border-radius: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; color: #1A1A1A; }
.form-grid .input { box-sizing: border-box; width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.panel-list { display: flex; flex-direction: column; gap: 20px; margin-top: 20px; }
.panel-actions { margin-top: 16px; display: flex; justify-content: flex-end; gap: 12px; }

.governance-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.governance-modal { width: min(520px, 100%); background: #FFFFFF; border-radius: 16px; box-shadow: var(--shadow-elevated); overflow: hidden; }
.governance-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 28px; border-bottom: 1px solid var(--border); }
.governance-modal-head strong { font-size: 18px; font-weight: 700; color: #1A1A1A; }
.governance-modal-body { padding: 24px 28px; }
.governance-modal-body p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.governance-modal-body label { display: block; margin-bottom: 16px; font-size: 14px; font-weight: 600; color: #1A1A1A; }
.governance-modal-body select, .governance-modal-body textarea { width: 100%; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; font-family: inherit; }
.governance-modal-body textarea { min-height: 100px; resize: vertical; }
.governance-modal-actions { display: flex; gap: 12px; justify-content: flex-end; padding: 20px 28px; border-top: 1px solid var(--border); }

.governance-modal-actions .secondary,.governance-modal-actions .primary{border:none;border-radius:8px;padding:9px 18px;font-size:14px;cursor:pointer}

/* --------------------------------------------------------------------------
   Admin console design system
   -------------------------------------------------------------------------- */
:root {
  --brand: #e96824;
  --brand-hover: #c9571a;
  --brand-soft: #fff4eb;
  --brand-tint: #fff9f5;
  --ink: #1f2937;
  --ink-strong: #111827;
  --muted: #667085;
  --muted-strong: #475467;
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --surface-subtle: #fbfcfd;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --success: #16835b;
  --success-soft: #e9f8f0;
  --warning: #a86609;
  --warning-soft: #fff5df;
  --danger: #c53b3b;
  --danger-soft: #fff0f0;
  --info: #2868b2;
  --info-soft: #edf5ff;
  --sidebar: #172231;
  --sidebar-deep: #101a28;
  --sidebar-text: #d7dee9;
  --sidebar-muted: #8f9caf;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-soft: 0 4px 16px rgba(16, 24, 40, .055);
  --shadow-elevated: 0 18px 48px rgba(16, 24, 40, .16);
  --ease-standard: cubic-bezier(.2, .8, .2, 1);
}

html { min-height: 100%; background: var(--canvas); }
body {
  min-width: 1024px;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select { border-radius: 8px; }

button {
  min-height: 40px;
  border: 0;
  transition: color .18s var(--ease-standard), background-color .18s var(--ease-standard), border-color .18s var(--ease-standard), box-shadow .18s var(--ease-standard), transform .18s var(--ease-standard);
}
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .52; }
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline: 3px solid rgba(233, 104, 36, .22); outline-offset: 2px; }

.shell { grid-template-columns: 248px minmax(0, 1fr); background: var(--canvas); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 100vh;
  min-height: 0;
  flex-direction: column;
  padding: 22px 13px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .18) transparent;
  color: var(--sidebar-text);
  background: linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-deep) 100%);
  box-shadow: 8px 0 24px rgba(16, 24, 40, .06);
}
.brand {
  flex: none;
  gap: 12px;
  margin: 0 5px 18px;
  padding: 0 8px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  color: #fff;
  font-size: 19px;
  letter-spacing: .01em;
}
.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(145deg, #ff9b59 0%, var(--brand) 100%);
  box-shadow: 0 8px 18px rgba(233, 104, 36, .28);
  font-size: 17px;
}
.nav-section { margin: 6px 0 0; }
.nav-section + .nav-section { margin-top: 4px; }
.nav-group {
  min-height: 34px;
  padding: 8px 10px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
}
.nav-group::after { content: "⌄"; margin-left: 8px; color: rgba(255, 255, 255, .35); font-size: 12px; }
.nav-group span { min-width: 19px; height: 19px; border: 1px solid rgba(255, 255, 255, .1); color: #cbd5e1; background: rgba(255, 255, 255, .07); font-size: 10px; }
.nav-items { padding: 0 0 5px; }
.nav-button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  margin: 2px 0;
  padding: 0 12px 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--sidebar-text);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
}
.nav-button:hover { color: #fff; background: rgba(255, 255, 255, .075); }
.nav-button.active {
  border-color: rgba(233, 104, 36, .28);
  color: #fff;
  background: linear-gradient(90deg, rgba(233, 104, 36, .24), rgba(233, 104, 36, .08));
  box-shadow: inset 3px 0 var(--brand), 0 3px 10px rgba(0, 0, 0, .08);
  font-weight: 650;
}
.nav-button em {
  min-width: 20px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-size: 10px;
  font-style: normal;
  line-height: 1.2;
  text-align: center;
}

.main { min-width: 0; background: var(--canvas); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(208, 213, 221, .85);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 1px 8px rgba(16, 24, 40, .025);
  backdrop-filter: blur(14px);
}
.top-title { color: var(--ink-strong); font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.admin-account { gap: 12px; }
.admin-account span { gap: 1px; }
.admin-account strong { color: var(--ink-strong); font-size: 13px; }
.admin-account small { color: var(--muted); font-size: 11px; }
.content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 32px 36px 56px; }
.page-heading { color: var(--ink-strong); font-size: 28px; font-weight: 750; letter-spacing: -.025em; }
.page-subtitle { max-width: 960px; margin: 7px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.section-heading { margin: 30px 0 14px; color: var(--ink-strong); font-size: 16px; font-weight: 700; }

.metrics { gap: 16px; margin-bottom: 24px; }
.metric,
.panel {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.metric {
  position: relative;
  min-height: 132px;
  padding: 22px 22px 20px;
  overflow: hidden;
  transition: box-shadow .2s var(--ease-standard), transform .2s var(--ease-standard);
}
.metric::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--brand); content: ""; }
.metric:nth-child(2)::before { background: #4b83d1; }
.metric:nth-child(3)::before { background: #2a9d78; }
.metric:nth-child(4)::before { background: #b17b2a; }
.metric:hover { box-shadow: var(--shadow-soft); transform: translateY(-2px); }
.metric-label { color: var(--muted); font-size: 13px; font-weight: 550; }
.metric-value { margin-top: 9px; color: var(--ink-strong); font-size: 30px; font-weight: 750; letter-spacing: -.03em; }
.metric-note { margin-top: 7px; color: var(--success); font-size: 12px; font-weight: 550; }
.panel { overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.panel-header { min-height: 64px; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.panel-header > :first-child { min-width: 0; }
.panel-title { color: var(--ink-strong); font-size: 16px; font-weight: 700; }
.panel-header > span:last-child,
.panel-header > div:last-child { flex: none; }

/* Shared controls keep list pages compact while login and message composer stay full width. */
.primary,
.secondary,
.danger,
.ghost {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}
.primary { width: auto; color: #fff; background: var(--brand); box-shadow: 0 3px 10px rgba(233, 104, 36, .18); }
.primary:hover { background: var(--brand-hover); box-shadow: 0 5px 14px rgba(233, 104, 36, .24); }
.secondary { color: var(--muted-strong); border-color: var(--border-strong); background: var(--surface); box-shadow: var(--shadow-xs); }
.secondary:hover { border-color: rgba(233, 104, 36, .48); color: var(--brand-hover); background: var(--brand-tint); }
.danger { color: var(--danger); border-color: #f0c4c4; background: #fffafa; }
.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.ghost { color: var(--muted-strong); background: transparent; }
.ghost:hover { color: var(--brand-hover); background: var(--brand-soft); }
.login .primary,
.support-thread > .primary { width: 100%; }
.panel-actions,
.aftersale-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.panel-actions { justify-content: flex-end; margin-top: 18px; }
.aftersale-actions { margin-top: 16px; }
.muted { color: var(--muted); font-size: 13px; }

input,
textarea,
select {
  color: var(--ink);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  transition: border-color .18s var(--ease-standard), box-shadow .18s var(--ease-standard), background-color .18s var(--ease-standard);
}
input::placeholder,
textarea::placeholder { color: #98a2b3; }
input:hover,
textarea:hover,
select:hover { border-color: #b8c0cc; }
input:focus,
textarea:focus,
select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(233, 104, 36, .1); outline: 0; }
.field-label { display: block; margin: 18px 0 7px; color: var(--muted-strong); font-size: 13px; font-weight: 650; }
.field-label + input,
.field-label + select { width: 100%; min-height: 42px; padding: 0 12px; }
.form-grid { gap: 16px; }
.form-grid label { color: var(--muted-strong); font-size: 13px; }
.form-grid .input { height: 42px; border-color: var(--border-strong); }
.input { color: var(--ink); background: var(--surface); }

table { min-width: 720px; }
th,
td { padding: 15px 22px; border-bottom-color: #eef0f3; font-size: 13px; }
th { color: var(--muted-strong); background: var(--surface-subtle); font-size: 12px; font-weight: 700; letter-spacing: .01em; }
tbody tr:hover { background: #fffaf7; }
.table-media { width: 42px; height: 42px; flex-basis: 42px; border: 1px solid var(--border); border-radius: 9px; }
.status { position: relative; gap: 6px; padding: 5px 10px; border: 1px solid transparent; font-size: 12px; font-weight: 650; }
.status::before { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; content: ""; opacity: .8; }
.status.ok { border-color: #bfe8d0; color: var(--success); background: var(--success-soft); }
.status.muted { border-color: #e4e7ec; color: #667085; background: #f2f4f7; }
.status.danger { border-color: #f3c1c1; color: var(--danger); background: var(--danger-soft); }
.status.info { border-color: #c4dcf7; color: var(--info); background: var(--info-soft); }
.empty { min-height: 150px; padding: 54px 28px; color: var(--muted); font-size: 13px; }
.empty::before { display: block; width: 34px; height: 34px; margin: 0 auto 12px; border: 1px solid var(--border-strong); border-radius: 50%; color: #98a2b3; content: "—"; font-size: 18px; line-height: 30px; }
.boundary { margin-top: 16px; padding: 13px 16px; border: 1px solid #f2d39a; border-radius: 10px; color: #8a5a13; background: #fff9eb; font-size: 13px; line-height: 1.6; }
.inline-error,
.login-error { border: 1px solid #f3c1c1; color: #a42b2b; background: var(--danger-soft); }

.list-stack { padding: 8px 22px 18px; }
.list-row { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; padding: 13px 14px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; }
.list-row:hover { border-color: #f5d8c5; background: var(--brand-tint); }
.list-row strong { overflow: hidden; color: var(--ink-strong); text-overflow: ellipsis; white-space: nowrap; }
.list-row span { color: var(--muted); font-size: 12px; }

.login {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 32px;
  background: radial-gradient(circle at 15% 10%, #fff0e4 0, transparent 34%), radial-gradient(circle at 90% 90%, #e9f1ff 0, transparent 30%), var(--canvas);
}
.login::before,
.login::after { position: absolute; border-radius: 50%; pointer-events: none; content: ""; }
.login::before { top: -180px; right: -120px; width: 460px; height: 460px; border: 1px solid rgba(233, 104, 36, .12); }
.login::after { bottom: -230px; left: -160px; width: 520px; height: 520px; border: 1px solid rgba(40, 104, 178, .08); }
.login-card { position: relative; z-index: 1; width: min(440px, 100%); padding: 40px; border: 1px solid rgba(208, 213, 221, .75); border-radius: 18px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow-elevated); }
.login-card::before { display: block; width: 44px; height: 4px; margin-bottom: 22px; border-radius: 999px; background: var(--brand); content: ""; }
.login-title { color: var(--ink-strong); font-size: 27px; letter-spacing: -.025em; }
.login-note { margin-bottom: 26px; color: var(--muted); font-size: 14px; }
.field { margin-bottom: 17px; }
.field label { margin-bottom: 7px; color: var(--muted-strong); font-size: 13px; }
.field input { height: 46px; border-color: var(--border-strong); border-radius: 9px; }
.login-boundary { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }

.support-workbench,
.aftersale-workbench,
.review-workbench { border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.support-queues,
.support-detail,
.aftersale-workbench > aside,
.review-workbench > aside { background: var(--surface-subtle); }
.support-queue,
.aftersale-row,
.review-row { border: 1px solid transparent; box-shadow: none; }
.support-queue:hover,
.support-queue.selected,
.aftersale-row:hover,
.aftersale-row.selected,
.review-row:hover,
.review-row.selected { border-color: #f4d1bb; background: var(--brand-tint); box-shadow: 0 3px 10px rgba(16, 24, 40, .05); }
.support-thread-head strong,
.review-detail .panel-header strong,
.aftersale-detail .panel-header strong { color: var(--ink-strong); font-size: 16px; }
.support-message { border: 1px solid #edf0f3; background: #f8fafc; }
.support-message.agent { border-color: transparent; background: var(--brand); }
.support-thread textarea,
.aftersale-detail textarea,
.review-detail textarea { border-color: var(--border-strong); background: #fff; }
.support-detail select,
.review-detail select { min-height: 40px; }
.support-suggestion { border: 1px solid #f2d39a; background: #fff9eb; }

.exception-toolbar { margin-bottom: 18px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-xs); }
.exception-filters { gap: 7px; }
.exception-filters .secondary { min-height: 36px; padding: 0 12px; font-size: 12px; }
.selected-filter { border-color: var(--brand); color: #fff; background: var(--brand); }
.selected-filter:hover { color: #fff; background: var(--brand-hover); }
.exception-search { gap: 8px; }
.exception-search input,
#operations-search,
#admin-search-input { min-height: 40px; padding: 0 12px; border-radius: 8px; }

.drawer { border: 1px solid var(--border); background: var(--surface-subtle); }
.dialog { border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.governance-overlay { padding: 24px; background: rgba(16, 24, 40, .52); backdrop-filter: blur(4px); }
.governance-modal { width: min(560px, 100%); max-height: min(760px, calc(100vh - 48px)); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-elevated); }
.governance-modal-head { min-height: 64px; padding: 16px 22px; }
.governance-modal-head strong { color: var(--ink-strong); font-size: 16px; }
.governance-modal-body { max-height: 58vh; overflow-y: auto; padding: 22px; }
.governance-modal-body label { color: var(--muted-strong); font-size: 13px; }
.governance-modal-body input,
.governance-modal-body select,
.governance-modal-body textarea { box-sizing: border-box; min-height: 42px; margin-top: 7px; padding: 9px 11px; border-color: var(--border-strong); }
.governance-modal-actions { padding: 15px 22px; background: var(--surface-subtle); }

@media (max-width: 1280px) {
  .content { padding-right: 26px; padding-left: 26px; }
  .support-workbench { grid-template-columns: 260px minmax(420px, 1fr); }
  .support-detail { display: none; }
}

@media (max-width: 980px) {
  body { min-width: 0; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; max-height: 280px; padding: 16px 14px; }
  .brand { margin-bottom: 10px; padding-bottom: 13px; }
  .nav-section { display: inline-block; width: 48%; vertical-align: top; }
  .nav-group { padding-top: 6px; padding-bottom: 6px; }
  .topbar { padding: 0 22px; }
  .content { padding: 24px 22px 42px; }
  .aftersale-workbench { grid-template-columns: 260px minmax(0, 1fr); }
  .review-workbench { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .topbar { height: auto; min-height: 68px; gap: 12px; padding: 12px 16px; }
  .top-title { font-size: 16px; }
  .admin-account small { display: none; }
  .content { padding: 20px 16px 36px; }
  .page-heading { font-size: 24px; }
  .metrics { grid-template-columns: 1fr; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .panel-header > :last-child { align-self: stretch; }
  .support-workbench,
  .aftersale-workbench,
  .review-workbench { grid-template-columns: 1fr; }
  .support-queues,
  .aftersale-workbench > aside,
  .review-workbench > aside { max-height: 280px; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .support-thread { min-height: 520px; }
  .exception-toolbar { align-items: stretch; flex-direction: column; }
  .exception-search input { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .login { padding: 16px; }
  .login-card { padding: 30px 24px; }
}

/* Final responsive console pass. Keep the dense operations UI inside the viewport. */
:root {
  --canvas: #f4f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --ink: #172033;
  --ink-strong: #0f172a;
  --muted: #64748b;
  --brand: #e96824;
  --brand-hover: #c9571a;
  --brand-soft: #fff3ea;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, .06);
}

html, body { width: 100%; min-width: 0; overflow-x: hidden; }
body { background: var(--canvas); }
.shell { width: 100%; min-width: 0; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { min-width: 0; }
.main, .content { min-width: 0; max-width: 100%; }
.content { overflow: hidden; container-name: admin-content; container-type: inline-size; }
.page-heading, .page-subtitle, .panel-title, .metric-label, .metric-note { overflow-wrap: anywhere; }
.panel-header { flex-wrap: wrap; }
.panel-header > span:last-child,
.panel-header > div:last-child { min-width: 0; max-width: 100%; }
.panel-header input { max-width: min(360px, 100%); }
.table-wrap, .panel:has(table) { max-width: 100%; overflow-x: auto; }
table { min-width: 680px; }
td, th { vertical-align: top; }
td { overflow-wrap: anywhere; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.metric-value { overflow-wrap: anywhere; }
.support-workbench { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(220px, 280px); }
.aftersale-workbench { grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); }
.review-workbench { grid-template-columns: minmax(220px, 320px) minmax(0, 1fr); }
.support-thread, .support-detail, .aftersale-detail, .review-detail { min-width: 0; }
.support-message { max-width: min(75%, 620px); overflow-wrap: anywhere; }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.exception-toolbar, .exception-search, .exception-filters { min-width: 0; }
.exception-search input { width: min(280px, 100%); }
.login-card { max-width: 100%; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .content { padding-right: 24px; padding-left: 24px; }
  .topbar { padding-right: 24px; padding-left: 24px; }
  .support-workbench { grid-template-columns: 240px minmax(0, 1fr); }
  .support-detail { display: none; }
}

@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; max-height: none; padding: 14px 12px; }
  .brand { margin-bottom: 10px; padding-bottom: 12px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; }
  .nav-section { width: auto; margin: 0; }
  .nav-items { padding-bottom: 2px; }
  .nav-button { min-height: 38px; padding-right: 9px; padding-left: 10px; font-size: 12px; }
  .sidebar-footer { display: none; }
  .topbar { position: relative; align-items: flex-start; flex-wrap: wrap; min-height: 0; padding: 14px 16px; }
  .topbar-actions { width: 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .admin-account { margin-left: auto; }
  .content { padding: 20px 16px 36px; }
  .page-heading { font-size: 24px; }
  .panel-header { align-items: stretch; flex-direction: column; gap: 12px; }
  .panel-header > span:last-child, .panel-header > div:last-child { width: 100%; }
  .panel-header input { width: 100%; max-width: none; }
  .support-workbench, .aftersale-workbench, .review-workbench { grid-template-columns: 1fr; min-height: 0; }
  .support-queues, .aftersale-workbench > aside, .review-workbench > aside { max-height: 260px; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .support-thread { min-height: 480px; padding: 18px; }
  .support-message { max-width: 88%; }
  .aftersale-detail, .review-detail { padding: 20px; }
  .exception-toolbar { align-items: stretch; flex-direction: column; }
  .exception-search { width: 100%; }
  .exception-search input { flex: 1; width: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .login { padding: 16px; }
  .login-card { padding: 30px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Mature operations console visual system */
:root {
  --canvas: #f2f4f7;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --border: #e3e7ed;
  --border-strong: #cbd2dc;
  --ink: #344054;
  --ink-strong: #101828;
  --muted: #667085;
  --muted-strong: #475467;
  --brand: #d65f25;
  --brand-hover: #b94c19;
  --brand-soft: #fff3eb;
  --brand-tint: #fffaf7;
  --sidebar: #202b3a;
  --sidebar-deep: #192331;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .035);
  --shadow-soft: 0 5px 18px rgba(16, 24, 40, .045);
  --shadow-elevated: 0 24px 70px rgba(16, 24, 40, .2);
}

body { color: var(--ink); background: var(--canvas); }
.shell { grid-template-columns: 252px minmax(0, 1fr); transition: grid-template-columns .22s ease; }
.sidebar { padding: 18px 12px 16px; background: var(--sidebar); box-shadow: 1px 0 0 rgba(16, 24, 40, .08); }
.brand { position: relative; margin: 0 3px 14px; padding: 0 30px 17px 7px; gap: 10px; border-color: rgba(255,255,255,.1); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); box-shadow: none; font-size: 15px; }
.brand-copy strong { font-size: 15px; }
.brand-copy small { margin-top: 3px; color: #aab5c4; font-size: 11px; }
.sidebar-toggle { position: absolute; top: 2px; right: 0; width: 28px; min-height: 28px; padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; color: #d7dee9; background: rgba(255,255,255,.05); font-size: 19px; }
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,.12); }
.sidebar-meta { margin: 0 8px 13px; color: #bdc6d2; font-size: 11px; }
.sidebar-meta-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px rgba(35, 173, 117, .14); }
.nav-section { margin-top: 2px; }
.nav-group { min-height: 31px; padding: 6px 9px; font-size: 10px; }
.nav-button { min-height: 38px; margin: 1px 0; border-radius: 7px; font-size: 12px; }
.nav-button.active { border-color: rgba(255,255,255,.07); background: rgba(255,255,255,.11); box-shadow: inset 2px 0 var(--brand); }
.sidebar-footer { margin: auto 5px 0; padding-top: 16px; }
.sidebar-footer-head { padding: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.035); }
.sidebar-footer-version { color: #98a5b6; }
.main { background: var(--canvas); }
.topbar { min-height: 68px; height: 68px; padding: 0 32px; background: #fff; box-shadow: none; backdrop-filter: none; }
.top-eyebrow { color: #98a2b3; font-size: 10px; }
.top-title { font-size: 15px; }
.topbar-actions { gap: 14px; }
.topbar-scope { padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px; color: #475467; background: #fff; font-size: 11px; }
.data-state { font-size: 11px; }
.admin-account { gap: 9px; }
.account-avatar { width: 30px; height: 30px; border-radius: 9px; color: #8f431e; background: #fbe8dc; font-size: 12px; }
.admin-account strong { font-size: 12px; }
.admin-account small { font-size: 10px; }
.admin-account .secondary { min-height: 32px; padding: 0 10px; font-size: 11px; }
.content { max-width: 1600px; padding: 28px 32px 48px; }
.page-heading { font-size: 23px; font-weight: 700; letter-spacing: 0; }
.page-subtitle { margin: 5px 0 20px; color: #7b8797; font-size: 12px; }
.section-heading { margin-top: 24px; font-size: 14px; }
.metric, .panel, .entity-table-panel { border-color: #e5e9ef; border-radius: 9px; box-shadow: var(--shadow-xs); }
.metric { min-height: 116px; padding: 18px 18px 15px; }
.metric::before { height: 2px; opacity: .7; }
.metric:hover { transform: translateY(-1px); }
.metric-label { font-size: 12px; }
.metric-value { margin-top: 8px; font-size: 25px; letter-spacing: 0; }
.metric-note { margin-top: 5px; color: #7b8797; font-size: 10px; font-weight: 450; }
.panel-header { min-height: 55px; padding: 13px 17px; }
.panel-title { font-size: 14px; }
.primary, .secondary, .danger, .ghost { min-height: 36px; border-radius: 7px; font-size: 12px; }
.primary { box-shadow: none; }
.primary:hover { box-shadow: 0 3px 8px rgba(214,95,37,.17); }
table { min-width: 680px; }
th, td { padding: 12px 16px; font-size: 12px; }
th { font-size: 11px; }
tbody tr:hover { background: #fafbfd; }
.status { min-height: 23px; padding: 3px 8px; font-size: 10px; }
.empty { min-height: 128px; padding: 40px 20px; }
.list-stack { padding: 6px 16px 14px; }
.list-row { padding: 11px 12px; }
.list-row strong { font-size: 12px; }
.list-row span { font-size: 11px; }
.entity-page-header { margin-bottom: 17px; }
.entity-kicker { margin-bottom: 5px; font-size: 9px; }
.entity-stat-grid { gap: 10px; }
.entity-stat { min-height: 100px; padding: 14px 15px; border-radius: 9px; }
.entity-stat strong { margin: 7px 0 4px; font-size: 23px; letter-spacing: 0; }
.entity-filter-bar { gap: 9px; padding: 10px; border-radius: 9px; }
.entity-table-panel { border-radius: 9px; }
.entity-table { min-width: 860px; }
.entity-table th { padding: 10px 14px; }
.entity-table td { padding: 11px 14px; }
.entity-primary { min-width: 170px; }
.entity-action { min-height: 31px; border-radius: 6px; font-size: 11px; }
.support-workbench, .aftersale-workbench, .review-workbench { border-radius: 10px; box-shadow: var(--shadow-xs); }
.support-queues, .support-detail, .aftersale-workbench > aside, .review-workbench > aside { padding: 14px; }
.support-queue, .aftersale-row, .review-row { border-radius: 8px; }
.support-thread { padding: 18px; }
.support-thread-head { padding-bottom: 14px; }
.support-messages { padding: 16px 2px; }
.support-message { padding: 10px 13px; border-radius: 10px; font-size: 12px; }
.support-tools { flex-wrap: wrap; }
.aftersale-detail, .review-detail { padding: 22px; }
.governance-overlay { backdrop-filter: blur(2px); }
.governance-modal { border-radius: 11px; }
.login { background: #f3f5f7; }
.login::before, .login::after { display: none; }
.login-card { padding: 36px; border-radius: 12px; box-shadow: 0 12px 32px rgba(16,24,40,.09); }
.login-card::before { width: 34px; margin-bottom: 19px; }
.login-title { font-size: 23px; letter-spacing: 0; }
.login-note { font-size: 12px; }
.login .primary { min-height: 44px; }
.sidebar-collapsed .shell { grid-template-columns: 72px minmax(0, 1fr); }
.sidebar-collapsed .sidebar { padding-right: 8px; padding-left: 8px; }
.sidebar-collapsed .brand { justify-content: center; padding-right: 0; padding-left: 0; }
.sidebar-collapsed .brand-copy, .sidebar-collapsed .sidebar-meta > span:not(.sidebar-meta-dot), .sidebar-collapsed .nav-group-name, .sidebar-collapsed .nav-count, .sidebar-collapsed .nav-group::after, .sidebar-collapsed .nav-button:not(.active), .sidebar-collapsed .nav-button.active ~ em, .sidebar-collapsed .sidebar-footer { display: none; }
.sidebar-collapsed .brand-mark { margin: auto; }
.sidebar-collapsed .sidebar-toggle { right: -3px; transform: rotate(180deg); }
.sidebar-collapsed .nav-group { justify-content: center; }
.sidebar-collapsed .nav-button.active { justify-content: center; overflow: hidden; color: transparent; font-size: 0; }
.sidebar-collapsed .nav-button.active::before { content: "•"; color: #fff; font-size: 20px; }

@media (max-width: 760px) {
  .shell, .sidebar-collapsed .shell { display: block; }
  .sidebar { padding: 12px; }
  .brand { justify-content: flex-start; padding-right: 36px; }
  .sidebar-toggle { display: none; }
  .sidebar-meta { margin-bottom: 9px; }
  .sidebar nav { grid-template-columns: 1fr 1fr; }
  .nav-group { white-space: nowrap; }
  .topbar { height: auto; min-height: 64px; padding: 12px 16px; }
  .topbar-actions { gap: 8px; }
  .topbar-scope { display: none; }
  .admin-account { margin-left: auto; }
  .content { padding: 18px 14px 32px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-height: 100px; padding: 13px; }
  .metric-value { font-size: 21px; }
  .metric-note { line-height: 1.4; }
  .entity-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 420px) {
  .sidebar nav { grid-template-columns: 1fr; }
  .nav-section:not([open]) .nav-items { display: none; }
  .topbar-actions { width: 100%; }
  .admin-account { margin-left: 0; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-label { font-size: 11px; }
  .metric-value { font-size: 19px; }
  .panel-header { padding: 12px; }
  .entity-filter-actions { flex-wrap: wrap; }
}

/* Merchant review cards: readable evidence before destructive actions. */
.review-application { margin: 0 0 14px; overflow: hidden; }
.review-application .panel-header { align-items: flex-start; padding: 16px 20px; }
.review-application .panel-header > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.panel-eyebrow { color: #98a2b3; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.review-application .panel-title { font-size: 15px; overflow-wrap: anywhere; }
.review-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 20px; border-bottom: 1px solid var(--border); color: #7b8797; background: #fbfcfe; font-size: 11px; }
.review-section { margin: 0 20px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.review-section h3 { margin: 0 0 12px; color: var(--ink-strong); font-size: 12px; font-weight: 750; }
.review-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.review-field { min-width: 0; }
.review-field-wide { grid-column: span 2; }
.review-field span, .review-field strong { display: block; }
.review-field span { margin-bottom: 4px; color: #98a2b3; font-size: 10px; }
.review-field strong { color: var(--ink); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.review-media-list { align-items: flex-start; gap: 12px; margin: 0; }
.review-media { width: 88px; margin: 0; }
.review-media .table-media { width: 88px; height: 68px; border-radius: 7px; }
.review-media figcaption { margin-top: 5px; color: #7b8797; font-size: 10px; text-align: center; }
.review-detail-line { margin: 14px 20px 0; padding: 10px 12px; border-left: 3px solid #e6a16e; color: #667085; background: #fffaf7; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.review-application > .panel-actions { justify-content: flex-start; margin: 16px 20px 20px; }
.review-application > .panel-actions .primary,
.review-application > .panel-actions .secondary,
.review-application > .panel-actions .danger { min-width: 104px; }

@media (max-width: 760px) {
  .review-application .panel-header { padding: 14px; }
  .review-meta { padding: 9px 14px; }
  .review-section { margin-right: 14px; margin-left: 14px; }
  .review-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
  .review-field-wide { grid-column: 1 / -1; }
  .review-detail-line { margin-right: 14px; margin-left: 14px; }
  .review-application > .panel-actions { margin-right: 14px; margin-left: 14px; }
  .review-application > .panel-actions button { flex: 1 1 130px; }
}

@media (max-width: 420px) {
  .review-fields { grid-template-columns: 1fr; }
  .review-field-wide { grid-column: auto; }
}

/* 本地生活运营总览：以运营目标为中心的仪表盘布局 */
.ops-overview { max-width: 1480px; }
.ops-overview-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.ops-overview-head h1 { margin: 6px 0 7px; color: #172033; font-size: clamp(28px, 3vw, 38px); font-weight: 780; letter-spacing: -.045em; }
.ops-overview-head p { margin: 0; color: #7b8494; font-size: 13px; }
.ops-section-label { color: #8b95a5; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.ops-overview-actions { display: flex; align-items: center; gap: 14px; padding-bottom: 4px; }
.ops-overview-actions .primary { width: auto; min-height: 38px; padding: 0 16px; font-size: 12px; }
.ops-live { display: inline-flex; align-items: center; gap: 7px; color: #64748b; font-size: 12px; white-space: nowrap; }
.ops-live i { width: 7px; height: 7px; border-radius: 50%; background: #18a66b; box-shadow: 0 0 0 4px rgba(24, 166, 107, .11); }
.ops-provider { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(250px, .75fr); margin-bottom: 14px; overflow: hidden; border: 1px solid #dfe5ec; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(20, 32, 50, .035); }
.ops-provider-main { padding: 19px 22px 18px; }
.ops-provider-title { display: flex; align-items: center; gap: 11px; margin-top: 11px; }
.ops-provider-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: #087f70; background: #dff7f1; font-size: 11px; font-weight: 850; letter-spacing: -.04em; }
.ops-provider-title h2, .ops-provider-title p { margin: 0; }
.ops-provider-title h2 { color: #1d2939; font-size: 15px; font-weight: 760; }
.ops-provider-title p { margin-top: 3px; color: #98a2b3; font-size: 11px; }
.ops-provider-state { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.ops-provider-state i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ops-provider-state.is-ok { color: #14845a; background: #e8f8f0; }
.ops-provider-state.is-off { color: #aa6a16; background: #fff4da; }
.ops-provider-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 21px; }
.ops-provider-metrics div { padding-right: 12px; border-right: 1px solid #edf0f4; }
.ops-provider-metrics div:last-child { border-right: 0; }
.ops-provider-metrics span, .ops-provider-metrics strong { display: block; }
.ops-provider-metrics span { color: #98a2b3; font-size: 10px; }
.ops-provider-metrics strong { margin-top: 5px; color: #27364a; font-size: 18px; font-weight: 760; letter-spacing: -.025em; }
.ops-provider-side { display: flex; min-height: 156px; flex-direction: column; justify-content: center; padding: 20px 22px; border-left: 1px solid #edf0f4; background: #fbfcfe; }
.ops-provider-side span { color: #98a2b3; font-size: 10px; }
.ops-provider-side strong { margin: 4px 0 12px; color: #475467; font-size: 11px; font-weight: 650; }
.ops-provider-side p { margin: 3px 0 0; color: #a2aab7; font-size: 10px; line-height: 1.55; }
.ops-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.ops-kpi { position: relative; min-height: 142px; padding: 17px 17px 15px; overflow: hidden; border: 1px solid #e0e6ed; border-radius: 13px; background: #fff; box-shadow: 0 3px 12px rgba(20, 32, 50, .028); }
.ops-kpi::after { position: absolute; right: -25px; bottom: -35px; width: 110px; height: 110px; border-radius: 50%; background: currentColor; content: ""; opacity: .055; }
.ops-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.ops-kpi-icon { display: block; width: 26px; height: 26px; border-radius: 8px; background: currentColor; opacity: .13; }
.ops-kpi-caption { color: #98a2b3; font-size: 10px; white-space: nowrap; }
.ops-kpi strong { display: block; margin-top: 16px; color: #233247; font-size: 20px; font-weight: 780; letter-spacing: -.03em; }
.ops-kpi > span:not(.ops-kpi-caption) { display: block; min-height: 16px; margin-top: 4px; overflow: hidden; color: #667085; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ops-kpi small { display: block; margin-top: 13px; color: #344054; font-size: 11px; font-weight: 760; }
.ops-kpi-blue { color: #3676d7; }.ops-kpi-violet { color: #7857c7; }.ops-kpi-green { color: #1c9b6b; }.ops-kpi-orange { color: #e27732; }.ops-kpi-slate { color: #60728f; }
.ops-governance { padding: 20px; border: 1px solid #dfe5ec; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(20, 32, 50, .035); }
.ops-governance-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.ops-governance-head h2 { margin: 5px 0 4px; color: #1d2939; font-size: 17px; letter-spacing: -.02em; }
.ops-governance-head p { margin: 0; color: #98a2b3; font-size: 11px; }
.ops-governance-head .secondary { min-height: 34px; padding: 0 12px; font-size: 11px; }
.ops-queue-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.ops-queue-card { display: grid; grid-template-columns: 8px auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 13px 14px; border: 1px solid #edf0f4; border-radius: 10px; background: #fbfcfe; }
.ops-queue-card strong { color: #1d2939; font-size: 22px; line-height: 1; }
.ops-queue-card > span:not(.ops-queue-dot) { align-self: end; color: #475467; font-size: 11px; font-weight: 700; }
.ops-queue-card small { grid-column: 2 / 4; margin-top: 5px; color: #98a2b3; font-size: 10px; }
.ops-queue-dot { grid-row: 1 / 3; width: 7px; height: 7px; border-radius: 50%; align-self: start; margin-top: 3px; }.ops-queue-dot.blue { background: #3676d7; }.ops-queue-dot.red { background: #d95c5c; }.ops-queue-dot.amber { background: #d99227; }.ops-queue-dot.green { background: #1c9b6b; }
.ops-search-panel { margin-top: 18px; border: 1px solid #edf0f4; border-radius: 11px; overflow: hidden; }
.ops-search-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #edf0f4; background: #fbfcfe; }
.ops-search-head h3 { margin: 0 0 3px; color: #344054; font-size: 13px; }.ops-search-head p { margin: 0; color: #98a2b3; font-size: 10px; }.ops-search-head > span { padding: 5px 8px; border-radius: 6px; color: #7b8494; background: #eef2f7; font-size: 10px; }
.ops-search-panel ul { margin: 0; padding: 0; list-style: none; }.ops-search-panel li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 16px; border-bottom: 1px solid #f0f2f5; }.ops-search-panel li:last-child { border-bottom: 0; }.ops-search-rank { min-width: 26px; color: #d97745; font-size: 11px; font-weight: 800; }.ops-search-panel li div { min-width: 0; flex: 1; }.ops-search-panel li strong, .ops-search-panel li small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.ops-search-panel li strong { color: #344054; font-size: 12px; }.ops-search-panel li small { margin-top: 3px; color: #98a2b3; font-size: 10px; }.ops-search-arrow { color: #aab4c2; font-size: 13px; }.ops-search-empty { justify-content: center; color: #98a2b3; font-size: 11px; }

@media (max-width: 1180px) { .ops-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.ops-provider { grid-template-columns: 1fr; }.ops-provider-side { min-height: 0; border-top: 1px solid #edf0f4; border-left: 0; } }
@media (max-width: 760px) { .ops-overview-head { align-items: flex-start; flex-direction: column; }.ops-overview-actions { width: 100%; justify-content: space-between; }.ops-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.ops-provider-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }.ops-provider-metrics div:nth-child(2) { border-right: 0; }.ops-queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* 2026 operations-console polish: stronger product chrome and less empty space. */
.brand-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.brand-copy strong { color: #fff; font-size: 17px; font-weight: 760; letter-spacing: -.01em; }
.brand-copy small { color: #93a2b7; font-size: 10px; font-weight: 550; letter-spacing: .08em; }
.sidebar-meta { display: flex; align-items: center; gap: 7px; margin: -4px 9px 12px; padding: 7px 10px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 8px; color: #9aa9bd; background: rgba(255, 255, 255, .035); font-size: 10px; }
.sidebar-meta-dot { width: 6px; height: 6px; border-radius: 50%; background: #37c98b; box-shadow: 0 0 0 3px rgba(55, 201, 139, .12); }
.sidebar-meta-tag { margin-left: auto; padding: 2px 5px; border-radius: 4px; color: #cbd8ea; background: rgba(255, 255, 255, .08); font-size: 9px; letter-spacing: .06em; }
.sidebar-footer { margin: auto 5px 0; padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-footer-head { display: flex; align-items: center; gap: 9px; }
.sidebar-footer-icon { display: grid; width: 23px; height: 23px; place-items: center; border: 1px solid rgba(55, 201, 139, .25); border-radius: 7px; color: #57d49b; background: rgba(55, 201, 139, .1); font-size: 12px; font-weight: 800; }
.sidebar-footer-head strong, .sidebar-footer-head small { display: block; }
.sidebar-footer-head strong { color: #d5dfed; font-size: 11px; font-weight: 700; }
.sidebar-footer-head small { margin-top: 2px; color: #8594aa; font-size: 10px; }
.sidebar-footer-version { display: block; margin-top: 10px; color: #687991; font-size: 9px; letter-spacing: .05em; }
.topbar-scope { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid #e5e9ef; border-radius: 7px; color: #667085; background: #fbfcfd; font-size: 10px; white-space: nowrap; }
.topbar-scope i { width: 6px; height: 6px; border-radius: 50%; background: #3676d7; box-shadow: 0 0 0 3px rgba(54, 118, 215, .1); }
.topbar-actions { gap: 12px; }
.data-state { padding-left: 7px; border-left: 1px solid #e9edf2; }

.ops-section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 12px; }
.ops-section-intro h2 { margin: 4px 0 0; color: #1d2939; font-size: 17px; font-weight: 760; letter-spacing: -.02em; }
.ops-section-intro > span { color: #98a2b3; font-size: 10px; }
.ops-hero { min-height: 204px; }
.ops-hero-side-state { display: flex; flex-direction: column; gap: 3px; margin-top: 16px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, .11); }
.ops-hero-side-state span { color: #9fb1c8; font-size: 10px; }
.ops-hero-side-state strong { margin: 0; color: #d9f7e7; font-size: 13px; }
.ops-kpi { min-height: 154px; }
.ops-kpi-searches .ops-kpi-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ops-kpi-searches .ops-kpi-stat:last-child { padding-left: 9px; border-left: 1px solid #edf0f4; }
.ops-provider { grid-template-columns: minmax(0, 1.8fr) minmax(240px, .7fr); margin-top: 2px; }
.ops-provider-main { padding-top: 18px; padding-bottom: 17px; }
.ops-provider-side { min-height: 136px; padding-top: 17px; padding-bottom: 17px; }
.ops-provider-metrics { margin-top: 17px; }
.ops-governance { margin-top: 16px; }

@media (max-width: 1180px) {
  .topbar-scope { display: none; }
  .ops-provider { grid-template-columns: 1fr; }
  .ops-provider-side { min-height: 0; border-top: 1px solid #edf0f4; border-left: 0; }
}
@media (max-width: 760px) {
  .sidebar-footer { display: none; }
  .ops-section-intro { align-items: flex-start; flex-direction: column; gap: 5px; }
}

/* Local-life operations: a denser command-center composition */
.ops-overview { max-width: 1540px; }
.ops-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .62fr);
  min-height: 190px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid #243b5f;
  border-radius: 18px;
  color: #f8fbff;
  background:
    radial-gradient(circle at 80% 15%, rgba(96, 165, 250, .25), transparent 32%),
    radial-gradient(circle at 8% 120%, rgba(233, 104, 36, .22), transparent 38%),
    linear-gradient(116deg, #17263e 0%, #1b3153 56%, #203d65 100%);
  box-shadow: 0 14px 28px rgba(29, 52, 82, .16);
}
.ops-hero-main { padding: 28px 32px 25px; }
.ops-hero .ops-section-label { color: #9bb2d2; }
.ops-hero h1 { margin: 9px 0 8px; color: #fff; font-size: clamp(27px, 3vw, 38px); font-weight: 770; letter-spacing: -.045em; }
.ops-hero p { max-width: 640px; margin: 0; color: #b8c6d9; font-size: 13px; line-height: 1.7; }
.ops-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 17px; margin-top: 22px; color: #9fb1c8; font-size: 11px; }
.ops-hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.ops-hero-meta span:first-child { color: #d9f7e7; }
.ops-hero-meta i { width: 7px; height: 7px; border-radius: 50%; background: #32c887; box-shadow: 0 0 0 4px rgba(50, 200, 135, .16); }
.ops-hero-side { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 26px 28px; border-left: 1px solid rgba(255, 255, 255, .1); background: rgba(10, 22, 40, .15); }
.ops-hero-side-label { color: #9fb1c8; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.ops-hero-side strong { margin-top: 9px; color: #fff; font-size: 19px; letter-spacing: -.02em; }
.ops-hero-side small { margin-top: 7px; color: #aabbd0; font-size: 11px; line-height: 1.55; }
.ops-hero-side .primary { width: auto; min-height: 36px; margin-top: 18px; padding: 0 14px; color: #17263e; background: #f6c69f; box-shadow: 0 4px 12px rgba(9, 23, 43, .18); }
.ops-hero-side .primary:hover { color: #17263e; background: #ffd8b9; }
.ops-hero-side .primary span, .ops-shortcut-actions button span { margin-left: 8px; font-size: 14px; }

.ops-provider { margin-bottom: 16px; border-color: #d8e1ec; border-radius: 15px; box-shadow: 0 4px 16px rgba(24, 39, 61, .045); }
.ops-provider-main { padding: 21px 24px 19px; }
.ops-provider-side { padding: 21px 24px; background: #f7f9fc; }
.ops-provider-side-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ops-provider-side-row span { color: #8b98a9; font-size: 10px; }
.ops-provider-side-row strong { margin: 0; color: #344054; font-size: 12px; font-weight: 700; }
.ops-provider-side p { margin-top: 2px; }

.ops-kpi-grid { gap: 13px; margin-bottom: 16px; }
.ops-kpi { min-height: 164px; padding: 17px 18px 15px; border-color: #dfe6ef; border-radius: 14px; box-shadow: 0 3px 13px rgba(24, 39, 61, .035); }
.ops-kpi:hover { transform: translateY(-2px); border-color: #cbd7e5; box-shadow: 0 10px 20px rgba(24, 39, 61, .075); }
.ops-kpi-top { align-items: center; }
.ops-kpi-index { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid currentColor; border-radius: 8px; color: inherit; background: color-mix(in srgb, currentColor 9%, white); font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.ops-kpi-caption { letter-spacing: .1em; }
.ops-kpi-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 17px; }
.ops-kpi-title strong { margin: 0; color: #1d2939; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.ops-kpi-title span { color: #a0a9b7; font-size: 10px; }
.ops-kpi-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #edf0f4; }
.ops-kpi-stat { min-width: 0; }
.ops-kpi-stat + .ops-kpi-stat { padding-left: 9px; border-left: 1px solid #edf0f4; }
.ops-kpi-stat strong { display: block; overflow: hidden; color: #26364c; font-size: 19px; font-weight: 780; letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.ops-kpi-stat span { display: block; margin-top: 4px; overflow: hidden; color: #8b98a9; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ops-kpi-searches .ops-kpi-stats, .ops-kpi-searches .ops-kpi-stat:last-child { grid-column: auto; }

.ops-governance { padding: 22px; border-color: #d8e1ec; border-radius: 15px; box-shadow: 0 4px 16px rgba(24, 39, 61, .045); }
.ops-governance-head h2 { margin-top: 6px; font-size: 18px; }
.ops-queue-grid { gap: 11px; margin-top: 19px; }
.ops-queue-card { min-height: 76px; padding: 13px 15px; border-color: #e6ebf1; background: #f8fafc; transition: border-color .16s ease, background-color .16s ease, transform .16s ease; }
.ops-queue-card:hover { border-color: #ccd8e6; background: #fff; transform: translateY(-1px); }
.ops-queue-card strong { font-size: 24px; }
.ops-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 13px; margin-top: 15px; }
.ops-search-panel { margin-top: 0; border-color: #e6ebf1; border-radius: 12px; }
.ops-search-head { padding: 14px 16px; }
.ops-search-panel li { min-height: 53px; }
.ops-search-rank { min-width: 25px; color: #8c9bb0; font-size: 11px; letter-spacing: .05em; }
.ops-search-count { color: #667085; font-size: 11px; font-weight: 700; white-space: nowrap; }
.ops-search-empty { flex-direction: column; gap: 5px; min-height: 130px; padding: 20px; }
.ops-search-empty strong { color: #667085; font-size: 12px; }
.ops-search-empty small { color: #a0a9b7; font-size: 10px; }
.ops-empty-mark { display: grid; width: 27px; height: 27px; place-items: center; margin-bottom: 2px; border: 1px solid #dbe3ed; border-radius: 8px; color: #8a9ab0; background: #f7f9fc; font-size: 16px; }
.ops-insight { overflow: hidden; border: 1px solid #e6ebf1; border-radius: 12px; background: #fff; }
.ops-insight-badge { padding: 4px 7px; border-radius: 5px; color: #18845b; background: #e9f8f0; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.ops-insight-body { display: flex; gap: 13px; padding: 20px 18px; }
.ops-insight-icon { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #326abf; background: #eaf2ff; font-size: 14px; font-weight: 800; }
.ops-insight-body strong { display: block; color: #344054; font-size: 13px; }
.ops-insight-body p { margin: 7px 0 0; color: #8b98a9; font-size: 11px; line-height: 1.65; }
.ops-shortcuts { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 15px; padding: 16px 18px; border: 1px solid #d8e1ec; border-radius: 13px; background: #fff; }
.ops-shortcuts > div:first-child { display: flex; flex-direction: column; gap: 5px; }
.ops-shortcuts strong { color: #344054; font-size: 13px; }
.ops-shortcut-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ops-shortcut-actions button { width: auto; min-height: 34px; padding: 0 12px; color: #475467; font-size: 11px; }
.ops-shortcut-actions button:hover { color: #c85a1a; border-color: #e5a77f; background: #fff8f3; }

@media (max-width: 1180px) {
  .ops-hero { grid-template-columns: minmax(0, 1fr) 270px; }
  .ops-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .ops-hero { grid-template-columns: 1fr; }
  .ops-hero-side { min-height: 150px; border-top: 1px solid rgba(255, 255, 255, .1); border-left: 0; }
  .ops-bottom-grid { grid-template-columns: 1fr; }
  .ops-shortcuts { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 760px) {
  .ops-hero-main { padding: 24px 21px; }
  .ops-hero-side { padding: 21px; }
  .ops-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-governance { padding: 16px; }
  .ops-queue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   Enterprise operations polish
   Keeps the existing warm-orange brand while tightening hierarchy, density,
   keyboard access and responsive behavior across the console.
   -------------------------------------------------------------------------- */
:root {
  --brand-deep: #b64b16;
  --brand-wash: #fff7f1;
  --ink-900: #17212f;
  --ink-700: #344054;
  --ink-500: #667085;
  --line-soft: #eaecf0;
  --line: #dfe3e8;
  --surface-raised: #ffffff;
  --surface-muted: #f8fafc;
  --nav-active: rgba(233, 104, 36, .16);
  --ring: rgba(233, 104, 36, .24);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

html { background: #f4f6f8; }
body {
  min-width: 0;
  color: var(--ink-900);
  background: #f4f6f8;
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: fixed;
  z-index: 2000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink-900);
  transform: translateY(-160%);
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

.shell { grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  padding: 18px 12px 16px;
  background: linear-gradient(180deg, #182536 0%, #111b29 100%);
  box-shadow: 10px 0 28px rgba(16, 24, 40, .08);
}
.sidebar nav { min-height: 0; }
.brand {
  align-items: center;
  margin: 0 4px 16px;
  padding: 3px 10px 18px;
  font-size: 18px;
}
.brand > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.brand::after {
  display: block;
  margin-left: auto;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 999px;
  color: #aeb8c7;
  content: "ADMIN";
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #ffab70, #e96824);
  box-shadow: 0 7px 16px rgba(233, 104, 36, .25);
  font-weight: 750;
}
.nav-section { margin-top: 5px; }
.nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  color: #8f9caf;
  font-size: 10px;
  letter-spacing: .12em;
}
.nav-group::after { margin-left: auto; content: "⌄"; font-size: 12px; opacity: .55; }
.nav-group-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.nav-group-name { letter-spacing: .12em; }
.nav-count {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 1px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 99px;
  color: #aeb8c7;
  background: rgba(255, 255, 255, .06);
  font-size: 9px;
  letter-spacing: 0;
}
.nav-items { padding: 0 2px 6px; }
.nav-button {
  position: relative;
  min-height: 39px;
  margin: 1px 0;
  padding: 0 11px 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 520;
}
.nav-button::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 5px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  content: "";
}
.nav-button:hover { border-color: rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .07); }
.nav-button.active {
  border-color: rgba(233, 104, 36, .28);
  color: #fff;
  background: var(--nav-active);
  box-shadow: none;
}
.nav-button.active::before { background: #ff9b59; }
.nav-button em { margin-left: auto; color: #fff; background: var(--brand); }

.main { background: #f4f6f8; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 76px;
  padding: 0 36px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
}
.top-context { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.top-eyebrow {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-title { font-size: 19px; letter-spacing: -.01em; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.data-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-500);
  font-size: 11px;
  white-space: nowrap;
}
.data-state i { width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.data-state.is-ready i { background: var(--success); box-shadow: 0 0 0 3px rgba(22, 131, 91, .1); }
.data-state.is-error { color: var(--danger); }
.data-state.is-error i { background: var(--danger); }
.data-state.is-warning { color: #9a6700; }
.data-state.is-warning i { background: #d99500; box-shadow: 0 0 0 3px rgba(217, 149, 0, .12); }
.admin-account { gap: 9px; }
.account-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--brand-deep);
  background: var(--brand-wash);
  font-size: 13px;
  font-weight: 750;
}
.admin-account > span:nth-child(2) { gap: 0; }
.admin-account small { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-account .secondary { min-height: 34px; padding: 0 12px; font-size: 12px; }
.content { max-width: 1760px; padding: 30px 36px 64px; }
.page-heading { margin-bottom: 0; font-size: clamp(24px, 2.2vw, 30px); letter-spacing: -.03em; }
.page-subtitle { max-width: 1040px; margin: 7px 0 24px; color: var(--ink-500); font-size: 13px; }

.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0 24px; }
.metric,
.panel {
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .035);
}
.metric { min-height: 128px; padding: 20px; }
.metric::before { height: 2px; }
.metric:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(16, 24, 40, .07); }
.metric-label { color: var(--ink-500); font-size: 12px; font-weight: 650; }
.metric-value { margin-top: 12px; color: var(--ink-900); font-size: 28px; line-height: 1.1; }
.metric-note { margin-top: 10px; color: var(--ink-500); font-size: 11px; font-weight: 500; }
.metric:nth-child(n+5) { min-height: 112px; background: #fbfcfd; }
.metric:nth-child(n+5) .metric-value { font-size: 24px; }
.panel-header { min-height: 60px; padding: 14px 20px; }
.panel-title { font-size: 15px; }
.panel > p:not(.page-subtitle) { margin: 0; padding: 0 20px; color: var(--ink-500); font-size: 13px; line-height: 1.65; }
.panel-list { gap: 12px; margin-top: 16px; }

.primary,
.secondary,
.danger,
.ghost { min-height: 38px; border-radius: 8px; font-size: 12px; font-weight: 650; }
.primary { box-shadow: 0 3px 8px rgba(233, 104, 36, .16); }
.primary:hover { transform: translateY(-1px); }
.secondary { color: var(--ink-700); }
.danger { color: #b42318; border-color: #f2c6c2; background: #fffafa; }
.ghost { color: var(--ink-500); }
.muted { color: var(--ink-500); }

input, textarea, select { min-height: 40px; border-color: #cfd5dd; border-radius: 8px; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #c5cad3 transparent;
}
.table-scroll:focus-visible { outline: 3px solid var(--ring); outline-offset: -3px; }
table { min-width: 760px; }
th, td { padding: 14px 20px; }
th { position: sticky; top: 0; z-index: 1; color: var(--ink-500); background: #f8fafc; }
td { color: var(--ink-700); }
td:first-child { color: var(--ink-900); }
tbody tr { transition: background-color .16s ease; }
tbody tr:hover { background: #fff8f3; }
.table-media { width: 40px; height: 40px; flex-basis: 40px; }
.status { padding: 4px 9px; border-radius: 6px; font-size: 11px; }
.status::before { width: 5px; height: 5px; }
.empty { min-height: 156px; padding: 46px 24px; color: var(--ink-500); }
.empty::before { width: 30px; height: 30px; line-height: 27px; }
.drawer { margin: 16px 20px 20px; border-radius: 10px; }

.login { background: radial-gradient(circle at 15% 15%, #fff0e4 0, transparent 34%), radial-gradient(circle at 90% 88%, #e8f0ff 0, transparent 32%), #f4f6f8; }
.login-card { width: min(460px, 100%); padding: 38px; border-radius: 18px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; color: var(--ink-900); }
.login-brand .brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 15px; }
.login-brand > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.login-brand strong { font-size: 15px; }
.login-brand small { color: var(--ink-500); font-size: 11px; }
.login-title { margin-bottom: 9px; font-size: 26px; }

.support-workbench,
.aftersale-workbench,
.review-workbench { border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.support-queue, .aftersale-row, .review-row { border-radius: 9px; }
.support-thread { padding: 22px; }
.support-thread-head { padding-bottom: 16px; }
.support-messages { padding: 18px 4px; }
.support-message { border-radius: 10px; }
.support-thread textarea { min-height: 88px; }
.governance-overlay { background: rgba(15, 23, 42, .58); }
.governance-modal { border-radius: var(--radius-lg); }
.governance-modal-body label { display: block; }

@media (max-width: 1280px) {
  .topbar { padding: 0 26px; }
  .content { padding-right: 26px; padding-left: 26px; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .data-state { display: none; }
}

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; max-height: none; padding: 14px; }
  .sidebar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
  .brand { margin-bottom: 11px; }
  .nav-section { min-width: 0; }
  .topbar { position: relative; height: auto; min-height: 72px; padding: 14px 22px; }
  .content { padding: 24px 22px 48px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support-workbench { grid-template-columns: 260px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .sidebar nav { grid-template-columns: 1fr; }
  .nav-section:not([open]) .nav-items { display: none; }
  .topbar { align-items: flex-start; gap: 12px; padding: 14px 16px; }
  .topbar-actions { align-items: flex-end; gap: 10px; }
  .admin-account > span:nth-child(2) { display: none; }
  .content { padding: 20px 16px 36px; }
  .page-heading { font-size: 24px; }
  .metrics { grid-template-columns: 1fr; gap: 10px; }
  .metric, .metric:nth-child(n+5) { min-height: 112px; }
  .metric-value, .metric:nth-child(n+5) .metric-value { font-size: 26px; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .panel-header > :last-child { align-self: stretch; }
  .support-workbench, .aftersale-workbench, .review-workbench { grid-template-columns: 1fr; }
  .support-queues, .aftersale-workbench > aside, .review-workbench > aside { max-height: 300px; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .support-thread { min-height: 520px; padding: 18px; }
  .exception-toolbar { align-items: stretch; flex-direction: column; }
  .exception-search input { width: 100%; }
  .login { padding: 16px; }
  .login-card { padding: 28px 22px; }
  .governance-modal-actions { flex-wrap: wrap; }
  .governance-modal-actions .primary, .governance-modal-actions .secondary { flex: 1; }
}

/* 主体运营工作区：高密度、可扫描、操作语义清晰 */
.entity-page { min-width: 0; }
.entity-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.entity-kicker { margin-bottom: 8px; color: #8a94a6; font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.entity-page .page-subtitle { max-width: 760px; margin-bottom: 0; }
.entity-header-actions { display: flex; align-items: center; gap: 12px; padding-top: 7px; }
.entity-sync { display: inline-flex; align-items: center; gap: 7px; color: #667085; font-size: 12px; white-space: nowrap; }
.entity-sync::before { width: 7px; height: 7px; border-radius: 50%; background: #16a36b; box-shadow: 0 0 0 3px rgba(22, 163, 107, .12); content: ""; }
.entity-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.entity-stat { min-height: 118px; padding: 17px 18px; border: 1px solid #e6eaf0; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .025); }
.entity-stat span, .entity-stat small { display: block; color: #7b8494; font-size: 12px; }
.entity-stat strong { display: block; margin: 10px 0 6px; color: #172033; font-size: 29px; font-weight: 760; letter-spacing: -.04em; }
.entity-stat small { color: #98a2b3; font-size: 11px; }
.entity-filter-bar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; padding: 13px 14px; border: 1px solid #e4e8ee; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .025); }
.entity-filter-field { display: flex; min-width: 160px; flex-direction: column; gap: 6px; }
.entity-filter-field span { color: #667085; font-size: 11px; font-weight: 700; }
.entity-filter-field input, .entity-filter-field select { width: 100%; min-height: 38px; padding: 0 11px; color: #344054; background: #fbfcfe; font-size: 12px; }
.entity-filter-search { min-width: 260px; flex: 1; }
.entity-filter-actions { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.entity-result-count { margin-left: 5px; color: #98a2b3; font-size: 11px; white-space: nowrap; }
.entity-table-panel { overflow: hidden; border: 1px solid #e4e8ee; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .025); }
.entity-table-scroll { overflow-x: auto; }
.entity-table { min-width: 930px; }
.entity-table th { padding: 12px 18px; border-bottom: 1px solid #e9edf2; color: #7b8494; background: #f8fafc; font-size: 11px; font-weight: 750; letter-spacing: .02em; }
.entity-table td { padding: 13px 18px; border-bottom: 1px solid #eef1f4; vertical-align: middle; font-size: 12px; }
.entity-table tbody tr:last-child td { border-bottom: 0; }
.entity-table tbody tr:hover { background: #fbfcfe; }
.entity-primary { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.entity-avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border: 1px solid #d8e2f0; border-radius: 9px; color: #2559a8; background: #edf4ff; font-size: 13px; font-weight: 800; }
.entity-primary strong, .entity-primary small { display: block; overflow: hidden; max-width: 215px; text-overflow: ellipsis; white-space: nowrap; }
.entity-primary strong { color: #1d2939; font-size: 13px; font-weight: 750; }
.entity-primary small, .entity-meta, .entity-updated { color: #98a2b3; font-size: 11px; }
.entity-meta { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-metric { display: block; color: #344054; font-weight: 700; }
.entity-reason { display: block; max-width: 180px; margin-top: 3px; overflow: hidden; color: #98a2b3; text-overflow: ellipsis; white-space: nowrap; }
.entity-actions { display: flex; justify-content: flex-end; min-width: 94px; }
.entity-action { display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 34px; padding: 0 12px; border: 1px solid #d7dde6; border-radius: 8px; color: #475467; background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.entity-action:hover { border-color: #aab4c2; background: #f8fafc; transform: translateY(-1px); }
.entity-action:active { transform: translateY(0); }
.entity-action.primary { border-color: #d97745; color: #fff; background: #e96824; box-shadow: 0 3px 8px rgba(233, 104, 36, .16); }
.entity-action.primary:hover { border-color: #c85a1a; background: #d95f1e; }
.entity-action.danger { border-color: #f2c6c2; color: #b42318; background: #fffafa; }
.entity-action.danger:hover { border-color: #e7a39e; background: #fff2f1; }
.entity-readonly { color: #98a2b3; font-size: 11px; }
.entity-table .status { white-space: nowrap; }
.entity-empty { display: flex; min-height: 210px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; color: #98a2b3; text-align: center; }
.entity-empty strong { color: #667085; font-size: 13px; }
.entity-empty span { font-size: 11px; }

@media (max-width: 1100px) {
  .entity-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entity-filter-bar { align-items: stretch; flex-wrap: wrap; }
  .entity-filter-search { min-width: 220px; }
}

@media (max-width: 720px) {
  .entity-page-header { flex-direction: column; gap: 12px; }
  .entity-header-actions { width: 100%; justify-content: space-between; }
  .entity-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .entity-stat { min-height: 104px; padding: 14px; }
  .entity-stat strong { font-size: 24px; }
  .entity-filter-bar { flex-direction: column; }
  .entity-filter-field, .entity-filter-search { width: 100%; min-width: 0; }
  .entity-filter-actions { justify-content: space-between; }
}

/* Final admin-console pass: consistent density, accessible controls and a
   predictable narrow-screen fallback while preserving the desktop workbench. */
:root {
  --canvas: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e9ef;
  --muted: #667085;
  --ink: #1d2939;
  --brand: #e96824;
  --brand-hover: #c9571a;
  --brand-soft: #fff4eb;
  --ring: rgba(233, 104, 36, .22);
}

body { background: var(--canvas); color: var(--ink); }
.sidebar { background: linear-gradient(180deg, #182334 0%, #0f172a 100%); }
.nav-button { min-height: 42px; }
.nav-button.active { background: rgba(233, 104, 36, .18); box-shadow: inset 3px 0 0 var(--brand); }
.topbar { border-bottom-color: var(--border); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.content { min-width: 0; }
.metric,.panel,.entity-table-panel { border: 1px solid var(--border); box-shadow: 0 4px 18px rgba(16,24,40,.035); }
.metric { min-width: 0; }
.panel-header { gap: 16px; }
.primary,.secondary,.ghost,.entity-action,.filter-button,.range-button { min-height: 40px; }
.primary,.secondary,.ghost { border-radius: 9px; }
input,textarea,select { min-height: 42px; }
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline-color: var(--ring); }
.table-scroll,.entity-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
table { min-width: 760px; }
.panel table { background: var(--surface); }
th { background: #f8fafc; }
tbody tr:hover { background: #fff8f3; }
.status { white-space: nowrap; }
.drawer,.dialog,.governance-modal { border: 1px solid var(--border); }
.governance-overlay { padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.governance-modal { max-height: min(760px, calc(100vh - 40px)); overflow: auto; }
.governance-modal-actions { position: sticky; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.entity-filter-bar { min-width: 0; }
.entity-filter-actions button { min-width: 88px; }
.entity-action { min-width: 72px; }
.support-tools,.aftersale-actions,.panel-actions { flex-wrap: wrap; }

@media (max-width: 960px) {
  body { min-width: 0; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; max-height: none; padding: 18px 16px; }
  .topbar { min-height: 72px; height: auto; padding: 14px 20px; }
  .content { padding: 24px 20px 40px; }
  .table-scroll,.entity-table-scroll { margin-right: -4px; padding-bottom: 4px; }
}

@media (max-width: 560px) {
  .content { padding-right: 14px; padding-left: 14px; }
  .page-heading { font-size: 24px; }
  .panel-header { align-items: flex-start; flex-direction: column; }
  .panel-header > :last-child { width: 100%; }
  .panel-header > :last-child button { width: 100%; }
  .login { padding: 18px; }
  .login-card { width: 100%; padding: 26px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .entity-stat-grid { grid-template-columns: 1fr 1fr; }
  .entity-filter-actions { width: 100%; }
  .entity-filter-actions button { flex: 1; }
  .governance-modal-head,.governance-modal-body,.governance-modal-actions { padding-right: 18px; padding-left: 18px; }
}

/* Fixed desktop chrome: the work area owns scrolling so navigation never
   disappears while an operator reviews a long list. */
:root {
  --admin-sidebar-width: 252px;
  --admin-sidebar-collapsed-width: 72px;
  --admin-topbar-height: 68px;
}

@media (min-width: 961px) {
  html, body { height: 100%; }
  body { overflow: hidden; }
  .shell { display: block; min-height: 100vh; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--admin-sidebar-width);
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    transition: width .22s var(--ease-standard), box-shadow .22s var(--ease-standard);
  }
  .sidebar nav {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
  }
  .main {
    width: calc(100% - var(--admin-sidebar-width));
    min-height: 100vh;
    margin-left: var(--admin-sidebar-width);
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: width .22s var(--ease-standard), margin-left .22s var(--ease-standard);
  }
  .topbar { min-height: var(--admin-topbar-height); }
  body.sidebar-collapsed .sidebar { width: var(--admin-sidebar-collapsed-width); }
  body.sidebar-collapsed .main {
    width: calc(100% - var(--admin-sidebar-collapsed-width));
    margin-left: var(--admin-sidebar-collapsed-width);
  }
}

/* Keep the desktop navigation visible even when the server retains an older
   stylesheet block earlier in the cascade. */
@media (min-width: 961px) {
  body { overflow: hidden !important; }
  .sidebar { position: fixed !important; top: 0; bottom: 0; left: 0; height: 100vh !important; }
  .main { height: 100vh; overflow-y: auto !important; }
}

/* Enterprise workbench refinement: make repeated operational surfaces
   compact, scannable and consistent across every admin route. */
.content > .panel,
.content > .panel-list > .panel,
.content > .review-workbench,
.content > .aftersale-workbench,
.content > .support-workbench { margin-bottom: 14px; }
.panel-list { gap: 10px; margin-top: 14px; }
.panel { border-radius: 10px; }
.panel > p { margin: 8px 18px 12px; color: #667085; font-size: 12px; line-height: 1.55; }
.panel-header { min-height: 54px; padding: 13px 18px; }
.panel-title { color: #1d2939; font-size: 14px; font-weight: 750; }
.panel-eyebrow { display: block; margin-bottom: 4px; color: #98a2b3; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.work-item { overflow: hidden; }
.work-item-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 18px 13px; color: #667085; font-size: 12px; }
.work-item-meta span + span { position: relative; }
.work-item-meta span + span::before { content: ""; position: absolute; left: -10px; top: 4px; width: 3px; height: 3px; border-radius: 50%; background: #c5ccd6; }
.work-item .aftersale-actions, .work-item .panel-actions { margin: 0 18px 15px; }
.form-panel .panel-header { border-bottom: 1px solid #eef1f4; }
.form-stack { display: grid; gap: 12px; padding: 15px 18px 2px; }
.form-stack label, .review-detail label { display: grid; gap: 6px; color: #667085; font-size: 11px; font-weight: 700; }
.form-stack textarea, .review-detail textarea { min-height: 112px; resize: vertical; }
.form-panel .aftersale-actions { margin: 13px 18px 17px; }
.batch-panel { margin-top: 18px; }
.schedule-form { padding: 15px 18px 18px; align-items: end; }
.schedule-form .field-label { display: grid; gap: 6px; color: #667085; font-size: 11px; font-weight: 700; }
.schedule-form .form-submit { align-self: end; }
.schedule-form input { width: 100%; }
.review-workbench, .aftersale-workbench { min-height: 360px; }
.review-workbench > aside, .aftersale-workbench > aside { background: #fbfcfe; }
.review-detail { min-width: 0; }
.review-detail > p { color: #667085; font-size: 12px; line-height: 1.6; }
.empty { min-height: 96px; padding: 28px 20px; color: #98a2b3; }
.review-workbench > .empty, .aftersale-workbench > .empty { min-height: 300px; }
.sidebar-collapsed .nav-button { position: relative; justify-content: center; width: 48px; margin-right: auto; margin-left: auto; padding: 0; color: #cbd5e1; font-size: 0; }
.sidebar-collapsed .nav-button::before { content: attr(data-nav-icon); display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: inherit; background: rgba(255,255,255,.06); font-size: 13px; font-weight: 800; }
.sidebar-collapsed .nav-button.active::before { color: #fff; background: var(--brand); box-shadow: 0 4px 12px rgba(233,104,36,.25); }
.sidebar-collapsed .nav-button:hover::after { content: attr(aria-label); position: absolute; left: 60px; z-index: 60; padding: 7px 9px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; color: #fff; background: #182334; font-size: 11px; white-space: nowrap; box-shadow: 0 8px 20px rgba(0,0,0,.18); }
.sidebar-collapsed .nav-button.active { color: transparent; }
.sidebar-collapsed .nav-button.active::after { display: none; }

@media (min-width: 961px) {
  .content { padding-top: 28px; }
  .panel-list > .panel { max-width: 1100px; }
  .form-panel, .batch-panel { max-width: 1100px; }
}

@media (max-width: 760px) {
  .work-item-meta { flex-direction: column; gap: 4px; }
  .work-item-meta span + span::before { display: none; }
  .schedule-form { grid-template-columns: 1fr; }
  .schedule-form .form-submit { margin-top: 2px; }
}

/* Make the operational surfaces read as one console instead of a collection
   of unrelated cards. */
.content { background: linear-gradient(180deg, #f7f8fa 0%, #f2f4f7 100%); }
.page-heading { line-height: 1.2; }
.page-subtitle { max-width: 880px; }
.metric, .panel, .entity-table-panel { box-shadow: 0 1px 2px rgba(16, 24, 40, .035), 0 8px 24px rgba(16, 24, 40, .025); }
.metric { background: linear-gradient(180deg, #fff 0%, #fcfdff 100%); }
.panel-header { background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%); }
.panel-header .secondary { flex: none; }
.table-scroll { scrollbar-color: #c7ced8 transparent; }
th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 #e9edf2; }
td:first-child { font-weight: 650; }
.status { letter-spacing: .01em; }

/* The support queue is a work surface, so each pane can scroll without
   pushing the reply composer below the fold. */
.support-workbench {
  height: clamp(560px, calc(100vh - 220px), 760px);
  min-height: 0;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(240px, 300px);
}
.support-queues, .support-detail { min-height: 0; overflow-y: auto; }
.support-thread { min-height: 0; }
.support-messages { overscroll-behavior: contain; scrollbar-color: #c7ced8 transparent; }
.support-thread-head strong { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 960px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .main { height: auto; margin-left: 0; overflow: visible; }
  .content { background: var(--canvas); }
  .support-workbench {
    height: auto;
    grid-template-columns: 1fr;
  }
  .support-queues, .support-detail {
    max-height: 280px;
    overflow-y: auto;
  }
  .support-detail { border-top: 1px solid var(--border); border-left: 0; }
}

/* Final layout guard: keep desktop work areas readable at wide viewport
   sizes and give every repeated surface a deliberate inner rhythm. */
@media (min-width: 961px) {
  .content {
    box-sizing: border-box;
    width: min(100%, 1440px) !important;
    max-width: 1440px !important;
    margin: 0 auto !important;
    padding: 32px 48px 64px !important;
  }
  .content > .page-heading,
  .content > .page-subtitle,
  .content > .section-heading,
  .content > .panel,
  .content > .panel-list,
  .content > .review-workbench,
  .content > .aftersale-workbench,
  .content > .support-workbench,
  .content > .entity-page,
  .content > .entity-table-panel,
  .content > .entity-filter-bar,
  .content > .boundary,
  .content > .empty { width: min(100%, 1120px); margin-right: auto; margin-left: auto; }
  .content > .panel-list { display: flex; }
  .content > .panel-list > .panel,
  .content > .panel { width: 100%; max-width: none; }
  .content > .panel + .panel { margin-top: 12px; }
  .content > .panel > .panel-header { padding-right: 24px; padding-left: 24px; }
  .content > .panel > p { margin-right: 24px; margin-left: 24px; }
  .content > .panel > .panel-actions,
  .content > .panel > .aftersale-actions { margin-right: 24px; margin-left: 24px; }
  .content > .panel > .form-grid,
  .content > .panel > .form-stack { padding-right: 24px; padding-left: 24px; }
  .content > .review-workbench,
  .content > .aftersale-workbench,
  .content > .support-workbench { width: min(100%, 1280px); }
  .content > .review-workbench + .panel,
  .content > .aftersale-workbench + .panel { margin-top: 16px; }
}

@media (max-width: 960px) {
  .content { padding: 24px 20px 48px !important; }
  .content > .panel,
  .content > .panel-list,
  .content > .review-workbench,
  .content > .aftersale-workbench,
  .content > .support-workbench { width: 100%; }
}

.access-denied-page {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px 16px;
  width: min(100%, 720px);
  margin: 72px auto 0;
  padding: 28px 32px;
  border: 1px solid #e5e9ef;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .05);
}
.access-denied-icon {
  display: grid;
  grid-row: span 2;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #f3d0b9;
  border-radius: 12px;
  color: #c9571a;
  background: #fff4eb;
  font-size: 20px;
  font-weight: 800;
}
.access-denied-page .page-heading { margin: 0; font-size: 22px; }
.access-denied-page .page-subtitle { margin: 7px 0 0; line-height: 1.7; }
.access-denied-meta { grid-column: 2; display: flex; align-items: center; gap: 9px; margin-top: 10px; padding-top: 13px; border-top: 1px solid #eef1f4; color: #98a2b3; font-size: 11px; }
.access-denied-meta strong { padding: 4px 8px; border-radius: 5px; color: #667085; background: #f4f6f8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 600; }
.support-workbench + * { margin-top: 14px; }
.support-workbench { min-height: 520px; }
.support-workbench .support-title { min-height: 52px; }
.support-workbench .support-detail { background: #fbfcfe; }
.support-workbench .support-tools { gap: 8px; padding-top: 12px; border-top: 1px solid #eef1f4; }
.support-workbench .support-tools button { min-height: 34px; }
.support-workbench textarea { min-height: 96px; margin-top: 12px; }
.support-metrics { display: flex; align-items: center; gap: 22px; width: min(100%, 1280px); margin: 0 auto 14px; padding: 12px 18px; border: 1px solid #e5e9ef; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.support-metrics > div { display: flex; align-items: baseline; gap: 7px; }
.support-metrics > div span { color: #98a2b3; font-size: 11px; }
.support-metrics > div strong { color: #1d2939; font-size: 16px; }
.support-metrics > .status { margin-left: auto; }
.support-empty-state { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px 16px; width: min(100%, 900px); margin: 52px auto 0; padding: 34px; border: 1px solid #e5e9ef; border-radius: 12px; background: #fff; box-shadow: 0 10px 30px rgba(16,24,40,.045); }
.support-empty-icon { display: grid; grid-row: span 2; width: 44px; height: 44px; place-items: center; border: 1px solid #dbe4ef; border-radius: 12px; color: #667085; background: #f5f8fc; font-size: 24px; }
.support-empty-state h1 { margin: 0; color: #1d2939; font-size: 20px; }
.support-empty-state p { margin: 7px 0 0; color: #667085; font-size: 13px; line-height: 1.7; }
.support-empty-state .support-metrics { grid-column: 2; width: auto; margin: 14px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid #eef1f4; border-radius: 0; box-shadow: none; }
.ai-metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: min(100%, 1120px); margin: 22px auto 16px; }
.ai-stat { min-height: 108px; padding: 18px 20px; border: 1px solid #e5e9ef; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.ai-stat span, .ai-stat small { display: block; color: #667085; font-size: 11px; }
.ai-stat strong { display: block; margin: 10px 0 6px; color: #1d2939; font-size: 28px; line-height: 1; }
.ai-stat strong small { display: inline; color: #667085; font-size: 12px; font-weight: 600; }
.ai-section { width: min(100%, 1120px) !important; margin: 0 auto 14px !important; }
.ai-section .panel-caption { color: #98a2b3; font-size: 11px; }
.ai-section .review-timeline { margin: 0; padding: 4px 24px 14px; }
.ai-section .table-scroll { padding: 0 18px 18px; }
.ai-section table { min-width: 720px; }
.pricing-rule { overflow: hidden; }
.pricing-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 16px 24px 4px; }
.pricing-fields label { display: grid; gap: 6px; color: #667085; font-size: 11px; font-weight: 700; }
.pricing-fields input { min-height: 40px; }
.pricing-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 14px 24px 16px; padding-top: 13px; border-top: 1px solid #eef1f4; }
.pricing-actions span { color: #98a2b3; font-size: 11px; }

@media (max-width: 720px) {
  .access-denied-page { grid-template-columns: 40px minmax(0, 1fr); margin-top: 32px; padding: 22px 20px; }
  .access-denied-icon { width: 36px; height: 36px; }
  .access-denied-meta { grid-column: 2; flex-wrap: wrap; }
  .support-metrics { flex-wrap: wrap; gap: 10px 16px; }
  .support-metrics > .status { margin-left: 0; }
  .support-empty-state { grid-template-columns: 40px minmax(0, 1fr); margin-top: 30px; padding: 24px 20px; }
  .support-empty-icon { width: 36px; height: 36px; }
  .support-empty-state .support-metrics { grid-column: 2; }
  .ai-metrics-grid { grid-template-columns: 1fr; }
  .pricing-fields { grid-template-columns: 1fr 1fr; padding-right: 18px; padding-left: 18px; }
  .pricing-actions { align-items: stretch; flex-direction: column; margin-right: 18px; margin-left: 18px; }
}

/* Shared page rhythm for legacy workbenches that render several sibling
   panels directly under .content. */
@media (min-width: 961px) {
  .content > .page-heading { margin-top: 0; margin-bottom: 8px; }
  .content > .page-subtitle { margin-bottom: 20px; }
  .content > .page-heading ~ .panel,
  .content > .page-heading ~ .panel-list,
  .content > .page-heading ~ .review-workbench,
  .content > .page-heading ~ .aftersale-workbench,
  .content > .page-heading ~ .support-workbench,
  .content > .page-heading ~ .entity-table-panel,
  .content > .page-heading ~ .boundary { margin-left: auto; margin-right: auto; }
  .content > .page-heading ~ .panel { width: min(100%, 1120px); }
  .content > .page-heading ~ .panel-list { width: min(100%, 1120px); }
  .content > .page-heading ~ .panel-list > .panel { width: 100%; }
  .content > .page-heading ~ .panel + .panel { margin-top: 12px; }
  .content > .page-heading ~ .panel > .panel-header { padding: 15px 24px; }
  .content > .page-heading ~ .panel > p { margin: 10px 24px 14px; }
  .content > .page-heading ~ .panel > .aftersale-actions,
  .content > .page-heading ~ .panel > .panel-actions { margin: 0 24px 16px; }
  .content > .page-heading ~ .panel > .form-grid { padding: 16px 24px 18px; }
  .content > .page-heading ~ .panel > table { margin: 0 24px 18px; width: calc(100% - 48px); }
  .content > .page-heading ~ .section-heading { width: min(100%, 1120px); margin-right: auto; margin-left: auto; }
  .content > .page-heading ~ .review-workbench,
  .content > .page-heading ~ .aftersale-workbench { width: min(100%, 1280px); margin-top: 16px; }
  .content > .page-heading ~ .empty { width: min(100%, 1120px); margin: 16px auto; }
  .content > .page-heading ~ .primary,
  .content > .page-heading ~ .secondary,
  .content > .page-heading ~ .danger { margin-bottom: 16px; }
}

.content > .boundary { max-width: 1120px; margin-top: 12px; margin-bottom: 16px; padding: 12px 16px; border-radius: 8px; }
.content > .inline-error { max-width: 1120px; margin: 12px auto; }
.content > h2:not(.section-heading) { width: min(100%, 1120px); margin: 28px auto 12px; color: #1d2939; font-size: 16px; }
.content > .panel-list + .panel { margin-top: 16px; }
.content > .panel-list > .empty { width: 100%; }
.content > .panel-list > .panel .panel-actions,
.content > .panel-list > .panel .aftersale-actions { min-height: 34px; }
.content > .panel-list > .panel .panel-actions button,
.content > .panel-list > .panel .aftersale-actions button { flex: 0 0 auto; }

@media (max-width: 960px) {
  .content > h2:not(.section-heading) { width: 100%; }
  .content > .page-heading ~ .panel,
  .content > .page-heading ~ .panel-list { width: 100%; }
  .content > .page-heading ~ .panel > .panel-header { padding: 14px 18px; }
  .content > .page-heading ~ .panel > p { margin-right: 18px; margin-left: 18px; }
  .content > .page-heading ~ .panel > .aftersale-actions,
  .content > .page-heading ~ .panel > .panel-actions { margin-right: 18px; margin-left: 18px; }
}

@media (min-width: 961px) and (max-width: 1280px) {
  .support-workbench { grid-template-columns: 260px minmax(0, 1fr); }
  .support-detail { display: none; }
}

/* Product category governance */
.category-page { width: min(100%, 1280px); margin: 0 auto; }
.category-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.category-kicker, .category-modal-kicker { margin-bottom: 6px; color: #7b8494; font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.category-page-header .page-heading { margin: 0; }
.category-page-header .page-subtitle { max-width: 720px; margin: 7px 0 0; }
.category-header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.category-header-actions .entity-sync { max-width: 300px; text-align: right; }
.category-notice, .category-error { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #cce9d8; border-radius: 10px; color: #176b3a; background: #f2fbf5; font-size: 13px; line-height: 1.5; }
.category-notice > span { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; border-radius: 50%; color: #fff; background: #1f9d58; font-size: 12px; font-weight: 800; }
.category-error { border-color: #f0c9c3; color: #a23b2f; background: #fff7f5; }
.category-error strong { color: #8d2c21; }
.category-toolbar { display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(200px, 1fr) 150px auto; align-items: end; gap: 12px; margin-bottom: 14px; padding: 14px; border: 1px solid #e4e8ee; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .025); }
.category-filter-field { display: grid; gap: 7px; min-width: 0; color: #667085; font-size: 11px; font-weight: 750; }
.category-filter-field input, .category-filter-field select { box-sizing: border-box; width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #d7dde6; border-radius: 8px; color: #1d2939; background: #fff; font: inherit; font-size: 13px; outline: none; }
.category-filter-field input:focus, .category-filter-field select:focus, .category-form input:focus, .category-form select:focus { border-color: #1f6feb; box-shadow: 0 0 0 3px rgba(31, 111, 235, .12); }
.category-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.category-toolbar-actions button { white-space: nowrap; }
.category-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.category-summary > div { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; padding: 15px 17px; border: 1px solid #e4e8ee; border-radius: 10px; background: #fff; }
.category-summary span, .category-summary small { color: #7b8494; font-size: 11px; }
.category-summary strong { grid-row: span 2; align-self: center; color: #1d2939; font-size: 24px; line-height: 1; }
.category-summary small { grid-column: 1; }
.category-table-panel { overflow: hidden; border: 1px solid #e4e8ee; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .025); }
.category-table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.category-table { width: 100%; min-width: 940px; border-collapse: collapse; }
.category-table th { padding: 12px 17px; border-bottom: 1px solid #e9edf2; color: #7b8494; background: #f8fafc; font-size: 11px; font-weight: 750; letter-spacing: .02em; text-align: left; white-space: nowrap; }
.category-table td { padding: 13px 17px; border-bottom: 1px solid #eef1f4; color: #475467; font-size: 12px; vertical-align: middle; }
.category-table tbody tr:last-child td { border-bottom: 0; }
.category-table tbody tr:hover { background: #fbfcfe; }
.category-name-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.category-name-cell > span:last-child { display: grid; gap: 4px; }
.category-name-cell strong, .category-table td > strong { color: #1d2939; font-size: 13px; }
.category-name-cell small, .category-subline { color: #98a2b3; font-size: 11px; }
.category-icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border: 1px solid #dbe7f8; border-radius: 9px; color: #2164b3; background: #eff6ff; font-size: 19px; font-weight: 700; }
.category-subline { display: block; margin-top: 4px; }
.category-count { color: #1d2939; font-weight: 750; }
.category-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.category-actions button { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.category-empty { display: grid; justify-items: center; gap: 7px; padding: 64px 20px; color: #98a2b3; text-align: center; }
.category-empty strong { color: #475467; font-size: 14px; }
.category-empty span:not(.category-empty-icon) { max-width: 420px; line-height: 1.6; }
.category-empty-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #dbe4ef; border-radius: 12px; color: #667085; background: #f5f8fc; font-size: 23px; }
.category-empty button { margin-top: 7px; }
.category-form { width: min(520px, 100%); }
.category-form .governance-modal-head { align-items: flex-start; }
.category-form .governance-modal-head > div { display: grid; gap: 2px; }
.category-form .governance-modal-head strong { font-size: 17px; }
.category-form-intro { margin-bottom: 18px; color: #667085; font-size: 12px; line-height: 1.6; }
.category-form label { display: grid; gap: 7px; margin-bottom: 15px; color: #475467; font-size: 13px; font-weight: 700; }
.category-form input, .category-form select { box-sizing: border-box; width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d7dde6; border-radius: 8px; color: #1d2939; background: #fff; font: inherit; font-size: 13px; }
.category-form select:disabled { color: #667085; background: #f8fafc; cursor: not-allowed; }
.category-field-hint { color: #98a2b3; font-size: 11px; font-weight: 500; }
.category-form-error { min-height: 18px; margin-top: 2px; color: #b42318; font-size: 12px; line-height: 1.5; }

@media (max-width: 960px) {
  .category-page-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .category-header-actions { justify-content: flex-start; }
  .category-header-actions .entity-sync { max-width: none; text-align: left; }
  .category-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-filter-search { grid-column: 1 / -1; }
  .category-toolbar-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 560px) {
  .category-summary { grid-template-columns: 1fr; }
  .category-toolbar { grid-template-columns: 1fr; }
  .category-filter-search, .category-toolbar-actions { grid-column: auto; }
  .category-toolbar-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category-toolbar-actions button { width: 100%; }
  .category-form .governance-modal-actions { flex-direction: column-reverse; }
  .category-form .governance-modal-actions button { width: 100%; }
}

/* Customer support desk: conversation list and a focused message workspace. */
.content > .support-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(100%, 1440px); box-sizing: border-box; margin: 0 auto 20px; }
.support-title h1 { margin: 0; color: #17212f; font-size: 26px; line-height: 1.3; }
.support-title p { margin: 6px 0 0; color: #667085; font-size: 13px; }
.support-top-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.support-top-actions button { min-height: 40px; }
.support-presence-label { display: flex; align-items: center; gap: 10px; color: #667085; font-size: 12px; }
.support-presence-label select { min-height: 40px; padding: 6px 10px; border: 1px solid #d8e0e9; border-radius: 8px; color: #344054; background: #fff; font: inherit; }
.support-workbench { display: grid; grid-template-columns: minmax(290px, 340px) minmax(0, 1fr); width: min(100%, 1440px); height: clamp(620px, calc(100dvh - 235px), 960px); min-height: 620px; box-sizing: border-box; margin: 0 auto 20px; overflow: hidden; border: 1px solid #e1e7ef; border-radius: 12px; background: #fff; box-shadow: 0 3px 16px #182a4308; }
.support-queues { display: flex; flex-direction: column; min-width: 0; min-height: 0; max-height: none; padding: 0; overflow: hidden; border: 0; border-right: 1px solid #e6ebf1; background: #fff; }
.support-queue-heading { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; min-height: 60px; padding: 0 20px; color: #344054; }
.support-queue-heading strong { font-size: 15px; }
.support-queue-heading > span { min-width: 22px; padding: 2px 6px; border-radius: 5px; color: #667085; background: #f1f4f8; font-size: 12px; text-align: center; }
.support-queue-tools { display: grid; gap: 14px; padding: 0 16px 12px; border-bottom: 1px solid #e9edf3; }
.support-search { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 40px; padding: 0 10px; border: 1px solid #e0e6ee; border-radius: 8px; color: #667085; background: #f8fafc; }
.support-search svg { flex: 0 0 auto; }
.support-search input { width: 100%; min-width: 0; height: 38px; padding: 0; border: 0; outline: 0; color: #344054; background: transparent; font: inherit; font-size: 13px; }
.support-search:focus-within { border-color: #2770c7; box-shadow: 0 0 0 3px #2770c714; }
.support-filter-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.support-filter-tabs button { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 38px; padding: 4px 2px; border: 0; border-radius: 6px; color: #667085; background: transparent; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.support-filter-tabs button[aria-pressed="true"] { color: #245b91; background: #edf5ff; font-weight: 650; }
.support-filter-tabs b { font-size: 11px; font-weight: 500; }
.support-queue-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #c8d0da transparent; }
.support-queue { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: start; gap: 11px; width: 100%; min-height: 104px; box-sizing: border-box; margin: 0; padding: 16px; border: 0; border-bottom: 1px solid #f0f2f6; border-radius: 0; color: #344054; background: #fff; text-align: left; cursor: pointer; transition: background-color .15s; box-shadow: none; }
.support-queue:hover { background: #f7f9fc; box-shadow: none; }
.support-queue.selected { background: #edf5ff; box-shadow: inset 3px 0 #2770c7; }
.support-queue-avatar, .support-person-avatar { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid #e0e6ee; border-radius: 12px; color: #475467; background: #f1f4f8; font-size: 15px; font-weight: 650; }
.support-queue-main { display: grid; gap: 8px; min-width: 0; }
.support-queue-person { display: flex; align-items: center; gap: 6px; min-width: 0; }
.support-queue-person strong { min-width: 0; overflow: hidden; color: #1d2939; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.support-queue-person time { flex: 0 0 auto; margin-left: auto; color: #8590a0; font-size: 10px; }
.support-actor-badge { display: inline-flex; flex: 0 0 auto; align-items: center; padding: 2px 5px; border: 1px solid #e0e6ee; border-radius: 4px; color: #475467; background: #f5f7fa; font-size: 10px; font-weight: 500; line-height: 1.4; }
.support-actor-customer { border-color: #d7e6f6; color: #315d89; background: #eef6ff; }
.support-actor-merchant { border-color: #cfe8dd; color: #27674f; background: #edf8f2; }
.support-actor-rider { border-color: #f0dfc1; color: #805b22; background: #fff8e9; }
.support-queue-preview { overflow: hidden; color: #667085; font-size: 13px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.support-queue-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 18px; color: #8590a0; font-size: 11px; }
.support-queue-foot b { display: inline-grid; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; place-items: center; border-radius: 10px; color: #fff; background: #cf482a; font-size: 10px; font-weight: 600; }
.support-workbench [hidden] { display: none !important; }
.support-queue-empty, .support-message-empty { display: grid; min-height: 100px; padding: 24px; place-items: center; color: #667085; font-size: 13px; text-align: center; }
.support-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0; background: #fff; }
.support-thread-head { display: flex; align-items: center; justify-content: flex-start; flex: 0 0 auto; gap: 12px; min-height: 84px; box-sizing: border-box; padding: 16px 24px; border-bottom: 1px solid #e9edf3; }
.support-thread-head > button { flex: 0 0 auto; min-height: 36px; padding: 7px 12px; font-size: 12px; }
.support-person-summary { flex: 1; min-width: 0; }
.support-person-name { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.support-person-name h2 { max-width: 100%; margin: 0; overflow-wrap: anywhere; color: #1d2939; font-size: 17px; line-height: 1.4; }
.support-thread-head .support-actor-badge { color: #475467; font-size: 11px; }
.support-thread-head .support-thread-state { color: #667085; font-size: 11px; }
.support-person-summary p { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 5px 0 0; }
.support-person-summary p span { color: #667085; font-size: 12px; overflow-wrap: anywhere; }
.support-session-toolbar { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; padding: 4px 24px; border-bottom: 1px solid #edf0f4; color: #667085; background: #fafbfd; font-size: 12px; }
.support-session-toolbar > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-session-toolbar > div { display: flex; align-items: center; flex: 0 0 auto; gap: 6px; }
.support-session-toolbar .is-error { max-width: 230px; color: #b42318; overflow-wrap: anywhere; }
.support-read-retry { padding: 3px 6px; border: 0; border-radius: 4px; color: #245b91; background: #eaf2fc; font: inherit; cursor: pointer; }
.support-context { flex: 0 0 auto; margin: 0; border: 0; border-bottom: 1px solid #e9edf3; background: #fff; }
.support-context > summary { display: list-item; min-height: 38px; box-sizing: border-box; padding: 9px 24px; color: #475467; font-size: 12px; cursor: pointer; list-style-position: inside; }
.support-context > summary span { margin-left: 12px; color: #8590a0; font-size: 11px; }
.support-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .7fr); align-items: start; gap: 20px; min-width: 0; max-height: 220px; padding: 6px 24px 18px; overflow-y: auto; border: 0; background: #fff; }
.support-detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; min-width: 0; margin: 0; }
.support-detail-list > div { display: grid; gap: 4px; min-width: 0; }
.support-detail-list dt { color: #8590a0; font-size: 11px; }
.support-detail-list dd { margin: 0; overflow-wrap: anywhere; color: #344054; font-size: 12px; }
.support-assign-block { display: grid; gap: 8px; min-width: 0; padding: 12px; border: 1px solid #e6ebf1; border-radius: 8px; background: #fafbfd; }
.support-assign-block label { color: #667085; font-size: 12px; }
.support-assign-block > div { display: flex; gap: 8px; }
.support-assign-block select { width: 100%; min-width: 0; min-height: 36px; padding: 6px; border: 1px solid #d8e0e9; border-radius: 6px; background: #fff; color: #344054; font-size: 12px; }
.support-assign-block button { flex: 0 0 auto; min-height: 36px; padding: 6px 10px; font-size: 12px; }
.support-messages { display: flex; flex: 1 1 auto; flex-direction: column; gap: 18px; min-height: 0; padding: 24px; overflow: auto; background: #f6f8fb; overscroll-behavior: contain; scrollbar-color: #c8d0da transparent; }
.support-message { display: grid; gap: 8px; align-self: flex-start; width: fit-content; max-width: min(80%, 720px); box-sizing: border-box; margin: 0; padding: 12px 16px; border: 1px solid #e3e8ef; border-radius: 4px 12px 12px; color: #263445; background: #fff; box-shadow: 0 1px 2px #182a4305; }
.support-message.agent { align-self: flex-end; margin: 0; border-color: #d5e5f9; border-radius: 12px 4px 12px 12px; color: #263445; background: #edf5ff; }
.support-message.assistant { border-color: #d9e9df; background: #f2f8f4; }
.support-message.system { align-self: center; max-width: 95%; padding: 4px 12px; border: 0; border-radius: 4px; color: #667085; background: transparent; box-shadow: none; text-align: center; }
.support-message > div { overflow-wrap: anywhere; font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
.support-message > small { display: block; margin: 0; color: #7a8698; opacity: 1; font-size: 11px; line-height: 1.4; }
.support-reply { flex: 0 0 auto; padding: 14px 24px 18px; border-top: 1px solid #e5eaf1; background: #fff; }
.support-compose-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.support-compose-heading button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.support-reply-label { margin: 0; color: #475467; font-size: 12px; font-weight: 600; }
.support-reply textarea { display: block; width: 100%; min-height: 88px; max-height: 180px; box-sizing: border-box; resize: vertical; margin: 0; padding: 12px; border: 1px solid #d8e0e9; border-radius: 8px; color: #1d2939; background: #fff; font: inherit; font-size: 14px; line-height: 1.6; }
.support-reply textarea:focus { border-color: #2770c7; outline: 0; box-shadow: 0 0 0 3px #2770c714; }
.support-reply textarea:disabled { color: #667085; background: #f8fafc; }
.support-first-reply-note, .support-permission-note { margin: 0 0 8px; color: #667085; font-size: 12px; }
.support-permission-note { margin-top: 8px; color: #9b3025; }
.support-reply-error, .support-inline-error { margin: 8px 0 0; padding: 8px 10px; border: 1px solid #f0c9c3; border-radius: 6px; color: #9b3025; background: #fff6f4; font-size: 12px; }
.support-reply-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.support-reply-footer small { color: #8590a0; font-size: 12px; }
.support-thread .support-reply-footer .primary { width: auto; min-width: 112px; min-height: 40px; margin: 0; }
.support-suggestion-loading { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 14px 16px; border: 1px solid #d9e4f2; border-radius: 12px; color: #475467; background: #f7faff; font-size: 13px; }
.support-suggestion-loading::before { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #3478c7; content: ""; animation: support-suggestion-pulse 1.2s ease-in-out infinite; }
@keyframes support-suggestion-pulse { 50% { opacity: .35; transform: scale(.8); } }
.support-suggestion { display: grid; gap: 14px; margin: 0 0 14px; padding: 16px; border: 1px solid #d9e3ee; border-radius: 14px; color: #344054; background: #f8fafc; font-size: 13px; }
.support-suggestion--ready { border-color: #c8e3d2; background: #f5faf7; }
.support-suggestion--review { border-color: #ead6b0; background: #fffaf1; }
.support-suggestion-header, .support-suggestion-header > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.support-suggestion-header { justify-content: space-between; }
.support-suggestion-header strong, .support-suggestion-draft > div strong, .support-suggestion-actions > strong { color: #25364a; font-size: 13px; font-weight: 700; }
.support-suggestion-state { padding: 4px 8px; border-radius: 999px; color: #52657c; background: #eaf0f6; font-size: 11px; line-height: 1.3; }
.support-suggestion--ready .support-suggestion-state { color: #1e6849; background: #e4f3e9; }
.support-suggestion--review .support-suggestion-state { color: #895a0a; background: #fbefd6; }
.support-suggestion-dismiss { min-height: 30px; padding: 4px 8px; border: 0; border-radius: 6px; color: #667085; background: transparent; font: inherit; cursor: pointer; }
.support-suggestion-dismiss:hover { color: #344054; background: #eaf0f6; }
.support-suggestion-draft { display: grid; gap: 8px; padding: 14px; border: 1px solid #e1e8ef; border-radius: 10px; background: #fff; }
.support-suggestion-draft > div { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.support-suggestion-draft > div span { color: #667085; font-size: 11px; }
.support-suggestion-draft p, .support-suggestion-reason, .support-suggestion-evidence p { margin: 0; overflow-wrap: anywhere; color: #344054; line-height: 1.65; white-space: pre-wrap; }
.support-suggestion-draft .secondary { justify-self: start; min-height: 34px; margin-top: 2px; }
.support-suggestion-reason { padding: 10px 12px; border-radius: 8px; color: #795516; background: #fff3da; font-size: 12px; }
.support-suggestion-actions { display: grid; gap: 8px; }
.support-suggestion-actions ul { display: grid; gap: 7px; margin: 0; padding-left: 20px; color: #475467; line-height: 1.6; }
.support-suggestion-actions li::marker { color: #4b80b8; }
.support-suggestion-sources { padding-top: 12px; border-top: 1px solid #e3e9ef; }
.support-suggestion-sources > summary { color: #475467; font-size: 12px; font-weight: 600; cursor: pointer; }
.support-suggestion-sources > div { display: grid; gap: 8px; margin-top: 10px; }
.support-suggestion-evidence { display: grid; gap: 4px; padding: 9px 11px; border: 1px solid #e5eaf0; border-radius: 8px; background: #fff; }
.support-suggestion-evidence strong { color: #475467; font-size: 11px; }
.support-suggestion-evidence p { color: #667085; font-size: 11px; }
.support-suggestion-no-source { margin: 0; color: #667085; font-size: 12px; }
.support-suggestion-footnote { color: #7a8698; font-size: 11px; line-height: 1.5; }
.support-knowledge-panel { width: min(100%, 1440px); box-sizing: border-box; margin: 0 auto 14px; border: 1px solid #e1e8f0; border-radius: 12px; background: #fff; }
.support-knowledge-panel > summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; padding: 13px 18px; color: #344054; cursor: pointer; list-style-position: inside; }
.support-knowledge-panel > summary span { color: #667085; font-size: 12px; }
.support-knowledge-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr); gap: 18px; padding: 0 18px 18px; border-top: 1px solid #edf1f5; }
.support-knowledge-list { display: grid; align-content: start; gap: 8px; min-width: 0; margin: 16px 0 0; padding: 0; list-style: none; }
.support-knowledge-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid #edf1f5; border-radius: 8px; background: #fafbfd; }
.support-knowledge-list li strong { min-width: 0; overflow: hidden; color: #344054; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.support-knowledge-list li span { flex: 0 0 auto; color: #7a8698; font-size: 11px; }
.support-knowledge-empty, .support-knowledge-readonly { color: #7a8698; font-size: 12px; line-height: 1.6; }
.support-knowledge-editor { display: grid; gap: 8px; margin-top: 16px; padding: 14px; border: 1px solid #e1e8ef; border-radius: 10px; background: #f8fafc; }
.support-knowledge-editor > div { margin-bottom: 3px; }
.support-knowledge-editor > div strong { color: #344054; font-size: 13px; }
.support-knowledge-editor > div p { margin: 5px 0 0; color: #667085; font-size: 11px; line-height: 1.5; }
.support-knowledge-editor label { color: #667085; font-size: 11px; }
.support-knowledge-editor input, .support-knowledge-editor textarea { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid #d8e0e9; border-radius: 7px; color: #1d2939; background: #fff; font: inherit; font-size: 12px; line-height: 1.5; }
.support-knowledge-editor textarea { resize: vertical; }
.support-knowledge-editor input:focus, .support-knowledge-editor textarea:focus { border-color: #2770c7; outline: 0; box-shadow: 0 0 0 3px #2770c714; }
.support-knowledge-editor button { justify-self: start; min-height: 34px; }
.support-knowledge-error { margin: 12px 0 0; color: #b42318; font-size: 12px; }
.support-knowledge-notice { margin: 0; color: #1e6849; font-size: 12px; }
@container admin-content (max-width: 760px) {
  .support-knowledge-content { grid-template-columns: minmax(0, 1fr); }
}
.support-empty-state { display: block; width: min(100%, 1440px); box-sizing: border-box; margin: 0 auto; padding: 60px 24px; border: 1px solid #e3e8ef; border-radius: 12px; background: #fff; color: #667085; text-align: center; }
.support-empty-state h2 { color: #344054; font-size: 18px; }
.support-workbench button:disabled { opacity: .55; cursor: not-allowed; }
.support-workbench :focus-visible, .support-top-actions :focus-visible { outline: 3px solid #2770c766; outline-offset: 2px; }
@container admin-content (max-width: 1080px) {
  .support-workbench { grid-template-columns: minmax(230px, 300px) minmax(0, 1fr); }
  .support-queue-person time { display: none; }
  .support-thread-head, .support-reply { padding-right: 18px; padding-left: 18px; }
  .support-details { grid-template-columns: minmax(0, 1fr); }
}
@container admin-content (max-width: 760px) {
  .support-workbench { height: auto; min-height: 0; grid-template-columns: minmax(0, 1fr); }
  .support-queues { min-height: 0; max-height: 330px; border-right: 0; border-bottom: 1px solid #e6ebf1; }
  .support-queue-heading { min-height: 48px; }
  .support-queue-list { max-height: 175px; }
  .support-thread { height: 720px; min-height: 0; }
  .support-thread-head { flex-wrap: wrap; padding: 14px; }
  .support-session-toolbar { flex-wrap: wrap; gap: 4px; padding: 8px 14px; }
  .support-session-toolbar .is-error { max-width: none; }
  .support-messages { min-height: 100px; padding: 20px 14px; }
  .support-message { max-width: 90%; }
  .support-context > summary { padding-right: 14px; padding-left: 14px; }
  .support-context > summary span { display: none; }
  .support-details { padding-right: 14px; padding-left: 14px; }
  .support-reply { padding: 12px 14px 16px; }
}
@media (max-width: 600px) {
  .content > .support-title { flex-wrap: wrap; gap: 14px; }
  .support-title h1 { font-size: 23px; }
  .support-filter-tabs button { min-height: 42px; }
  .support-person-name h2 { font-size: 15px; }
  .support-thread-head > button { min-height: 38px; }
  .support-reply-footer small { max-width: 55%; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .support-queue { transition: none; } }

.support-image-list { display: grid; gap: 10px; white-space: normal; }
.support-image-attachment { display: grid; justify-items: start; gap: 10px; width: 260px; max-width: 100%; min-height: 96px; }
.support-image-attachment > span, .support-image-unavailable { align-self: center; color: #667085; font-size: 13px; }
.support-image-button { display: grid; gap: 0; width: 100%; padding: 0; overflow: hidden; border: 1px solid #d8e1ec; border-radius: 8px; background: #f1f4f8; cursor: zoom-in; }
.support-image-button img { display: block; width: 100%; height: 188px; object-fit: contain; }
.support-image-button:hover { border-color: var(--brand); }
.support-image-hint { padding: 7px 10px; border-top: 1px solid #e3e8ef; color: #475467; background: #fff; font-size: 12px; text-align: center; }
.support-image-button:focus-visible, .support-image-preview a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.support-image-preview { width: min(960px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 16px; overflow: auto; border: 1px solid #d8e1ec; border-radius: 12px; background: #fff; box-shadow: 0 24px 80px rgba(16, 24, 40, .25); }
.support-image-preview::backdrop { background: rgba(16, 24, 40, .72); }
.support-image-preview > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; color: #263445; }
.support-image-preview > img { display: block; width: 100%; max-height: calc(100dvh - 180px); object-fit: contain; background: #f1f4f8; }
.support-image-preview > a { display: inline-block; margin-top: 12px; padding: 4px 0; color: var(--brand); font-size: 14px; }

/* Entity records open as a focused, scrollable profile rather than a narrow
   confirmation dialog. */
.entity-detail-overlay { z-index: 1100; }
.entity-detail-modal { display: flex; width: min(920px, 100%); max-height: min(820px, calc(100dvh - 40px)); flex-direction: column; overflow: hidden; border-radius: 16px; }
.entity-detail-modal .governance-modal-head { flex: 0 0 auto; min-height: 72px; padding: 16px 24px; }
.entity-detail-modal .governance-modal-head > div { display: grid; gap: 4px; }
.entity-detail-eyebrow { color: #8b95a5; font-size: 11px; font-weight: 750; letter-spacing: .1em; }
.entity-detail-modal .governance-modal-head strong { color: #182230; font-size: 19px; }
.entity-detail-modal .governance-modal-head button { min-height: 38px; padding: 0 14px; }
.entity-detail-body { min-height: 0; padding: 8px 24px 28px; overflow: auto; overscroll-behavior: contain; }
.entity-detail-section { margin: 18px 0 0; padding: 18px; border: 1px solid #e7ebf0; border-radius: 12px; background: #fff; }
.entity-detail-section > h3 { margin: 0 0 15px; color: #27364a; font-size: 14px; font-weight: 750; }
.entity-detail-grid,.entity-detail-record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.entity-detail-field { display: grid; min-width: 0; gap: 5px; padding: 10px 12px; border-radius: 8px; background: #f7f9fc; }
.entity-detail-field > span { color: #798597; font-size: 11px; }
.entity-detail-field > strong { overflow-wrap: anywhere; color: #263445; font-size: 13px; font-weight: 650; line-height: 1.55; }
.entity-detail-hours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.entity-detail-hours > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 13px; border-radius: 8px; background: #f7f9fc; font-size: 12px; }
.entity-detail-hours > div > span { color: #798597; }
.entity-detail-hours > div > strong { color: #263445; font-weight: 650; }
.entity-detail-record-list { display: grid; gap: 10px; }
.entity-detail-record { padding: 14px; border: 1px solid #e8edf3; border-radius: 10px; background: #fbfcfe; }
.entity-detail-record-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.entity-detail-record-head > strong { color: #263445; font-size: 13px; }
.entity-detail-record-grid .entity-detail-field { background: #fff; }
.entity-detail-record-note { margin: 10px 0 0; color: #a33b32; font-size: 12px; line-height: 1.55; }
.entity-detail-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.entity-detail-media-card,.entity-detail-media-missing { display: grid; min-width: 0; overflow: hidden; border: 1px solid #e4e9f0; border-radius: 10px; background: #fff; }
.entity-detail-media-card { color: inherit; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.entity-detail-media-card:hover { transform: translateY(-2px); border-color: #aab8ca; }
.entity-detail-media-card > img { display: block; width: 100%; height: 140px; object-fit: contain; background: #f3f5f8; }
.entity-detail-media-card > span { display: grid; gap: 3px; padding: 10px 11px; }
.entity-detail-media-card strong,.entity-detail-media-missing > span { color: #344054; font-size: 12px; font-weight: 700; }
.entity-detail-media-card small,.entity-detail-media-missing small { color: #8792a2; font-size: 11px; line-height: 1.5; }
.entity-detail-media-missing { min-height: 176px; align-content: center; justify-items: center; gap: 6px; padding: 12px; text-align: center; }
.entity-detail-addresses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.entity-detail-addresses article { padding: 13px; border: 1px solid #e8edf3; border-radius: 9px; background: #fbfcfe; }
.entity-detail-addresses article > strong { color: #344054; font-size: 12px; }
.entity-detail-addresses article > p { margin: 8px 0; color: #475467; font-size: 12px; line-height: 1.6; }
.entity-detail-addresses article > small { color: #8792a2; font-size: 11px; }
.entity-detail-empty,.entity-detail-loading { margin: 0; padding: 14px; border-radius: 8px; color: #8792a2; background: #f7f9fc; font-size: 12px; }
.entity-detail-error { margin: 20px 0; padding: 14px; border-radius: 8px; color: #a33b32; background: #fff3f1; font-size: 13px; }
.entity-detail-rider-photo { display: inline-grid; gap: 8px; max-width: 280px; color: #475467; font-size: 12px; text-decoration: none; }
.entity-detail-rider-photo img { display: block; width: 100%; max-height: 240px; border: 1px solid #e4e9f0; border-radius: 10px; object-fit: contain; background: #f3f5f8; }

@media (max-width: 640px) {
  .entity-detail-overlay { padding: 12px; }
  .entity-detail-modal { max-height: calc(100dvh - 24px); border-radius: 13px; }
  .entity-detail-modal .governance-modal-head { min-height: 62px; padding: 12px 16px; }
  .entity-detail-body { padding: 2px 14px 18px; }
  .entity-detail-section { margin-top: 12px; padding: 13px; }
  .entity-detail-grid,.entity-detail-record-grid,.entity-detail-hours,.entity-detail-addresses { grid-template-columns: minmax(0, 1fr); }
  .entity-detail-media { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entity-detail-media-card > img { height: 118px; }
}

/* Qualification review: explain the workflow first, then make each evidence
   record and decision easy to scan without leaving large empty stretches. */
.qualification-page { display: grid; width: min(100%, 1240px); gap: 20px; margin: 0 auto; color: #263445; }
.qualification-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 4px 0 20px; border-bottom: 1px solid #e5e9ef; }
.qualification-header-copy { min-width: 0; }
.qualification-eyebrow { display: block; margin-bottom: 8px; color: #9a5a31; font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.qualification-header h1 { margin: 0; color: #182536; font-size: clamp(25px, 2.2vw, 32px); font-weight: 760; letter-spacing: -.035em; line-height: 1.2; }
.qualification-header p { max-width: 760px; margin: 9px 0 0; color: #667085; font-size: 13px; line-height: 1.65; }
.qualification-refresh { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 40px; padding: 0 15px; }
.qualification-refresh > svg { width: 16px; height: 16px; stroke: #b64b16; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qualification-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.qualification-stat { display: flex; align-items: center; gap: 14px; min-width: 0; min-height: 106px; box-sizing: border-box; padding: 17px 18px; border: 1px solid #e5e9ef; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.025); }
.qualification-stat-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #a64a1d; background: #fff2e9; }
.qualification-stat-icon > svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qualification-stat > div { display: grid; min-width: 0; grid-template-columns: 1fr auto; align-items: baseline; gap: 3px 10px; }
.qualification-stat > div > span { color: #667085; font-size: 12px; font-weight: 650; }
.qualification-stat > div > strong { grid-column: 2; grid-row: 1 / span 2; color: #182536; font-size: 27px; font-weight: 760; line-height: 1; }
.qualification-stat > div > small { grid-column: 1; overflow: hidden; color: #98a2b3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.qualification-stat--pending .qualification-stat-icon { color: #9a6700; background: #fff5dc; }
.qualification-stat--expiring .qualification-stat-icon { color: #9b4c31; background: #fff0e8; }
.qualification-stat--follow .qualification-stat-icon { color: #475467; background: #eef2f6; }
.qualification-work { overflow: hidden; border: 1px solid #e3e8ef; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.025); }
.qualification-work-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 22px 14px; }
.qualification-work-head h2 { margin: 0; color: #1d2939; font-size: 16px; font-weight: 750; }
.qualification-work-head p { margin: 5px 0 0; color: #7b8797; font-size: 12px; line-height: 1.55; }
.qualification-readonly { flex: 0 0 auto; color: #7b8797; font-size: 11px; }
.qualification-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 0 22px 15px; }
.qualification-filter { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 1px solid transparent; border-radius: 7px; color: #667085; background: #f5f7f9; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.qualification-filter:hover { border-color: #e5c3ae; color: #9d481d; background: #fff8f3; }
.qualification-filter.is-active { border-color: #f0d0bb; color: #9d481d; background: #fff3e9; }
.qualification-filter > span { display: grid; min-width: 19px; height: 19px; place-items: center; border-radius: 10px; color: #fff; background: #bd5c2c; font-size: 10px; line-height: 1; }
.qualification-sections { display: grid; gap: 16px; }
.qualification-section { min-width: 0; overflow: hidden; border: 1px solid #e3e8ef; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(16,24,40,.025); }
.qualification-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; box-sizing: border-box; padding: 15px 20px; border-bottom: 1px solid #edf0f4; }
.qualification-section-head > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qualification-section-mark { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 1px solid #f1e2d7; border-radius: 10px; color: #a95525; background: #fff8f3; }
.qualification-section-mark > svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qualification-section-head h2 { margin: 0; color: #243246; font-size: 14px; font-weight: 750; }
.qualification-section-head p { margin: 4px 0 0; color: #8792a2; font-size: 11px; line-height: 1.45; }
.qualification-section-count { flex: 0 0 auto; padding: 5px 9px; border-radius: 6px; color: #667085; background: #f3f5f8; font-size: 11px; font-weight: 650; }
.qualification-list { display: grid; gap: 10px; padding: 14px; }
.qualification-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; min-width: 0; padding: 17px 18px; border: 1px solid #e8edf2; border-radius: 10px; background: #fcfdff; transition: border-color .15s ease, box-shadow .15s ease; }
.qualification-card:hover { border-color: #d5dfe9; box-shadow: 0 4px 14px rgba(16,24,40,.045); }
.qualification-card-main { display: grid; min-width: 0; gap: 13px; }
.qualification-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qualification-card-heading h3 { margin: 4px 0 0; overflow-wrap: anywhere; color: #263445; font-size: 14px; font-weight: 730; }
.qualification-card-type { color: #9a5a31; font-size: 10px; font-weight: 750; letter-spacing: .025em; }
.qualification-card-fields { display: flex; flex-wrap: wrap; gap: 9px 22px; }
.qualification-card-fields > div { display: grid; min-width: 110px; max-width: 100%; gap: 4px; }
.qualification-card-fields > div > span { color: #8792a2; font-size: 10px; }
.qualification-card-fields > div > strong { overflow-wrap: anywhere; color: #475467; font-size: 11px; font-weight: 650; line-height: 1.5; }
.qualification-card-fields > .qualification-card-reason { min-width: min(100%, 320px); }
.qualification-card-fields > .qualification-card-reason > strong { color: #9b3025; }
.qualification-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; align-self: stretch; min-width: 0; max-width: 270px; flex-wrap: wrap; }
.qualification-card-actions > button { min-height: 34px; padding: 0 10px; white-space: nowrap; font-size: 11px; }
.qualification-card-actions > span { color: #98a2b3; font-size: 10px; text-align: right; }
.qualification-media { display: flex; flex-wrap: wrap; gap: 8px; }
.qualification-media > a { display: block; width: 92px; height: 68px; overflow: hidden; border: 1px solid #e1e7ef; border-radius: 7px; background: #f2f5f8; }
.qualification-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .16s ease; }
.qualification-media > a:hover img { transform: scale(1.04); }
.qualification-media-missing,.qualification-media > span { align-self: start; padding: 7px 9px; border-radius: 6px; color: #98a2b3; background: #f3f5f8; font-size: 10px; }
.qualification-empty { display: grid; min-height: 170px; align-content: center; justify-items: center; gap: 8px; box-sizing: border-box; padding: 24px; color: #667085; text-align: center; }
.qualification-empty-icon { display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 2px; border: 1px solid #e7ebf0; border-radius: 13px; color: #a16b4c; background: #f8fafc; }
.qualification-empty-icon svg { width: 25px; height: 25px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.qualification-empty > strong { color: #344054; font-size: 13px; font-weight: 700; }
.qualification-empty > span:not(.qualification-empty-icon) { max-width: 480px; color: #8792a2; font-size: 11px; line-height: 1.6; }
.qualification-empty > button { margin-top: 4px; }
.qualification-footnote { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 1px solid #e6ebf1; border-radius: 9px; color: #667085; background: #f8fafc; }
.qualification-footnote > span { display: grid; width: 17px; height: 17px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #52657c; background: #e8eef5; font-size: 11px; font-weight: 800; }
.qualification-footnote p { margin: 0; color: #667085; font-size: 10px; line-height: 1.65; }
.qualification-load-error { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 15px; border: 1px solid #f0c9c3; border-radius: 9px; color: #9b3025; background: #fff7f5; font-size: 12px; }
.qualification-load-error > strong { flex: 0 0 auto; }
.qualification-load-error > span { min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; }
.qualification-load-error > button { min-height: 32px; }
.qualification-page :focus-visible { outline: 3px solid rgba(233,104,36,.3); outline-offset: 2px; }
@container admin-content (max-width: 1040px) {
  .qualification-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qualification-card { grid-template-columns: minmax(0, 1fr); }
  .qualification-card-actions { justify-content: flex-start; max-width: none; padding-top: 12px; border-top: 1px solid #edf0f4; }
  .qualification-card-actions > span { text-align: left; }
}
@container admin-content (max-width: 620px) {
  .qualification-page { gap: 14px; }
  .qualification-header { align-items: flex-start; flex-direction: column; gap: 14px; padding-bottom: 16px; }
  .qualification-refresh { align-self: flex-start; }
  .qualification-summary { gap: 8px; }
  .qualification-stat { min-height: 86px; gap: 9px; padding: 12px 10px; }
  .qualification-stat-icon { width: 32px; height: 32px; border-radius: 9px; }
  .qualification-stat-icon > svg { width: 18px; height: 18px; }
  .qualification-stat > div { grid-template-columns: 1fr; gap: 3px; }
  .qualification-stat > div > strong { grid-column: 1; grid-row: auto; font-size: 22px; }
  .qualification-stat > div > small { display: none; }
  .qualification-work-head { align-items: flex-start; flex-direction: column; gap: 8px; padding: 15px 14px 12px; }
  .qualification-filters { gap: 5px; padding: 0 14px 13px; }
  .qualification-filter { min-height: 32px; padding: 0 9px; font-size: 11px; }
  .qualification-section-head { min-height: 68px; padding: 12px; }
  .qualification-section-head p { max-width: 240px; }
  .qualification-list { padding: 9px; }
  .qualification-card { padding: 13px; }
  .qualification-card-heading { align-items: flex-start; }
  .qualification-card-fields { gap: 9px 14px; }
  .qualification-card-fields > div { min-width: calc(50% - 8px); }
  .qualification-card-actions { gap: 6px; }
  .qualification-card-actions > button { flex: 1 1 100px; }
}
@media (prefers-reduced-motion: reduce) { .qualification-filter,.qualification-card,.qualification-media img { transition: none; } }
