/* Design system tokens - Professional Corporate */
:root {
  /* Corporate Palette */
  --primary: #2c3e50;
  --primary-light: #34495e;
  --accent: #3498db;
  --accent-dark: #2980b9;
  --bg-body: #ecf0f1;
  --bg-card: #ffffff;
  --text-main: #2c3e50;
  --text-muted: #7f8c8d;
  --border: #bdc3c7;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #c0392b;
  
  /* Shadows & Radius */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 4px rgba(0,0,0,0.1);
  --radius: 4px;
  
  /* Typography */
  --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Legacy variable mappings for compatibility */
  --color-bg: var(--bg-body);
  --color-card: var(--bg-card);
  --color-border: var(--border);
  --color-text: var(--text-main);
  --color-muted: var(--text-muted);
  --color-primary: var(--accent);
  --color-primary-600: var(--accent-dark);
  --color-success: var(--success);
  --color-warning: var(--warning);
  --color-danger: var(--danger);
  --radius-1: var(--radius);
  --radius-2: var(--radius);
  --shadow-1: var(--shadow-sm);
  --shadow-2: var(--shadow-md);
  
  /* Spacing */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
}

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

* { box-sizing: border-box; }

html, body {
  padding: 0;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout Structure */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: var(--primary);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 2rem;
  width: calc(100% - 250px);
}

/* Sidebar Components */
.logo {
  padding: 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
}

.sidebar nav {
  padding: 1rem 0;
  flex: 1;
  overflow-y: auto;
}

.nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  color: #bdc3c7;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 4px solid transparent;
}

.nav-btn:hover {
  background-color: var(--primary-light);
  color: white;
}

.nav-btn.active {
  background-color: var(--primary-light);
  color: white;
  border-left-color: var(--accent);
}

.user-profile {
  padding: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 40px;
  height: 40px;
  background: #95a5a6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #dcdcdc;
}

h1 {
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--text-main);
  margin: 0;
}

h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Cards / Sections */
.card, .section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e0e0e0;
  margin-bottom: 1.5rem;
}

.section > h2 {
  margin-top: 0;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
  border-left: 4px solid var(--accent);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 300;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.stat-trend {
  font-size: 0.8rem;
  font-weight: 500;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* Forms */
.form-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group, .field {
  margin-bottom: 1.5rem;
  flex: 1;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.help {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  background-color: #fff;
  color: var(--text-main);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-card);
  color: var(--text-main);
}

.btn:hover {
  box-shadow: var(--shadow-sm);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent-dark);
}

.btn-primary:hover {
  background-color: var(--accent-dark);
}

.btn-secondary {
  background-color: white;
  border-color: var(--border);
  color: var(--text-main);
}

/* Provider connect buttons (Google / Outlook) */
.btn-provider {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  gap: 0.6rem;
  padding: 0.7rem 1.1rem;
}

.btn-provider .provider-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
}

.btn-provider .provider-icon img {
  width: 18px;
  height: 18px;
  display: block;
}

.btn-provider.btn-google {
  background: #4285F4;
  border-color: #3367D6;
  color: #ffffff;
}

.btn-provider.btn-google:hover {
  background: #3367D6;
}

.btn-provider.btn-outlook {
  background: #0078D4;
  border-color: #106EBE;
  color: #ffffff;
}

.btn-provider.btn-outlook:hover {
  background: #106EBE;
}

.btn-secondary:hover {
  background-color: #f5f5f5;
  border-color: #95a5a6;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
  border-color: #a93226;
}

.btn-danger:hover {
  background-color: #a93226;
}

.btn-block {
  width: 100%;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
}

table, .table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: white;
}

th {
  text-align: left;
  padding: 0.8rem 1rem;
  background: #f8f9fa;
  border-bottom: 2px solid #dcdcdc;
  color: var(--text-main);
  font-weight: 700;
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Badges */
.badge, .status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge.success, .status-completed { background: #e8f8f5; color: var(--success); border-color: #a3e4d7; }
.badge.warn, .badge.warning, .status-ongoing { background: #fffbeb; color: var(--warning); border-color: #fcd34d; }
.badge.error, .badge.danger, .status-missed { background: #fdedec; color: var(--danger); border-color: #fadbd8; }
.badge.neutral { background: #f3f4f6; color: var(--text-muted); border-color: #e5e7eb; }

/* Alerts / Banners */
.alert, .banner {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.alert-info, .banner.info {
  background: #ebf5fb;
  color: #2980b9;
  border-color: #aed6f1;
}

.alert-success, .banner.success {
  background: #e8f8f5;
  color: #27ae60;
  border-color: #a3e4d7;
}

.alert-warning, .banner.warning {
  background: #fef9e7;
  color: #f39c12;
  border-color: #f9e79f;
}

.alert-error, .banner.error {
  background: #fdedec;
  color: #c0392b;
  border-color: #fadbd8;
}

/* Stepper */
.stepper {
  display: flex;
  background: white;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  border: 1px solid #e0e0e0;
  gap: 0; /* Reset gap from old styles */
}

.step {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0.5rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  background: none;
  border: none;
  box-shadow: none;
}

.step:not(:last-child)::after {
  content: '›';
  position: absolute;
  right: -5px;
  font-size: 1.5rem;
  color: #bdc3c7;
}

.step.active {
  color: var(--accent);
  font-weight: 700;
  border: none;
}

.step.done, .step.completed {
  color: var(--success);
  background: none;
  border: none;
}

.step .index, .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ecf0f1;
  margin-right: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.step.active .index {
  background: var(--accent);
  color: white;
}

.step.done .index {
  background: var(--success);
  color: white;
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.pricing-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pricing-card.popular {
  border: 2px solid var(--accent);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-header {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.plan-name {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.plan-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.price-period {
  font-size: 1rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.plan-minutes {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  flex-grow: 1;
}

.features-list li {
  padding: 0.8rem 0;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-main);
}

.features-list li::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: #e8f8f5;
  color: var(--success);
  font-weight: 700;
  font-size: 12px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 62, 80, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 999;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 560px;
  padding: 2rem;
}

.modal-title {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  color: var(--primary);
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

/* Utilities */
.sr-only, .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.stack { display: flex; flex-direction: column; gap: 1rem; }
.hstack { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkbox-item label {
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
  }

  .nav-btn {
    display: inline-block;
    width: auto;
    border-left: none;
    border-bottom: 4px solid transparent;
  }

  .nav-btn.active {
    border-left: none;
    border-bottom-color: var(--accent);
  }

  .sidebar nav {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0;
    display: flex;
  }
  
  .stepper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .step:not(:last-child)::after {
    display: none;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Profile Button */
.user-profile-btn {
  width: 100%;
  padding: 1.5rem;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  text-align: left;
  color: white;
  transition: background-color 0.2s;
  font-family: inherit;
}

.user-profile-btn:hover {
  background-color: rgba(255,255,255,0.1);
}

.user-profile-btn:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.8rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Profile Modal Details */
.value {
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  font-size: 0.95rem;
}

.code-font {
  font-family: monospace;
  font-size: 0.85rem;
  color: #555;
}

/* ============================================================ */
/* Integration Cards — Phase 23-07 Pet Grooming Integrations    */
/* ============================================================ */

.integration-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.integration-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  background: white;
}

.integration-card.connected {
  border-left: 4px solid #22c55e;
}

.integration-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.integration-card-title {
  font-size: 18px;
  font-weight: 600;
}

.badge-connected {
  background: #dcfce7;
  color: #166534;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-disconnected {
  background: #f3f4f6;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.integration-detail {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 4px;
}

.integration-instructions {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
  line-height: 1.5;
}

.integration-input-group {
  margin-bottom: 12px;
}

.integration-input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

.integration-input-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

.integration-app-name-suffix {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .integration-cards {
    grid-template-columns: 1fr;
  }
}

/* Edition Selector */
.edition-selector { max-width: 960px; margin: 0 auto; padding: var(--space-6); }
.edition-card { cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s; border: 2px solid transparent; }
.edition-card:hover, .edition-card.selected { border-color: var(--accent); box-shadow: 0 4px 12px rgba(52,152,219,0.15); }
.edition-name { font-size: 28px; font-weight: 400; line-height: 1.2; }

/* Billing toggle */
.billing-toggle { display: inline-flex; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.toggle-btn { padding: 8px 16px; border: none; background: var(--bg-card); cursor: pointer; font-size: 14px; }
.toggle-btn.active { background: var(--accent); color: white; }

/* Repeater rows */
.repeater-row { display: flex; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); flex-wrap: wrap; }
.repeater-name { flex: 1; min-width: 120px; }
.repeater-phone { flex: 1; min-width: 120px; }
.repeater-checkbox { white-space: nowrap; }

/* Wizard step */
.wizard-step { max-width: 640px; margin: 0 auto; padding: var(--space-8) var(--space-4); }
.wizard-actions { display: flex; gap: var(--space-2); justify-content: space-between; margin-top: var(--space-6); flex-wrap: wrap; }

/* Small danger button for repeater remove */
.btn-sm { padding: 4px 8px; font-size: 14px; min-width: 32px; min-height: 32px; }

/* Scam Log table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: var(--space-2) var(--space-4); text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { font-weight: 700; font-size: 14px; color: var(--text-secondary); }

/* View container for edition-specific portal views */
.view-container { padding: var(--space-6); max-width: 800px; }

/* Mobile responsive */
@media (max-width: 480px) {
  .repeater-row { flex-direction: column; }
  .repeater-name, .repeater-phone { min-width: 100%; }
}

/* ============================================================ */
/* Phase 52: Call Performance View                               */
/* ============================================================ */
.call-performance { padding: 24px; font-family: 'Space Grotesk', sans-serif; }
.call-performance-section { margin-top: 32px; }
.call-performance-section h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: #1a1a1a;
  font-family: 'Space Grotesk', sans-serif;
}
.call-performance-kpi-strip {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.call-performance-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}
.call-performance-filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.8125rem;
  color: #333;
}
.call-performance-filters select,
.call-performance-filters input[type="date"] {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.875rem;
  background: #fff;
  min-width: 160px;
}
.call-performance-chart-wrap {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.call-performance-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.call-performance-table th,
.call-performance-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
}
.call-performance-table th {
  background: #f9fafb;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: #374151;
}
.call-performance-table th:hover { background: #f3f4f6; }
.call-performance-greyed {
  opacity: 0.5;
  color: #999;
}
.call-performance-flagged-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}
.call-performance-flagged-row:last-child { border-bottom: none; }
.call-performance-flagged-row .phone {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1a1a1a;
  min-width: 130px;
}
.call-performance-flagged-row .badge-targeting {
  background: #fee2e2;
  color: #dc2626;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.call-performance-flagged-row .badge-wrong-number {
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.call-performance-flagged-row .exclude-btn {
  margin-left: auto;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
}
.call-performance-flagged-row .exclude-btn:hover { background: #f3f4f6; }
.call-performance-flagged-row .exclude-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .call-performance { padding: 16px; }
  .call-performance-kpi-strip > div { min-width: 100% !important; }
  .call-performance-flagged-row { flex-direction: column; align-items: flex-start; }
  .call-performance-flagged-row .exclude-btn { margin-left: 0; }
}

/* ========================================================================
   Phase 55-01 — ConsentBanner (CONS-01 / CONS-02 / CONS-04)
   ------------------------------------------------------------------------
   Reuses existing design tokens (--space-*, --bg-card, --border, --text-*,
   --accent, --primary) — zero new color variables introduced per UI-SPEC.
   APPEND-ONLY: do not edit any rule above this block.
   ======================================================================== */

.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998; /* below modals at 9999, above all page content */
  background: var(--bg-card);
  color: var(--text-main);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  padding: var(--space-4) var(--space-5);
  /* Off-screen until .is-visible is added (double-rAF in ConsentBanner.js) */
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.2, 0, 0, 1);
}

.consent-banner.is-visible {
  transform: translateY(0);
}

.consent-banner.is-exiting {
  opacity: 0;
  transition: opacity 200ms cubic-bezier(0.4, 0, 1, 1);
}

.consent-banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.consent-banner-text {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.875rem; /* 14px body per UI-SPEC typography */
  line-height: 1.5;
  color: var(--text-main);
}

.consent-policy-link {
  color: var(--accent);
  text-decoration: underline;
  margin-left: var(--space-1);
}

.consent-btn-group {
  flex: 0 0 auto;
  display: flex;
  gap: var(--space-2);
}

.consent-btn {
  min-height: 40px;
  min-width: 120px;
}

.consent-dismiss {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  margin-left: var(--space-2);
  border-radius: var(--radius);
}

.consent-dismiss:hover {
  color: var(--primary);
}

/* Keyboard focus — required for accessibility (no default .btn focus style) */
.consent-banner .btn:focus-visible,
.consent-dismiss:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Mobile: stack vertically, full-width buttons, X pinned to corner */
@media (max-width: 768px) {
  .consent-banner {
    padding: var(--space-4);
  }
  .consent-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    position: relative;
  }
  .consent-btn-group {
    flex-direction: column;
    width: 100%;
  }
  .consent-btn {
    width: 100%;
  }
  .consent-dismiss {
    position: absolute;
    top: 0;
    right: 0;
    margin-left: 0;
  }
}

/* Honor user's motion preference — banner appears/disappears instantly */
@media (prefers-reduced-motion: reduce) {
  .consent-banner,
  .consent-banner.is-exiting {
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
  }
}

/* =========================================================================
   Phase 55-06 — Meta Tracking section (UI-SPEC lines 214-278, 382-384)
   GrowthSettings admin surface for per-tenant Meta Pixel/Dataset IDs + EMQ.
   Uses existing --space-*, --text-muted, --danger tokens; reuses the .badge
   base rule at styles.css:457-465. APPEND-ONLY — no existing rules edited.
   ========================================================================= */

.meta-field {
  margin-bottom: var(--space-4);
}

.meta-field label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.meta-field input {
  max-width: 480px;
}

.meta-field .help {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.meta-field .error {
  font-size: 13px;
  color: var(--danger);
  margin-top: var(--space-1);
}

.meta-field input.has-error {
  border-color: var(--danger);
}

.meta-field .readonly-value {
  font-family: "Menlo", "Consolas", monospace;
  font-size: 13px;
  color: var(--text-main);
  padding: var(--space-2);
  background: var(--bg-subtle, #f5f6f7);
  border-radius: 3px;
  display: inline-block;
}

.meta-field .readonly-value.empty {
  color: var(--text-muted);
  font-family: inherit;
  background: transparent;
  padding: 0;
}

/* EMQ badges — reuse .badge base rule, override for data readability */
.badge-emq {
  font-size: 0.8rem;
  text-transform: none;
  padding: 4px 10px;
  letter-spacing: 0;
}

.badge.badge-emq.badge-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.badge.badge-emq.badge-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.badge.badge-emq.badge-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.badge.badge-emq.badge-neutral {
  background: #e9ecef;
  color: #495057;
  border: 1px solid #ced4da;
}

.emq-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.meta-settings-save-row {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
}

/* At narrow viewports the 480px input cap is released (UI-SPEC line 439) */
@media (max-width: 480px) {
  .meta-field input {
    max-width: none;
  }
}

/* -------------------------------------------------------------------------
   Phase 72 — Owner Personal Assistant Settings UI
   - Owner profile editor (family / doctors / medications / interests / etc.)
   - Pending reminders viewer (list + cancel)
   - Mobile-responsive at the 375px target via the 480px breakpoint below.
   ------------------------------------------------------------------------- */

.owner-profile-editor .section-title,
.reminders-viewer .section-title {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.owner-profile-editor .section-hint,
.reminders-viewer .section-hint {
  color: var(--color-muted, #666);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.owner-profile-subsection {
  margin-bottom: 1.25rem;
}

.subsection-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.owner-profile-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.owner-profile-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.owner-profile-row input[type="text"] {
  flex: 1 1 180px;
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid var(--color-border, #ccc);
  border-radius: 4px;
}

.btn-remove {
  color: var(--color-danger, #c00);
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}

.btn-add {
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.checkbox-row input[type="checkbox"] {
  margin-top: 0.25rem;
}

.reminders-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reminder-item {
  border: 1px solid var(--color-border, #ddd);
  border-radius: 4px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reminder-text {
  font-weight: 500;
}

.reminder-due {
  font-size: 0.85rem;
}

.btn-cancel-reminder {
  align-self: flex-start;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

/* Mobile responsiveness — must not overflow at 375px width.
   Stack the per-row input pairs vertically below 480px so the editor
   fits inside the smallest target viewport without horizontal scroll. */
@media (max-width: 480px) {
  .owner-profile-row {
    flex-direction: column;
    align-items: stretch;
  }
  .owner-profile-row input[type="text"] {
    flex: 1 1 auto;
  }
}
