:root {
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --primary: #FF6B35;
}

body { overflow-x: hidden; }

/* Login */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #FF6B35 0%, #e55a26 100%);
}
.login-card {
  background: var(--bs-body-bg); border-radius: 20px; padding: 40px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-logo {
  width: 70px; height: 70px; background: var(--primary); border-radius: 16px;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
  font-size: 36px; color: #fff;
}

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
  background: #1a1a2e; color: #c0c0d0; z-index: 1030;
  display: flex; flex-direction: column; transition: transform .3s;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 18px 20px; font-size: 18px; font-weight: 700;
  color: var(--primary); border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.sidebar-nav { list-style: none; padding: 12px 0; margin: 0; flex-grow: 1; }
.sidebar-nav li { padding: 0; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  color: #a0a0b0; text-decoration: none; font-size: 14px; transition: all .2s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover, .sidebar-link.active {
  color: #fff; background: rgba(255,107,53,0.12); border-left-color: var(--primary);
}
.sidebar-link i { font-size: 16px; width: 20px; }
.sidebar-footer { padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; }

/* Main wrapper */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .3s;
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 1020;
  height: var(--topbar-height); padding: 0 20px;
  display: flex; align-items: center; gap: 12px;
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Page content */
.page-content { padding: 20px; flex-grow: 1; }
.page { display: none; }
.page.active { display: block; }

/* Stat Cards */
.stat-card {
  border-radius: 16px; padding: 20px; position: relative; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.stat-num { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 13px; opacity: 0.85; margin-top: 4px; }
.stat-icon { position: absolute; right: 16px; top: 16px; font-size: 36px; opacity: 0.2; }

/* Live Feed */
.feed-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--bs-border-color); font-size: 13px;
}
.feed-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Category Cards */
.cat-manage-card {
  background: var(--bs-body-bg); border-radius: 14px; padding: 16px;
  border: 1px solid var(--bs-border-color); display: flex; align-items: center; gap: 12px;
}
.cat-icon-preview { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }

/* Table Cards */
.table-manage-card {
  background: var(--bs-body-bg); border-radius: 14px; padding: 16px;
  border: 2px solid var(--bs-border-color); text-align: center;
  transition: border-color .2s;
}
.table-manage-card.status-occupied { border-color: #198754; }
.table-manage-card.status-reserved { border-color: #ffc107; }
.table-manage-card.status-empty { border-color: var(--bs-border-color); }
.table-num { font-size: 32px; font-weight: 700; color: var(--primary); }

/* Status badges */
.badge-pending { background: #fff3cd; color: #856404; }
.badge-preparing { background: #cff4fc; color: #055160; }
.badge-ready { background: #d1e7dd; color: #0a3622; }
.badge-delivered { background: #d1e7dd; color: #0a3622; }
.badge-cancelled { background: #f8d7da; color: #58151c; }

/* User cards */
.user-card {
  background: var(--bs-body-bg); border-radius: 14px; padding: 20px;
  border: 1px solid var(--bs-border-color); text-align: center;
}
.user-avatar { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; margin: 0 auto 12px; }

/* Waiter call cards */
.wc-card {
  background: var(--bs-body-bg); border-radius: 14px; padding: 16px;
  border: 1px solid var(--bs-border-color);
}
.wc-card.pending { border-left: 4px solid #dc3545; }
.wc-card.answered { border-left: 4px solid #198754; opacity: .7; }

/* Sidebar Backdrop */
.sidebar-backdrop {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 1025;
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }

/* Responsive */
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-width))); }
.main-wrapper.expanded { margin-left: 0; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
  .sidebar.collapsed { transform: translateX(0); }
  .sidebar-backdrop { display: block; }
  .main-wrapper { margin-left: 0; }
  .main-wrapper.expanded { margin-left: 0; }
  .stat-num { font-size: 22px; }
  #sidebarToggle { padding: 12px 14px !important; }
}

/* Dark mode */
[data-bs-theme="dark"] .sidebar { background: #0d0d1a; }
[data-bs-theme="dark"] .login-card { background: #1a1a2e; }
[data-bs-theme="dark"] .stat-card { box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
