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

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Brand Warm Cafe Palette */
  --primary: #92400e;
  --primary-hover: #78350f;
  --primary-light: #fef3c7;
  --primary-rgb: 146, 64, 14;
  
  --secondary: #475569;
  --secondary-light: #f1f5f9;
  
  --accent: #d97706;
  --accent-light: #fffbeb;
  
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0284c7;
  --info-light: #e0f2fe;

  /* Neutral tones */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #1e1b18;
  --bg-sidebar-hover: #2d2822;
  --bg-sidebar-active: #92400e;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-sidebar: #cbd5e1;
  
  --border-color: #e2e8f0;
  --border-focus: #b45309;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.06);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition: all 0.2s ease-in-out;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 0.95rem;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* Layout - Admin & Staff Panels */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  width: 260px;
  height: 100vh;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  background-color: var(--bg-sidebar);
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.4);
}

.sidebar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.sidebar-role-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  color: #fbbf24;
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
}

.sidebar-menu {
  padding: 1rem 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.menu-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.75rem 0.75rem 0.35rem;
  letter-spacing: 0.05em;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.menu-item i {
  width: 20px;
  font-size: 1.1rem;
  text-align: center;
  color: #94a3b8;
  transition: var(--transition);
}

.menu-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: #ffffff;
}

.menu-item:hover i {
  color: #fbbf24;
}

.menu-item.active {
  background: linear-gradient(90deg, var(--primary) 0%, #b45309 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(146, 64, 14, 0.35);
}

.menu-item.active i {
  color: #ffffff;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.user-profile-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: #334155;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.user-info {
  flex-grow: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-label {
  font-size: 0.75rem;
  color: #94a3b8;
}

.btn-logout {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

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

/* Main Content Area */
.main-content {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: calc(100% - 260px);
  max-width: 100%;
  background-color: var(--bg-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Topbar */
.topbar {
  height: 70px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-main);
  font-size: 1.1rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
  background: var(--success-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

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

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* Page Body */
.page-body {
  padding: 1.75rem;
  flex-grow: 1;
}

/* Cards */
.card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  max-width: 100%;
  box-sizing: border-box;
}

/* Dashboard 2-1 Responsive Grid */
.dashboard-charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.info    { background: var(--info-light); color: var(--info); }
.stat-icon.danger  { background: var(--danger-light); color: var(--danger); }

.stat-info {
  flex-grow: 1;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
  letter-spacing: -0.02em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-secondary {
  background: var(--secondary);
  color: #ffffff;
}
.btn-secondary:hover {
  background: #334155;
  color: #ffffff;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}
.btn-success:hover {
  background: #047857;
  color: #ffffff;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: #b91c1c;
  color: #ffffff;
}

.btn-warning {
  background: var(--warning);
  color: #ffffff;
}
.btn-warning:hover {
  background: #b45309;
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

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

.form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #ffffff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.form-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  min-width: 200px;
}

/* Tables */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
}

.table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.table tbody tr:hover {
  background-color: #f8fafc;
}

.table-img-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Order Status Badges */
.badge-pending {
  background: #fef3c7;
  color: #92400e;
}
.badge-processing {
  background: #e0f2fe;
  color: #0369a1;
}
.badge-ready {
  background: #ede9fe;
  color: #6d28d9;
}
.badge-completed {
  background: #d1fae5;
  color: #065f46;
}
.badge-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

/* Payment Status Badges */
.badge-paid {
  background: #d1fae5;
  color: #065f46;
}
.badge-unpaid {
  background: #fee2e2;
  color: #991b1b;
}

/* Table Availability Badges */
.badge-available {
  background: #d1fae5;
  color: #065f46;
}
.badge-occupied {
  background: #ffedd5;
  color: #c2410c;
}

/* Alerts */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

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

.alert-danger {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.alert-info {
  background-color: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #075985;
}

/* Filters bar */
.filter-bar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  animation: modal-enter 0.2s ease-out;
}

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
}

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

/* Mobile Drawer & Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.sidebar-backdrop.active {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fbbf24;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    transform: translateX(-100%) !important;
    z-index: 99999 !important;
    box-shadow: none !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
  }

  .sidebar-close-btn {
    display: inline-flex !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }

  .mobile-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: var(--radius-md) !important;
  }

  .dashboard-charts-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
}

@media (max-width: 768px) {
  .topbar {
    height: 60px;
    padding: 0 1rem;
  }

  .page-title {
    font-size: 1.1rem;
  }

  .page-body {
    padding: 1rem;
  }

  .card {
    padding: 1.15rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
  }

  /* Filters */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 1rem;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
  }

  .filter-group > div,
  .filter-group input,
  .filter-group select,
  .filter-group button,
  .filter-group a {
    width: 100% !important;
    max-width: 100% !important;
  }

  .filter-bar > div:last-child {
    width: 100%;
  }

  .filter-bar > div:last-child .btn {
    width: 100%;
    justify-content: center;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.9rem;
    gap: 0.75rem;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  /* Tables */
  .table th, .table td {
    padding: 0.75rem 0.65rem;
    font-size: 0.85rem;
  }

  /* Modals */
  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-box {
    max-width: 100%;
    border-radius: var(--radius-md);
  }

  .modal-header, .modal-body, .modal-footer {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .topbar {
    height: 56px;
    padding: 0 0.75rem;
  }

  .topbar-left {
    gap: 0.6rem;
  }

  .page-title {
    font-size: 1rem;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-right {
    gap: 0.4rem;
  }

  .topbar-btn-text,
  .status-text {
    display: none;
  }

  .topbar-qr-btn {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
  }

  .status-indicator {
    padding: 6px 8px;
  }

  .page-body {
    padding: 0.75rem;
  }

  .card {
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

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

  .stat-card {
    padding: 0.75rem 0.6rem;
    gap: 0.5rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
  }

  .stat-label {
    font-size: 0.68rem;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .table-responsive {
    margin-left: -0.85rem;
    margin-right: -0.85rem;
    width: calc(100% + 1.7rem);
    border-radius: 0;
  }

  .table th, .table td {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }

  .btn {
    font-size: 0.85rem;
  }
}

/* Waiter Bell & Dropdown in Staff Topbar */
.waiter-bell-wrapper {
  position: relative;
}

.btn-waiter-bell {
  position: relative;
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-waiter-bell:hover {
  background: #ffedd5;
  color: #ea580c;
  border-color: #fdba74;
}

.waiter-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ea580c;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bellPulse 1.5s infinite;
}

@keyframes bellPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(234, 88, 12, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}

.waiter-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  width: 320px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
}

.waiter-dropdown-header {
  padding: 0.75rem 1rem;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #78350f;
}

.waiter-dropdown-body {
  max-height: 340px;
  overflow-y: auto;
}

.waiter-call-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.2s;
}

.waiter-call-item:hover {
  background: #f8fafc;
}

.waiter-call-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.waiter-call-table {
  font-weight: 800;
  font-size: 0.88rem;
  color: #c2410c;
}

.waiter-call-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.waiter-call-msg {
  font-size: 0.82rem;
  color: #334155;
  background: #f1f5f9;
  padding: 5px 8px;
  border-radius: 6px;
  margin: 3px 0;
}

.btn-resolve-call {
  background: #10b981;
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-resolve-call:hover {
  background: #059669;
}

/* ==========================================================================
   Denah Meja Kafe (Floor Plan Layout) - Admin & Kasir
   ========================================================================== */

.cafe-floor-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 2rem;
}

.cafe-floor-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.cafe-floor-title {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cafe-floor-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d97706, #92400e);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.cafe-floor-title h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}

.cafe-floor-title p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 3px 0 0;
}

/* Floor Filter Pills & Legend */
.floor-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.floor-pill-btn {
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.floor-pill-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #fffbeb;
}

.floor-pill-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.floor-pill-badge {
  background: rgba(0, 0, 0, 0.07);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.floor-pill-btn.active .floor-pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Floor Canvas with Blueprint grid */
.cafe-floor-canvas {
  background-color: #f8fafc;
  background-image: radial-gradient(#cbd5e1 1.25px, transparent 1.25px);
  background-size: 20px 20px;
  padding: 1.75rem;
  position: relative;
}

.floor-landmark-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px dashed #cbd5e1;
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.floor-landmark-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Floor Tables Grid */
.floor-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
}

/* Table Card Shape & Design */
.floor-table-card {
  background: #ffffff;
  border-radius: 18px;
  border: 2px solid #e2e8f0;
  padding: 1.25rem;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.floor-table-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 24px -5px rgba(0, 0, 0, 0.12);
}

/* Table Chair Indicators (Visual Floor Representation) */
.table-chair {
  position: absolute;
  background: #cbd5e1;
  border-radius: 6px;
  transition: background-color 0.25s ease;
}
.table-chair-top {
  width: 32px;
  height: 6px;
  top: -6px;
  left: calc(50% - 16px);
}
.table-chair-bottom {
  width: 32px;
  height: 6px;
  bottom: -6px;
  left: calc(50% - 16px);
}
.table-chair-left {
  width: 6px;
  height: 32px;
  left: -6px;
  top: calc(50% - 16px);
}
.table-chair-right {
  width: 6px;
  height: 32px;
  right: -6px;
  top: calc(50% - 16px);
}

/* 1. STATE: TERSEDIA (Available) */
.floor-table-card.state-available {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 45%);
}
.floor-table-card.state-available .table-chair {
  background: #86efac;
}
.floor-table-card.state-available .table-name {
  color: #15803d;
}
.floor-table-card.state-available .table-status-pill {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* 2. STATE: DIGUNAKAN (Occupied / Processing) */
.floor-table-card.state-occupied {
  border-color: #7dd3fc;
  background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 45%);
}
.floor-table-card.state-occupied .table-chair {
  background: #7dd3fc;
}
.floor-table-card.state-occupied .table-name {
  color: #0369a1;
}
.floor-table-card.state-occupied .table-status-pill {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}

/* 3. STATE: MENUNGGU PEMBAYARAN (Billing) */
.floor-table-card.state-billing {
  border-color: #f59e0b;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 45%);
  animation: pulse-billing-card 2.5s infinite ease-in-out;
}
.floor-table-card.state-billing .table-chair {
  background: #f59e0b;
}
.floor-table-card.state-billing .table-name {
  color: #b45309;
}
.floor-table-card.state-billing .table-status-pill {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

@keyframes pulse-billing-card {
  0%, 100% {
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.15);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4), 0 12px 24px -3px rgba(245, 158, 11, 0.22);
  }
}

/* Floor Table Header & Body */
.floor-table-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.table-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.table-status-pill {
  font-size: 0.73rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.floor-table-middle {
  min-height: 62px;
  margin-bottom: 1rem;
}

.floor-table-info-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
}

.floor-table-bottom {
  margin-top: auto;
}

@media (max-width: 640px) {
  .floor-tables-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .cafe-floor-canvas {
    padding: 1.25rem 1rem;
  }
}

/* Hide CodeIgniter Debug Toolbar / Flame Icon */
#debugbar, #toolbarContainer, [id*="debugbar"], .ci-debugbar {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
