:root {
  --primary: #1E3A8A;
  --primary-light: #2563EB;
  --primary-surface: #EFF6FF;
  --accent: #E15A3F;
  --accent-light: #FDEEEB;
  --gastro: #E65100;
  --gastro-light: #FFF3E0;
  --success: #15803D;
  --success-light: #E8F5E9;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --sidebar-w: 260px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: #0F172A;
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

.logo-mark {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: white;
  font-weight: 900;
  font-size: 16px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: -0.5px;
}

.brand-text h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.badge-role {
  font-size: 11px;
  color: #94A3B8;
  font-weight: 600;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: #94A3B8;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.nav-item.active {
  background: var(--primary-light);
  color: white;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.nav-item i {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.admin-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.admin-user-pill .avatar {
  width: 34px;
  height: 34px;
  background: var(--primary-light);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.admin-user-pill .name {
  font-size: 12.5px;
  font-weight: 700;
}

.admin-user-pill .email {
  font-size: 11px;
  color: #94A3B8;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.topbar {
  padding: 20px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title h1 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.4px;
}

.topbar-title .subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.district-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

.district-filter select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary-light);
  color: white;
}
.btn-primary:hover {
  background: var(--primary);
  box-shadow: 0 4px 10px rgba(37,99,235,0.25);
}

.btn-outline {
  background: white;
  border: 1px solid var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-light);
}
.btn-ghost:hover {
  text-decoration: underline;
}

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

/* CONTENT BODY */
.content-body {
  padding: 28px 32px;
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 16px;
  align-items: center;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-gastro { background: var(--gastro-light); color: var(--gastro); }
.icon-specials { background: var(--accent-light); color: var(--accent); }
.icon-clubs { background: var(--primary-surface); color: var(--primary-light); }
.icon-stories { background: #FDF4FF; color: #C026D3; }

.stat-content .label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.stat-content h3 {
  font-size: 24px;
  font-weight: 900;
  margin: 2px 0;
}
.stat-content .trend {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-content .trend.positive {
  color: var(--success);
}

/* PANELS */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-header h2 {
  font-size: 16.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.compact-list {
  padding: 12px 24px;
}
.compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.compact-item:last-child {
  border-bottom: none;
}
.compact-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.compact-item-info h4 {
  font-size: 13.5px;
  font-weight: 800;
}
.compact-item-info p {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* DATA TABLE */
.table-container {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th {
  background: #F8FAFC;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 14px 20px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:hover {
  background: #F1F5F9;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-primary { background: var(--primary-surface); color: var(--primary-light); }
.badge-district { background: #F1F5F9; color: var(--text-main); font-weight: 700; }

/* MCP PANEL */
.mcp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px;
}
.mcp-card {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius-sm);
}
.mcp-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--primary-light);
}
.mcp-card-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}
.feature-bullets {
  margin-top: 12px;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.6;
}
.tool-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tool-item {
  background: white;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tool-item code {
  color: var(--primary-light);
  font-weight: 800;
  font-size: 12.5px;
}
.tool-item span {
  font-size: 11.5px;
  color: var(--text-muted);
}
.code-box {
  margin: 0 24px 24px 24px;
  background: #0F172A;
  color: #38BDF8;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.code-header {
  background: #1E293B;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #94A3B8;
  font-size: 12px;
}
.code-box pre {
  padding: 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  overflow-x: auto;
}

/* FORM STYLES */
.form-container {
  padding: 24px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.open {
  display: flex;
}
.modal-dialog {
  background: white;
  width: 90%;
  max-width: 650px;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.btn-close {
  background: none;
  border: none;
  cursor: pointer;
}

/* AUTH & GATE STYLES */
.auth-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  overflow-y: auto;
}

.auth-card {
  background: white;
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 16px;
}

.auth-logo {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: white;
  font-weight: 900;
  font-size: 24px;
  padding: 12px 18px;
  border-radius: 14px;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.auth-brand h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -0.4px;
}

.auth-badge {
  display: inline-block;
  margin-top: 4px;
  background: var(--primary-surface);
  color: var(--primary-light);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.45;
  margin-bottom: 22px;
}

.auth-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-alert.error {
  background: #FEE2E2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 12px;
}

/* Demo Picker */
.auth-demo-picker {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.demo-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-align: center;
}
.demo-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.demo-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.demo-chip:hover {
  background: #E2E8F0;
  transform: translateY(-1px);
}
.demo-chip i { width: 14px; height: 14px; }
.chip-admin { border-left: 4px solid var(--primary-light); }
.chip-gastro { border-left: 4px solid var(--gastro); }
.chip-club { border-left: 4px solid var(--success); }
.chip-citizen { border-left: 4px solid #94A3B8; }

/* Citizen blocked */
.text-center { text-align: center; }
.blocked-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-surface);
  color: var(--primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.blocked-icon i { width: 32px; height: 32px; }
.app-store-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 18px 0;
}
.store-badge {
  background: #0F172A;
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mt-4 { margin-top: 16px; }

/* App layout wrapper */
.app-layout {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.btn-logout {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: all 0.2s;
}
.btn-logout:hover {
  color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
}
.btn-logout i { width: 16px; height: 16px; }

/* Image Preview & Upload */
.img-preview-wrap {
  margin-top: 8px;
  border-radius: 10px;
  overflow: hidden;
  max-height: 180px;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
}
.img-preview-wrap img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.checkbox-inline input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.dish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.tag-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}
.tag-veg { background: #DCFCE7; color: #15803D; }
.tag-vegan { background: #D1FAE5; color: #065F46; }
.tag-gf { background: #FEF3C7; color: #B45309; }
.tag-allergen { background: #F1F5F9; color: #475569; }

.action-buttons-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
