:root {
  --dcms-metrics-ink: #172033;
  --dcms-metrics-muted: #68758c;
  --dcms-metrics-line: #dfe5ee;
  --dcms-metrics-soft: #f4f6f9;
  --dcms-metrics-card: #ffffff;
  --dcms-metrics-navy: #111b2e;
  --dcms-metrics-orange: #ff6b12;
  --dcms-metrics-green: #138a52;
  --dcms-metrics-red: #c93535;
  --dcms-metrics-amber: #bd7411;
  --dcms-metrics-blue: #2563eb;
}

.dcms-metrics-admin-wrap {
  margin: 16px 20px 0 0;
}

#dot-dcms-metrics,
#dot-dcms-metrics * {
  box-sizing: border-box;
}

.dcms-dealer-metrics {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 24px;
  color: var(--dcms-metrics-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dcms-dealer-metrics.is-frontend {
  padding-top: 34px;
  padding-bottom: 60px;
}

.dcms-dealer-metrics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 26px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 107, 18, .25), transparent 32%),
    linear-gradient(135deg, #101a2c, #1b2941);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(17, 27, 46, .17);
}

.dcms-dealer-brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.dcms-dealer-brand img {
  width: 132px;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .18));
}

.dcms-dealer-brand span,
.dcms-metrics-section-title span {
  display: block;
  margin-bottom: 5px;
  color: #ffad76;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.dcms-dealer-brand h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(23px, 2.4vw, 36px);
  line-height: 1.05;
  letter-spacing: -.03em;
}

.dcms-dealer-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.dcms-dealer-header-actions a,
.dcms-metrics-button,
.dcms-metrics-filter-actions button,
.dcms-metrics-filter-actions a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 10px;
  color: inherit;
  background: rgba(255, 255, 255, .08);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.dcms-dealer-header-actions a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .15);
  transform: translateY(-1px);
}

.dcms-dealer-notice {
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid #a7dfc2;
  border-radius: 12px;
  color: #0b6c3d;
  background: #eefbf4;
  font-weight: 700;
}

.dcms-metrics-retention {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 17px 20px;
  border: 1px solid #f2c6a9;
  border-left: 5px solid var(--dcms-metrics-orange);
  border-radius: 14px;
  background: #fff8f3;
}

.dcms-metrics-retention > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dcms-metrics-retention strong {
  font-size: 14px;
}

.dcms-metrics-retention span {
  color: #6f5748;
  font-size: 13px;
  line-height: 1.45;
}

.dcms-metrics-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin: 18px 0;
  padding: 20px;
  border: 1px solid var(--dcms-metrics-line);
  border-radius: 16px;
  background: var(--dcms-metrics-card);
  box-shadow: 0 8px 28px rgba(26, 38, 61, .06);
}

.dcms-metrics-filter-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.dcms-metrics-filter-form label > span {
  color: #46536a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .035em;
}

.dcms-metrics-filter-form select,
.dcms-metrics-filter-form input[type="search"] {
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #cdd5e1;
  border-radius: 10px;
  color: var(--dcms-metrics-ink);
  background: #fff;
  font-size: 14px;
  line-height: 1.2;
}

.dcms-metrics-filter-form select:focus,
.dcms-metrics-filter-form input[type="search"]:focus {
  border-color: var(--dcms-metrics-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 18, .13);
  outline: 0;
}

.dcms-metrics-search {
  grid-column: span 2;
}

.dcms-metrics-filter-actions {
  display: flex;
  align-items: end;
  gap: 9px;
}

.dcms-metrics-filter-actions button,
.dcms-metrics-filter-actions a {
  min-height: 44px;
  border-color: #d8dee8;
  color: #334158;
  background: #f7f8fa;
}

.dcms-metrics-filter-actions button.primary {
  border-color: var(--dcms-metrics-orange);
  color: #fff;
  background: var(--dcms-metrics-orange);
}

.dcms-metrics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0;
}

.dcms-metrics-toolbar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dcms-metrics-toolbar > div:first-child strong {
  font-size: 18px;
}

.dcms-metrics-toolbar > div:first-child span {
  color: var(--dcms-metrics-muted);
  font-size: 13px;
}

.dcms-metrics-toolbar > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dcms-inline-form {
  display: inline-flex;
  margin: 0;
}

.dcms-metrics-button {
  min-height: 39px;
  border-color: #ced6e1;
  color: #253148;
  background: #fff;
  box-shadow: none;
}

.dcms-metrics-button:hover {
  color: #111b2e;
  border-color: #aeb8c7;
  background: #f7f8fa;
}

.dcms-metrics-button.secondary {
  color: #7b4a12;
  border-color: #e7c59e;
  background: #fff8ef;
}

.dcms-dealer-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 13px;
  margin: 18px 0 22px;
}

.dcms-dealer-summary-card {
  position: relative;
  min-height: 142px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--dcms-metrics-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(22, 34, 54, .06);
}

.dcms-dealer-summary-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: #9aa5b6;
  content: "";
}

.dcms-dealer-summary-card.completion::before { background: var(--dcms-metrics-green); }
.dcms-dealer-summary-card.reschedule::before { background: var(--dcms-metrics-blue); }
.dcms-dealer-summary-card.nlos::before { background: var(--dcms-metrics-red); }
.dcms-dealer-summary-card.cancelled::before { background: var(--dcms-metrics-amber); }
.dcms-dealer-summary-card.pole-signs::before { background: #7c3aed; }
.dcms-dealer-summary-card.sales-leads::before { background: #0891b2; }

.dcms-dealer-summary-card > span {
  display: block;
  color: var(--dcms-metrics-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dcms-dealer-summary-card > strong {
  display: block;
  margin: 12px 0 14px;
  font-size: clamp(27px, 2.8vw, 40px);
  line-height: 1;
  letter-spacing: -.04em;
}

.dcms-metric-delta {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  padding: 4px 7px;
  border-radius: 999px;
  color: #647086;
  background: #f0f2f5;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.dcms-metric-delta.better {
  color: #087541;
  background: #e8f8ef;
}

.dcms-metric-delta.worse {
  color: #a52b2b;
  background: #fdecec;
}

.dcms-metric-delta.neutral {
  color: #5d6676;
  background: #eef1f5;
}

.dcms-metric-delta.none {
  color: #7a8493;
  background: transparent;
  padding-left: 0;
  white-space: normal;
}

.dcms-metrics-table-card,
.dcms-metrics-history-card,
.dcms-metrics-definition-card {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--dcms-metrics-line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 9px 28px rgba(22, 34, 54, .055);
}

.dcms-metrics-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 21px;
  border-bottom: 1px solid var(--dcms-metrics-line);
}

.dcms-metrics-section-title span {
  color: var(--dcms-metrics-orange);
}

.dcms-metrics-section-title h2 {
  margin: 0;
  color: var(--dcms-metrics-ink);
  font-size: 20px;
  line-height: 1.15;
}

.dcms-metrics-section-title > em {
  color: var(--dcms-metrics-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.dcms-metrics-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.dcms-metrics-table {
  width: 100%;
  min-width: 1270px;
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
}

.dcms-metrics-table.history {
  min-width: 1120px;
}

.dcms-metrics-table th,
.dcms-metrics-table td {
  padding: 13px 12px;
  border: 0;
  border-bottom: 1px solid #e8ecf2;
  text-align: left;
  vertical-align: middle;
}

.dcms-metrics-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #59667a;
  background: #f6f8fb;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dcms-metrics-table tbody tr:hover {
  background: #fbfcfd;
}

.dcms-metrics-table tbody tr:last-child td {
  border-bottom: 0;
}

.dcms-metrics-table td:first-child {
  min-width: 210px;
}

.dcms-metrics-table td strong,
.dcms-metrics-table td > span,
.dcms-metrics-table td > small,
.dcms-metrics-table td > .dcms-metric-delta {
  display: block;
}

.dcms-metrics-table td:first-child > span {
  margin-top: 3px;
  color: var(--dcms-metrics-muted);
  font-size: 11px;
}

.dcms-metric-cell-value {
  margin-bottom: 3px;
  color: var(--dcms-metrics-ink);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.1;
}

.dcms-metrics-table td small {
  margin: 3px 0 6px;
  color: var(--dcms-metrics-muted);
  font-size: 10px;
  line-height: 1.25;
}

.dcms-metrics-table td .dcms-metric-delta {
  margin-top: 5px;
}

.dcms-status-pill {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  margin-top: 7px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
}

.dcms-status-pill.live {
  color: #075f8a;
  background: #e8f6fc;
}

.dcms-status-pill.final {
  color: #0b7041;
  background: #e8f8ef;
}

.dcms-status-pill.inactive {
  color: #6d7582;
  background: #eceff3;
}

.dcms-metrics-table td.empty {
  padding: 38px 20px;
  color: var(--dcms-metrics-muted);
  text-align: center;
}

.dcms-metrics-definition-card {
  padding: 21px;
}

.dcms-metrics-definition-card h2 {
  margin: 0 0 14px;
  font-size: 19px;
}

.dcms-metrics-definition-card > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 22px;
}

.dcms-metrics-definition-card p {
  margin: 0;
  color: #5b6678;
  font-size: 13px;
  line-height: 1.5;
}

.dcms-metrics-definition-card strong {
  color: var(--dcms-metrics-ink);
}

.dcms-metrics-access-denied {
  width: min(680px, calc(100% - 32px));
  margin: 50px auto;
  padding: 32px;
  border: 1px solid var(--dcms-metrics-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(20, 31, 50, .1);
  text-align: center;
}

.dcms-metrics-access-denied h2 {
  margin-top: 0;
}

.dcms-metrics-access-denied p {
  color: var(--dcms-metrics-muted);
}

.dcms-metrics-access-denied a {
  display: inline-flex;
  margin-top: 7px;
  padding: 10px 17px;
  border-radius: 10px;
  color: #fff;
  background: var(--dcms-metrics-orange);
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 1280px) {
  .dcms-dealer-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dcms-metrics-filter-form { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 900px) {
  .dcms-dealer-metrics { padding: 16px; }
  .dcms-dealer-metrics-header,
  .dcms-metrics-toolbar,
  .dcms-metrics-section-title { align-items: flex-start; flex-direction: column; }
  .dcms-dealer-header-actions,
  .dcms-metrics-toolbar > div:last-child { justify-content: flex-start; }
  .dcms-metrics-retention { grid-template-columns: 1fr; }
  .dcms-metrics-filter-form { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .dcms-metrics-search { grid-column: span 1; }
  .dcms-metrics-definition-card > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .dcms-dealer-metrics { padding: 10px; }
  .dcms-dealer-metrics-header { padding: 18px; border-radius: 15px; }
  .dcms-dealer-brand { align-items: flex-start; flex-direction: column; gap: 10px; }
  .dcms-dealer-brand img { width: 112px; }
  .dcms-dealer-header-actions { width: 100%; }
  .dcms-dealer-header-actions a { flex: 1 1 auto; }
  .dcms-metrics-filter-form { grid-template-columns: 1fr; padding: 15px; }
  .dcms-metrics-filter-actions { align-items: stretch; flex-direction: column; }
  .dcms-dealer-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .dcms-dealer-summary-card { min-height: 128px; padding: 15px; }
  .dcms-dealer-summary-card > strong { font-size: 30px; }
  .dcms-metrics-definition-card > div { grid-template-columns: 1fr; }
  .dcms-metrics-toolbar > div:last-child,
  .dcms-metrics-toolbar > div:last-child > *,
  .dcms-inline-form,
  .dcms-inline-form button { width: 100%; }
  .dcms-metrics-button { width: 100%; }
}

@media print {
  body { background: #fff !important; }
  #adminmenumain,
  #wpadminbar,
  #wpfooter,
  .dcms-dealer-header-actions,
  .dcms-metrics-filter-form,
  .dcms-metrics-toolbar > div:last-child,
  .dcms-dealer-notice { display: none !important; }
  #wpcontent,
  #wpbody-content { margin: 0 !important; padding: 0 !important; }
  .dcms-dealer-metrics { width: 100%; max-width: none; padding: 0; }
  .dcms-dealer-metrics-header { color: #000; background: #fff; box-shadow: none; border: 1px solid #ccc; }
  .dcms-dealer-brand h1 { color: #000; }
  .dcms-dealer-brand span { color: #555; }
  .dcms-dealer-summary-card,
  .dcms-metrics-table-card,
  .dcms-metrics-history-card,
  .dcms-metrics-definition-card { box-shadow: none; break-inside: avoid; }
  .dcms-metrics-table-wrap { overflow: visible; }
  .dcms-metrics-table { min-width: 0; font-size: 8px; }
  .dcms-metrics-table th,
  .dcms-metrics-table td { padding: 5px; }
  .dcms-metric-delta { font-size: 7px; }
}

.dcms-technician-detail-link {
  color: var(--dcms-metrics-ink);
  text-decoration: none;
}
.dcms-technician-detail-link:hover {
  color: var(--dcms-metrics-orange);
  text-decoration: underline;
}


/* v0.7.4 scoring scope and provider-withdrawal exclusions */
.dcms-metrics-scope-card {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(360px, 1.6fr);
  gap: 18px;
  align-items: stretch;
  margin: 18px 0;
  padding: 18px 20px;
  border: 1px solid var(--dcms-metrics-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(26, 38, 61, .06);
}
.dcms-metrics-scope-card.company { border-left: 5px solid var(--dcms-metrics-blue); }
.dcms-metrics-scope-card.technician { border-left: 5px solid var(--dcms-metrics-green); }
.dcms-metrics-scope-copy { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.dcms-metrics-scope-copy > span { color: var(--dcms-metrics-muted); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.dcms-metrics-scope-copy > strong { color: var(--dcms-metrics-ink); font-size: 15px; line-height: 1.4; }
.dcms-metrics-scope-copy > small { color: var(--dcms-metrics-muted); font-size: 12.5px; line-height: 1.5; }
.dcms-metrics-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dcms-metrics-breakdown > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 13px 14px; border: 1px solid #e4e8ef; border-radius: 12px; background: #f8fafc; }
.dcms-metrics-breakdown > div > span { color: #536078; font-size: 11px; font-weight: 800; line-height: 1.3; }
.dcms-metrics-breakdown > div > strong { color: var(--dcms-metrics-ink); font-size: 22px; line-height: 1.1; }
.dcms-metrics-breakdown > div > small { color: var(--dcms-metrics-muted); font-size: 11.5px; line-height: 1.35; }
.dcms-metrics-breakdown > div.excluded { border-color: #d9ccfa; background: #f7f4ff; }
.dcms-metrics-breakdown > div.excluded > strong { color: #6941c6; }
.dcms-metrics-table td small { display: block; margin-top: 4px; color: var(--dcms-metrics-muted); font-size: 11px; line-height: 1.35; }

@media (max-width: 900px) {
  .dcms-metrics-scope-card { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dcms-metrics-breakdown { grid-template-columns: 1fr; }
}


/* =========================================================
   DCMS v3.1.3 — Office Portal responsive desktop/mobile cleanup
   Scope: office/dealer/admin portal pages only. Technician mobile app untouched.
   ========================================================= */
:root{
  --dcms-office-max: 1540px;
  --dcms-office-pad: 28px;
  --dcms-office-gap: 16px;
  --dcms-office-bg: #f4f6fa;
  --dcms-office-card: #ffffff;
  --dcms-office-line: #dfe4ee;
  --dcms-office-text: #111827;
  --dcms-office-muted: #667085;
  --dcms-office-orange: #f97316;
  --dcms-office-dark: #101828;
}

body.dot-dcms-dealer-hub-page,
body.dcms-office-shell-page,
body.dot-dcms-operations-page,
body.dot-dcms-native-sales-page,
body.dot-dcms-office-suite-page,
body.dot-dcms-live-tracker-page,
body.dcms-v3-office-page,
body.dot-dcms-team-page,
body.dot-dcms-production-page,
body.dot-dcms-metrics-page{
  background: var(--dcms-office-bg) !important;
  overflow-x: hidden !important;
}

body.dot-dcms-dealer-hub-page .site-header,
body.dot-dcms-dealer-hub-page .site-footer,
body.dot-dcms-dealer-hub-page .entry-header,
body.dot-dcms-dealer-hub-page .page-header,
body.dot-dcms-dealer-hub-page .wp-block-post-title,
body.dot-dcms-dealer-hub-page header.wp-block-template-part,
body.dot-dcms-dealer-hub-page footer.wp-block-template-part,
body.dcms-office-shell-page .site-header,
body.dcms-office-shell-page .site-footer,
body.dcms-office-shell-page .entry-header,
body.dcms-office-shell-page .page-header,
body.dot-dcms-operations-page .site-header,
body.dot-dcms-operations-page .site-footer,
body.dot-dcms-operations-page .entry-header,
body.dot-dcms-native-sales-page .site-header,
body.dot-dcms-native-sales-page .site-footer,
body.dot-dcms-native-sales-page .entry-header,
body.dot-dcms-office-suite-page .site-header,
body.dot-dcms-office-suite-page .site-footer,
body.dot-dcms-office-suite-page .entry-header,
body.dot-dcms-live-tracker-page .site-header,
body.dot-dcms-live-tracker-page .site-footer,
body.dot-dcms-live-tracker-page .entry-header,
body.dcms-v3-office-page .site-header,
body.dcms-v3-office-page .site-footer,
body.dcms-v3-office-page .entry-header,
body.dot-dcms-team-page .site-header,
body.dot-dcms-team-page .site-footer,
body.dot-dcms-team-page .entry-header{
  display:none!important;
}

body.dot-dcms-dealer-hub-page #page,
body.dot-dcms-dealer-hub-page #content,
body.dot-dcms-dealer-hub-page .site,
body.dot-dcms-dealer-hub-page .site-content,
body.dot-dcms-dealer-hub-page .content-area,
body.dot-dcms-dealer-hub-page .site-main,
body.dot-dcms-dealer-hub-page .entry-content,
body.dot-dcms-dealer-hub-page .wp-block-post-content,
body.dcms-office-shell-page #page,
body.dcms-office-shell-page #content,
body.dcms-office-shell-page .site,
body.dcms-office-shell-page .site-content,
body.dcms-office-shell-page .content-area,
body.dcms-office-shell-page .site-main,
body.dcms-office-shell-page .entry-content,
body.dot-dcms-operations-page #page,
body.dot-dcms-operations-page #content,
body.dot-dcms-operations-page .site,
body.dot-dcms-operations-page .site-content,
body.dot-dcms-operations-page .content-area,
body.dot-dcms-operations-page .site-main,
body.dot-dcms-operations-page .entry-content,
body.dot-dcms-native-sales-page #page,
body.dot-dcms-native-sales-page #content,
body.dot-dcms-native-sales-page .site,
body.dot-dcms-native-sales-page .site-content,
body.dot-dcms-native-sales-page .content-area,
body.dot-dcms-native-sales-page .site-main,
body.dot-dcms-native-sales-page .entry-content,
body.dot-dcms-office-suite-page #page,
body.dot-dcms-office-suite-page #content,
body.dot-dcms-office-suite-page .site,
body.dot-dcms-office-suite-page .site-content,
body.dot-dcms-office-suite-page .content-area,
body.dot-dcms-office-suite-page .site-main,
body.dot-dcms-office-suite-page .entry-content,
body.dot-dcms-live-tracker-page #page,
body.dot-dcms-live-tracker-page #content,
body.dot-dcms-live-tracker-page .site,
body.dot-dcms-live-tracker-page .site-content,
body.dot-dcms-live-tracker-page .content-area,
body.dot-dcms-live-tracker-page .site-main,
body.dot-dcms-live-tracker-page .entry-content,
body.dcms-v3-office-page #page,
body.dcms-v3-office-page #content,
body.dcms-v3-office-page .site,
body.dcms-v3-office-page .site-content,
body.dcms-v3-office-page .content-area,
body.dcms-v3-office-page .site-main,
body.dcms-v3-office-page .entry-content,
body.dot-dcms-team-page #page,
body.dot-dcms-team-page #content,
body.dot-dcms-team-page .site,
body.dot-dcms-team-page .site-content,
body.dot-dcms-team-page .content-area,
body.dot-dcms-team-page .site-main,
body.dot-dcms-team-page .entry-content{
  max-width:none!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
}

/* Main office canvases */
.dh-ai-main,
.dcms-dealer-main,
.dcms-dealer-metrics,
.ops-main,
.dns-main,
.dos-app,
.dt-main,
.dcms-team-main,
.prod-main,
.dv3-main{
  width:min(var(--dcms-office-max), calc(100vw - 32px))!important;
  max-width:var(--dcms-office-max)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:0!important;
  padding-right:0!important;
}

/* Dealer portal: modern desktop-first layout */
.dh-ai-dashboard{min-height:100vh!important;}
.dh-ai-main{padding:var(--dcms-office-pad) 0 54px!important;}
.dh-ai-hero{grid-template-columns:minmax(0,1.55fr) minmax(380px,.75fr)!important;align-items:stretch!important;}
.dh-ai-kpi-strip{grid-template-columns:repeat(4,minmax(0,1fr))!important;align-items:stretch!important;}
.dh-ai-workbench{grid-template-columns:minmax(390px,.95fr) minmax(0,1.45fr)!important;align-items:start!important;}
.dh-ai-lower-grid{grid-template-columns:minmax(0,1.08fr) minmax(360px,.9fr)!important;align-items:start!important;}
.dh-ai-action-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
.dh-ai-more-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
.dh-ai-card{backdrop-filter:none!important;}
.dh-ai-action-card,.dh-ai-more-grid a,.dh-ai-alert,.dh-ai-activity-list a,.dh-ai-notice-list article{transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease,background .16s ease;}
.dh-ai-action-card:hover,.dh-ai-more-grid a:hover,.dh-ai-alert:hover,.dh-ai-activity-list a:hover{transform:translateY(-2px);border-color:#fed7aa!important;box-shadow:0 12px 28px rgba(16,24,40,.08)!important;background:#fff!important;}

/* Shared panel/grids across office tabs */
.dcms-dealer-card,
.dd-card,
.ops-card,
.ops-panel,
.dns-panel,
.dos-panel,
.dt-panel,
.dcms-team-panel,
.prod-panel,
.dv3-panel,
.dcms-metrics-filter-card,
.dcms-metrics-history-card,
.dcms-metrics-table-card,
.dcms-metrics-definition-card{
  border-radius:18px!important;
  border:1px solid var(--dcms-office-line)!important;
  box-shadow:0 8px 24px rgba(16,24,40,.055)!important;
  background:var(--dcms-office-card)!important;
}

.dd-grid,
.dcms-dealer-grid,
.dcms-dealer-action-grid,
.ops-grid,
.ops-kpis,
.dns-grid,
.dns-kpis,
.dos-kpis,
.dt-grid,
.dcms-team-grid,
.prod-grid,
.prod-kpis,
.dv3-grid,
.dcms-metrics-kpi-grid,
.dcms-metrics-definition-grid{
  display:grid!important;
  gap:16px!important;
}

@media(min-width:1100px){
  .dd-grid,.dcms-dealer-grid,.ops-grid,.dns-grid,.dos-grid,.dt-grid,.dcms-team-grid,.prod-grid,.dv3-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  .dcms-dealer-action-grid,.ops-kpis,.dns-kpis,.dos-kpis,.prod-kpis,.dcms-metrics-kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;}
  .dcms-metrics-definition-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .dns-split,.ops-split,.dv3-split,.prod-split{display:grid!important;grid-template-columns:minmax(0,1.2fr) minmax(360px,.8fr)!important;gap:18px!important;align-items:start!important;}
}

/* Tabs / link rows: desktop horizontal, mobile scroll */
.dns-tabs,
.ops-tabs,
.dv3-tabs,
.dcms-dealer-tabs,
.dcms-metrics-tabs,
.dos-link-row,
.prod-tabs,
.dd-tabs{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:8px!important;
  align-items:center!important;
  padding:4px 0 10px!important;
  overflow:visible!important;
}
.dns-tabs a,.dns-tabs button,
.ops-tabs a,.ops-tabs button,
.dv3-tabs a,.dv3-tabs button,
.dcms-dealer-tabs a,.dcms-dealer-tabs button,
.dcms-metrics-tabs a,.dcms-metrics-tabs button,
.dos-link-row a,
.prod-tabs a,.prod-tabs button,
.dd-tabs a,.dd-tabs button{
  flex:0 0 auto!important;
  border-radius:999px!important;
  min-height:38px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:9px 13px!important;
  font-weight:800!important;
  text-decoration:none!important;
  white-space:nowrap!important;
}

/* Forms: stop desktop from looking like narrow stacked mobile cards */
.dns-form,
.dos-grid-form,
.dos-inline-form,
.ops-form,
.dv3-form,
.dcms-team-form,
.prod-form,
.dd-form{
  gap:14px!important;
}
@media(min-width:900px){
  .dns-form .dns-grid,
  .dos-grid-form,
  .ops-form-grid,
  .dv3-form-grid,
  .dcms-team-form-grid,
  .prod-form-grid,
  .dd-form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .dns-form .wide,
  .ops-form .wide,
  .dv3-form .wide,
  .dcms-team-wide,
  .prod-form .wide,
  .dd-form .wide{
    grid-column:1/-1!important;
  }
}

/* Tables: full desktop table width and safe mobile overflow */
.dns-table-wrap,
.dos-table-wrap,
.ops-table-wrap,
.dv3-table-wrap,
.dcms-team-table-wrap,
.prod-table-wrap,
.dcms-metrics-table-wrap,
.dd-table-wrap,
.dcms-dealer-table-wrap{
  width:100%!important;
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch!important;
  border-radius:14px!important;
}
.dns-table,
.dos-table-wrap table,
.ops-table,
.dv3-table,
.dcms-team-table,
.prod-table,
.dcms-metrics-table,
.dd-table,
.dcms-dealer-table{
  width:100%!important;
  min-width:880px!important;
  border-collapse:collapse!important;
}

/* Desktop: give top/hero areas more room */
@media(min-width:1180px){
  .dh-ai-hero-copy{min-height:270px!important;}
  .dh-ai-hero h1{max-width:840px!important;}
  .dh-ai-action-card{min-height:132px!important;}
  .dh-ai-more-grid a{min-height:68px!important;}
}

/* Tablet */
@media(max-width:1120px){
  .dh-ai-main,
  .dcms-dealer-main,
  .dcms-dealer-metrics,
  .ops-main,
  .dns-main,
  .dos-app,
  .dt-main,
  .dcms-team-main,
  .prod-main,
  .dv3-main{width:calc(100vw - 24px)!important;}
  .dh-ai-hero,.dh-ai-workbench,.dh-ai-lower-grid{grid-template-columns:1fr!important;}
  .dh-ai-kpi-strip,.dh-ai-action-grid,.dh-ai-more-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
}

/* Mobile: app-like cards, no desktop squish */
@media(max-width:700px){
  :root{--dcms-office-pad:12px;}
  .dh-ai-main,
  .dcms-dealer-main,
  .dcms-dealer-metrics,
  .ops-main,
  .dns-main,
  .dos-app,
  .dt-main,
  .dcms-team-main,
  .prod-main,
  .dv3-main{width:calc(100vw - 20px)!important;padding-top:12px!important;}
  .dh-ai-hero-copy{border-radius:22px!important;padding:22px 18px!important;min-height:auto!important;}
  .dh-ai-hero h1{font-size:34px!important;line-height:1!important;letter-spacing:-.055em!important;}
  .dh-ai-hero-actions{display:grid!important;grid-template-columns:1fr!important;}
  .dh-ai-btn{width:100%!important;}
  .dh-ai-kpi-strip,.dh-ai-action-grid,.dh-ai-more-grid,.dd-grid,.dcms-dealer-grid,.dcms-dealer-action-grid,.ops-grid,.ops-kpis,.dns-grid,.dns-kpis,.dos-kpis,.dt-grid,.dcms-team-grid,.prod-grid,.prod-kpis,.dv3-grid,.dcms-metrics-kpi-grid,.dcms-metrics-definition-grid{grid-template-columns:1fr!important;}
  .dns-tabs,.ops-tabs,.dv3-tabs,.dcms-dealer-tabs,.dcms-metrics-tabs,.dos-link-row,.prod-tabs,.dd-tabs{flex-wrap:nowrap!important;overflow-x:auto!important;padding-bottom:8px!important;scrollbar-width:none!important;}
  .dns-tabs::-webkit-scrollbar,.ops-tabs::-webkit-scrollbar,.dv3-tabs::-webkit-scrollbar,.dcms-dealer-tabs::-webkit-scrollbar,.dcms-metrics-tabs::-webkit-scrollbar,.dos-link-row::-webkit-scrollbar,.prod-tabs::-webkit-scrollbar,.dd-tabs::-webkit-scrollbar{display:none!important;}
  .dh-ai-panel-head{display:block!important;}
  .dh-ai-panel-head h2{font-size:21px!important;}
  .dh-ai-mini-status{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  .dh-ai-profile-line{align-items:flex-start!important;}
  .dh-ai-footer{display:block!important;line-height:1.7!important;}
}

/* Small phone */
@media(max-width:420px){
  .dh-ai-hero h1{font-size:30px!important;}
  .dh-ai-mini-status{grid-template-columns:1fr!important;}
  .dh-ai-card,.dh-ai-priority-panel,.dh-ai-actions-panel,.dh-ai-lower-grid>.dh-ai-card{border-radius:20px!important;padding:14px!important;}
  .dh-ai-action-card{min-height:112px!important;}
}
