/* ===== Google Font ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== CSS Custom Properties ===== */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-sidebar: rgba(10, 10, 18, 0.95);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-modal-overlay: rgba(0, 0, 0, 0.7);

  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --text-accent: #f09433;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(240, 148, 51, 0.5);

  /* Instagram Gradient */
  --gradient-ig: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #bc1888);
  --gradient-ig-reverse: linear-gradient(135deg, #bc1888, #dc2743, #e6683c, #f09433);
  --gradient-ig-soft: linear-gradient(135deg, rgba(240,148,51,0.15), rgba(188,24,136,0.15));

  /* Status Colors */
  --status-new: #3b82f6;
  --status-ai-engaged: #8b5cf6;
  --status-handoff: #ef4444;
  --status-contacted: #f97316;
  --status-reserved: #22c55e;
  --status-completed: #6b7280;
  --status-lost: #374151;

  /* Reservation Status */
  --res-pending: #eab308;
  --res-confirmed: #3b82f6;
  --res-completed: #22c55e;
  --res-cancelled: #ef4444;
  --res-no-show: #6b7280;

  /* Spacing */
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(240, 148, 51, 0.15);
  --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.login-bg::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240,148,51,0.12), transparent 70%);
  top: -200px;
  right: -200px;
  animation: floatBubble 15s ease-in-out infinite;
}

.login-bg::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(188,24,136,0.1), transparent 70%);
  bottom: -150px;
  left: -150px;
  animation: floatBubble 18s ease-in-out infinite reverse;
}

@keyframes floatBubble {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, -80px) scale(0.95); }
  75% { transform: translate(40px, -30px) scale(1.02); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 48px 40px;
  background: var(--bg-card);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  text-align: center;
  animation: fadeInUp 0.6s ease;
}

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

.login-logo {
  font-size: 42px;
  font-weight: 900;
  background: var(--gradient-ig);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  letter-spacing: -1px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 36px;
  font-weight: 400;
}

.login-card .form-group {
  margin-bottom: 24px;
}

.login-card input[type="password"] {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  outline: none;
}

.login-card input[type="password"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(240,148,51,0.15);
}

.login-card input[type="password"]::placeholder {
  color: var(--text-muted);
}

.login-error {
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 16px;
  min-height: 20px;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.login-error.visible {
  opacity: 1;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient-ig);
  color: white;
  box-shadow: 0 4px 15px rgba(220, 39, 67, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(220, 39, 67, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-full { width: 100%; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 16px;
}

/* ===== Layout ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
  font-size: 26px;
  font-weight: 800;
  background: var(--gradient-ig);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-base);
  text-decoration: none;
  position: relative;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
  text-decoration: none;
}

.sidebar-link.active {
  color: var(--text-primary);
  background: var(--gradient-ig-soft);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--gradient-ig);
  border-radius: 0 3px 3px 0;
}

.sidebar-link-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link-badge {
  margin-left: auto;
  background: var(--status-handoff);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: all var(--transition-base);
}

.sidebar-logout:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.1);
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ===== Top Header ===== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--gradient-ig-soft);
  border: 1px solid rgba(240,148,51,0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-accent);
}

.header-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== Page Content ===== */
.page-content {
  padding: 32px;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ===== Stat Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-ig);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  border-color: rgba(255,255,255,0.12);
}

.stat-card:hover::after { opacity: 1; }

.stat-card-icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: inline-block;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card-change {
  font-size: 12px;
  margin-top: 8px;
  font-weight: 600;
}

.stat-card-change.up { color: #22c55e; }
.stat-card-change.down { color: #ef4444; }

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

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

thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ===== Status Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-new {
  background: rgba(59, 130, 246, 0.15);
  color: var(--status-new);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-ai_engaged, .badge-ai-engaged {
  background: rgba(139, 92, 246, 0.15);
  color: var(--status-ai-engaged);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-handoff {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-handoff);
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(239,68,68,0.2); }
  50% { box-shadow: 0 0 15px rgba(239,68,68,0.4); }
}

.badge-contacted {
  background: rgba(249, 115, 22, 0.15);
  color: var(--status-contacted);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge-reserved {
  background: rgba(34, 197, 94, 0.15);
  color: var(--status-reserved);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-completed {
  background: rgba(107, 114, 128, 0.15);
  color: var(--status-completed);
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.badge-lost {
  background: rgba(55, 65, 81, 0.15);
  color: var(--status-lost);
  border: 1px solid rgba(55, 65, 81, 0.3);
}

.badge-cold {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-hot {
  background: rgba(239, 68, 68, 0.15);
  color: #ff4757;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-blocked {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.badge-booked {
  background: rgba(34, 197, 94, 0.15);
  color: var(--status-reserved);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Reservation Badges */
.badge-pending {
  background: rgba(234, 179, 8, 0.15);
  color: var(--res-pending);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-confirmed {
  background: rgba(59, 130, 246, 0.15);
  color: var(--res-confirmed);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--res-cancelled);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-no_show, .badge-no-show {
  background: rgba(107, 114, 128, 0.15);
  color: var(--res-no-show);
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ===== Toggle Switch ===== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 26px;
  transition: all var(--transition-base);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--gradient-ig);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.toggle-switch.lg {
  width: 56px;
  height: 30px;
}

.toggle-switch.lg .toggle-slider::before {
  height: 24px;
  width: 24px;
}

.toggle-switch.lg input:checked + .toggle-slider::before {
  transform: translateX(26px);
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(240,148,51,0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0b0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
}

.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 160px;
  padding: 10px 14px;
  font-size: 13px;
}

.filter-bar .form-select {
  padding-right: 34px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrapper .form-input {
  padding-left: 40px;
}

.search-input-wrapper::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
  line-height: 1;
}

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

.modal-body {
  padding: 28px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px;
  border-top: 1px solid var(--border-color);
}

/* ===== Tags ===== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.tag-remove {
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1;
  transition: color var(--transition-fast);
}

.tag-remove:hover { color: #ef4444; }

.tag-input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  min-width: 80px;
  padding: 3px 0;
}

/* ===== Service Cards ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.service-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-base);
  position: relative;
}

.service-card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.service-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.service-card-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.service-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  margin-left: 10px;
}

.service-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.service-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.service-card-price {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.service-card-price small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.service-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* ===== Category Pills ===== */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.category-pill {
  padding: 8px 20px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
}

.category-pill:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--text-primary);
}

.category-pill.active {
  background: var(--gradient-ig);
  border-color: transparent;
  color: white;
}

/* ===== Reservation Cards ===== */
.reservation-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-base);
}

.reservation-card:hover {
  border-color: rgba(255,255,255,0.12);
}

.reservation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.reservation-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.reservation-customer {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.reservation-service {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.reservation-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.reservation-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reservation-actions {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

/* ===== Settings ===== */
.settings-section {
  margin-bottom: 32px;
}

.settings-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  transition: all var(--transition-base);
}

.toggle-row:hover {
  border-color: rgba(255,255,255,0.12);
}

.toggle-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-row-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-row-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Quick Action Buttons (Dashboard) ===== */
.quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
}

.quick-action-btn:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.quick-action-btn.active {
  border-color: rgba(34,197,94,0.5);
  box-shadow: 0 0 20px rgba(34,197,94,0.1);
}

.quick-action-btn.inactive {
  border-color: rgba(239,68,68,0.3);
  opacity: 0.7;
}

/* ===== Platform Icons ===== */
.platform-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
}

.platform-icon.instagram { color: #e1306c; }
.platform-icon.whatsapp { color: #25D366; }
.platform-icon.web { color: #3b82f6; }

/* ===== Handoff Highlight ===== */
tr.handoff-row {
  background: rgba(239, 68, 68, 0.04);
}

tr.handoff-row:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #f09433;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  min-width: 280px;
  max-width: 420px;
  pointer-events: auto;
  animation: toastIn 0.35s ease;
  font-size: 14px;
  color: var(--text-primary);
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(50px); }
}

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success { border-left: 3px solid #22c55e; }
.toast.success .toast-icon::after { content: '✓'; color: #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.error .toast-icon::after { content: '✕'; color: #ef4444; }
.toast.info { border-left: 3px solid #3b82f6; }
.toast.info .toast-icon::after { content: 'ℹ'; color: #3b82f6; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 15px;
  font-weight: 500;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination-btn {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
}

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

.pagination-btn.active {
  background: var(--gradient-ig);
  border-color: transparent;
  color: white;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 8px;
}

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

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

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

  .hamburger-btn {
    display: block;
  }

  .page-content {
    padding: 20px 16px;
  }

  .top-header {
    padding: 0 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card-value {
    font-size: 24px;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .form-input,
  .filter-bar .form-select {
    width: 100%;
  }

  .search-input-wrapper {
    width: 100%;
  }

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

  .modal {
    max-width: 100%;
    margin: 10px;
    max-height: 90vh;
  }

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

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

  .login-card {
    margin: 16px;
    padding: 36px 24px;
  }

  .quick-actions {
    flex-direction: column;
  }
}

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

  .header-badge {
    display: none;
  }
}

/* ===== Sidebar Overlay (mobile) ===== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ===== Price Modifiers ===== */
.modifiers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modifier-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.modifier-row .form-input {
  padding: 8px 12px;
  font-size: 13px;
}

.modifier-label {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
}

.modifier-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 60px;
  text-align: right;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.4s ease;
}

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

.slide-up {
  animation: slideUp 0.5s ease;
}

/* Staggered animation for cards */
.stats-grid .stat-card:nth-child(1) { animation: slideUp 0.4s ease 0.0s both; }
.stats-grid .stat-card:nth-child(2) { animation: slideUp 0.4s ease 0.1s both; }
.stats-grid .stat-card:nth-child(3) { animation: slideUp 0.4s ease 0.2s both; }
.stats-grid .stat-card:nth-child(4) { animation: slideUp 0.4s ease 0.3s both; }

/* ===== Misc ===== */
.text-gradient {
  background: var(--gradient-ig);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 24px 0;
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }

/* ===== Kanban CRM Styles (Simplified) ===== */
.platform-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.platform-tab {
  padding: 10px 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.platform-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.platform-tab.active[data-platform="instagram"] {
  background: var(--gradient-ig);
  border-color: transparent;
  color: white;
}
.platform-tab.active[data-platform="whatsapp"] {
  background: #25D366;
  border-color: transparent;
  color: white;
}
.platform-tab.active[data-platform="web"] {
  background: #3b82f6;
  border-color: transparent;
  color: white;
}
.platform-tab.active[data-platform="all"] {
  background: var(--text-primary);
  border-color: transparent;
  color: var(--bg-primary);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-column {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kanban-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kanban-column-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  max-height: 70vh;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: var(--shadow-card);
}

.kanban-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

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

.score-bar-wrapper {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.05);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.score-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.score-bar.hot {
  background: linear-gradient(90deg, #ef4444, #f97316);
}
.score-bar.warm {
  background: #eab308;
}
.score-bar.cold {
  background: #3b82f6;
}

.kanban-card-score-text {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  text-align: right;
}

.kanban-card-score-text.hot { color: #f97316; }
.kanban-card-score-text.warm { color: #eab308; }
.kanban-card-score-text.cold { color: #3b82f6; }

/* ===== Dynamic Knowledge Base (Settings) ===== */
.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.knowledge-item {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.knowledge-item input, .knowledge-item textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.knowledge-item input:focus, .knowledge-item textarea:focus {
  border-color: var(--border-focus);
}

.btn-delete-knowledge {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-delete-knowledge:hover {
  background: #ef4444;
  color: white;
}

/* ===== Responsive Kanban for Mobile ===== */
@media (max-width: 992px) {
  .kanban-board {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .kanban-column {
    min-height: auto;
  }
  
  .kanban-cards {
    max-height: 350px;
  }
}

/* ===== DM-Like Customer List Layout ===== */
.customer-list-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.customer-row {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  transition: all var(--transition-base);
  cursor: pointer;
}

.customer-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.customer-row.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(240, 148, 51, 0.4);
  box-shadow: 0 0 15px rgba(240, 148, 51, 0.05);
}

.customer-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.customer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-ig-soft);
  border: 1px solid rgba(240, 148, 51, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.customer-details {
  flex: 1;
  min-width: 0;
}

.customer-name-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 2px;
}

.customer-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.customer-last-msg {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
  padding-left: 2px;
  width: 100%;
}

.customer-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  margin-top: 2px;
  gap: 8px;
  width: 100%;
}

.customer-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.customer-row-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .customer-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }
  .customer-score-section {
    max-width: 100%;
  }
  .customer-actions {
    justify-content: flex-end;
  }
  
  /* Mobile Horizontal Scroll tabs & columns */
  .platform-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    overflow-x: auto !important;
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  .platform-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
  .platform-tab {
    flex-shrink: 0;
  }
  
  .quick-actions {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    padding-bottom: 8px;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .quick-actions::-webkit-scrollbar {
    display: none;
  }
  .quick-action-btn {
    flex-shrink: 0;
  }
  
  /* Split DM modal responsiveness */
  .lead-modal-split {
    flex-direction: column !important;
    min-height: auto !important;
  }
  .chat-section {
    border-right: none !important;
    padding-right: 0 !important;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 16px;
  }
}

/* Custom Datepicker Styles */
.custom-datepicker {
  position: relative;
  width: 100%;
  user-select: none;
}

.datepicker-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.datepicker-trigger:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.custom-datepicker:focus-within .datepicker-trigger {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(240, 148, 51, 0.15);
}

.datepicker-calendar {
  position: absolute;
  top: 105%;
  left: 0;
  width: 320px;
  background: #14141e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: 16px;
  z-index: 1050; /* higher than other elements */
}

@media (max-width: 480px) {
  .datepicker-calendar {
    width: 280px;
    padding: 12px;
  }
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-month-year {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

.calendar-nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: background var(--transition-fast);
}

.calendar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
  column-gap: 4px;
}

.calendar-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-day-cell:hover:not(.disabled-day):not(.padding-day) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.calendar-day-cell.padding-day {
  color: var(--text-muted);
  opacity: 0.3;
  cursor: default;
}

.calendar-day-cell.today {
  border: 1px dashed var(--text-accent);
  color: var(--text-accent);
}

.calendar-day-cell.selected-day {
  background: var(--gradient-ig);
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(240, 148, 51, 0.3);
}

.calendar-day-cell.disabled-day {
  opacity: 0.25;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ===== CRM SPLIT CONTAINER (Messenger-Like Layout) ===== */
.crm-split-container {
  display: flex;
  gap: 20px;
  height: calc(100vh - 150px);
  min-height: 600px;
  width: 100%;
  position: relative;
}

/* Default state: show list full width, hide right chat panel */
.crm-left-panel {
  flex: 1;
  max-width: 100% !important;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow: hidden;
  transition: all var(--transition-base);
}

.crm-right-panel {
  display: none !important; /* Hidden by default */
}

/* Chat active state: hide list, show chat panel full width */
.crm-split-container.chat-active .crm-left-panel {
  display: none !important;
}

.crm-split-container.chat-active .crm-right-panel {
  flex: 1;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: all var(--transition-base);
}

/* Hide top header when chat is active */
.main-content.chat-view-active {
  padding: 0 !important;
}
.main-content.chat-view-active .top-header {
  display: none !important;
}
.main-content.chat-view-active .page-content {
  padding: 0 !important;
  height: 100vh !important;
}
.main-content.chat-view-active .crm-split-container {
  height: 100vh !important;
  min-height: 100vh !important;
}

.customer-list-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-right: 4px;
}

.customer-list-scroll::-webkit-scrollbar {
  width: 6px;
}
.customer-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Chat area components */
#leadChatActiveArea {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.chat-section {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  padding: 20px;
  height: 100%;
  overflow: hidden;
}

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

#chatMessageStream {
  flex: 1;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.chat-input-area {
  flex-shrink: 0;
}

.info-section {
  flex: 0.8;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  overflow: hidden;
}

.info-scroll-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.info-scroll-container::-webkit-scrollbar {
  width: 4px;
}
.info-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.active-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-ig);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.customer-row.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(240, 148, 51, 0.3);
}

.mobile-back-header {
  display: none;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

/* PC specific details for chat action header */
@media (min-width: 769px) {
  .toggle-details-btn {
    display: none !important; /* Hide details toggle on PC since it is side-by-side */
  }
}

/* Mobile Split View & Responsiveness */
@media (max-width: 768px) {
  .crm-split-container {
    height: calc(100vh - 120px);
  }
  
  .crm-split-container.chat-active .crm-right-panel {
    display: flex !important;
  }
  
  #leadChatActiveArea {
    flex-direction: row !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  
  /* Mobile Tab Toggle Logic: Chat view vs Info view */
  #leadChatActiveArea:not(.show-details) .info-section {
    display: none !important;
  }
  #leadChatActiveArea.show-details .chat-section {
    display: none !important;
  }
  #leadChatActiveArea:not(.show-details) .chat-section {
    display: flex !important;
    flex: 1 !important;
    height: 100% !important;
    border-right: none !important;
    border-bottom: none !important;
  }
  #leadChatActiveArea.show-details .info-section {
    display: flex !important;
    flex: 1 !important;
    height: 100% !important;
    overflow-y: auto !important;
  }
  
  .mobile-info-header {
    display: flex !important;
  }
}

/* Small mobile device button layout adjustments */
@media (max-width: 480px) {
  .customer-row-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .customer-row-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .customer-row-actions button, .customer-row-actions a {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 70px !important;
    text-align: center !important;
    justify-content: center !important;
    font-size: 10px !important;
    height: 28px !important;
    padding: 2px 6px !important;
  }
}


