/* SeatedIQ - Custom CSS with Tailwind CDN */
:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-700: #374151;
  --gray-900: #111827;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #f3f4f6;
  color: #111827;
  margin: 0;
}

/* Sidebar */
.sidebar {
  width: 256px;
  min-height: 100vh;
  background: #1a1a2e;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo h1 {
  color: white;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
}

.sidebar-logo span {
  color: #818cf8;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6b7280;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.nav-item.active {
  background: rgba(99,102,241,0.15);
  color: #818cf8;
  border-right: 3px solid #818cf8;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-bottom {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  color: white;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: #6b7280;
  font-size: 11px;
  text-transform: capitalize;
}

/* Main content */
.main-content {
  margin-left: 256px;
  min-height: 100vh;
}

.topbar {
  background: white;
  padding: 16px 32px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.page-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin: 2px 0 0;
}

.page-body {
  padding: 28px 32px;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.card-body {
  padding: 20px;
}

/* Stats */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: #4f46e5;
  color: white;
}
.btn-primary:hover { background: #3730a3; color: white; }

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.btn-secondary:hover { background: #e5e7eb; color: #111827; }

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fecaca; }

.btn-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  padding: 8px;
  border-radius: 8px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.btn-icon:hover { background: #e5e7eb; }

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  color: #111827;
  background: white;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.form-control:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-control.error {
  border-color: #ef4444;
}

.form-hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

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

th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

td {
  padding: 13px 16px;
  font-size: 14px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-indigo { background: #e0e7ff; color: #3730a3; }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo h1 {
  font-size: 28px;
  font-weight: 900;
  color: #1a1a2e;
  margin: 0;
}

.auth-logo span {
  color: #4f46e5;
}

.auth-subtitle {
  font-size: 14px;
  color: #6b7280;
  text-align: center;
  margin-top: 4px;
}

/* Onboarding */
.onboarding-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.onboarding-card {
  background: white;
  border-radius: 20px;
  padding: 48px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e7eb;
}

.step-dot.active {
  background: #4f46e5;
  width: 24px;
  border-radius: 4px;
}

.step-dot.done {
  background: #10b981;
}

/* Checkbox */
.checkbox-card {
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox-card:hover {
  border-color: #c7d2fe;
  background: #f5f3ff;
}

.checkbox-card input:checked ~ * {
  color: #4f46e5;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: #d1d5db;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: #374151;
  margin: 0 0 6px;
}

/* Status colors */
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-seated { background: #d1fae5; color: #065f46; }
.status-completed { background: #e0e7ff; color: #3730a3; }
.status-no_show { background: #fee2e2; color: #991b1b; }
.status-cancelled { background: #f3f4f6; color: #6b7280; }

/* Source colors */
.source-opentable { background: #fee2e2; color: #b91c1c; }
.source-resy { background: #1a1a2e; color: white; }
.source-sevenrooms { background: #f3f4f6; color: #374151; }
.source-manual { background: #e0e7ff; color: #3730a3; }
.source-phone { background: #d1fae5; color: #065f46; }
.source-walk_in { background: #fef3c7; color: #92400e; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 0;
  justify-content: center;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  background: white;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  transition: all 0.15s;
}

.page-link:hover { background: #f3f4f6; }
.page-link.active { background: #4f46e5; color: white; border-color: #4f46e5; }
.page-link.disabled { opacity: 0.4; cursor: not-allowed; }

/* Divider */
.divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 20px 0;
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

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

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
}

/* Campaign type badges */
.type-winback { background: #ede9fe; color: #5b21b6; }
.type-review_request { background: #d1fae5; color: #065f46; }
.type-birthday { background: #fce7f3; color: #831843; }
.type-anniversary { background: #fff7ed; color: #9a3412; }
.type-promotional { background: #dbeafe; color: #1e40af; }
.type-custom { background: #f3f4f6; color: #374151; }

/* Toggle */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: 0.2s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.toggle input:checked + .toggle-slider { background: #4f46e5; }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

/* Risk bands */
.risk-low { border-left: 4px solid #10b981; }
.risk-medium { border-left: 4px solid #f59e0b; }
.risk-high { border-left: 4px solid #ef4444; }

/* Platform cards */
.platform-card {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.15s;
  cursor: default;
}

.platform-card.connected {
  border-color: #10b981;
  background: #f0fdf4;
}

/* Textarea */
textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Checkbox */
input[type="checkbox"].form-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #4f46e5;
  cursor: pointer;
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 14px;
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: #374151;
  width: 100%;
}

.search-bar svg {
  color: #9ca3af;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

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

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

/* Utility */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: #6b7280; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
