/**
 * dashboard.css — Owner Dashboard UI
 *
 * Shared across every demo's "behind the curtain" dashboard view (metrics,
 * pipeline, leads table, GEO score, knowledge base, automation). The HTML
 * that consumes these classes lives per-industry in configs/*.content.html
 * because the copy and sample data differ; the layout primitives here do not.
 *
 * Color tokens come from krevio-tokens.css; accent colors come from the
 * industry-overrides.css layer via the data-industry attribute. Structural
 * pixel values (3/6/7/10/14/22/28px) are intentionally finer-grained than
 * the --space scale — the dashboard uses a denser grid than customer-facing
 * sections, so this file is scoped out of the strict-value stylelint rule
 * (see scripts/.stylelintrc.json overrides).
 */

/* ─── Layout ─── */
.od-layout { display: flex; min-height: calc(100vh - 40px); }
.od-sidebar {
  width: 220px; flex-shrink: 0; background: var(--bg1);
  border-right: 1px solid var(--border); padding: 16px 8px;
  display: flex; flex-direction: column; position: sticky; top: 40px;
  height: calc(100vh - 40px); overflow-y: auto;
}
.od-sidebar-logo { padding: 0 8px; margin-bottom: 20px; }
.od-sidebar-logo-name { font-weight: 700; font-size: var(--text-base); color: var(--t0); }
.od-sidebar-logo-sub { font-size: var(--text-xs); color: var(--t2); }
.od-nav-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: var(--radius-md); border: none; background: transparent;
  color: var(--t1); font-size: var(--text-sm); font-weight: 500;
  cursor: pointer; font-family: var(--font-body); width: 100%;
  text-align: left; transition: all .15s; margin-bottom: 2px;
}
.od-nav-item:hover { background: var(--bg2); color: var(--t0); }
.od-nav-item.active, .od-nav-item[aria-selected="true"] {
  background: var(--sidebar-active); color: var(--sidebar-active-text);
}
.od-nav-icon { width: 18px; text-align: center; flex-shrink: 0; }
.od-main { flex: 1; padding: 24px; overflow-x: hidden; }
.od-view { display: none; }
.od-view.active { display: block; }
.od-header { margin-bottom: 20px; }
.od-header-title { font-size: var(--text-2xl); font-weight: 700; color: var(--t0); margin-bottom: 4px; }
.od-header-sub { font-size: var(--text-sm); color: var(--t2); }

/* ─── Metrics cards ─── */
.metrics-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.metric-card { background: var(--bg1); border-radius: var(--radius-lg); padding: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.metric-label { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--t2); margin-bottom: 6px; }
.metric-value { font-size: var(--text-xl); font-weight: 700; color: var(--t0); margin-bottom: 4px; }
.metric-trend { font-size: var(--text-xs); color: var(--t2); }
.metric-trend.up { color: var(--green); }
.metric-trend.down { color: var(--red); }

/* ─── Surface cards ─── */
.card-dashboard { background: var(--bg1); border-radius: var(--radius-xl); padding: 22px 24px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.card-title { font-size: var(--text-md); font-weight: 700; color: var(--t0); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card-highlight { background: var(--accentS); border: 1px solid var(--accentB); border-radius: var(--radius-xl); padding: 16px 20px; margin-bottom: 16px; }
.ai-summary-label { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.ai-summary-text { font-size: var(--text-base); color: var(--t0); line-height: var(--leading-relaxed); }

/* ─── Schedule table ─── */
.today-schedule { width: 100%; border-collapse: collapse; }
.today-schedule th { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--t2); padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.today-job td { padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: var(--text-base); vertical-align: middle; }
.today-time { font-weight: 700; color: var(--accent); font-size: var(--text-sm); white-space: nowrap; }
.today-customer { font-weight: 600; color: var(--t0); font-size: var(--text-sm); }
.today-service { font-size: var(--text-xs); color: var(--t2); }
.today-status-confirmed { background: var(--greenS); color: var(--green); border: 1px solid var(--greenB); border-radius: var(--radius-full); padding: 3px 10px; font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.today-status-pending { background: var(--amberS); color: var(--amber); border: 1px solid var(--amberB); border-radius: var(--radius-full); padding: 3px 10px; font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }

/* ─── Badges ─── */
.badge { font-size: var(--text-xs); font-weight: 600; padding: 3px 10px; border-radius: var(--radius-full); display: inline-flex; align-items: center; }
.badge--accent { background: var(--accentS); color: var(--accent); }
.badge--green { background: var(--greenS); color: var(--green); }
.badge--amber { background: var(--amberS); color: var(--amber); }
.badge--red { background: var(--redS); color: var(--red); }
.badge--muted { background: var(--bg2); color: var(--t2); }

/* ─── Data table ─── */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.data-table th { padding: 10px 12px; font-size: var(--text-xs); text-transform: uppercase; color: var(--t2); border-bottom: 1px solid var(--border); text-align: left; letter-spacing: .04em; font-weight: 700; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--t0); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ─── Filter bar ─── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.filter-search { padding: 7px 10px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg2); color: var(--t0); font-size: var(--text-sm); font-family: var(--font-body); width: 180px; }
.filter-select { padding: 7px 10px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--bg2); color: var(--t0); font-size: var(--text-sm); font-family: var(--font-body); }

/* ─── Pipeline / Kanban ─── */
.pipeline-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.pipeline-col { flex: 0 0 240px; background: var(--bg2); border-radius: var(--radius-xl); padding: 12px; }
.pipeline-col-header { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.pipeline-col-count { background: var(--bg3); border-radius: var(--radius-full); padding: 1px 7px; font-size: 10px; color: var(--t2); }
.pipeline-card { background: var(--bg1); border-radius: var(--radius-md); padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--border); }
.pipeline-card-name { font-weight: 600; font-size: var(--text-sm); color: var(--t0); margin-bottom: 3px; }
.pipeline-card-service { font-size: var(--text-xs); color: var(--t2); margin-bottom: 6px; }
.pipeline-card-meta { display: flex; align-items: center; justify-content: space-between; }

/* ─── GEO score gauge ─── */
.geo-gauge-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.geo-gauge { width: 140px; height: 140px; border-radius: 50%; background: conic-gradient(var(--accent) 0%, var(--accent) calc(var(--pct) * 1%), var(--bg3) calc(var(--pct) * 1%)); display: flex; align-items: center; justify-content: center; position: relative; box-shadow: var(--shadow-md); }
.geo-gauge-inner { width: 108px; height: 108px; border-radius: 50%; background: var(--bg1); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.geo-gauge-score { font-size: 28px; font-weight: 700; color: var(--t0); line-height: 1; }
.geo-gauge-label { font-size: var(--text-xs); color: var(--t2); }
.geo-category-bar { margin-bottom: 10px; }
.geo-cat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.geo-cat-name { font-size: var(--text-sm); font-weight: 500; color: var(--t0); }
.geo-cat-score { font-size: var(--text-sm); font-weight: 700; color: var(--t0); }
.geo-bar-track { height: 6px; background: var(--bg3); border-radius: var(--radius-full); overflow: hidden; }
.geo-bar-fill { height: 100%; border-radius: var(--radius-full); background: var(--accent); }

/* ─── Knowledge base FAQ ─── */
.kb-faq { border-bottom: 1px solid var(--border); }
.kb-faq-q { width: 100%; padding: 14px 0; background: none; border: none; color: var(--t0); font-size: var(--text-md); font-weight: 600; cursor: pointer; text-align: left; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-body); }
.kb-faq-q .arrow { font-size: 12px; color: var(--t2); transition: transform .2s; }
.kb-faq.open .kb-faq-q .arrow { transform: rotate(180deg); }
.kb-faq-a { display: none; padding: 0 0 14px; font-size: var(--text-base); color: var(--t1); line-height: var(--leading-relaxed); }
.kb-faq.open .kb-faq-a { display: block; }

/* ─── Automation ─── */
.automation-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.automation-stat { background: var(--bg1); border-radius: var(--radius-lg); padding: 14px; border: 1px solid var(--border); text-align: center; }
.automation-stat-icon { font-size: 20px; margin-bottom: 6px; }
.automation-stat-val { font-size: var(--text-xl); font-weight: 700; color: var(--t0); }
.automation-stat-label { font-size: var(--text-xs); color: var(--t2); }
.campaign-card { background: var(--bg1); border-radius: var(--radius-xl); padding: 18px; border: 1px solid var(--border); margin-bottom: 10px; }
.campaign-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.campaign-icon { font-size: 20px; }
.campaign-name { font-weight: 700; font-size: var(--text-md); color: var(--t0); }
.campaign-desc { font-size: var(--text-sm); color: var(--t2); line-height: var(--leading-normal); }

/* ─── Misc ─── */
.empty-state { text-align: center; padding: 32px; color: var(--t2); font-size: var(--text-base); }
.od-hamburger { display: none; }
.od-sidebar-overlay { display: none; }
.dash-bottom-cta { text-align: center; padding: 48px 24px; margin-top: 24px; background: var(--bg2); border-radius: var(--radius-xl); border: 1px solid var(--border); }
.dash-bottom-cta h3 { font-size: var(--text-lg); font-weight: 700; color: var(--t0); margin-bottom: 8px; }
.dash-bottom-cta p { font-size: var(--text-base); color: var(--t2); margin-bottom: 16px; max-width: 500px; margin-left: auto; margin-right: auto; }
.dash-cta-btn { display: inline-block; padding: 12px 28px; background: var(--accent); color: var(--btn-primary-color); border-radius: var(--radius-full); font-weight: 600; font-size: var(--text-md); text-decoration: none; }
.dash-cta-btn:hover { opacity: var(--alpha-strong); }

/* ─── Remodeling/realestate gallery before/after overrides ─── */
.gallery-item .gallery-before { background: var(--redS); border: 1px solid var(--redB); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 28px 20px; text-align: center; }
.gallery-item .gallery-after { background: var(--accentS); border: 1px solid var(--accentB); border-radius: 0 0 var(--radius-xl) var(--radius-xl); padding: 28px 20px; text-align: center; }
.gallery-emoji { font-size: 32px; margin-bottom: 8px; }
.gallery-meta { text-align: center; margin-top: 10px; }
.gallery-location { font-size: var(--text-xs); color: var(--t2); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .od-sidebar { position: fixed; top: 40px; left: -220px; z-index: var(--z-nav); height: calc(100vh - 40px); transition: left .25s; }
  .od-sidebar.open { left: 0; }
  .od-sidebar-overlay { position: fixed; inset: 40px 0 0; background: var(--overlay); z-index: calc(var(--z-nav) - 1); }
  .od-sidebar.open ~ .od-sidebar-overlay { display: block; }
  .od-hamburger { display: flex; position: fixed; top: 46px; left: 10px; z-index: var(--z-hamburger); background: var(--bg1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 5px 8px; cursor: pointer; font-size: 16px; }
  .od-main { padding: 14px 14px 14px 46px; }
  .metrics-grid, .automation-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .metrics-grid, .automation-grid { grid-template-columns: repeat(2,1fr); }
  .pipeline-col { flex: 0 0 200px; }
  .filter-search { width: 100%; }
  .hide-mobile { display: none; }
}
