/* Reservia — Design System from Dribbble Research */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --primary: #1B4332;
  --primary-light: #2D6A4F;
  --primary-dark: #0F2921;
  --accent: #E76F51;
  --accent-light: #F4A261;
  --bg: #F8F4F0;
  --surface: #FFFFFF;
  --surface-hover: #F3F0EC;
  --border: #E5E1DC;
  --border-light: #F0EDE8;
  --text: #1A1A2E;
  --text-secondary: #4A4A5A;
  --text-muted: #9CA3AF;
  --success: #22C55E;
  --success-bg: #F0FDF4;
  --warning: #F59E0B;
  --warning-bg: #FFFBEB;
  --error: #EF4444;
  --error-bg: #FEF2F2;
  --info: #3B82F6;
  --info-bg: #EFF6FF;
  --purple: #8B5CF6;
  --purple-bg: #F5F3FF;

  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;

  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);

  --sidebar-width: 240px;
  --header-height: 64px;
  --transition-fast: 150ms;
  --transition-normal: 200ms;
  --easing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }

/* === TYPOGRAPHY === */
h1 { font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 16px; font-weight: 600; line-height: 1.4; }
h4 { font-size: 14px; font-weight: 600; line-height: 1.4; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }

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

/* Sidebar */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width);
  background: var(--primary); color: white; display: flex; flex-direction: column; z-index: 100;
  transition: transform var(--transition-normal) var(--easing);
}
.sidebar-logo {
  height: var(--header-height); padding: 0 var(--space-6);
  display: flex; align-items: center; gap: var(--space-3);
  border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 16px; font-weight: 700; cursor: pointer;
}
.sidebar-logo .logo-icon {
  width: 32px; height: 32px; background: var(--accent); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700;
}
.sidebar-nav { flex: 1; padding: var(--space-4) var(--space-3); overflow-y: auto; }
.nav-section {
  font-size: 11px; text-transform: uppercase; color: rgba(255,255,255,0.35);
  padding: var(--space-4) var(--space-3) var(--space-2); font-weight: 500; letter-spacing: 0.05em;
}
.nav-item {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); color: rgba(255,255,255,0.65); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--transition-fast) var(--easing); margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active { background: rgba(255,255,255,0.15); color: white; }
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 15px; opacity: 0.8; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--accent); color: white;
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: var(--radius-full);
}
.sidebar-footer {
  padding: var(--space-4) var(--space-6); border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: var(--space-3);
}
.sidebar-footer .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.sidebar-footer .user-name { font-size: 13px; font-weight: 500; }
.sidebar-footer .user-role { font-size: 11px; color: rgba(255,255,255,0.5); }

/* Main content */
.main-content { margin-left: var(--sidebar-width); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.header {
  height: var(--header-height); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-8);
  position: sticky; top: 0; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: var(--space-4); }
.header-right { display: flex; align-items: center; gap: var(--space-4); }
.page-content { padding: var(--space-6) var(--space-8); flex: 1; max-width: 1280px; width: 100%; }
.hamburger { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); padding: var(--space-2); }

/* === COMPONENTS === */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 40px; padding: 0 var(--space-5); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer; border: none;
  transition: all var(--transition-fast) var(--easing); white-space: nowrap;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: white; }
.btn-secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-danger { background: var(--error); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-sm { height: 32px; padding: 0 var(--space-3); font-size: 12px; }
.btn-lg { height: 48px; padding: 0 var(--space-6); font-size: 15px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-md);
  overflow: hidden; transition: box-shadow var(--transition-fast) var(--easing);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
}
.card-body { padding: var(--space-5); }
.card-footer { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-light); }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-6); }
.stat-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: var(--space-5); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: var(--space-2); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-change { font-size: 12px; margin-top: var(--space-1); display: flex; align-items: center; gap: var(--space-1); }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 500;
}
.badge-confirmed { background: var(--info-bg); color: var(--info); }
.badge-arrived { background: var(--purple-bg); color: var(--purple); }
.badge-seated { background: var(--success-bg); color: var(--primary); }
.badge-completed { background: #F3F4F6; color: #6B7280; border: 1px solid #E5E7EB; }
.badge-cancelled { background: var(--error-bg); color: var(--error); }
.badge-no_show { background: var(--error-bg); color: #DC2626; }
.badge-walk_in { background: var(--warning-bg); color: #92400E; }
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: #F3F4F6; color: #6B7280; }
.source-ai { background: var(--success-bg); color: var(--primary); font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.source-manual { background: #F3F4F6; color: var(--text-secondary); font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.source-walk_in { background: var(--warning-bg); color: #92400E; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.source-online { background: var(--info-bg); color: var(--info); font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }

/* Tables */
.data-table { width: 100%; }
.data-table th {
  text-align: left; padding: 10px var(--space-5); font-size: 11px;
  font-weight: 500; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em; background: var(--bg); border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.data-table th:hover { color: var(--text-secondary); }
.data-table th .sort-icon { margin-left: 4px; opacity: 0.3; }
.data-table th.sorted .sort-icon { opacity: 1; color: var(--primary); }
.data-table td {
  padding: var(--space-3) var(--space-5); font-size: 13px;
  border-bottom: 1px solid var(--border-light); vertical-align: middle;
}
.data-table tr:hover td { background: var(--surface-hover); }
.data-table .actions { white-space: nowrap; }
.data-table .actions button { margin-left: var(--space-1); }

/* Avatar */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: white; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* Forms */
.form-group { margin-bottom: var(--space-5); }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: var(--space-1); }
.form-input, .form-select, .form-textarea {
  width: 100%; height: 40px; padding: 0 var(--space-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; background: var(--surface); color: var(--text);
  transition: border-color var(--transition-fast) var(--easing);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,67,50,0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { height: auto; min-height: 80px; padding: var(--space-3); resize: vertical; }
.form-select { cursor: pointer; appearance: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-error { color: var(--error); font-size: 12px; margin-top: var(--space-1); }
.required::after { content: ' *'; color: var(--error); }
.form-actions { display: flex; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--border-light); }

/* Toolbar (above tables) */
.toolbar {
  display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.toolbar .search-input {
  height: 36px; padding: 0 var(--space-3) 0 36px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; min-width: 240px; background: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.toolbar .search-input:focus { outline: none; border-color: var(--primary); }
.toolbar .filter-select {
  height: 36px; padding: 0 var(--space-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; background: var(--surface); cursor: pointer;
}
.toolbar .spacer { flex: 1; }

/* Two column grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); margin-bottom: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }

/* Table status cards */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); padding: var(--space-4); }
.table-card {
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  padding: var(--space-3); text-align: center; cursor: pointer;
  transition: all var(--transition-fast) var(--easing);
}
.table-card:hover { box-shadow: var(--shadow-sm); }
.table-card.available { border-left: 3px solid var(--success); }
.table-card.occupied { border-left: 3px solid var(--error); background: var(--error-bg); }
.table-card.reserved { border-left: 3px solid var(--info); background: var(--info-bg); }
.table-card .table-id { font-size: 14px; font-weight: 600; }
.table-card .table-seats { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.table-card .table-status { font-size: 10px; font-weight: 500; margin-top: var(--space-2); text-transform: uppercase; letter-spacing: 0.05em; }
.table-card.available .table-status { color: var(--success); }
.table-card.occupied .table-status { color: var(--error); }
.table-card.reserved .table-status { color: var(--info); }

/* Booking item in lists */
.booking-item {
  display: flex; align-items: center; padding: var(--space-3) var(--space-5); gap: var(--space-3);
  border-bottom: 1px solid var(--border-light); transition: background var(--transition-fast);
  cursor: pointer;
}
.booking-item:hover { background: var(--surface-hover); }
.booking-item:last-child { border-bottom: none; }
.booking-info { flex: 1; min-width: 0; }
.booking-name { font-size: 14px; font-weight: 500; }
.booking-detail { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.booking-time { font-size: 13px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; margin-right: var(--space-3); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 200;
  opacity: 0; transition: opacity var(--transition-normal) var(--easing);
}
.modal-overlay.open { display: flex; opacity: 1; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); width: 90%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg);
  transform: scale(0.95); transition: transform var(--transition-normal) var(--easing);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-body { padding: var(--space-6); }
.modal-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--border-light); display: flex; gap: var(--space-3); justify-content: flex-end; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-muted); padding: var(--space-1); }

/* Toast */
.toast-container { position: fixed; top: var(--space-6); right: var(--space-6); z-index: 300; display: flex; flex-direction: column; gap: var(--space-2); }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-5); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: var(--space-3); min-width: 300px; max-width: 420px;
  animation: slideInRight 0.3s var(--easing);
  font-size: 13px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--info); }
.toast .toast-close { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 16px; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Empty state */
.empty-state { text-align: center; padding: var(--space-12) var(--space-6); color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: var(--space-4); opacity: 0.3; }
.empty-state p { margin-bottom: var(--space-4); }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.tab {
  padding: var(--space-3) var(--space-5); font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-4); padding: var(--space-3) 0; }
.pagination-info { font-size: 12px; color: var(--text-muted); }
.pagination-btns { display: flex; gap: var(--space-1); }
.pagination-btns button {
  width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.pagination-btns button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination-btns button:hover:not(.active) { background: var(--surface-hover); }

/* Chart bars (CSS-only charts) */
.chart-bar-container { display: flex; align-items: flex-end; gap: var(--space-2); height: 160px; padding: var(--space-4) 0; }
.chart-bar {
  flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 4px;
  transition: height 0.5s var(--easing); position: relative;
}
.chart-bar:hover { opacity: 0.8; }
.chart-bar .chart-label {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text-muted); white-space: nowrap;
}
.chart-bar .chart-value {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 600; color: var(--text);
}

/* Detail view */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.detail-field { margin-bottom: var(--space-4); }
.detail-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-1); }
.detail-value { font-size: 14px; color: var(--text); }

/* Confirm dialog */
.confirm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none;
  align-items: center; justify-content: center; z-index: 250;
}
.confirm-overlay.open { display: flex; }
.confirm-box {
  background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-6);
  max-width: 400px; width: 90%; box-shadow: var(--shadow-lg); text-align: center;
}
.confirm-box h3 { margin-bottom: var(--space-2); }
.confirm-box p { color: var(--text-secondary); margin-bottom: var(--space-5); font-size: 14px; }
.confirm-box .confirm-actions { display: flex; gap: var(--space-3); justify-content: center; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: block; }
  .page-content { padding: var(--space-4); }
  .header { padding: 0 var(--space-4); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .search-input { min-width: auto; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: var(--space-2) var(--space-3); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  h1 { font-size: 20px; }
}

/* === HOSTESS DARK MODE === */
.hostess-mode {
  --bg: #0F1117; --surface: #1A1D27; --surface-hover: #252833;
  --border: #2D3040; --border-light: #252833;
  --text: #E5E7EB; --text-secondary: #9CA3AF; --text-muted: #6B7280;
}
.hostess-mode body, .hostess-mode .main-content { background: var(--bg); color: var(--text); }
.hostess-mode .card { background: var(--surface); border-color: var(--border); }
.hostess-mode .header { background: var(--surface); border-color: var(--border); }
.hostess-mode .data-table th { background: var(--surface); }
.hostess-mode .data-table td { border-color: var(--border); }
.hostess-mode .form-input, .hostess-mode .form-select { background: var(--surface); color: var(--text); border-color: var(--border); }
