/* =============================================
   Cloud Analyzer - Dashboard Styles
   ============================================= */

:root {
  --bg: #0f1117;
  --sidebar-bg: #161922;
  --surface: #1c1f2e;
  --surface-hover: #252838;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e6f0;
  --text-muted: #8b8fa3;
  --text-dim: #5d6175;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-bg: rgba(99, 102, 241, 0.12);
  --green: #22c55e;
  --green-bg: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.12);
  --chart-green: #22c55e;
  --chart-blue: #3b82f6;
  --chart-line: rgba(255, 255, 255, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* =============================================
   Reset & Base
   ============================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.3;
}

p {
  margin: 0;
}

/* =============================================
   Sidebar
   ============================================= */

.sidebar {
  width: 240px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: transform 0.25s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar__icon {
  color: var(--accent-light);
  flex-shrink: 0;
}

.sidebar__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sidebar__nav {
  padding: 16px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__spacer {
  flex: 1;
}

.sidebar__bottom {
  padding: 8px 0 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: block;
  width: calc(100% - 24px);
  padding: 10px 20px;
  margin: 0 12px;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent-light);
  font-weight: 600;
}

.nav-item--action {
  font-size: 0.85rem;
}

/* =============================================
   Topbar
   ============================================= */

.topbar {
  margin-left: 240px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.topbar__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: background 0.15s;
}

.topbar__hamburger:hover span {
  background: var(--text);
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.topbar__tenant {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.topbar__status {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topbar__center {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* =============================================
   Search
   ============================================= */

.search-bar {
  position: relative;
  width: 100%;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-bar input::placeholder {
  color: var(--text-dim);
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow: auto;
  display: none;
  z-index: 20;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.1s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--surface-hover);
}

.search-result-item__title {
  font-weight: 500;
  color: var(--text);
}

.search-result-item__meta {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 2px;
}

.search-result-group {
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* =============================================
   Main Content
   ============================================= */

.main-content {
  margin-left: 240px;
  padding: 24px 32px;
  min-height: 100vh;
}

/* =============================================
   Tab Panels
   ============================================= */

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Grid Layouts
   ============================================= */

.grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* =============================================
   Summary Cards
   ============================================= */

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.15s ease;
}

.summary-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.summary-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-card__value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}

.summary-card__note {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* =============================================
   Card (generic)
   ============================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card__header .card__title {
  margin-bottom: 0;
}

.card__subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: -8px;
  margin-bottom: 14px;
}

.card__subtitle-inline {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 10px;
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.card__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card__controls {
  display: flex;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card__controls span {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
}

.card--chart {
  display: flex;
  flex-direction: column;
}

.card--history {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card--table {
  padding: 16px;
}

/* =============================================
   Cost Bars (Cost vs Savings)
   ============================================= */

.cost-bars {
  display: grid;
  gap: 18px;
}

.cost-bar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cost-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-fill--spend {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.progress-fill--savings {
  background: linear-gradient(90deg, var(--chart-green), var(--chart-blue));
}

/* =============================================
   Comparison Grid
   ============================================= */

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.comparison-item {
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
}

.comparison-item--current {
  border-color: var(--accent);
}

.comparison-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.comparison-item strong {
  font-size: 1.4rem;
}

.comparison-meta {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.comparison-change {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
}

.comparison-change.up {
  background: var(--red-bg);
  color: var(--red);
}

.comparison-change.down {
  background: var(--green-bg);
  color: var(--green);
}

.comparison-change.flat {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.change-arrow {
  font-size: 1rem;
}

.change-value {
  font-weight: 600;
}

.change-percent {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* =============================================
   Trend Charts (SVG)
   ============================================= */

.trend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.trend-card {
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.trend-card__label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.trend-card--history {
  flex: 1;
}

.trend-canvas {
  position: relative;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  outline: none;
  cursor: crosshair;
  min-width: 0;
  overflow: visible;
}

.trend-canvas:focus-visible {
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.trend-card--history .trend-canvas {
  padding: 12px 14px;
  min-height: 300px;
  flex: 1;
}

.trend-chart {
  width: 100%;
  height: 200px;
  display: block;
  max-width: 100%;
}

.trend-card--history .trend-chart {
  height: 300px;
}

/* Chart SVG elements */
.trend-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-area {
  fill: rgba(34, 197, 94, 0.22);
}

.trend-grid-line {
  stroke: var(--chart-line);
  stroke-width: 1;
}

.trend-axis {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.trend-label {
  fill: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.trend-point {
  fill-opacity: 0.7;
}

.trend-focus-line {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.trend-focus-dot {
  stroke: var(--bg);
  stroke-width: 2.5;
}

.trend-tooltip {
  position: absolute;
  min-width: 120px;
  max-width: 260px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(10, 10, 14, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  font-size: 0.82rem;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.12s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.trend-tooltip.is-visible {
  opacity: 1;
}

.trend-tooltip__label {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-bottom: 4px;
}

.trend-tooltip__value {
  font-weight: 600;
}

.trend-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Chart legend */
.chart-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Legacy alias for app.js compatibility */
.azure-chart__legend {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 12px;
  height: 6px;
  border-radius: 999px;
  display: inline-block;
}

.legend-swatch--actual {
  background: var(--chart-green);
}

.legend-swatch--forecast {
  background: var(--chart-blue);
}

/* Historical cost metrics */
.history-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 6px;
}

.history-metric {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.history-metric span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.history-metric strong {
  font-size: 1.05rem;
}

/* Legacy alias */
.azure-chart__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 6px;
}

.azure-metric {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.azure-metric span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.azure-metric strong {
  font-size: 1.05rem;
}

/* Range toggle */
.range-toggle {
  display: flex;
  gap: 4px;
}

.range-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: inherit;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.range-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.range-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* =============================================
   Bar Stack (Spend by service, etc.)
   ============================================= */

.bar-stack {
  display: grid;
  gap: 14px;
}

.bar {
  display: grid;
  gap: 6px;
}

.bar__label {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.bar__track {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.bar__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* =============================================
   Signal Grid
   ============================================= */

.signal-section {
  margin-top: 4px;
}

.signal-grid {
  display: grid;
  gap: 10px;
}

.signal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.signal span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.signal strong {
  font-size: 1.4rem;
}

/* =============================================
   Savings Grid
   ============================================= */

.savings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.savings-item {
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
}

.savings-item--implemented {
  border-left: 3px solid var(--green);
}

.savings-item--pending {
  border-left: 3px solid var(--blue);
}

.savings-item span:first-child {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.savings-item strong {
  font-size: 1.4rem;
}

.savings-count {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* =============================================
   Scan Details
   ============================================= */

.scan-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.scan-tabs__controls {
  display: flex;
  gap: 6px;
}

.scan-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scan-tab:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.scan-tab.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.scan-tab-panel {
  display: none;
}

.scan-tab-panel--active {
  display: block;
}

.scan-details {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.scan-detail {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.scan-detail span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.scan-detail strong {
  font-size: 1rem;
}

.scan-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 6px;
}

/* Drilldown */
.scan-drilldown {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.scan-drilldown__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.scan-drilldown__header h4 {
  font-size: 0.92rem;
}

.scan-drilldown__reset {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-family: inherit;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scan-drilldown__reset:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.scan-drilldown__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.scan-drilldown__breadcrumb button {
  border: none;
  background: transparent;
  color: var(--accent-light);
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
  font-family: inherit;
}

.scan-drilldown__breadcrumb button:hover {
  text-decoration: underline;
}

.scan-drilldown__breadcrumb span {
  color: var(--text-dim);
}

.scan-drilldown__list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.drilldown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  text-align: left;
  width: 100%;
}

.drilldown-item--action {
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.drilldown-item--action:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.drilldown-item__title {
  font-size: 0.85rem;
  font-weight: 600;
}

.drilldown-item__meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.drilldown-item__tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.drilldown-tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.drilldown-link {
  font-size: 0.72rem;
  color: var(--accent-light);
  text-decoration: none;
}

.drilldown-link:hover {
  text-decoration: underline;
}

/* =============================================
   Recommendations Toolbar
   ============================================= */

.rec-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-toolbar__filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.rec-toolbar__filters select {
  padding: 8px 30px 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8fa3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.rec-toolbar__filters select option {
  background: var(--surface);
  color: var(--text);
}

.rec-toolbar__filters select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.rec-toolbar__bulk {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rec-toolbar__bulk span {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.bulk-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: inherit;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bulk-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

/* =============================================
   Data Table
   ============================================= */

.table__scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.1s;
}

.data-table th:hover {
  background: var(--surface-hover);
}

.data-table th.sorted {
  color: var(--accent-light);
}

.data-table th .sort-indicator {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.85rem;
  opacity: 0.35;
  transition: opacity 0.15s, color 0.15s;
}

.data-table th.sorted .sort-indicator {
  opacity: 1;
  color: var(--accent);
  font-weight: 700;
}

.data-table .th--checkbox {
  width: 40px;
  cursor: default;
}

.data-table .th--checkbox:hover {
  background: transparent;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.data-table tbody tr {
  transition: background 0.1s;
}

.data-table tbody tr:hover {
  background: var(--surface-hover);
  cursor: pointer;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr:nth-child(even):hover {
  background: var(--surface-hover);
}

.data-table input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Legacy table alias for compatibility with old HTML classes */
table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}

th:hover {
  background: var(--surface-hover);
}

th .sort-indicator {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.85rem;
  opacity: 0.35;
  transition: opacity 0.15s, color 0.15s;
}

th.sorted .sort-indicator {
  opacity: 1;
  color: var(--accent);
  font-weight: 700;
}

tbody tr:hover {
  background: var(--surface-hover);
  cursor: pointer;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}

/* =============================================
   Lists
   ============================================= */

.list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  transition: border-color 0.1s;
}

.list-item:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.list-item__meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.list-item--unread {
  border-left: 3px solid var(--accent);
}

.list-item--read {
  opacity: 0.6;
}

/* =============================================
   Stat
   ============================================= */

.stat {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* =============================================
   Simulator
   ============================================= */

.simulator__summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.simulator__summary div {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  flex: 1;
}

.simulator__summary span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.simulator__summary strong {
  font-size: 1rem;
}

/* =============================================
   Subscriptions
   ============================================= */

.subscription-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.subscription-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  border: 1px solid var(--border);
}

.subscription-item input {
  accent-color: var(--accent);
}

/* =============================================
   Buttons
   ============================================= */

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.btn--primary:hover {
  background: var(--accent-light);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--ghost {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* =============================================
   Badge
   ============================================= */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  margin-left: 6px;
}

.badge:empty {
  display: none;
}

/* =============================================
   Budget Progress
   ============================================= */

.budget-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.budget-progress__fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.budget-progress__fill--ok {
  background: var(--green);
}

.budget-progress__fill--warning {
  background: var(--amber);
}

.budget-progress__fill--exceeded {
  background: var(--red);
}

/* =============================================
   Drawer (Recommendation detail)
   ============================================= */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 90vw);
  height: 100%;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
  z-index: 15;
  transform: translateX(100%);
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer__content {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer__close {
  align-self: flex-end;
  border: none;
  background: none;
  font-size: 0.92rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: inherit;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.drawer__close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.drawer__resource-info {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 8px 0;
}

.drawer__info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.drawer__info-row span:first-child {
  color: var(--text-muted);
}

.drawer__meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.drawer__actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.drawer__azure-link {
  display: inline-block;
  color: var(--accent-light);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 8px;
  transition: color 0.15s;
}

.drawer__azure-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.drawer__azure-link.hidden {
  display: none;
}

/* =============================================
   Modal (Settings)
   ============================================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 24px;
}

.modal.open {
  display: flex;
}

.modal__content {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: min(640px, 95vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal__header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal__note {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.modal__content--wide {
  width: min(660px, 95vw);
}

/* =============================================
   Toggle Pill (replaces <select> for on/off)
   ============================================= */

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 20px;
  border: 2px solid #ef4444;
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toggle-pill__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444;
  transition: background 0.2s;
}

.toggle-pill.on {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.toggle-pill.on .toggle-pill__dot {
  background: #10b981;
}

/* =============================================
   Settings Sections
   ============================================= */

.settings-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 4px;
}

.settings-section h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.settings-section__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.settings-common-fields {
  margin-bottom: 14px;
}

.azure-connect-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
}

.azure-connect-card p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.azure-connect-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.azure-subscription-picker {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.azure-subscription-picker__header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.azure-subscription-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.azure-subscription-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  font-size: 0.82rem;
}

.azure-subscription-option span {
  display: block;
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-top: 2px;
}

.manual-azure-fallback {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.manual-azure-fallback summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
}

.manual-azure-fallback > p {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.manual-azure-fallback .form-grid {
  margin-top: 12px;
}

@media (max-width: 640px) {
  .azure-connect-card,
  .azure-subscription-picker__header {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* toggle-pill is used instead of settings-toggle-select */

/* =============================================
   Schedule Picker
   ============================================= */

.schedule-picker {
  padding: 4px 0;
}

.schedule-picker__row {
  display: flex;
  gap: 28px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.schedule-picker__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-picker__label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.schedule-btn-group {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: none;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px;
  border-radius: 10px;
}

.schedule-btn {
  padding: 10px 28px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-btn.active {
  background: #6366f1;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

.schedule-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.schedule-time-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-input {
  width: 64px;
  padding: 10px 8px;
  border-radius: 8px;
  border: 2px solid rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.06);
  color: #e8e6f0;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.time-input::-webkit-inner-spin-button,
.time-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.time-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.schedule-time-colon {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
}

.schedule-summary {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #e8e6f0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.schedule-summary:empty {
  display: none;
}

.schedule-summary strong {
  color: var(--accent-light);
  font-weight: 600;
}

/* =============================================
   Plan & Billing
   ============================================= */

.billing-plan-card {
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.billing-plan-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.billing-plan-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.billing-plan-badge.plan-starter {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-color: var(--border);
}

.billing-plan-badge.plan-pro {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.25);
}

.billing-plan-badge.plan-business {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}

.billing-plan-badge.plan-enterprise {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
}

.billing-plan-status {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.billing-plan-status.status-active {
  color: #10b981;
}

.billing-plan-status.status-trialing {
  color: #818cf8;
}

.billing-plan-status.status-past_due {
  color: #ef4444;
}

.billing-plan-status.status-canceled {
  color: var(--text-muted);
}

.billing-limits {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  gap: 18px;
}

.billing-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.billing-upgrade-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-inline-status {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.team-invite-row,
.account-actions,
.legal-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.team-invite-row input { flex: 1 1 250px; }
.team-invite-row select { min-width: 110px; }
.team-list { margin-top: 12px; display: grid; gap: 7px; }
.team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 0.82rem;
}
.team-row__meta { color: var(--text-muted); font-size: 0.74rem; }
.account-actions { margin-top: 12px; }
.legal-links { margin-top: 12px; }
.legal-links a { color: var(--accent); font-size: 0.78rem; }
.btn--danger { color: #9f2434; border-color: #e0a3ab; background: var(--red-bg); }

@media (max-width: 600px) {
  .team-row { grid-template-columns: 1fr; }
}

.btn--accent {
  background: #6366f1;
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn--accent:hover {
  background: #4f46e5;
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.82rem;
  border-radius: 6px;
}

/* =============================================
   Form Grid (Settings form)
   ============================================= */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.form-grid input,
.form-grid select {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-grid select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8fa3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.form-grid input:focus,
.form-grid select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.form-grid input::placeholder {
  color: var(--text-dim);
}

.form-grid select option {
  background: var(--surface);
  color: var(--text);
}

/* Global dark theme for ALL selects/options inside the modal */
.modal select {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.modal select option {
  background: #1c1f2e;
  color: #e8e6f0;
}

.modal input {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.modal input::placeholder {
  color: var(--text-dim);
}

/* =============================================
   Confirm Dialog
   ============================================= */

.confirm-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.confirm-dialog__content {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: min(400px, 90vw);
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.confirm-dialog__content h4 {
  margin-bottom: 10px;
}

.confirm-dialog__content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.confirm-dialog__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* =============================================
   Sidebar Overlay (mobile)
   ============================================= */

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9;
}

.sidebar-overlay.active {
  display: block;
}

/* =============================================
   Focus & Accessibility
   ============================================= */

.btn:focus-visible,
.bulk-btn:focus-visible,
.scan-tab:focus-visible,
.range-btn:focus-visible,
.scan-drilldown__reset:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

/* =============================================
   Scrollbar
   ============================================= */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* =============================================
   Reduced Motion
   ============================================= */

/* =============================================
   Onboarding Wizard
   ============================================= */

.onboarding {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: min(560px, 92vw);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.onboarding__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.onboarding__header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.onboarding__skip {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 8px;
}

.onboarding__skip:hover {
  color: var(--text);
}

.onboarding__steps {
  margin-bottom: 24px;
}

.onboarding__progress {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.onboarding__progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 25%;
}

.onboarding__step-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.onboarding__step {
  display: none;
}

.onboarding__step.active {
  display: block;
}

.onboarding__icon {
  margin-bottom: 16px;
}

.onboarding__step h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

.onboarding__step > p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 16px;
}

.onboarding__detail {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 0.88rem;
}

.onboarding__detail strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.onboarding__detail ul,
.onboarding__detail ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
  line-height: 1.8;
}

.onboarding__detail li {
  margin-bottom: 2px;
}

.onboarding__open-settings {
  margin-top: 8px;
  width: 100%;
}

.onboarding__nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.nav-item--help {
  color: var(--accent-light) !important;
  font-weight: 500;
}

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

/* =============================================
   Responsive: Tablet (< 1200px)
   ============================================= */

@media (max-width: 1200px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3col {
    grid-template-columns: 1fr 1fr;
  }

  .history-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =============================================
   Responsive: Mobile (< 768px)
   ============================================= */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .topbar {
    margin-left: 0;
    padding: 12px 16px;
  }

  .topbar__hamburger {
    display: flex;
  }

  .topbar__left {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .topbar__center {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .summary-cards {
    grid-template-columns: 1fr 1fr;
  }

  .grid-2col {
    grid-template-columns: 1fr;
  }

  .grid-3col {
    grid-template-columns: 1fr;
  }

  .trend-grid {
    grid-template-columns: 1fr;
  }

  .savings-grid {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .comparison-change {
    grid-column: span 1;
  }

  .history-metrics {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .rec-toolbar__filters {
    flex-direction: column;
  }

  .rec-toolbar__bulk {
    flex-wrap: wrap;
  }

  .simulator__summary {
    flex-direction: column;
  }
}

/* =============================================
   Responsive: Small mobile (< 480px)
   ============================================= */

@media (max-width: 480px) {
  .summary-cards {
    grid-template-columns: 1fr;
  }

  .summary-card__value {
    font-size: 1.6rem;
  }

  .topbar__right {
    display: none;
  }

  .card {
    padding: 16px;
  }

  .drawer__content {
    padding: 20px 16px;
  }
}

/* Toast notifications */
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  max-width: 400px;
  word-wrap: break-word;
}

.toast.error {
  animation: toastIn 0.3s ease, toastOut 0.3s ease 7.7s forwards;
}

.toast.success { background: #059669; }
.toast.error { background: #dc2626; }
.toast.info { background: #2563eb; }
.toast.warning { background: #d97706; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* =============================================
   Loading State
   ============================================= */

body.loading::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 99999;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-light), transparent);
  animation: loadingBar 1.2s ease-in-out infinite;
}

@keyframes loadingBar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* =============================================
   2026 QA visual system: Azure field console
   ============================================= */

:root {
  --bg: #edf3f8;
  --sidebar-bg: #0b2135;
  --surface: #ffffff;
  --surface-soft: #f4f8fb;
  --surface-hover: #eef5fa;
  --border: #d5e0e9;
  --border-strong: #b9cad7;
  --text: #10253a;
  --text-muted: #5f7182;
  --text-dim: #7f8f9e;
  --accent: #0078d4;
  --accent-light: #0869b2;
  --accent-bg: #e8f3fb;
  --accent-border: #acd2ec;
  --green: #0b8a68;
  --green-bg: #e5f5ef;
  --red: #c43d4b;
  --red-bg: #fdecef;
  --amber: #b76900;
  --amber-bg: #fff3d8;
  --blue: #0078d4;
  --blue-bg: #e8f3fb;
  --chart-green: #0b8a68;
  --chart-blue: #0078d4;
  --chart-line: #dbe5ed;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(15, 35, 55, 0.06), 0 10px 28px rgba(15, 35, 55, 0.07);
}

html {
  background: var(--bg);
}

body {
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 88% 8%, rgba(0, 120, 212, 0.09), transparent 28rem),
    linear-gradient(rgba(64, 108, 143, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 108, 143, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 32px 32px, 32px 32px, auto;
}

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tab-panel[hidden],
.scan-tab-panel[hidden] {
  display: none !important;
}

.sidebar {
  width: 252px;
  color: #dbe9f5;
  background:
    linear-gradient(155deg, rgba(24, 103, 158, 0.28), transparent 38%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--sidebar-bg);
  background-size: auto, 28px 28px, 28px 28px, auto;
  border-right: 1px solid rgba(166, 205, 233, 0.18);
  box-shadow: 12px 0 40px rgba(14, 36, 55, 0.09);
}

.sidebar__brand {
  min-height: 78px;
  padding: 22px 22px;
  border-bottom-color: rgba(190, 218, 238, 0.14);
}

.sidebar__icon {
  color: #55b8f5;
  filter: drop-shadow(0 0 14px rgba(45, 168, 239, 0.38));
}

.sidebar__title {
  color: #f5f9fc;
  font-size: 1.04rem;
  letter-spacing: -0.025em;
}

.sidebar__nav {
  gap: 5px;
  padding: 20px 0 10px;
}

.sidebar__bottom {
  border-top-color: rgba(190, 218, 238, 0.14);
}

.nav-item {
  position: relative;
  width: calc(100% - 28px);
  margin: 0 14px;
  padding: 11px 14px 11px 18px;
  color: #a8bdce;
  border: 1px solid transparent;
}

.nav-item::before {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav-item:hover {
  color: #f4f9fd;
  background: rgba(164, 210, 241, 0.09);
}

.nav-item.active {
  color: #ffffff;
  background: rgba(65, 166, 229, 0.15);
  border-color: rgba(104, 188, 239, 0.18);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.nav-item.active::before {
  background: #4fb7f6;
  box-shadow: 0 0 12px rgba(79, 183, 246, 0.6);
}

.nav-item--help {
  color: #72c3f5 !important;
}

.topbar {
  min-height: 78px;
  margin-left: 252px;
  padding: 15px 36px;
  background: rgba(248, 251, 253, 0.88);
  border-bottom: 1px solid rgba(178, 197, 211, 0.72);
  backdrop-filter: blur(16px) saturate(135%);
}

.topbar__tenant {
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

.topbar__status {
  position: relative;
  padding-left: 13px;
  color: var(--text-muted);
}

.topbar__status::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-bg);
}

.search-bar input {
  min-height: 42px;
  padding: 10px 16px 10px 18px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 35, 55, 0.04);
}

.search-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.13);
}

.search-results {
  background: #ffffff;
  border-color: var(--border-strong);
}

.search-result-item {
  width: 100%;
  color: var(--text);
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--border);
  font: inherit;
  text-align: left;
}

.search-result-item:focus-visible {
  position: relative;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.main-content {
  max-width: 1800px;
  margin-left: 252px;
  padding: 34px 38px 48px;
}

.tab-panel.active {
  gap: 22px;
  animation: fieldReveal 0.3s ease both;
}

@keyframes fieldReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 2px 2px 6px;
}

.page-heading h1 {
  margin: 2px 0 5px;
  color: #0b2135;
  font-size: clamp(1.6rem, 2.3vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.page-heading p:not(.page-heading__eyebrow) {
  max-width: 680px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.page-heading__eyebrow {
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-heading__signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #315069;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
}

.page-heading__signal span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
}

.grid-2col,
.grid-3col,
.summary-cards {
  gap: 16px;
}

.grid-2col > *,
.grid-3col > *,
.card,
.table__scroll {
  min-width: 0;
  max-width: 100%;
}

.card,
.summary-card,
.rec-toolbar {
  background: rgba(255, 255, 255, 0.94);
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.card {
  padding: 22px;
}

.card__title {
  color: #173047;
  font-size: 0.9rem;
  letter-spacing: -0.015em;
}

.card__subtitle,
.card__controls,
.trend-meta {
  color: var(--text-muted);
}

.summary-card {
  position: relative;
  min-height: 138px;
  padding: 22px 22px 20px;
  overflow: hidden;
}

.summary-card::after {
  content: "";
  position: absolute;
  inset: auto -18px -36px auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 120, 212, 0.12), transparent 68%);
}

.summary-card:first-child {
  border-top: 3px solid var(--accent);
}

.summary-card:nth-child(2) {
  border-top: 3px solid var(--green);
}

.summary-card:nth-child(3) {
  border-top: 3px solid var(--amber);
}

.summary-card:nth-child(4) {
  border-top: 3px solid #5386a6;
}

.summary-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(15, 35, 55, 0.1);
}

.summary-card__label {
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.summary-card__value,
.history-metric strong,
.azure-metric strong,
.signal strong,
.savings-item strong {
  color: #102a41;
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
}

.summary-card__value {
  font-size: clamp(1.65rem, 2.35vw, 2.35rem);
}

.trend-card,
.history-metric,
.azure-metric,
.signal,
.savings-item,
.comparison-item,
.scan-detail,
.list-item,
.subscription-item,
.simulator__summary div,
.drilldown-item {
  background: var(--surface-soft);
  border-color: var(--border);
}

.trend-canvas {
  background:
    linear-gradient(rgba(112, 142, 165, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 142, 165, 0.055) 1px, transparent 1px),
    #fbfdff;
  background-size: 24px 24px;
  border-color: var(--border);
}

.trend-chart {
  overflow: visible;
}

.trend-label,
.trend-empty {
  fill: #667b8e;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.trend-empty {
  font-size: 12px;
}

.trend-axis {
  stroke: #b9c8d4;
}

.trend-focus-line {
  stroke: #6c879a;
}

.trend-focus-dot {
  stroke: #ffffff;
}

.trend-area {
  fill: rgba(11, 138, 104, 0.13);
}

.trend-tooltip {
  color: #f5f9fc;
  background: #102a41;
  border-color: #284a64;
  box-shadow: 0 10px 28px rgba(8, 30, 48, 0.26);
}

.trend-tooltip__label {
  color: #a7c0d2;
}

.range-btn,
.scan-tab,
.bulk-btn,
.scan-drilldown__reset {
  color: #536b7e;
  background: #ffffff;
  border-color: var(--border-strong);
  border-radius: 6px;
}

.range-btn.active,
.scan-tab.active,
.schedule-btn.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.2);
}

.progress-track,
.bar__track,
.budget-progress {
  background: #dfe8ef;
}

.progress-fill--spend,
.bar__fill {
  background: linear-gradient(90deg, #0067b8, #43a6df);
}

.progress-fill--savings {
  background: linear-gradient(90deg, #087a5e, #28a985);
}

.filter-field {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.rec-toolbar__filters select,
.form-grid input,
.form-grid select,
.modal input,
.modal select,
.time-input {
  color: var(--text);
  background-color: #ffffff;
  border-color: var(--border-strong);
}

.rec-toolbar__filters select:focus,
.form-grid input:focus,
.form-grid select:focus,
.time-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.12);
}

.modal select option,
.rec-toolbar__filters select option,
.form-grid select option {
  color: var(--text);
  background: #ffffff;
}

.data-table th,
th {
  color: #607487;
  background: #f3f7fa;
  border-bottom-color: var(--border-strong);
  cursor: default;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.07em;
}

.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.data-table th[data-sort]:hover,
.data-table th.sorted {
  color: #005ea8;
  background: #e9f3fa;
}

.data-table td,
td {
  color: #233a4f;
  border-bottom-color: #e2e9ef;
}

.data-table tbody tr:nth-child(even),
tbody tr:nth-child(even) {
  background: #fbfdfe;
}

.data-table tbody tr:hover,
.data-table tbody tr:nth-child(even):hover,
tbody tr:hover {
  background: #edf6fc;
}

.data-table tbody tr:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.data-table__empty td {
  padding: 42px 20px;
  color: var(--text-muted);
  text-align: center;
}

.data-table__empty strong,
.data-table__empty span {
  display: block;
}

.data-table__empty strong {
  margin-bottom: 5px;
  color: var(--text);
}

.btn {
  border-radius: 7px;
}

.btn--primary,
.btn--accent {
  color: #ffffff;
  background: #0067b8;
  box-shadow: 0 4px 12px rgba(0, 103, 184, 0.2);
}

.btn--primary:hover,
.btn--accent:hover {
  background: #005a9e;
  box-shadow: 0 6px 16px rgba(0, 103, 184, 0.24);
  transform: none;
}

.btn--ghost {
  color: #405c71;
  background: #ffffff;
  border-color: var(--border-strong);
}

.badge {
  background: #0067b8;
}

.drawer {
  color: var(--text);
  background: #f7fafc;
  border-left-color: var(--border-strong);
  box-shadow: -18px 0 48px rgba(10, 37, 58, 0.18);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.drawer.open {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.drawer__resource-info {
  background: #ffffff;
}

.modal {
  background: rgba(9, 29, 45, 0.56);
  backdrop-filter: blur(7px);
}

.modal__content,
.onboarding,
.confirm-dialog__content {
  color: var(--text);
  background: #ffffff;
  border-color: var(--border-strong);
  box-shadow: 0 24px 70px rgba(8, 30, 48, 0.24);
}

.settings-section {
  border-bottom-color: var(--border);
}

.settings-security-note {
  margin-top: 14px;
  padding: 10px 12px;
  color: #775014;
  background: var(--amber-bg);
  border: 1px solid #e7cc90;
  border-radius: 7px;
  font-size: 0.76rem;
  line-height: 1.5;
}

.toggle-pill {
  color: #a73140;
  background: var(--red-bg);
  border-color: #e8aab2;
}

.toggle-pill__dot {
  background: var(--red);
}

.toggle-pill.on {
  color: #087456;
  background: var(--green-bg);
  border-color: #9ed9c7;
}

.toggle-pill.on .toggle-pill__dot {
  background: var(--green);
}

.schedule-btn-group {
  background: #e8eff4;
}

.schedule-btn {
  color: var(--text-muted);
}

.schedule-btn:hover:not(.active) {
  color: var(--text);
  background: #f7fafc;
}

.schedule-summary,
.billing-plan-card,
.onboarding__detail {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border);
}

.billing-plan-badge,
.billing-plan-badge.plan-pro {
  color: #005a9e;
  background: var(--accent-bg);
  border-color: var(--accent-border);
}

.billing-plan-status.status-trialing {
  color: #0067b8;
}

.onboarding__progress {
  background: #dce6ed;
}

.onboarding__progress-bar {
  background: linear-gradient(90deg, #0067b8, #38a6df);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(9, 29, 45, 0.2);
}

.toast.success { background: #087a5e; }
.toast.error { background: #b93645; }
.toast.info { background: #0067b8; }
.toast.warning { background: #a96000; }

::-webkit-scrollbar-thumb {
  background: #b8c7d3;
}

::-webkit-scrollbar-thumb:hover {
  background: #8fa4b4;
}

.btn:focus-visible,
.bulk-btn:focus-visible,
.scan-tab:focus-visible,
.range-btn:focus-visible,
.scan-drilldown__reset:focus-visible,
.nav-item:focus-visible,
.toggle-pill:focus-visible,
.table-sort:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(0, 120, 212, 0.42);
  outline-offset: 2px;
}

input:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.13);
}

@media (max-width: 1050px) {
  .sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
    transition-delay: 0s;
  }

  .topbar,
  .main-content {
    margin-left: 0;
  }

  .topbar__hamburger {
    display: flex;
  }

  .grid-3col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 68px;
    padding: 12px 16px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar__center {
    display: block;
    order: 3;
    flex: 1 0 100%;
    max-width: none;
  }

  .main-content {
    padding: 24px 16px 40px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .summary-cards,
  .grid-2col,
  .grid-3col,
  .history-metrics,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    min-height: 122px;
  }

  .card {
    padding: 18px;
  }

  .card__header,
  .scan-tabs {
    align-items: flex-start;
    flex-direction: column;
  }

  .rec-toolbar__filters,
  .filter-field,
  .rec-toolbar__filters select {
    width: 100%;
  }

  .trend-card--history .trend-canvas,
  .trend-card--history .trend-chart {
    min-height: 230px;
    height: 230px;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal__content,
  .onboarding {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }
}

@media (max-width: 480px) {
  .topbar__right {
    display: flex;
  }

  .topbar__right .btn--ghost {
    display: none;
  }

  .topbar__status {
    display: none;
  }

  .page-heading h1 {
    font-size: 1.65rem;
  }

  .summary-card__value {
    font-size: 1.85rem;
  }

  .drawer {
    width: 100vw;
  }

  .drawer__content {
    padding: 24px 18px;
  }
}

/* =============================================
   Spend trend clarity
   ============================================= */

.dashboard-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.spend-trend-card .card__header,
.scan-trend-card .card__header {
  margin-bottom: 14px;
}

.spend-trend-summary {
  margin-bottom: 14px;
  padding: 11px 14px;
  color: #24465f;
  background: var(--blue-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-weight: 600;
  line-height: 1.5;
}

.spend-trend-card .history-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.spend-trend-card .history-metric {
  min-height: 92px;
  padding: 13px 14px;
}

.spend-trend-card .history-metric strong {
  display: block;
  font-size: 1.12rem;
  line-height: 1.35;
}

.spend-trend-card .history-metric small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.history-metric.direction-up {
  border-top: 3px solid var(--red);
}

.history-metric.direction-up strong {
  color: var(--red);
}

.history-metric.direction-down {
  border-top: 3px solid var(--green);
}

.history-metric.direction-down strong {
  color: #087b58;
}

.history-metric.direction-flat {
  border-top: 3px solid var(--accent);
}

.trend-grid--split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spend-trend-card .trend-card--history {
  padding: 16px 18px 13px;
}

.spend-trend-card .trend-canvas {
  min-height: 340px;
}

.spend-trend-card .trend-chart {
  height: 340px;
}

.spend-bar {
  fill: var(--accent);
  opacity: 0.62;
  transition: opacity 0.12s ease;
}

.spend-bar--partial {
  fill: var(--amber);
  opacity: 0.78;
}

.spend-average-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spend-peak-marker {
  fill: var(--amber);
  stroke: #ffffff;
  stroke-width: 2.5;
}

.spend-peak-label,
.trend-axis-title {
  fill: #425f74;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}

.spend-focus-dot {
  fill: var(--accent);
}

.legend-swatch--daily {
  height: 9px;
  background: var(--accent);
  opacity: 0.7;
  border-radius: 2px;
}

.legend-swatch--average {
  height: 3px;
  background: var(--green);
}

.legend-swatch--partial {
  height: 9px;
  background: var(--amber);
  border-radius: 2px;
}

.spend-trend-card .trend-tooltip {
  min-width: 190px;
  white-space: normal;
}

.spend-trend-card .chart-legend {
  flex-wrap: wrap;
  row-gap: 8px;
}

.trend-tooltip__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 5px;
}

.trend-tooltip__row span {
  color: #a7c0d2;
}

.trend-tooltip__row strong {
  color: #ffffff;
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1050px) {
  .spend-trend-card .history-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .spend-trend-card .history-metrics,
  .trend-grid--split {
    grid-template-columns: 1fr;
  }

  .spend-trend-card .trend-canvas,
  .spend-trend-card .trend-chart {
    min-height: 250px;
    height: 250px;
  }

  .spend-trend-card .trend-card--history {
    padding: 12px 10px 10px;
  }
}
