/* ══════════════════════════════════════════════
   octofieldAI Dashboard – Portfolio Embed
   Self-contained styles scoped under .of-dashboard-wrap
   ══════════════════════════════════════════════ */

/* ── Design tokens (dashboard-specific) ── */
.of-dashboard-wrap {
  --db-bg:         #F4F6F9;
  --db-surface:    #FFFFFF;
  --db-surface2:   #EBEEf4;
  --db-border:     #D8DFE8;
  --db-border2:    #BBC6D5;
  --db-blue:       #2563EB;
  --db-accent:     #1565A8;
  --db-accent-dim: #D6E8F7;
  --db-green:      #16A34A;
  --db-red:        #DC2626;
  --db-text:       #0D1B2E;
  --db-text-2:     #445669;
  --db-text-3:     #8FA3B8;
  --db-card:       #FFFFFF;
  --db-mono:       'SF Mono', ui-monospace, monospace;
  --db-sans:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --db-amber:      #1565A8;
}

body.light .of-dashboard-wrap {
  --db-bg:         #F4F6F9;
  --db-surface:    #FFFFFF;
  --db-surface2:   #EBEEf4;
  --db-border:     #D8DFE8;
  --db-border2:    #BBC6D5;
  --db-accent:     #1565A8;
  --db-green:      #16A34A;
  --db-red:        #DC2626;
  --db-text:       #0D1B2E;
  --db-text-2:     #445669;
  --db-text-3:     #8FA3B8;
  --db-card:       #FFFFFF;
  --db-amber:      #1565A8;
}

/* Dark mode (default in portfolio) */
body:not(.light) .of-dashboard-wrap {
  --db-bg:         #080C12;
  --db-surface:    #0D1117;
  --db-surface2:   #131A22;
  --db-border:     #1C242E;
  --db-border2:    #263040;
  --db-accent:     #38BDF8;
  --db-green:      #22C55E;
  --db-red:        #EF4444;
  --db-text:       #E8EFF7;
  --db-text-2:     #7A8FA3;
  --db-text-3:     #758C9E;
  --db-card:       #131A22;
  --db-amber:      #38BDF8;
}

.of-dashboard-wrap {
  font-family: var(--db-sans);
  color: var(--db-text);
  margin-top: 32px;
  height:620px;
  display: flex;
  flex-direction: column;
}

/* Override global heading font (Geist Mono) with Inter for all dashboard headings */
.of-dashboard-wrap h1,
.of-dashboard-wrap h2,
.of-dashboard-wrap h3,
.of-dashboard-wrap h4,
.of-dashboard-wrap h5,
.of-dashboard-wrap h6 {
  font-family: var(--db-sans);
  text-transform: none;
}

/* Reset global link/button styles that leak in from styles.css */
.of-dashboard-wrap a {
  border-bottom: none;
  font-weight: inherit;
  text-decoration: none;
  color: inherit;
}
body.light .of-dashboard-wrap a {
  color: inherit;
  background: none;
}
body.light .of-dashboard-wrap a:hover {
  color: inherit;
  background: none;
}

/* Reset global `body.light .work-content button` rule (specificity 0,2,1)
   Dashboard is inside .work-content so all buttons get that purple #7785ff fill.
   Same specificity + later file order = this wins. */
body.light .of-dashboard-wrap button {
  background: transparent;
  border: none;
  color: var(--db-text);
  border-radius: 0;
  font-size: inherit;
  font-weight: inherit;
}
body.light .of-dashboard-wrap button:hover {
  background: transparent;
  border: none;
}
body.light .of-dashboard-wrap button:hover a {
  color: inherit;
  background: none;
}

/* Reset global `button:hover` (background: #f7f8f8) for dark mode dashboard */
body:not(.light) .of-dashboard-wrap button {
  background: transparent;
  border: none;
  color: var(--db-text);
  border-radius: 0;
  font-size: inherit;
  font-weight: inherit;
}
body:not(.light) .of-dashboard-wrap button:hover {
  background: transparent;
  border: none;
}
body:not(.light) .of-dashboard-wrap button:hover a {
  color: inherit;
  background: none;
}

/* Re-establish dashboard-specific button styles with higher specificity (0,4,1)
   so they beat the global body.light .work-content button[:hover] at (0,3,2) */
body.light .of-dashboard-wrap .dp-badge-btn {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25) !important;
  border-radius: 100px;
  color: var(--db-green);
}
body.light .of-dashboard-wrap .dp-badge-btn:hover {
  background: rgba(34,197,94,0.18);
}

body.light .of-dashboard-wrap .dp-view-btn {
  border-radius: 5px;
  color: var(--db-text-2);
}
body.light .of-dashboard-wrap .dp-view-btn:hover {
  color: var(--db-text);
}
body.light .of-dashboard-wrap .dp-view-btn.active {
  background: var(--db-card);
  color: var(--db-text);
  border: 1px solid color-mix(in srgb, var(--db-text-2) 18%, transparent) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body.light .of-dashboard-wrap .dp-mobile-nav-btn {
  background: var(--db-surface2);
  border-radius: 8px;
  color: var(--db-text);
}
body.light .of-dashboard-wrap .dp-mobile-nav-btn:hover {
  background: var(--db-surface2);
}

body.light .of-dashboard-wrap .dp-inline-stat-btn:hover {
  background: var(--db-surface2);
}

body.light .of-dashboard-wrap .dp-group-toggle {
  background: color-mix(in srgb, var(--db-text) 6%, transparent);
  border-radius: 20px;
  color: var(--db-text-2);
}
body.light .of-dashboard-wrap .dp-group-toggle:hover {
  background: color-mix(in srgb, var(--db-text) 12%, transparent);
  color: var(--db-text);
}

body.light .of-dashboard-wrap .dp-row-time {
  color: var(--db-accent);
  border-radius: 5px;
}
body.light .of-dashboard-wrap .dp-row-time:hover {
  background: color-mix(in srgb, var(--db-accent) 10%, transparent);
}
body.light .of-dashboard-wrap .dp-row-time-done {
  color: var(--db-green);
  background: color-mix(in srgb, var(--db-green) 10%, transparent);
}

body.light .of-dashboard-wrap .dp-nav-jobs-btn {
  background: transparent;
  color: var(--db-text);
}
body.light .of-dashboard-wrap .dp-nav-jobs-btn:hover,
body.light .of-dashboard-wrap .dp-nav-jobs-btn.active {
  background: transparent;
  border: 1px solid var(--db-border) !important;
  border-radius: 8px;
}

body.light .of-dashboard-wrap .dp-reschedule-option {
  color: var(--db-text);
}
body.light .of-dashboard-wrap .dp-reschedule-option:hover {
  color: var(--db-accent);
}

body.light .of-dashboard-wrap .dp-nav-date-option {
  color: var(--db-text);
  background: transparent;
}
body.light .of-dashboard-wrap .dp-nav-date-option:hover {
  background: var(--db-surface2);
}

body.light .of-dashboard-wrap .dp-loc-btn {
  color: var(--db-text-3);
}
body.light .of-dashboard-wrap .dp-loc-btn:hover {
  color: var(--db-accent);
}

body.light .of-dashboard-wrap .dp-tech-trigger {
  color: var(--db-text-2);
}
body.light .of-dashboard-wrap .dp-tech-trigger:hover {
  color: var(--db-accent);
}

body.light .of-dashboard-wrap .dp-row-phone {
  font-size: 12px;
  color: var(--db-text-3);
}
body.light .of-dashboard-wrap .dp-row-phone:hover {
  color: var(--db-accent);
}

body.light .of-dashboard-wrap .dp-row-tech-btn {
  color: var(--db-text-2);
}
body.light .of-dashboard-wrap .dp-row-tech-btn:hover {
  color: var(--db-accent);
  text-decoration: underline;
}

/* Re-establish dashboard-specific button hover styles for dark mode (0,4,1) */
body:not(.light) .of-dashboard-wrap .dp-badge-btn {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25) !important;
  border-radius: 100px;
  color: var(--db-green);
}
body:not(.light) .of-dashboard-wrap .dp-badge-btn:hover {
  background: rgba(34,197,94,0.2);
}

body:not(.light) .of-dashboard-wrap .dp-view-btn {
  border-radius: 5px;
  color: var(--db-text-2);
}
body:not(.light) .of-dashboard-wrap .dp-view-btn:hover {
  background: color-mix(in srgb, var(--db-text) 8%, transparent);
  color: var(--db-text);
}
body:not(.light) .of-dashboard-wrap .dp-view-btn.active {
  background: var(--db-card);
  color: var(--db-text);
  border: 1px solid color-mix(in srgb, var(--db-text-2) 18%, transparent) !important;
}

body:not(.light) .of-dashboard-wrap .dp-mobile-nav-btn:hover {
  background: var(--db-surface2);
}

body:not(.light) .of-dashboard-wrap .dp-inline-stat-btn:hover {
  background: var(--db-surface2);
}

body:not(.light) .of-dashboard-wrap .dp-group-toggle:hover {
  background: color-mix(in srgb, var(--db-text) 12%, transparent);
  color: var(--db-text);
}

body:not(.light) .of-dashboard-wrap .dp-row-time:hover {
  background: color-mix(in srgb, var(--db-accent) 10%, transparent);
}

body:not(.light) .of-dashboard-wrap .dp-nav-jobs-btn:hover,
body:not(.light) .of-dashboard-wrap .dp-nav-jobs-btn.active {
  background: transparent;
  border: 1px solid var(--db-border) !important;
  border-radius: 8px;
}

body:not(.light) .of-dashboard-wrap .dp-reschedule-option:hover {
  background: color-mix(in srgb, var(--db-accent) 10%, transparent);
  color: var(--db-accent);
}

body:not(.light) .of-dashboard-wrap .dp-nav-date-option:hover {
  background: var(--db-surface2);
}

body:not(.light) .of-dashboard-wrap .dp-loc-btn:hover {
  color: var(--db-accent);
}

body:not(.light) .of-dashboard-wrap .dp-tech-trigger:hover {
  color: var(--db-accent);
}

body:not(.light) .of-dashboard-wrap .dp-row-phone {
  font-size: 12px;
  color: var(--db-text-3);
}
body:not(.light) .of-dashboard-wrap .dp-row-phone:hover {
  color: var(--db-accent);
}

body:not(.light) .of-dashboard-wrap .dp-row-tech-btn:hover {
  color: var(--db-accent);
  text-decoration: underline;
}

/* Restore specific anchor colours after reset */
.of-dashboard-wrap .dp-loc-dir-btn,
body.light .of-dashboard-wrap .dp-loc-dir-btn {
  color: var(--db-accent);
}
.of-dashboard-wrap .dp-loc-dir-btn:hover,
body.light .of-dashboard-wrap .dp-loc-dir-btn:hover {
  color: var(--db-accent);
  background: var(--db-surface2);
}
.of-dashboard-wrap .dp-tooltip-option,
body.light .of-dashboard-wrap .dp-tooltip-option {
  color: var(--db-text);
}
.of-dashboard-wrap .dp-tooltip-option:hover,
body.light .of-dashboard-wrap .dp-tooltip-option:hover {
  color: var(--db-text);
  background: var(--db-surface2);
}

.of-dashboard-wrap *, .of-dashboard-wrap *::before, .of-dashboard-wrap *::after {
  box-sizing: border-box;
}
.of-dashboard-wrap button, .of-dashboard-wrap input {
  font-family: inherit;
  font-size: inherit;
}

/* ── Dashboard Preview Shell ── */
.dashboard-preview {
  background: var(--db-surface);
  border: 1px solid var(--db-border2);
  border-radius: 16px;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dp-top-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 20px;
  background: transparent;
  border-bottom: 1px solid var(--db-border);
}
body:not(.light) .dp-top-bar {
  background: var(--db-surface2);
}

.dp-acme-logo {
  color: var(--db-text-2);
  flex-shrink: 0;
  opacity: 0.7;
}

.dp-dot { display: none; }

.dp-title {
  font-family: var(--db-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--db-text-2);
}

.dp-top-bar-app {
  display: none;
  align-items: center;
  gap: 9px;
}

.dp-app-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--db-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dp-app-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--db-text);
  line-height: 1.2;
}

.dp-app-sub {
  font-size: 12px;
  color: var(--db-text-3);
  line-height: 1.3;
  font-family: var(--db-sans);
}

/* ── Agent Activity Badge ── */
.dp-badge {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  font-size: 12px;
  font-weight: 500;
  color: var(--db-green);
  font-family: var(--db-sans);
}

.dp-badge-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: 1px solid rgba(34,197,94,0.25);
  outline: none;
  transition: background 0.15s;
}
.dp-badge-btn:hover {
  background: rgba(34,197,94,0.18);
}

.dp-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--db-green);
  flex-shrink: 0;
  animation: db-badge-pulse 2s ease-in-out infinite;
}

.dp-badge-count {
  background: var(--db-accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 20px;
  animation: db-badge-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 var(--db-accent);
}

@keyframes db-badge-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--db-accent) 70%, transparent); }
  60%  { box-shadow: 0 0 0 5px color-mix(in srgb, var(--db-accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--db-accent) 0%, transparent); }
}

/* ── Activity Panel ── */
.dp-activity-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  height: auto;
  max-height: 560px;
  background: var(--db-surface);
  border: 1px solid var(--db-border2);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 9999;
}

.dp-activity-group {
  border-bottom: 1px solid var(--db-border);
}
.dp-activity-group:last-child {
  border-bottom: none;
}
.dp-activity-group-label {
  padding: 7px 14px 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--db-text-3);
}

.dp-activity-header {
  padding: 10px 14px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--db-text-3);
  border-bottom: 1px solid var(--db-border);
}

.dp-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--db-border);
  transition: background 0.12s;
}
.dp-activity-item:last-child { border-bottom: none; }
.dp-activity-item:hover { background: var(--db-surface2); }

.dp-activity-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--db-surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.dp-activity-body {
  flex: 1;
  min-width: 0;
}

.dp-activity-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--db-text);
  line-height: 1.3;
}

.dp-activity-sub {
  font-size: 11px;
  color: var(--db-text-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dp-activity-time {
  font-size: 10px;
  color: var(--db-text-3);
  white-space: nowrap;
  margin-top: 2px;
}

/* ── Body Layout ── */
.dp-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dp-sidebar {
  padding: 20px 16px;
  border-right: 1px solid var(--db-border);
  overflow-y: auto;
}

.dp-mobile-nav { display: none; }
.dp-mobile-stats { display: none; }

.dp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 2px;
  color: var(--db-text-2);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dp-nav-item:hover, .dp-nav-item.active {
  background: var(--db-surface2);
  color: var(--db-text);
}

.dp-nav-item.active { padding-left: 10px; }

.dp-nav-badge {
  margin-left: auto;
  background: var(--db-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 20px;
  letter-spacing: 0;
  animation: db-badge-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 var(--db-accent);
}

/* ── Main Area ── */
.dp-main { padding: 16px; 
  overflow-y: auto;
  overflow-x:hidden;
  flex: 1; min-height: 0; 
  display: flex; 
  flex-direction: column; 
}

.dp-schedule-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.dp-inline-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.dp-inline-stat-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  outline: none;
  border-radius: 8px;
  cursor: pointer;
  min-width: 56px;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}
.dp-inline-stat-btn:hover {
  background: var(--db-surface2);
}

.dp-inline-stat-l {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--db-text-3);
  white-space: nowrap;
}

.dp-inline-stat-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dp-inline-stat-n {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1;
  color: var(--db-text);
}

.dp-stat-dropdown {
  min-width: 160px;
  right: 0;
  left: auto;
}

.dp-stat-dropdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border-radius: 6px;
}

/* ── Nav Jobs Button ── */
.dp-nav-jobs-btn {
  width: auto;
  justify-content: flex-start;
  cursor: pointer;
  text-align: left;
  border: 1px solid transparent;
  outline: none;
  background: none;
}

body.light .dp-nav-jobs-btn.active,
body.light .dp-nav-jobs-btn:hover {
  background: transparent;
  border: 1px solid var(--db-border);
}

.dp-nav-date-dropdown {
  background: var(--db-surface);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  min-width: 190px;
  overflow: hidden;
  padding: 4px;
}

.dp-nav-date-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 0;
  border: none;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  background: transparent;
  color: var(--db-text);
  transition: background 0.12s;
}
.dp-nav-date-option:hover { background: transparent; }
.dp-nav-date-option.active { background: transparent; }
.dp-nav-date-option--disabled {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.dp-nav-date-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.dp-nav-date-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--db-text);
  line-height: 1.2;
}
.dp-nav-date-option.active .dp-nav-date-label {
  color: var(--db-accent);
}

.dp-nav-date-sub {
  font-size: 10px;
  color: var(--db-text-3);
}

.dp-nav-date-jobs {
  font-size: 10px;
  font-weight: 600;
  color: var(--db-text-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.dp-nav-date-option.active .dp-nav-date-jobs {
  color: var(--db-accent);
}

/* ── Job Rows ── */
.dp-rows {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.dp-rows--list { grid-template-columns: 1fr; }
.dp-rows--grid { grid-template-columns: repeat(2, 1fr); }

.dp-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px 0;
  border-radius: 10px;
  border: 1px solid var(--db-border);
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

body:not(.light) .dp-row {
  background: var(--db-surface2);
}

.dp-row-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  border-top: 1px solid var(--db-border);
}
.dp-row-header .dp-edit-btn { margin-left: auto; }
.dp-row-header .dp-tech-trigger { order: -1; }

.dp-row-job-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.dp-row-job {
  font-size: 15px;
  font-weight: 700;
  color: var(--db-text);
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.dp-row-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--db-accent);
  background: transparent;
  border: none;
  border-radius: 5px;
  padding: 2px 7px;
  cursor: pointer;
}
.dp-row-time:hover {
  background: color-mix(in srgb, var(--db-accent) 10%, transparent);
}
.dp-row-time-done {
  color: var(--db-green);
  background: color-mix(in srgb, var(--db-green) 10%, transparent);
  cursor: default;
  pointer-events: none;
}

/* Reschedule tooltip */
.dp-reschedule-tooltip {
  background: var(--db-surface);
  border: 1px solid var(--db-border2);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  min-width: 130px;
}
.dp-reschedule-header {
  font-size: 10px;
  font-weight: 600;
  color: var(--db-text-3);
  padding: 7px 12px 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.dp-reschedule-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--db-text);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  border-top: 1px solid var(--db-border);
}
.dp-reschedule-option:hover {
  color: var(--db-accent);
}

/* Customer row */
.dp-row-customer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.of-dashboard-wrap .dp-row-phone {
  font-size: 12px;
  color: var(--db-text-3);
  letter-spacing: 0.02em;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.of-dashboard-wrap .dp-row-phone:hover {
  color: var(--db-accent);
  text-decoration: underline;
}

/* Phone / contact tooltip */
.dp-tooltip {
  background: var(--db-surface);
  border: 1px solid var(--db-border2);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: row;
  overflow: hidden;
  pointer-events: all;
}

.dp-tooltip-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--db-text);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s;
}
.dp-tooltip-option:hover {
  background: var(--db-surface2);
}
.dp-tooltip-option + .dp-tooltip-option {
  border-left: 1px solid var(--db-border);
}

/* Location pin */
.dp-loc-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--db-text-3);
  vertical-align: middle;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.dp-loc-btn:hover {
  color: var(--db-accent);
}

.dp-loc-tooltip {
  background: var(--db-surface);
  border: 1px solid var(--db-border2);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 160px;
  max-width: 220px;
  pointer-events: all;
}

.dp-loc-address {
  font-size: 11px;
  color: var(--db-text-2);
  padding: 8px 12px 6px;
  line-height: 1.4;
}

.dp-loc-dir-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--db-accent);
  text-decoration: none;
  border-top: 1px solid var(--db-border);
  transition: background 0.12s;
}
.dp-loc-dir-btn:hover {
  background: var(--db-surface2);
}

/* Tech avatar / trigger */
.dp-tech-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--db-border);
}

.dp-row-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--db-text);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.of-dashboard-wrap .dp-row-name-trigger {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
}
.of-dashboard-wrap .dp-row-name-trigger:hover {
  text-decoration: underline;
  color: var(--db-accent);
}

.dp-row-tech-btn {
  font-size: 11px;
  color: var(--db-text-2);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.dp-row-tech-btn:hover {
  color: var(--db-accent);
  text-decoration: underline;
}

.dp-tech-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  color: var(--db-text-2);
  border-radius: 4px;
}
.dp-tech-trigger:hover {
  color: var(--db-accent);
}
.dp-tech-trigger:hover .dp-tech-avatar {
  outline: 2px solid var(--db-accent);
}

.dp-row-amount {
  font-family: var(--db-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--db-green);
  background: rgba(34,197,94,0.1);
  border-radius: 4px;
  padding: 1px 5px;
}

.dp-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(168,85,247,0.9);
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

body:not(.light) .dp-ai-badge {
  color: #C084FC;
  background: rgba(192,132,252,0.1);
  border-color: rgba(192,132,252,0.25);
}

/* New lead ribbon */
.dp-row-new-lead {
  border-color: rgba(168,85,247,0.55);
  box-shadow: 0 0 0 1px rgba(168,85,247,0.2), 0 2px 12px rgba(168,85,247,0.12);
  background: transparent;
  overflow: hidden;
}
body:not(.light) .dp-row-new-lead {
  background: linear-gradient(160deg, rgba(168,85,247,0.06) 0%, var(--db-surface2) 60%);
}

/* ── Group labels ── */
.dp-group-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--db-text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 0 2px;
  margin-top: 8px;
  cursor: pointer;
  user-select: none;
}
.dp-group-label:first-child { margin-top: 0; }
.dp-group-label:hover { color: var(--db-text); }
.dp-group-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: color-mix(in srgb, var(--db-text) 6%, transparent);
  border: none;
  border-radius: 20px;
  padding: 2px 6px 2px 8px;
  cursor: pointer;
  color: var(--db-text-2);
  transition: background 0.15s, color 0.15s;
}
.dp-group-toggle:hover {
  background: color-mix(in srgb, var(--db-text) 12%, transparent);
  color: var(--db-text);
}
.dp-group-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.7;
}
.dp-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}
.dp-group-dot--amber { background: var(--db-amber); }
.dp-group-dot--blue  { background: var(--db-blue); }
.dp-group-dot--green { background: var(--db-green); }
.dp-group-count {
  font-size: 10px;
  font-weight: 500;
  color: inherit;
}

/* ── View Toggle ── */
.dp-view-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: color-mix(in srgb, var(--db-text) 6%, transparent);
  border-radius: 7px;
  padding: 2px;
  flex-shrink: 0;
}
.dp-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--db-text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dp-view-btn:hover { color: var(--db-text); }
.dp-view-btn.active {
  background: var(--db-card);
  color: var(--db-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid color-mix(in srgb, var(--db-text-2) 18%, transparent);
}

/* Chips */
.dp-chip {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.chip-blue   { background: rgba(21,101,168,0.10);  color: #1565A8; }
.chip-amber  { background: rgba(21,101,168,0.10);  color: #1565A8; }
.chip-green  { background: rgba(22,163,74,0.10);   color: #15803d; }

body:not(.light) .chip-blue   { background: rgba(56,189,248,0.12);  color: #7DD3FC; }
body:not(.light) .chip-amber  { background: rgba(56,189,248,0.12);  color: #7DD3FC; }
body:not(.light) .chip-green  { background: rgba(34,197,94,0.12);   color: #4ADE80; }

/* ── Thin scrollbars ── */
.of-dashboard-wrap ::-webkit-scrollbar {
  width: 2px;
  height: 2px;
}
.of-dashboard-wrap ::-webkit-scrollbar-track {
  background: transparent;
}
.of-dashboard-wrap ::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--db-text) 18%, transparent);
  border-radius: 99px;
}
.of-dashboard-wrap ::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--db-text) 32%, transparent);
}
.of-dashboard-wrap * {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--db-text) 18%, transparent) transparent;
}

/* ── Mobile Responsive ── */
@media (max-width: 900px) {
  .dp-top-bar-app { display: none; }
  .dp-view-toggle { display: none; }
  .dp-badge { margin-left: 0; font-size: 10px; padding: 3px 9px; }

  .of-dashboard-wrap {
    height: 620px;
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
  }
  .dashboard-preview {
    overflow: hidden;
    margin-left: 0;
    margin-right: 0;
    border-radius: 16px;
    /* box-shadow: 0 8px 48px rgba(0,0,0,0.18), 0 2px 12px rgba(0,0,0,0.1); */
  }
  .dp-activity-panel {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    bottom: auto;
    width: 280px;
    height: auto;
    max-height: 58dvh;
    overflow-y: auto;
    border: 1px solid var(--db-border2);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  }
  .dp-body {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
  .dp-sidebar {
    display: flex;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--db-border);
    padding: 10px 16px;
    gap: 6px;
    overflow: visible;
    position: relative;
  }
  .dp-sidebar-inner { display: none; }
  .dp-mobile-nav { display: block; }
  .dp-mobile-stats { display: block; }
  .dp-mobile-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--db-surface2);
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--db-text);
    white-space: nowrap;
    min-width: 0;
  }
  .dp-mobile-nav-dropdown { min-width: 200px; }
  .dp-mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--db-text-2);
    cursor: pointer;
    transition: background 0.12s;
  }
  .dp-mobile-nav-item:hover {
    background: var(--db-surface2);
    color: var(--db-text);
  }
  .dp-mobile-nav-item--active {
    color: var(--db-text);
    font-weight: 500;
  }
  .dp-mobile-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
  }
  .dp-mobile-stat-label { color: var(--db-text-2); }
  .dp-mobile-stat-value {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--db-text);
  }
  .dp-inline-stats { display: none; }
  .dp-schedule-bar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }
  .dp-rows:not(.dp-rows--grid) { grid-template-columns: 1fr; gap: 10px; }
  .dp-row { padding: 14px 16px 0; gap: 8px; }
  .dp-row-time, .dp-row-time-done { min-height: 24px; padding: 4px 8px; }
  .dp-row-time { font-size: 12px; }
  .dp-loc-btn { min-width: 24px; min-height: 24px; }
  .dp-row-phone { min-height: 24px; display: inline-flex; align-items: center; }
  .dp-chip { min-height: 24px; display: inline-flex; align-items: center; padding: 4px 10px; }
  .dp-ai-badge { min-height: 24px; align-items: center; }
  .dp-tech-trigger { min-height: 24px; }
  .dp-row-amount { min-height: 24px; display: inline-flex; align-items: center; }
  .dp-row-header { gap: 8px; }

  /* New views mobile */
  .dp-stat-cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dp-act-row { flex-wrap: wrap; gap: 8px; }
  .dp-act-row-time { margin-left: 36px; }
  .dp-lead-card { padding: 12px 14px; }
  .dp-cust-table th, .dp-cust-table td { padding: 8px 6px; font-size: 11px; }
  .dp-cust-hide-mobile { display: none; }
  .dp-cust-email { display: none; }
  .dp-cust-table-wrap { margin: 0 -8px; }
  .dp-page-title { font-size: 14px; }
}

/* ══════════════════════════════════════════════
   New Views – Agent Activity, Lead Pipeline, Customers
   ══════════════════════════════════════════════ */

/* ── Page header ── */
.dp-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.dp-page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--db-text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.dp-page-subtitle {
  font-size: 12px;
  height: 16px;
  color: var(--db-text-3);
  font-weight: 500;
}

/* ── Stat cards row ── */
.dp-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.dp-stat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--db-border);
  background: var(--db-card);
}
.dp-stat-card--filter {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  user-select: none;
}
.dp-stat-card--filter:hover {
  border-color: var(--db-border2);
  background: color-mix(in srgb, var(--db-text) 4%, var(--db-card));
}
.dp-stat-card--active {
  border-color: var(--db-accent) !important;
  box-shadow: 0 0 0 1px var(--db-accent);
  background: color-mix(in srgb, var(--db-accent) 8%, var(--db-card)) !important;
}
body:not(.light) .dp-stat-card {
  background: var(--db-surface2);
}
.dp-stat-card-n {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.dp-stat-card-l {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--db-text-3);
}

/* ── Agent Activity (full view) ── */
.dp-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dp-act-group {
  margin-bottom: 8px;
}
.dp-act-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--db-text-3);
  padding: 6px 0 4px;
  border-bottom: 1px solid var(--db-border);
  margin-bottom: 2px;
}
.dp-act-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  transition: background 0.12s;
}
.dp-act-row:hover {
  background: var(--db-surface2);
}
body:not(.light) .dp-act-row:hover {
  background: color-mix(in srgb, var(--db-text) 6%, transparent);
}
.dp-act-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.dp-act-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--db-text);
}
.dp-act-row-sub {
  font-size: 12px;
  color: var(--db-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-act-row-time {
  font-size: 11px;
  color: var(--db-text-3);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Lead Pipeline ── */
.dp-lead-pipeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dp-lead-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid var(--db-border);
  background: var(--db-card);
  transition: border-color 0.15s;
}
body:not(.light) .dp-lead-card {
  background: var(--db-surface2);
}
.dp-lead-card:hover {
  border-color: var(--db-border2);
}
.dp-lead-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dp-lead-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--db-text);
}
.dp-lead-time {
  font-size: 11px;
  color: var(--db-text-3);
  white-space: nowrap;
}
.dp-lead-card-mid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dp-lead-service {
  font-size: 12px;
  font-weight: 600;
  color: var(--db-text-2);
}
.dp-lead-stage {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dp-lead-card-bot {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dp-lead-source {
  font-size: 11px;
  color: var(--db-text-3);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Customers Table ── */
.dp-cust-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--db-border);
}
.dp-cust-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dp-cust-table thead {
  background: var(--db-surface2);
}
body:not(.light) .dp-cust-table thead {
  background: color-mix(in srgb, var(--db-text) 6%, transparent);
}
.dp-cust-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--db-text-3);
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--db-border);
}
.dp-cust-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--db-border);
  vertical-align: middle;
}
.dp-cust-table tbody tr {
  transition: background 0.12s;
}
.dp-cust-table tbody tr:hover {
  background: var(--db-surface2);
}
body:not(.light) .dp-cust-table tbody tr:hover {
  background: color-mix(in srgb, var(--db-text) 4%, transparent);
}
.dp-cust-table tbody tr:last-child td {
  border-bottom: none;
}
.dp-cust-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--db-text);
  line-height: 1.2;
}
.dp-cust-email {
  font-size: 11px;
  color: var(--db-text-3);
  margin-top: 1px;
}
.dp-cust-phone {
  font-size: 12px;
  color: var(--db-text-2);
  white-space: nowrap;
}
.dp-cust-svc {
  font-size: 12px;
  font-weight: 500;
  color: var(--db-text);
}
.dp-cust-date {
  font-size: 11px;
  color: var(--db-text-3);
}
.dp-cust-jobs {
  font-weight: 700;
  color: var(--db-text);
  text-align: center;
}
.dp-cust-rev {
  font-family: var(--db-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--db-green);
  white-space: nowrap;
}
.dp-cust-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.dp-cust-status--active {
  background: rgba(22,163,74,0.1);
  color: #15803d;
}
.dp-cust-status--new {
  background: rgba(37,99,235,0.1);
  color: #2563EB;
}
body:not(.light) .dp-cust-status--active {
  background: rgba(34,197,94,0.12);
  color: #4ADE80;
}
body:not(.light) .dp-cust-status--new {
  background: rgba(56,189,248,0.12);
  color: #7DD3FC;
}
