/* ═══════════════════════════════════════════════════════════════
   CATERING DASHBOARD - STYLES
   Modern, minimalist design with dark mode
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Dark Theme Colors (Default) */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-card: #222222;
  --bg-hover: #2a2a2a;

  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  --border: #333333;
  --border-light: #444444;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════════════════════ */

[data-theme="light"] {
  /* Light Theme Colors */
  --bg-primary: #f5f7fa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0f2f5;

  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --success: #16a34a;
  --warning: #d97706;
  --error: #dc2626;
  --info: #2563eb;

  --border: #e2e8f0;
  --border-light: #cbd5e1;

  /* Light Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
}

/* Theme Transition */
body,
.navbar,
.stat-card,
.orders-section,
.modal-content,
.toast,
.login-card,
.result-card,
.filter-btn,
.btn {
  transition: background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════
   THEME TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════ */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-icon {
  font-size: 20px;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
  position: absolute;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

.theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="light"] .theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════ */

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 20px;
}

.login-container {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.login-header .logo {
  font-size: 64px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

.login-features {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 32px 0;
  flex-wrap: wrap;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
}

.feature-icon {
  font-size: 24px;
}

.google-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: white;
  color: #333;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-normal);
}

.google-login-btn:hover {
  background: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.login-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-footer {
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD PAGE
   ═══════════════════════════════════════════════════════════════ */

.dashboard-page {
  background: var(--bg-primary);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-brand .logo {
  font-size: 28px;
}

.nav-brand h1 {
  font-size: 20px;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
}

.live-badge.connected {
  color: var(--success);
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* Main Content */
.dashboard-main {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Stats Section */
.stats-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

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

.stat-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.stat-card.pending .stat-value {
  color: var(--warning);
}

.stat-card.paid .stat-value {
  color: var(--success);
}

.stat-card.revenue .stat-value {
  color: var(--accent-primary);
}

.stat-card.today .stat-value {
  color: var(--info);
}

.stat-card.month .stat-value {
  color: var(--accent-secondary);
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  min-height: 100px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Orders Section */
.orders-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.filter-buttons {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.filter-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

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

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

.orders-table th,
.orders-table td {
  padding: 16px 24px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

.orders-table th {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.orders-table tbody tr {
  transition: var(--transition-fast);
}

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

.order-id {
  font-weight: 600;
  color: var(--accent-primary);
}

.customer-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customer-info strong {
  font-weight: 500;
  color: var(--text-primary);
}

.customer-info .separator {
  color: var(--text-muted);
  font-size: 12px;
}

.customer-info small {
  color: var(--text-muted);
  font-size: 13px;
}

.amount {
  font-weight: 600;
  color: var(--success);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.status-paid {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.status-failed,
.status-payment_failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.status-cancelled {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
}

.status-completed {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

/* Action Buttons */
.actions {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-primary {
  background: var(--accent-gradient);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

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

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
}

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

.btn-view:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.btn-resend {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}

.btn-resend:hover {
  background: var(--accent-primary);
  color: white;
}

.btn-logout {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-logout:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

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

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

.empty-state p {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
}

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-card);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--error);
  color: white;
}

/* Order Details */
.order-details {
  padding: 24px;
}

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

.order-header h2 {
  font-size: 24px;
  font-weight: 700;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h3 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.detail-section p {
  margin-bottom: 4px;
}

.detail-section.pricing .total {
  font-size: 18px;
  color: var(--success);
  margin-top: 8px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  animation: slideIn 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast-success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.toast-error {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.toast-info {
  border-color: var(--info);
  background: rgba(59, 130, 246, 0.1);
}

.toast.fade-out {
  animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════
   PAYMENT RESULT PAGES
   ═══════════════════════════════════════════════════════════════ */

.result-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.result-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 48px;
  text-align: center;
  max-width: 420px;
  border: 1px solid var(--border);
}

.result-icon {
  font-size: 72px;
  margin-bottom: 24px;
}

.result-card h1 {
  font-size: 28px;
  margin-bottom: 12px;
}

.result-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.result-card.success {
  border-color: var(--success);
}

.result-card.cancelled {
  border-color: var(--warning);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .navbar {
    padding: 12px 16px;
  }

  .nav-brand h1 {
    font-size: 16px;
  }

  .dashboard-main {
    padding: 16px;
  }

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

  .section-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .orders-table th,
  .orders-table td {
    padding: 12px;
  }

  .actions {
    flex-direction: column;
  }

  .modal-content {
    max-height: 100vh;
    border-radius: 0;
  }
}

/* Error styles */
.error {
  color: var(--error);
  padding: 20px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS BUTTON
   ═══════════════════════════════════════════════════════════════ */

.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
  font-size: 20px;
  text-decoration: none;
}

.settings-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
  margin-right: 12px;
}

.back-link:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.back-arrow {
  font-size: 18px;
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════════════════════════ */

.settings-main {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.settings-header {
  margin-bottom: 32px;
}

.settings-header h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.settings-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ═══════════════════════════════════════════════════════════════
   API KEYS GRID
   ═══════════════════════════════════════════════════════════════ */

.api-keys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.api-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.api-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border);
  transition: var(--transition-normal);
}

.api-card.configured::before {
  background: var(--success);
}

.api-card.not-configured::before {
  background: var(--warning);
}

.api-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

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

.api-icon {
  font-size: 40px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
}

.status-indicator.valid {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  animation: statusPop 0.3s ease;
}

.status-indicator.invalid {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

@keyframes statusPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.api-card-body h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.api-description {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

.api-key-preview {
  background: var(--bg-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.api-key-preview code {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.api-card-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-edit {
  width: 100%;
  justify-content: center;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.btn-edit:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════
   API MODAL
   ═══════════════════════════════════════════════════════════════ */

.api-modal-content {
  max-width: 480px;
}

.api-modal-header {
  text-align: center;
  padding: 24px 24px 0;
}

.api-icon-large {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.api-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.api-modal-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

#api-form {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-with-validation {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-validation input {
  flex: 1;
  padding: 12px 16px;
  padding-right: 80px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: monospace;
  transition: var(--transition-fast);
}

.input-with-validation input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.toggle-visibility {
  position: absolute;
  right: 44px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
  transition: var(--transition-fast);
}

.toggle-visibility:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   VALIDATION ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

.validation-indicator {
  position: absolute;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.validation-indicator .validating-spinner,
.validation-indicator .valid-check,
.validation-indicator .invalid-cross {
  position: absolute;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
}

/* Validating State - Spinner */
.validation-indicator.validating .validating-spinner {
  opacity: 1;
  transform: scale(1);
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Valid State - Animated Check */
.validation-indicator.valid .valid-check {
  opacity: 1;
  transform: scale(1);
  font-size: 22px;
  color: var(--success);
  animation: validPop 0.5s ease;
}

@keyframes validPop {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }

  50% {
    transform: scale(1.4) rotate(0deg);
  }

  70% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Invalid State - Animated Cross */
.validation-indicator.invalid .invalid-cross {
  opacity: 1;
  transform: scale(1);
  font-size: 22px;
  color: var(--error);
  animation: invalidShake 0.5s ease;
}

@keyframes invalidShake {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  30% {
    transform: scale(1.2);
    opacity: 1;
  }

  40% {
    transform: translateX(-4px) scale(1);
  }

  50% {
    transform: translateX(4px);
  }

  60% {
    transform: translateX(-4px);
  }

  70% {
    transform: translateX(4px);
  }

  80% {
    transform: translateX(-2px);
  }

  90% {
    transform: translateX(2px);
  }

  100% {
    transform: translateX(0) scale(1);
  }
}

.validation-message {
  display: block;
  font-size: 12px;
  margin-top: 6px;
  height: 18px;
}

.validation-message.success {
  color: var(--success);
}

.validation-message.error {
  color: var(--error);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE SETTINGS
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .settings-main {
    padding: 16px;
  }

  .api-keys-grid {
    grid-template-columns: 1fr;
  }

  .api-modal-content {
    max-width: 100%;
    margin: 16px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   CALENDAR PAGE
   ═══════════════════════════════════════════════════════════════ */

.calendar-page {
  background: var(--bg-primary);
  min-height: 100vh;
}

.calendar-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

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

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.current-month {
  font-size: 24px;
  font-weight: 600;
  min-width: 200px;
  text-align: center;
}

.btn-nav {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-nav:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

.calendar-legend {
  display: flex;
  gap: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.booking {
  background: var(--success);
}

.legend-dot.delivery {
  background: var(--error);
}

.calendar-grid-wrapper {
  grid-column: 1;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.weekday {
  padding: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(120px, auto);
}

.calendar-day {
  border: 1px solid var(--border);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.calendar-day:hover {
  background: var(--bg-hover);
}

.calendar-day.today {
  background: rgba(99, 102, 241, 0.1);
}

.calendar-day.outside-month {
  background: var(--bg-primary);
  opacity: 0.4;
}

.day-number {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.event-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-badge.booking {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
  border-left: 3px solid var(--success);
}

.event-badge.delivery {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
  border-left: 3px solid var(--error);
}

.event-badge:hover {
  opacity: 0.8;
  transform: translateX(2px);
}

/* Events Sidebar */
.events-sidebar {
  grid-column: 2;
  grid-row: 1 / 3;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  padding: 24px;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.events-sidebar h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.selected-date {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.no-events {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.event-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-left: 3px solid transparent;
}

.event-item.booking {
  border-left-color: var(--success);
}

.event-item.delivery {
  border-left-color: var(--error);
}

.event-item:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.event-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.event-icon {
  font-size: 16px;
}

.event-title {
  font-size: 14px;
  font-weight: 500;
}

.event-details-small {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.event-details-small .status-badge {
  font-size: 10px;
  padding: 2px 8px;
}

/* Event Modal */
.event-modal {
  max-width: 600px;
  padding: 32px;
}

.event-modal h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.event-modal .modal-section {
  margin-bottom: 20px;
}

.event-modal .modal-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.event-modal .modal-section p {
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.event-modal .modal-section strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Navigation Links */
.nav-links {
  display: flex;
  gap: 12px;
}

.nav-link {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
}

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

.nav-link.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* Live Indicator */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--success);
}

.live-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* Responsive Calendar */
@media (max-width: 1200px) {
  .calendar-container {
    grid-template-columns: 1fr;
  }

  .events-sidebar {
    grid-row: 3;
    position: relative;
    top: 0;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .calendar-header {
    flex-direction: column;
    gap: 16px;
  }

  .calendar-legend {
    flex-direction: column;
    gap: 8px;
  }

  .calendar-days {
    grid-auto-rows: minmax(80px, auto);
  }

  .calendar-day {
    min-height: 80px;
    padding: 8px;
  }

  .day-number {
    font-size: 12px;
  }

  .event-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .current-month {
    font-size: 20px;
  }
}