/* ==========================================================================
   Demo Dental Glasgow - Vercel Dashboard Aesthetic
   Pure black (#000000), dark panels (#0A0A0A), hairline borders (#1F1F1F),
   monochrome typography with status dots only.
   ========================================================================== */

:root {
  --bg-primary: #000000;
  --bg-secondary: #0A0A0A;
  --bg-tertiary: #111111;
  --bg-card: #0A0A0A;
  --bg-hover: #141414;
  --bg-active: #1A1A1A;

  --border-color: #1F1F1F;
  --border-subtle: #161616;
  --border-focus: #383838;

  --text-primary: #FFFFFF;
  --text-secondary: #888888;
  --text-muted: #666666;
  --text-faint: #444444;

  /* Minimal status dot accents */
  --status-green: #10B981;
  --status-blue: #0070F3;
  --status-amber: #F5A623;
  --status-gray: #666666;
  --status-red: #EF4444;
  --status-purple: #8B5CF6;
  --emerald: #10B981;

  /* Premium border radius tokens */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-btn: 8px;
  --radius-input: 8px;
  --radius-card: 12px;
  --radius-lg: 12px;
  --radius-modal: 16px;
  --radius-xl: 16px;

  /* Layered depth shadows */
  --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 6px 18px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 24px 64px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(255, 255, 255, 0.08);

  --font-sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', Menlo, Consolas, Monaco, monospace;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
  outline: 2px solid #0070F3;
  outline-offset: 2px;
}

/* Minimal Gray Demo Pill */
.demo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Layout */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Sidebar */
.sidebar {
  width: 230px;
  min-width: 230px;
  height: 100%;
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 50;
  user-select: none;
}

.sidebar-header {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon-box {
  width: 22px;
  height: 22px;
  background: #FFFFFF;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 11px;
}

.brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  border-radius: var(--radius-md);
  transition: color 0.12s ease, background-color 0.12s ease;
}

.nav-link svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.75;
  color: var(--text-muted);
  transition: color 0.12s ease;
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.nav-link:hover svg {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--text-primary);
  background-color: var(--bg-hover);
  font-weight: 500;
}

.nav-link.active svg {
  color: var(--text-primary);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer .clinic-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer .clinic-title {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
}

/* Top Bar */
.top-header {
  height: 54px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.hamburger-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-btn);
  color: var(--text-secondary);
  min-width: 38px;
  min-height: 38px;
  padding: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hamburger-btn svg {
  width: 18px;
  height: 18px;
}

.header-title-container {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.page-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.header-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* View Container */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Micro-Labels (Vercel Style) */
.micro-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

/* Vercel Action Bar */
.view-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

/* Search Input */
.search-box {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  padding: 7px 10px 7px 32px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-tertiary);
}

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

/* Vercel Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 14px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s ease;
  white-space: nowrap;
  user-select: none;
}

.btn svg {
  width: 13px;
  height: 13px;
}

/* Solid White Primary Button (Vercel Signature) */
.btn-primary {
  background-color: #FFFFFF;
  color: #000000;
  border: 1px solid #FFFFFF;
}

.btn-primary:hover {
  background-color: #E8E8E8;
  border-color: #E8E8E8;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Subtle Bordered Secondary Button */
.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-focus);
}

/* Subtle Danger Button */
.btn-danger {
  background-color: transparent;
  color: var(--status-red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: var(--status-red);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px;
  border-radius: var(--radius-btn);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background-color: var(--bg-hover);
}

/* Stat Cards Grid (Vercel Metrics) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 92px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-card-hover);
}

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

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value, .kpi-value, .stat-number, .metric-number {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Dashboard Split Grid */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
}

.panel-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tables (Dense, Crisp Hairline Dividers) */
.table-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background-color: var(--bg-primary);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background-color: var(--bg-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Contact Cell */
.contact-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.contact-name {
  font-weight: 500;
  color: var(--text-primary);
}

.contact-phone-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Status Dots & Subtle Pills */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.dot-completed {
  background-color: var(--status-green);
}

.status-dot.dot-booked,
.status-dot.dot-scheduled {
  background-color: var(--status-blue);
}

.status-dot.dot-quoted,
.status-dot.dot-noshow {
  background-color: var(--status-amber);
}

.status-dot.dot-newlead {
  background-color: var(--status-gray);
}

.status-dot.dot-contacted {
  background-color: var(--status-purple);
}

.status-dot.dot-cancelled,
.status-dot.dot-danger {
  background-color: var(--status-red);
}

/* Micro Tag Pill */
.tag-pill {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  color: var(--text-secondary);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-right: 4px;
  margin-bottom: 2px;
}

/* Kanban / Pipeline View */
.pipeline-mobile-selector {
  display: none;
}

.kanban-wrapper {
  overflow-x: auto;
  padding-bottom: 12px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(240px, 1fr));
  gap: 12px;
  min-width: 1200px;
}

.kanban-column {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  transition: border-color 0.15s ease;
}

.kanban-column.drag-over {
  border-color: var(--text-secondary);
  background-color: var(--bg-hover);
}

.kanban-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.kanban-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

.kanban-cards {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 120px;
}

.kanban-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  color: var(--text-muted);
  font-size: 11px;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  margin: 6px 0;
}

.kanban-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: grab;
  user-select: none;
  transition: border-color 0.12s ease, transform 0.12s ease;
}

.kanban-card:hover {
  border-color: var(--border-focus);
}

.kanban-card.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

/* Activity Feed (Vercel Style) */
.activity-list {
  list-style: none;
}

.activity-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12px;
  transition: background-color 0.1s ease;
}

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

.activity-item:hover {
  background-color: var(--bg-hover);
}

.activity-dot-col {
  padding-top: 5px;
}

.activity-body {
  flex: 1;
}

.activity-text {
  color: var(--text-primary);
  line-height: 1.4;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Modal System (Vercel Dialog) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100dvh - 32px);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  flex-shrink: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.modal-body {
  flex: 1 1 auto;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  flex-shrink: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Forms (Vercel Style) */
.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--status-red);
}

.form-control, .form-input, .form-select, .form-textarea {
  width: 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-control:focus, .form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

select.form-control, select.form-select {
  cursor: pointer;
}

textarea.form-control, textarea.form-textarea {
  resize: vertical;
  min-height: 80px;
}

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

/* Empty States */
.empty-state {
  padding: 44px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-card);
  margin: 12px 0;
}

.empty-state-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.empty-state-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 16px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  min-width: 260px;
  animation: toastSlideIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-hide {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.15s ease;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* Loading Spinner */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  color: var(--text-muted);
  gap: 12px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2150;
}

.mobile-bottom-nav {
  display: none;
}

/* Mobile Breakpoints */
@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -280px;
    width: 280px;
    z-index: 2200;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    box-shadow: none;
    transition: left 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.open {
    left: 0;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.85);
  }

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

  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
  }

  .hamburger-btn {
    display: inline-flex;
  }

  .top-header {
    padding: 0 14px;
    height: 52px;
  }

  .page-subtitle {
    display: none !important;
  }

  .header-date {
    display: none !important;
  }

  .header-right {
    padding-right: 0 !important;
    gap: 8px;
  }

  .content-area {
    padding: 14px 14px 84px 14px;
  }

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background-color: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1500;
  }

  .mobile-nav-item {
    flex: 1;
    height: 100%;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.12s ease;
  }

  .mobile-nav-item svg {
    width: 18px;
    height: 18px;
  }

  .mobile-nav-item:hover,
  .mobile-nav-item.active {
    color: var(--text-primary);
  }

  .mobile-nav-item.active svg {
    stroke: #FFFFFF;
  }

  .chat-trigger-btn {
    bottom: 70px !important;
    right: 14px !important;
    padding: 7px 12px;
  }

  .chat-drawer {
    bottom: 68px !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: calc(100dvh - 136px) !important;
    max-height: none !important;
  }

  .stats-grid,
  .metrics-grid,
  .kpi-grid,
  .analytics-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .view-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .search-box {
    width: 100%;
  }

  .btn {
    min-height: 44px;
    font-size: 13px;
  }

  .form-control, .form-input, .form-select, .form-textarea, .search-input {
    min-height: 44px;
    font-size: 16px; /* Prevents auto zoom on mobile Safari */
  }

  .modal-card {
    max-width: 100% !important;
    margin: 8px !important;
    max-height: calc(100dvh - 16px) !important;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
    min-height: 44px;
  }

  #inbox-stream-container {
    grid-template-columns: 1fr !important;
  }

  /* Pipeline Mobile First View */
  .pipeline-mobile-selector {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 14px 2px;
    margin-bottom: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .pipeline-mobile-selector::-webkit-scrollbar {
    display: none;
  }

  .pipeline-stage-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.15s ease;
    user-select: none;
  }

  .pipeline-stage-pill:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
  }

  .pipeline-stage-pill.active {
    background-color: #1a1a1a;
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

  .pipeline-stage-pill .stage-pill-name {
    white-space: nowrap;
  }

  .stage-pill-count {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 9999px;
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    line-height: 1;
  }

  .pipeline-stage-pill.active .stage-pill-count {
    background-color: #ffffff;
    color: #000000;
    border-color: #ffffff;
  }

  .kanban-wrapper {
    overflow-x: visible !important;
    padding-bottom: 0 !important;
    width: 100% !important;
  }

  .kanban-board {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .kanban-column {
    display: none !important;
  }

  .kanban-column.active-mobile-stage {
    display: flex !important;
    width: 100% !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .kanban-column.active-mobile-stage .kanban-header {
    display: none !important;
  }

  .kanban-column.active-mobile-stage .kanban-cards {
    padding: 0 !important;
    gap: 10px !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    min-height: 0 !important;
  }

  .kanban-column.active-mobile-stage .kanban-card {
    width: 100% !important;
    box-sizing: border-box !important;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
  }

  .kanban-column.active-mobile-stage .kanban-card:active {
    transform: scale(0.99);
    background-color: var(--bg-hover);
    border-color: var(--border-focus);
  }

  .kanban-column.active-mobile-stage .kanban-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
  }

  .kanban-column.active-mobile-stage .kanban-card-meta {
    font-size: 12px;
    margin-top: 6px;
  }

  .kanban-column.active-mobile-stage .kanban-empty {
    height: 110px;
    width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    padding: 16px;
    margin: 8px 0;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
  }
}

/* ==========================================================================
   AI Receptionist Chat Widget (Vercel Aesthetic)
   ========================================================================== */

.chat-trigger-btn {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.chat-trigger-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-focus);
}

.chat-trigger-btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.chat-online-dot {
  width: 7px;
  height: 7px;
  background-color: var(--status-green);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.chat-trigger-label {
  letter-spacing: -0.01em;
}

/* Chat Drawer Window */
.chat-drawer {
  position: fixed;
  bottom: 68px;
  right: 22px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 90px);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  overflow: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.chat-drawer.hidden {
  display: none;
}

.chat-drawer-header {
  padding: 12px 14px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 26px;
  height: 26px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}

.chat-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.chat-status-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-close-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.chat-close-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Chat Body & Messages */
.chat-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--bg-primary);
}

.chat-message-row {
  display: flex;
  width: 100%;
}

.chat-message-row.user-row {
  justify-content: flex-end;
}

.chat-message-row.bot-row {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-bubble.bot-bubble {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.chat-bubble.user-bubble {
  background-color: var(--bg-hover);
  border: 1px solid #282828;
  color: #FFFFFF;
}

.chat-bubble-text strong {
  color: #FFFFFF;
  font-weight: 600;
}

.chat-bubble-provider {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-bubble-time {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 3px;
  text-align: right;
}

/* Suggestion Pills */
.chat-suggestions-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 12px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  scrollbar-width: none;
}

.chat-suggestions-bar::-webkit-scrollbar {
  display: none;
}

.chat-pill-btn {
  white-space: nowrap;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-pill-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Chat Footer & Input */
.chat-drawer-footer {
  padding: 10px 12px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.chat-drawer-footer form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input {
  flex: 1;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s ease;
}

.chat-input:focus {
  border-color: var(--border-focus);
}

.chat-send-btn {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-sm);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.chat-send-btn:hover {
  opacity: 0.9;
}

.chat-send-btn svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Owner AI Assistant Cards & Thread
   ========================================================================== */

.owner-ai-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}

.owner-ai-card.user-card {
  border-left: 2px solid var(--status-blue);
}

.owner-ai-card.assistant-card {
  border-left: 2px solid var(--status-green);
}

.owner-ai-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.owner-ai-card-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
}

.example-query-pill {
  transition: all 0.15s ease;
}

.example-query-pill:hover {
  background-color: var(--bg-hover) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-focus) !important;
}

/* ==========================================================================
   Review Engine Styles (Vercel Aesthetic)
   ========================================================================== */

.review-honest-note,
.review-live-note {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--status-green);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.review-verified-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #052E16;
  border: 1px solid #14532D;
  color: #10B981;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.review-demo-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1C1917;
  border: 1px solid #442E15;
  color: #F59E0B;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.review-settings-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-top: 24px;
}

.review-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.var-tag-pill {
  display: inline-block;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}

.var-tag-pill:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

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

@media (max-width: 768px) {
  #inbox-stream-container {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 540px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Color Badge Variants */
.badge-purple {
  background: #1e1b4b !important;
  border: 1px solid #3730a3 !important;
  color: #c084fc !important;
}

.badge-blue {
  background: #082f49 !important;
  border: 1px solid #0369a1 !important;
  color: #38bdf8 !important;
}

.badge-emerald {
  background: #064e3b !important;
  border: 1px solid #065f46 !important;
  color: #34d399 !important;
}

.badge-amber {
  background: #451a03 !important;
  border: 1px solid #78350f !important;
  color: #fbbf24 !important;
}

/* SVG Chart Bar Hover Effects */
.chart-bar {
  transition: all 0.2s ease;
}

.chart-bar-group:hover .chart-bar {
  fill: #ffffff;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}

.chart-bar-group:hover .bar-hover-bg {
  fill: rgba(255, 255, 255, 0.04);
}


