/* ============================================================
   SMEvent AI Copilot — Premium Design System
   Dark Mode + Glassmorphism + Micro-animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables (Design Tokens) ── */
:root {
  /* Brand Colors */
  --brand-red: #c00015;
  --brand-red-dark: #8b000f;
  --brand-red-glow: rgba(192, 0, 21, 0.25);
  --brand-red-subtle: rgba(192, 0, 21, 0.08);

  /* Background Layers (Light Mode) */
  --bg-base: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-sidebar: rgba(255, 255, 255, 0.98);
  --bg-input: #ffffff;

  /* Glass Effect */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);

  /* Text (Light Mode) */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #c00015;

  /* Status */
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #2563eb;

  /* Borders */
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-red: 0 4px 16px rgba(192, 0, 21, 0.15);

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

  /* Sidebar */
  --sidebar-width: 280px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(192, 0, 21, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(59, 130, 246, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout Shell ── */
#app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform var(--transition-normal);
  overflow-y: auto;
}

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

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-red);
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-subtitle {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
  padding-left: 46px;
  line-height: 1.4;
}

/* Sidebar Nav */
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 6px;
  margin-top: 16px;
}

.nav-section-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  margin-bottom: 2px;
  text-decoration: none;
}

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

.nav-item.active {
  background: var(--brand-red-subtle);
  color: #ff4466;
  border-color: rgba(192, 0, 21, 0.25);
}

.nav-item .nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* Sidebar Admin Panel */
.sidebar-admin {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

/* Sidebar Saved Proposals */
.sidebar-saved {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.saved-proposal-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--text-secondary);
  font-size: 0.82rem;
  border: 1px solid transparent;
}

.saved-proposal-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.saved-proposal-item .del-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition-fast);
  flex-shrink: 0;
}

.saved-proposal-item .del-btn:hover {
  color: var(--danger);
}

/* ── Main Content Area ── */
#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header Bar ── */
#topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.topbar-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Status dot */
.status-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse-dot 2s infinite;
}

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

/* ── Page Sections ── */
.page-section {
  display: none;
  padding: 24px 28px;
  flex: 1;
  animation: fadeIn var(--transition-normal);
}

.page-section.active {
  display: flex;
  flex-direction: column;
}

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

/* ── Chat + Proposal Layout ── */
#section-chat {
  display: none;
  flex-direction: row;
  gap: 20px;
  padding: 0;
  height: calc(100vh - 65px);
  overflow: hidden;
}

#section-chat.active {
  display: flex;
}

/* Chat Panel */
#chat-panel {
  width: 400px;
  min-width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.6);
}

#chat-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

#chat-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#chat-header p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#chat-messages::-webkit-scrollbar {
  width: 4px;
}
#chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 2px;
}

/* Chat Bubble */
.chat-bubble {
  display: flex;
  gap: 10px;
  max-width: 100%;
  animation: bubbleIn 0.25s ease;
}

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

.chat-bubble.user {
  flex-direction: row-reverse;
}

.bubble-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.bubble-avatar.bot {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  box-shadow: var(--shadow-red);
}

.bubble-avatar.user {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.bubble-content {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.87rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble.bot .bubble-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 4px var(--radius-md) var(--radius-md) var(--radius-md);
}

.chat-bubble.user .bubble-content {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  color: white;
  border-radius: var(--radius-md) 4px var(--radius-md) var(--radius-md);
}

/* Chat Input */
#chat-input-area {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.quick-samples {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 4px;
  scrollbar-width: none; /* Firefox */
}

.quick-samples::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}


.sample-chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sample-chip:hover {
  background: var(--brand-red-subtle);
  color: #ff4466;
  border-color: rgba(192, 0, 21, 0.3);
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

#chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  resize: none;
  height: 42px;
  max-height: 120px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  overflow-y: hidden;
}

#chat-input:focus {
  outline: none;
  border-color: rgba(192, 0, 21, 0.5);
  box-shadow: 0 0 0 3px var(--brand-red-subtle);
}

#chat-input::placeholder {
  color: var(--text-muted);
  font-size: 0.83rem;
}

#chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-red);
}

#chat-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(192, 0, 21, 0.4);
}

#chat-send-btn:active {
  transform: translateY(0);
}

#chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#chat-clear-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'Outfit', sans-serif;
}

#chat-clear-btn:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
}

/* ── Proposal Panel ── */
#proposal-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  min-width: 0;
}

#proposal-panel::-webkit-scrollbar {
  width: 4px;
}
#proposal-panel::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 2px;
}

.proposal-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 60px 20px;
}

.proposal-empty .empty-icon {
  font-size: 4rem;
  opacity: 0.3;
}

.proposal-empty h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.proposal-empty p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 300px;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

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

.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Meta Cards Row */
.meta-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.meta-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.meta-card .meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.meta-card .meta-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.meta-card .meta-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'Outfit', sans-serif;
  white-space: nowrap;
}

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

.tab-btn.active {
  background: var(--brand-red);
  color: white;
  box-shadow: var(--shadow-red);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn var(--transition-fast);
}

/* ── Tables ── */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background var(--transition-fast);
}

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

tbody tr:hover {
  background: var(--bg-card-hover);
}

tbody td {
  padding: 9px 12px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* Editable table cells */
td[contenteditable="true"] {
  cursor: text;
  border-radius: 4px;
  transition: background var(--transition-fast);
  min-width: 60px;
}

td[contenteditable="true"]:hover {
  background: rgba(0, 0, 0, 0.02);
}

td[contenteditable="true"]:focus {
  outline: none;
  background: rgba(192, 0, 21, 0.03);
  box-shadow: inset 0 0 0 1px rgba(192, 0, 21, 0.2);
}

/* ── Financial Summary ── */
.financial-summary {
  background: linear-gradient(135deg, rgba(192, 0, 21, 0.08), rgba(192, 0, 21, 0.03));
  border: 1px solid rgba(192, 0, 21, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.fin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.88rem;
}

.fin-row .label {
  color: var(--text-secondary);
}

.fin-row .value {
  font-weight: 600;
  color: var(--text-primary);
}

.fin-row.total {
  border-top: 1px solid rgba(192, 0, 21, 0.2);
  margin-top: 8px;
  padding-top: 12px;
}

.fin-row.total .label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.fin-row.total .value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-red);
}

.fin-row.discount .value {
  color: var(--success);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
  color: white;
  box-shadow: var(--shadow-red);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(192, 0, 21, 0.4);
}

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

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

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

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

.btn-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.btn-success:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.2);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ── Form Elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(192, 0, 21, 0.5);
  box-shadow: 0 0 0 3px var(--brand-red-subtle);
}

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

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

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

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

/* ── Badges & Tags ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-red {
  background: var(--brand-red-subtle);
  color: #ff4466;
  border: 1px solid rgba(192, 0, 21, 0.25);
}

.badge-green {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-yellow {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  line-height: 1.5;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.alert-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

/* ── Loading Spinner ── */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(7, 11, 20, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.loading-overlay.show {
  display: flex;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(192, 0, 21, 0.2);
  border-top-color: var(--brand-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── Toast Notifications ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9998;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 320px;
  border: 1px solid;
  animation: slideInToast 0.3s ease, fadeOutToast 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(10px);
}

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

@keyframes fadeOutToast {
  to { opacity: 0; transform: translateX(20px); }
}

.toast-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86efac;
}

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

.toast-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(7, 11, 20, 0.8);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 460px;
  width: 90%;
  animation: modalIn 0.25s ease;
  box-shadow: var(--glass-shadow);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  margin-bottom: 24px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

/* ── Admin Panel ── */
.admin-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(192, 0, 21, 0.1);
  border: 1px solid rgba(192, 0, 21, 0.3);
  color: #ff4466;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ── Booking Cards ── */
.booking-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast);
  margin-bottom: 10px;
}

.booking-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.booking-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.booking-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.booking-card-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.booking-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ── Menu Lookup ── */
.menu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-normal);
  margin-bottom: 12px;
}

.menu-card-header {
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition-fast);
}

.menu-card-header:hover {
  background: var(--bg-card-hover);
}

.menu-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-card-price {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--brand-red);
}

.menu-card-body {
  display: none;
  padding: 0 16px 14px;
  border-top: 1px solid var(--border);
}

.menu-card-body.open {
  display: block;
  animation: fadeIn var(--transition-fast);
}

.menu-category-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin: 12px 0 4px;
}

.menu-dish-item {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 2px 0;
}

.menu-dish-item::before {
  content: '•';
  color: var(--brand-red);
  margin-right: 6px;
}

/* ── Price Table Search ── */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-bar .form-input {
  flex: 1;
  min-width: 200px;
}

/* ── Section Headers ── */
.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Discount Input ── */
.discount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.discount-row label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.discount-row input[type="number"] {
  width: 80px;
  text-align: center;
}

/* ── Expander ── */
.expander {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
}

.expander-header {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  transition: background var(--transition-fast);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.expander-header:hover {
  background: var(--bg-card-hover);
}

.expander-icon {
  transition: transform var(--transition-fast);
  font-style: normal;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.expander.open .expander-icon {
  transform: rotate(180deg);
}

.expander-body {
  display: none;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.1);
}

.expander.open .expander-body {
  display: block;
  animation: fadeIn var(--transition-fast);
}

/* ── Budget Recommendation Cards ── */
.reco-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  border: 1px solid;
  font-size: 0.82rem;
}

.reco-card.exact {
  background: rgba(34, 197, 94, 0.06);
  border-color: rgba(34, 197, 94, 0.2);
}

.reco-card.upsell {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}

.reco-card .reco-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.reco-card .reco-meta {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Print Preview ── */
#print-preview-frame {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ── Scrollbar ── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

/* ── Section Booking & Menu Styles ── */
#section-booking, #section-menu {
  display: none;
  flex-direction: column;
  padding: 24px 28px;
  gap: 20px;
  overflow-y: auto;
  height: calc(100vh - 65px);
}
#section-booking.active, #section-menu.active {
  display: flex;
}

/* ── Responsive ── */
@media (max-width: 992px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

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

  #topbar {
    padding: 14px 16px;
  }

  #section-chat {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
  }

  #chat-panel {
    width: 100% !important;
    min-width: unset !important;
    height: 60vh !important;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  #proposal-panel {
    height: auto !important;
    overflow: visible !important;
    padding: 16px 12px !important;
  }

  #section-booking, #section-menu {
    padding: 16px 16px 80px;
    height: auto;
  }

  .meta-cards {
    grid-template-columns: 1fr;
  }

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

  .tabs {
    flex-wrap: wrap;
  }
}


/* ── Utility ── */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-red { color: var(--brand-red); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.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; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none; }
.w-full { width: 100%; }
.number-highlight {
  color: var(--brand-red);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Login Screen Overlay ── */
.login-screen-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: radial-gradient(circle at 50% 50%, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.99));
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  transition: opacity 300ms ease, visibility 300ms ease;
}

.login-screen-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 440px;
  max-width: 90%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: scaleUp 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.login-logo {
  margin-bottom: 28px;
}

.login-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.login-logo h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-logo p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.login-roles {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.role-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px;
  background: var(--bg-card-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.role-btn:hover {
  border-color: var(--brand-red);
  background: var(--brand-red-subtle);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.role-icon {
  font-size: 1.8rem;
  background: white;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.role-details {
  flex: 1;
}

.role-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.role-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.login-admin-form {
  margin-top: 16px;
  text-align: left;
  animation: fadeIn 200ms ease;
}

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

