/* BWS 2.0 — ad-analytics.css
   Ad Intelligence Center — full dashboard styles.
   Requires style.css and admin.css to be loaded first. */

/* ═══════════════════════════════════════════════
   RESET / BASE
═══════════════════════════════════════════════ */
.ada-body {
  background: #0a0400;
  color: #f6ead7;
  min-height: 100vh;
  font-family: var(--font-ui, 'Inter', sans-serif);
}

.ada-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════
   TOPBAR
═══════════════════════════════════════════════ */
.ada-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  height: 56px;
  background: rgba(8, 3, 0, 0.97);
  border-bottom: 1px solid rgba(218, 139, 39, 0.18);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.ada-topbar-left,
.ada-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ada-back {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(218, 139, 39, 0.7);
  text-decoration: none;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.ada-back:hover {
  color: #dda34a;
  background: rgba(218, 139, 39, 0.08);
}

.ada-topbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(218, 139, 39, 0.2);
  flex-shrink: 0;
}

.ada-logo-mark {
  font-family: var(--font-display, 'Orbitron', sans-serif);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #c8892a;
}

.ada-topbar-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ada-topbar-title h1 {
  font-family: var(--font-display, 'Orbitron', sans-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #f6ead7;
  margin: 0;
  line-height: 1.2;
}
.ada-topbar-sub {
  font-size: 10.5px;
  color: rgba(246, 234, 215, 0.4);
  letter-spacing: 0.04em;
}

/* Live badge */
.ada-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(42, 140, 110, 0.35);
  border-radius: 999px;
  background: rgba(42, 140, 110, 0.1);
  font-size: 12px;
  font-weight: 600;
  color: rgba(42, 200, 140, 0.85);
  font-family: var(--font-ui);
  white-space: nowrap;
}
.ada-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ac87c;
  box-shadow: 0 0 6px #2ac87c;
  animation: ada-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes ada-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px #2ac87c; }
  50%       { opacity: 0.6; box-shadow: 0 0 2px #2ac87c; }
}

/* Selects */
.ada-select {
  background: rgba(20, 8, 0, 0.9);
  border: 1px solid rgba(218, 139, 39, 0.28);
  border-radius: 5px;
  color: rgba(246, 234, 215, 0.85);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color 0.12s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(218,139,39,.55)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.ada-select:hover,
.ada-select:focus {
  border-color: rgba(218, 139, 39, 0.55);
  outline: none;
}

/* Buttons */
.ada-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 5px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap;
  border: 1px solid rgba(218, 139, 39, 0.55);
  background: rgba(218, 139, 39, 0.14);
  color: #dda34a;
}
.ada-btn:hover {
  background: rgba(218, 139, 39, 0.24);
  border-color: rgba(218, 139, 39, 0.8);
  color: #f0b84a;
}
.ada-btn-outline {
  background: transparent;
  border-color: rgba(218, 139, 39, 0.3);
  color: rgba(218, 139, 39, 0.7);
}
.ada-btn-outline:hover {
  background: rgba(218, 139, 39, 0.08);
  border-color: rgba(218, 139, 39, 0.55);
  color: #dda34a;
}
.ada-btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}
.ada-btn-xs {
  padding: 3px 8px;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  border-color: rgba(218, 139, 39, 0.3);
  background: transparent;
  color: rgba(218, 139, 39, 0.65);
}
.ada-btn-xs:hover {
  background: rgba(218, 139, 39, 0.12);
  border-color: rgba(218, 139, 39, 0.55);
  color: #dda34a;
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════════════ */
.ada-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 32px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ═══════════════════════════════════════════════
   KPI CARDS
═══════════════════════════════════════════════ */
.ada-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.ada-kpi-card {
  position: relative;
  background: rgba(14, 6, 0, 0.88);
  border: 1px solid rgba(218, 139, 39, 0.2);
  border-radius: 8px;
  padding: 16px 18px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.18s;
}
.ada-kpi-card:hover {
  border-color: rgba(218, 139, 39, 0.38);
}
.ada-kpi-card--live {
  border-color: rgba(42, 140, 110, 0.28);
}
.ada-kpi-card--live:hover {
  border-color: rgba(42, 140, 110, 0.5);
}
.ada-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(218, 139, 39, 0.6), transparent);
  border-radius: 8px 8px 0 0;
}
.ada-kpi-card--live::before {
  background: linear-gradient(90deg, rgba(42, 140, 110, 0.7), transparent);
}

.ada-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(246, 234, 215, 0.45);
  display: flex;
  align-items: center;
  gap: 5px;
}
.ada-kpi-period {
  font-size: 9.5px;
  font-weight: 600;
  color: rgba(218, 139, 39, 0.5);
  padding: 1px 5px;
  border: 1px solid rgba(218, 139, 39, 0.2);
  border-radius: 3px;
}

.ada-kpi-value {
  font-family: var(--font-display, 'Orbitron', sans-serif);
  font-size: 26px;
  font-weight: 700;
  color: #f6ead7;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 2px 0;
}
.ada-kpi-live {
  color: #2ac87c;
}

.ada-kpi-delta {
  font-size: 11px;
  font-weight: 600;
  color: rgba(246, 234, 215, 0.45);
  min-height: 14px;
}
.ada-kpi-delta--up   { color: #2ac87c; }
.ada-kpi-delta--down { color: #c0392b; }

.ada-kpi-meta {
  font-size: 11px;
  color: rgba(246, 234, 215, 0.45);
}
.ada-kpi-time {
  font-size: 10.5px;
  color: rgba(218, 139, 39, 0.6);
}

.ada-sparkline {
  display: block;
  width: 100%;
  height: 32px;
  margin-top: 6px;
  overflow: visible;
}

/* ═══════════════════════════════════════════════
   PANELS (shared)
═══════════════════════════════════════════════ */
.ada-panel {
  background: rgba(12, 5, 0, 0.9);
  border: 1px solid rgba(218, 139, 39, 0.16);
  border-radius: 8px;
  overflow: hidden;
}

.ada-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid rgba(218, 139, 39, 0.1);
  flex-wrap: wrap;
}

.ada-panel-title {
  font-family: var(--font-display, 'Rajdhani', sans-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(246, 234, 215, 0.9);
  margin: 0;
  line-height: 1.2;
}

.ada-panel-sub {
  font-size: 11px;
  color: rgba(246, 234, 215, 0.38);
  margin-top: 2px;
}
.ada-panel-sub--label {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  color: rgba(246, 234, 215, 0.35);
  margin-bottom: 6px;
}

.ada-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════
   MID ROW (persona + heatmap)
═══════════════════════════════════════════════ */
.ada-mid-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  align-items: start;
}

/* ── Persona Panel ── */
.ada-persona-panel {}

.ada-persona-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 18px 18px 0;
}

/* Donut */
.ada-donut-wrap {
  position: relative;
  flex-shrink: 0;
  width: 160px;
  height: 160px;
}
.ada-donut {
  width: 100%;
  height: 100%;
  display: block;
}
.ada-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  line-height: 1.2;
}
.ada-donut-center strong {
  display: block;
  font-family: var(--font-display, 'Orbitron', sans-serif);
  font-size: 18px;
  font-weight: 700;
  color: #f6ead7;
}
.ada-donut-center span {
  display: block;
  font-size: 10px;
  color: rgba(246, 234, 215, 0.45);
  margin-top: 2px;
  letter-spacing: 0.03em;
}

/* Persona legend */
.ada-persona-legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}
.ada-persona-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  cursor: default;
}
.ada-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.ada-legend-demo {
  flex: 1;
  color: rgba(246, 234, 215, 0.75);
  font-size: 11.5px;
  font-weight: 500;
}
.ada-legend-pct {
  font-size: 11px;
  font-weight: 700;
  color: rgba(246, 234, 215, 0.5);
  text-align: right;
  flex-shrink: 0;
}

/* Legend row (charts) */
.ada-legend-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ada-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: rgba(246, 234, 215, 0.6);
  font-weight: 600;
  cursor: default;
}

/* Persona table */
.ada-persona-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 16px;
}
.ada-persona-table thead tr {
  border-top: 1px solid rgba(218, 139, 39, 0.1);
  border-bottom: 1px solid rgba(218, 139, 39, 0.14);
}
.ada-persona-table th {
  padding: 8px 12px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(246, 234, 215, 0.35);
  text-align: left;
  background: rgba(218, 139, 39, 0.04);
}
.ada-persona-table td {
  padding: 9px 12px;
  color: rgba(246, 234, 215, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.ada-persona-table tbody tr:hover td {
  background: rgba(218, 139, 39, 0.05);
}
.ada-persona-table tbody tr:last-child td {
  border-bottom: none;
}

.ada-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
  flex-shrink: 0;
}

.ada-mult-high { color: #9b59b6; font-weight: 700; }
.ada-mult-med  { color: #2a8c6e; font-weight: 700; }
.ada-mult-base { color: rgba(246, 234, 215, 0.5); }

/* ── Heatmap Panel ── */
.ada-heatmap-panel {}

.ada-heatmap-wrap {
  padding: 12px 18px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ada-heatmap-hours {
  display: flex;
  padding-left: 36px;
}
.ada-heatmap-hours span {
  flex: 1;
  font-size: 9px;
  color: rgba(246, 234, 215, 0.3);
  text-align: center;
  min-width: 0;
}
.ada-hm-day-spacer {
  flex: none;
  width: 0;
}

.ada-heatmap-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ada-hm-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ada-hm-day-label {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(246, 234, 215, 0.35);
  letter-spacing: 0.04em;
  width: 28px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 6px;
}
.ada-hm-cell {
  flex: 1;
  height: 14px;
  border-radius: 2px;
  background: #c8892a;
  min-width: 0;
  cursor: default;
  transition: opacity 0.12s, transform 0.1s;
}
.ada-hm-cell:hover {
  transform: scaleY(1.3);
  z-index: 2;
}

.ada-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: rgba(246, 234, 215, 0.3);
  padding-left: 36px;
  margin-top: 4px;
}
.ada-heatmap-legend-bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(200, 137, 42, 0.15), rgba(200, 137, 42, 1));
  max-width: 120px;
}

/* Time multiplier bars */
.ada-time-mult-wrap {
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(218, 139, 39, 0.1);
  margin-top: 4px;
}
.ada-time-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 56px;
}
.ada-tbar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  position: relative;
  cursor: default;
  min-width: 0;
}
.ada-tbar--now {
  z-index: 2;
}
.ada-tbar--now .ada-tbar-fill {
  box-shadow: 0 0 6px rgba(218, 139, 39, 0.6);
  outline: 1px solid rgba(218, 139, 39, 0.7);
  outline-offset: 1px;
}
.ada-tbar-fill {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 3px;
  transition: height 0.4s ease;
}
.ada-tbar-label {
  position: absolute;
  bottom: -16px;
  font-size: 8.5px;
  color: rgba(246, 234, 215, 0.28);
  white-space: nowrap;
  text-align: center;
}
.ada-tbar-now-label {
  position: absolute;
  top: -18px;
  font-size: 7.5px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #dda34a;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════
   LIVE PRICING TABLE
═══════════════════════════════════════════════ */
.ada-pricing-panel {
  width: 100%;
}

.ada-surge-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(200, 137, 42, 0.18);
  border: 1px solid rgba(218, 139, 39, 0.5);
  color: #f0b84a;
  white-space: nowrap;
  animation: ada-surge-pulse 2s ease-in-out infinite;
}
@keyframes ada-surge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

.ada-select-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(246, 234, 215, 0.45);
  text-transform: uppercase;
  white-space: nowrap;
}

.ada-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ada-slider {
  width: 100px;
  accent-color: #c8892a;
  cursor: pointer;
}
.ada-slider-wrap span {
  font-size: 11.5px;
  font-weight: 700;
  color: rgba(218, 139, 39, 0.85);
  min-width: 36px;
}

.ada-pricing-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ada-pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 860px;
}

.ada-pricing-table thead tr {
  background: rgba(218, 139, 39, 0.04);
  border-bottom: 1px solid rgba(218, 139, 39, 0.14);
}
.ada-pricing-table th {
  padding: 9px 12px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(246, 234, 215, 0.38);
  text-align: left;
  white-space: nowrap;
}
.ada-th-num {
  text-align: right;
}
.ada-th-price {
  color: rgba(218, 139, 39, 0.6);
}

.ada-pricing-table td {
  padding: 10px 12px;
  color: rgba(246, 234, 215, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}
.ada-pricing-table tbody tr:hover td {
  background: rgba(218, 139, 39, 0.04);
}
.ada-pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.ada-row-paused td {
  opacity: 0.45;
}

.ada-slot-name {
  font-weight: 600;
  color: rgba(246, 234, 215, 0.9);
  white-space: nowrap;
}
.ada-slot-page {
  font-size: 11.5px;
  color: rgba(246, 234, 215, 0.55);
}
.ada-slot-pos {
  font-size: 11px;
  color: rgba(246, 234, 215, 0.45);
  white-space: nowrap;
}

.ada-td-num {
  text-align: right;
  font-family: var(--font-ui);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}
.ada-td-price {
  font-weight: 700;
  color: #c8892a;
  font-size: 13px;
}
.ada-mult-cell {
  color: rgba(246, 234, 215, 0.5);
  font-size: 11.5px;
}

.ada-price-surge {
  color: #e67e22 !important;
}
.ada-price-elevated {
  color: #dda34a !important;
}

/* Fill rate */
.ada-fill-cell {
  white-space: nowrap;
}
.ada-fill-bar {
  display: inline-block;
  width: 48px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
  margin-left: 5px;
}
.ada-fill-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2a8c6e, #2ac87c);
}

/* Status */
.ada-status-active {
  color: #2ac87c;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.ada-status-paused {
  color: rgba(246, 234, 215, 0.35);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Footer */
.ada-pricing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 10px;
  border-top: 1px solid rgba(218, 139, 39, 0.08);
  gap: 12px;
  flex-wrap: wrap;
}
.ada-pricing-note {
  font-size: 10.5px;
  color: rgba(246, 234, 215, 0.3);
}
.ada-pricing-note--right {
  font-size: 10.5px;
  color: rgba(218, 139, 39, 0.45);
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   CHARTS ROW
═══════════════════════════════════════════════ */
.ada-charts-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 16px;
  align-items: start;
}

.ada-bar-chart-wrap,
.ada-line-chart-wrap {
  padding: 12px 18px 16px;
  overflow: hidden;
}
.ada-bar-chart,
.ada-line-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* SVG chart text */
.ada-chart-label {
  font-size: 11px;
  fill: rgba(246, 234, 215, 0.45);
  font-family: var(--font-ui, sans-serif);
}
.ada-chart-val {
  font-size: 11.5px;
  font-weight: 700;
  fill: rgba(246, 234, 215, 0.75);
  font-family: var(--font-ui, sans-serif);
}
.ada-chart-ctr {
  font-size: 10px;
  fill: rgba(246, 234, 215, 0.35);
  font-family: var(--font-ui, sans-serif);
}
.ada-grid-line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}
.ada-bar {
  cursor: default;
  transition: opacity 0.12s;
}
.ada-bar:hover {
  opacity: 1 !important;
}
.ada-dot-pt {
  cursor: default;
}
.ada-dot-pt:hover {
  r: 4.5;
}

/* ═══════════════════════════════════════════════
   PRICING RULES EDITOR
═══════════════════════════════════════════════ */
.ada-rules-panel {}

.ada-rules-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0;
}

.ada-rules-section {
  padding: 16px 18px;
  border-right: 1px solid rgba(218, 139, 39, 0.1);
}
.ada-rules-section:last-child {
  border-right: none;
}

.ada-rules-label {
  font-family: var(--font-display, 'Rajdhani', sans-serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(246, 234, 215, 0.55);
  margin: 0 0 4px;
}
.ada-rules-note {
  font-size: 11px;
  color: rgba(246, 234, 215, 0.32);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* Demo multiplier cards */
.ada-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.ada-rule-card {
  background: rgba(var(--rule-color, 200 137 42) / 0.05);
  border: 1px solid rgba(218, 139, 39, 0.14);
  border-left: 2px solid var(--rule-color, rgba(218, 139, 39, 0.4));
  border-radius: 6px;
  padding: 10px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ada-rule-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(246, 234, 215, 0.55);
  display: block;
  margin-bottom: 2px;
}

.ada-rule-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ada-rule-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(218, 139, 39, 0.24);
  border-radius: 4px;
  color: #f6ead7;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  padding: 4px 7px;
  transition: border-color 0.12s;
  min-width: 0;
  -moz-appearance: textfield;
}
.ada-rule-input:focus {
  border-color: rgba(218, 139, 39, 0.55);
  outline: none;
  background: rgba(218, 139, 39, 0.06);
}
.ada-rule-input::-webkit-inner-spin-button,
.ada-rule-input::-webkit-outer-spin-button {
  opacity: 0.4;
}
.ada-rule-unit {
  font-size: 13px;
  font-weight: 700;
  color: rgba(218, 139, 39, 0.6);
  flex-shrink: 0;
}
.ada-rule-unit-sm {
  font-size: 11px;
}
.ada-rule-hint {
  font-size: 10px;
  color: rgba(246, 234, 215, 0.28);
}

/* Time rule cards */
.ada-time-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 5px;
}

.ada-time-rule-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(20, 8, 0, 0.5);
  border: 1px solid rgba(218, 139, 39, 0.12);
  border-radius: 5px;
  padding: 7px 6px 5px;
  text-align: center;
}
.ada-time-rule-card.is-now {
  border-color: rgba(218, 139, 39, 0.5);
  background: rgba(218, 139, 39, 0.08);
  box-shadow: 0 0 0 1px rgba(218, 139, 39, 0.15) inset;
}
.ada-time-rule-card .ada-rule-label {
  font-size: 9.5px;
  text-align: center;
  color: rgba(218, 139, 39, 0.65);
  margin-bottom: 0;
  letter-spacing: 0.02em;
}
.ada-time-rule-card.is-now .ada-rule-label {
  color: #dda34a;
}
.ada-time-rule-card .ada-rule-input {
  width: 100%;
  font-size: 12px;
  padding: 3px 4px;
  text-align: center;
}
.ada-time-rule-card .ada-rule-unit-sm {
  color: rgba(218, 139, 39, 0.5);
  font-size: 10px;
}

.ada-rules-status {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 600;
  border-top: 1px solid rgba(218, 139, 39, 0.1);
  min-height: 36px;
  color: rgba(246, 234, 215, 0.45);
}
.ada-rules-status--ok {
  color: #2ac87c;
}
.ada-rules-status--err {
  color: #c0392b;
}

/* ═══════════════════════════════════════════════
   TOOLTIP
═══════════════════════════════════════════════ */
.ada-tooltip {
  position: fixed;
  z-index: 9000;
  max-width: 260px;
  padding: 6px 10px;
  background: rgba(10, 4, 0, 0.96);
  border: 1px solid rgba(218, 139, 39, 0.4);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(246, 234, 215, 0.9);
  font-family: var(--font-ui);
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .ada-mid-row {
    grid-template-columns: 1fr 1fr;
  }
  .ada-charts-row {
    grid-template-columns: 1fr 1fr;
  }
  .ada-rules-body {
    grid-template-columns: 1fr;
  }
  .ada-rules-section {
    border-right: none;
    border-bottom: 1px solid rgba(218, 139, 39, 0.1);
  }
  .ada-rules-section:last-child {
    border-bottom: none;
  }
}

@media (max-width: 1024px) {
  .ada-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .ada-mid-row {
    grid-template-columns: 1fr;
  }
  .ada-charts-row {
    grid-template-columns: 1fr;
  }
  .ada-persona-body {
    gap: 16px;
  }
  .ada-donut-wrap {
    width: 130px;
    height: 130px;
  }
}

@media (max-width: 768px) {
  .ada-topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .ada-topbar-right {
    flex-wrap: wrap;
    gap: 8px;
  }
  .ada-main {
    padding: 12px 12px 24px;
    gap: 12px;
  }
  .ada-kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .ada-kpi-value {
    font-size: 21px;
  }
  .ada-persona-body {
    flex-direction: column;
    align-items: center;
  }
  .ada-pricing-panel .ada-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .ada-panel-actions {
    width: 100%;
  }
  .ada-rules-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  .ada-time-rules-grid {
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  }
}

@media (max-width: 480px) {
  .ada-kpi-row {
    grid-template-columns: 1fr;
  }
  .ada-topbar-title h1 {
    font-size: 12px;
  }
  .ada-topbar-sub { display: none; }
  .ada-range-select,
  .ada-demo-select { max-width: 130px; }
}
