/* ==========================================================================
   MyMenuBuddy Modern Admin Portal CSS
   Design System: Deep Dark Glassmorphism, Emerald & Indigo Accents
   ========================================================================== */

:root {
  --bg-base: #0a0e17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --bg-card: rgba(22, 30, 46, 0.85);
  --bg-card-hover: rgba(30, 41, 62, 0.95);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #10b981;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;

  --accent-primary: #10b981; /* Emerald */
  --accent-primary-hover: #059669;
  --accent-primary-glow: rgba(16, 185, 129, 0.25);

  --accent-secondary: #06b6d4; /* Cyan */
  --accent-indigo: #6366f1;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --sidebar-width: 260px;
  --topbar-height: 70px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.6);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

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

.brand-icon {
  font-size: 28px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-titles h2 {
  font-size: 19px;
  color: #fff;
  line-height: 1.1;
}

.sub-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.mobile-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(16, 185, 129, 0.14);
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background-color: var(--accent-primary);
  border-radius: 0 4px 4px 0;
}

.nav-icon {
  font-size: 17px;
}

.nav-label {
  flex: 1;
}

.nav-counter {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.nav-item.active .nav-counter {
  background: rgba(16, 185, 129, 0.25);
  color: var(--accent-primary);
}

.nav-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.nav-tag.bot-tag {
  background: rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-primary);
}

.status-dot.pulse {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.client-web-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--accent-secondary);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.client-web-link:hover {
  background: rgba(6, 182, 212, 0.1);
}

/* MAIN CONTENT */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR */
.admin-topbar {
  height: var(--topbar-height);
  background-color: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.page-title-wrap h1 {
  font-size: 20px;
  color: #fff;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-subtle);
}

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

.quick-status-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.chip-dot.green { background-color: var(--accent-primary); }

.admin-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
}

/* ==========================================================================
   BUTTONS & COMMON UI
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #052e16;
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  box-shadow: 0 0 15px var(--accent-primary-glow);
}

.btn-secondary {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.btn-danger-outline {
  background: transparent;
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger-outline:hover {
  background: rgba(244, 63, 94, 0.15);
}

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

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   TAB PANES
   ========================================================================== */

.tab-pane {
  display: none;
  padding: 28px;
  animation: fadeIn 0.25s ease-out;
}

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

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

/* ==========================================================================
   DASHBOARD KPI CARDS
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

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

.stat-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.stat-icon-wrap.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.stat-icon-wrap.emerald { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.stat-icon-wrap.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.stat-icon-wrap.amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.stat-value {
  font-size: 32px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  line-height: 1;
  margin-bottom: 12px;
}

.stat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.highlight-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.highlight-pill.green { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.highlight-pill.purple { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
.highlight-pill.amber { background: rgba(245, 158, 11, 0.18); color: #fde68a; }

.stat-sub {
  color: var(--text-subtle);
}

/* ==========================================================================
   SERVICES HEALTH BANNER
   ========================================================================== */

.service-health-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}

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

.service-card-header h3 {
  font-size: 16px;
  color: #fff;
}

.health-badge.healthy {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.service-icon {
  font-size: 22px;
}

.service-info {
  flex: 1;
}

.service-info h4 {
  font-size: 13px;
  color: #fff;
}

.service-info p {
  font-size: 11px;
  color: var(--text-subtle);
}

.status-indicator {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.status-indicator.online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-primary);
}

/* ==========================================================================
   DISTRIBUTION LISTS & CHARTS
   ========================================================================== */

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-row.two-col {
  grid-template-columns: 1.2fr 1fr;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-card-header h3 {
  font-size: 15px;
  color: #fff;
}

.dash-card-header .subtext {
  font-size: 11px;
  color: var(--text-subtle);
}

.distribution-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dist-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dist-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.dist-label {
  color: var(--text-muted);
}

.dist-count {
  font-weight: 600;
  color: #fff;
}

.dist-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dist-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  transition: width 0.6s ease;
}

.dist-bar-fill.cyan { background: var(--accent-secondary); }
.dist-bar-fill.purple { background: var(--accent-purple); }
.dist-bar-fill.amber { background: var(--accent-amber); }

/* ==========================================================================
   DATA TABLES
   ========================================================================== */

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.table-container.compact {
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-subtle);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #052e16;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.user-cell-meta h4 {
  font-size: 14px;
  color: #fff;
  font-weight: 600;
}

.user-id-sub {
  font-size: 11px;
  color: var(--text-subtle);
  font-family: monospace;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-pill.persona {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-pill.tg {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  text-decoration: none;
}

.badge-pill.tg:hover {
  background: rgba(59, 130, 246, 0.25);
}

.badge-pill.web {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.badge-pill.diet-veg {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.badge-pill.diet-nonveg {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
}

.badge-pill.lang {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
}

.stats-badges-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
}

.stats-badges-col span {
  color: var(--text-subtle);
}

.stats-badges-col strong {
  color: var(--text-main);
}

/* ==========================================================================
   SEARCH & FILTERS
   ========================================================================== */

.section-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-filter-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}

.search-input-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  gap: 10px;
  min-width: 320px;
  flex: 1;
  transition: var(--transition);
}

.search-input-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.search-input-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 13px;
  width: 100%;
}

.search-input-box input::placeholder {
  color: var(--text-subtle);
}

.filter-dropdowns {
  display: flex;
  gap: 10px;
}

.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus {
  border-color: var(--border-focus);
}

.filter-select option {
  background: var(--bg-surface-elevated);
  color: #fff;
}

.action-buttons-group {
  display: flex;
  gap: 10px;
}

.table-empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-subtle);
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.table-empty-state h4 {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ==========================================================================
   TIMELINE & ACTIVITY
   ========================================================================== */

.activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}

.timeline-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
}

.timeline-content p {
  font-size: 13px;
  color: var(--text-main);
}

.timeline-content p strong {
  color: #fff;
}

.timeline-time {
  font-size: 11px;
  color: var(--text-subtle);
}

/* ==========================================================================
   RECIPES CARDS GRID
   ========================================================================== */

.recipes-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.recipe-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.recipe-admin-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
}

.recipe-card-media {
  height: 140px;
  background-color: var(--bg-surface-elevated);
  position: relative;
  overflow: hidden;
}

.recipe-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-diet-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.recipe-diet-pill.veg {
  background: rgba(16, 185, 129, 0.9);
  color: #064e3b;
}

.recipe-diet-pill.nonveg {
  background: rgba(244, 63, 94, 0.9);
  color: #881337;
}

.recipe-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipe-card-body h4 {
  font-size: 15px;
  color: #fff;
  line-height: 1.2;
}

.recipe-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-subtle);
}

.recipe-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}

.recipe-card-footer {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   TELEGRAM BROADCAST PANEL
   ========================================================================== */

.broadcast-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}

.broadcast-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.form-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.form-header h3 {
  font-size: 17px;
  color: #fff;
}

.form-header p {
  font-size: 12px;
  color: var(--text-subtle);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

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

.field-hint {
  font-size: 11px;
  color: var(--text-subtle);
}

/* TELEGRAM MOCK PHONE PREVIEW */
.broadcast-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.broadcast-preview-card h4 {
  font-size: 15px;
  color: #fff;
  margin-bottom: 16px;
  align-self: flex-start;
}

.telegram-mock-phone {
  width: 100%;
  max-width: 320px;
  background: #0f172a;
  border-radius: 24px;
  border: 4px solid #334155;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tg-chat-header {
  background: #1e293b;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tg-bot-avatar {
  font-size: 20px;
}

.tg-bot-info {
  display: flex;
  flex-direction: column;
}

.tg-bot-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.tg-bot-sub {
  font-size: 10px;
  color: #94a3b8;
}

.tg-bubble {
  background: #1e293b;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid #10b981;
}

.tg-msg-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.tg-msg-body {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
  white-space: pre-wrap;
}

.tg-msg-footer {
  font-size: 10px;
  color: #64748b;
  font-style: italic;
  margin-top: 4px;
}

.tg-msg-btn {
  display: block;
  text-align: center;
  background: #2563eb;
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 4px;
}

/* ==========================================================================
   SLIDE-OUT USER PROFILE DRAWER
   ========================================================================== */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.user-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 520px;
  max-width: 95vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.user-drawer.hidden, .drawer-backdrop.hidden {
  display: none;
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-user-lead {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-large-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.drawer-user-lead h2 {
  font-size: 18px;
  color: #fff;
}

.user-handle {
  font-size: 12px;
  color: var(--accent-secondary);
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  gap: 4px;
  background: rgba(0, 0, 0, 0.15);
  overflow-x: auto;
}

.drawer-tab-btn {
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.drawer-tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

.drawer-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.drawer-pane {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.drawer-pane.active {
  display: block;
}

.user-info-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.info-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.info-card.full-width {
  grid-column: 1 / -1;
}

.info-label {
  display: block;
  font-size: 11px;
  color: var(--text-subtle);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info-val {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.drawer-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.drawer-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-history-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pantry-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pantry-chip {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
}

/* ==========================================================================
   MODAL WINDOWS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  animation: modalScale 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

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

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================================================
   COMMUNITY GRID & CARDS
   ========================================================================== */

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.community-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.community-card-img {
  height: 180px;
  width: 100%;
  object-fit: cover;
}

.community-card-body {
  padding: 16px;
  flex: 1;
}

.community-card-footer {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   DIAGNOSTICS LIST
   ========================================================================== */

.diagnostics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.diag-details-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diag-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.diag-item .diag-label {
  color: var(--text-muted);
}

.diag-item .diag-val {
  font-weight: 600;
  color: #fff;
  font-family: monospace;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.success { border-left: 4px solid var(--accent-primary); }
.toast.error { border-left: 4px solid var(--accent-rose); }
.toast.info { border-left: 4px solid var(--accent-secondary); }

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

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
  .dashboard-row.two-col {
    grid-template-columns: 1fr;
  }
  .broadcast-layout {
    grid-template-columns: 1fr;
  }
  .diagnostics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .mobile-close-btn {
    display: block;
  }
  .mobile-menu-btn {
    display: block;
  }
  .admin-main {
    margin-left: 0;
  }
  .topbar-actions .quick-status-chip {
    display: none;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   DEDICATED FULL SCREEN USER DETAIL VIEW (NO POPUP)
   ========================================================================== */
.user-full-detail-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.25s ease;
}

.view-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.user-avatar-badge.lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.detail-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.detail-cards-grid .full-width {
  grid-column: span 2;
}

.user-info-dl {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.user-info-dl .info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.user-info-dl .info-lbl {
  color: var(--text-muted);
  font-size: 13px;
}

.user-info-dl .info-val {
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  text-align: right;
}

.user-detail-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.user-detail-history-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-detail-history-card img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   FULL SCREEN CHAT INTERFACE (TELEGRAM / WHATSAPP STYLE)
   ========================================================================== */
.chat-interface-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 160px);
  min-height: 520px;
  overflow: hidden;
  animation: fadeIn 0.25s ease;
}

.chat-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.chat-meta-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
}

.chat-messages-stream {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-color: #0b111a;
  background-image: radial-gradient(circle at 50% 50%, rgba(34, 158, 217, 0.03) 0%, transparent 60%);
}

.chat-bubble {
  max-width: 68%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
  animation: bubbleAppear 0.2s ease;
}

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

.chat-bubble {
  display: inline-flex;
  flex-direction: column;
  width: fit-content;
  max-width: 65%;
  min-width: 120px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
  animation: bubbleAppear 0.2s ease;
}

.chat-bubble.user {
  align-self: flex-start;
  background: #182533;
  color: #fff;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-bubble.bot {
  align-self: flex-end;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.chat-bubble .bubble-sender {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-bubble .bubble-meta {
  font-size: 10.5px;
  opacity: 0.7;
  margin-top: 6px;
  text-align: right;
}

.chat-bubble img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 10px;
  margin-top: 8px;
  display: block;
  cursor: pointer;
}

.chat-reply-bar {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  align-items: center;
}

.chat-reply-bar input {
  flex: 1;
}

/* Sidebar Backdrop Overlay */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.hidden {
  display: none !important;
}

body.mobile-sidebar-active {
  overflow: hidden !important;
}

@media (max-width: 900px) {
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .admin-layout {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .admin-sidebar {
    transform: translateX(-100%);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 84vw;
    z-index: 1000;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.85);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .mobile-close-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    font-size: 20px;
    line-height: 1;
  }

  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .tab-pane {
    padding: 16px 12px;
  }

  .admin-topbar {
    padding: 10px 14px;
    height: auto;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .admin-topbar .quick-status-chip {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .page-title-wrap {
    min-width: 0;
    flex: 1;
  }

  .page-title-wrap h1 {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-subtitle {
    display: none !important;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

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

  .admin-avatar {
    padding: 6px 8px;
  }

  .admin-avatar .admin-name {
    display: none;
  }

  /* User Drawer Mobile Overrides */
  .user-drawer {
    width: 100% !important;
    max-width: 100vw !important;
    border-left: none !important;
    border-radius: 0 !important;
  }

  .drawer-header {
    padding: 14px 16px;
  }

  .drawer-tabs {
    padding: 0 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-wrap: nowrap;
  }

  .drawer-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 12px;
  }

  .drawer-body {
    padding: 16px 14px;
  }

  .user-info-cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Layout grids */
  .detail-cards-grid {
    grid-template-columns: 1fr;
  }

  .detail-cards-grid .full-width {
    grid-column: span 1;
  }

  .diagnostics-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .diag-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
  }

  .diag-item .diag-val {
    word-break: break-all;
    text-align: left;
    max-width: 100%;
  }

  .chat-bubble {
    max-width: 88%;
  }

  .chat-interface-card {
    height: calc(100vh - 120px);
  }

  /* Filter and Action Bars */
  .section-actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-filter-wrap {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .search-input-box {
    width: 100%;
    max-width: 100%;
  }

  .search-input-box input {
    width: 100%;
    font-size: 14px;
    padding: 9px 12px 9px 36px;
  }

  .filter-select {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box;
    font-size: 13px;
  }

  /* Tables container */
  .user-table-wrap,
  .data-table-wrap,
  .table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
  }

  .data-table {
    min-width: 580px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

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

  .community-grid {
    grid-template-columns: 1fr;
  }

  /* Modals on Mobile */
  .modal-backdrop {
    padding: 10px;
    align-items: center;
  }

  .modal-card {
    max-width: 100%;
    max-height: 94vh;
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 16px 14px;
    max-height: calc(94vh - 110px);
  }

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

  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-footer button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tab-pane {
    padding: 12px 8px;
  }

  .dash-card, .analytics-main-card {
    padding: 14px 10px !important;
  }

  .stat-card-val {
    font-size: 1.4rem;
  }
}

/* ==========================================================================
   USER FEEDBACK SECTION ENHANCEMENTS
   ========================================================================== */

.feedback-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.feedback-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(16px);
  transition: var(--transition);
}

.feedback-stat-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feedback-stat-card.highlight-loved {
  border-left: 4px solid var(--accent-rose);
}

.feedback-stat-card.highlight-good {
  border-left: 4px solid var(--accent-secondary);
}

.feedback-stat-card.highlight-satisfaction {
  border-left: 4px solid var(--accent-amber);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-card-info {
  display: flex;
  flex-direction: column;
}

.feedback-filter-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.feedback-filter-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.feedback-filter-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.feedback-filter-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-primary-glow);
}

.feedback-filter-btn.filter-loved.active {
  background: var(--accent-rose);
  border-color: var(--accent-rose);
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
}

.feedback-filter-btn.filter-good.active {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.rating-pill-loved {
  background: rgba(244, 63, 94, 0.15) !important;
  color: #fb7185 !important;
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
  font-weight: 600;
}

.rating-pill-good {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(6, 182, 212, 0.35) !important;
  font-weight: 600;
}

.feedback-comment-cell {
  max-width: 320px;
  font-size: 13px;
  color: #d1d5db;
  line-height: 1.4;
  font-style: italic;
}

/* ==========================================================================
   SYSTEM HEALTH: DAILY ACTIVE USERS & ANALYTICS CHARTS
   ========================================================================== */

.analytics-section-container {
  margin-top: 28px;
}

.analytics-main-card {
  background: linear-gradient(180deg, rgba(22, 30, 46, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.analytics-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.analytics-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 600px;
}

.header-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.analytics-title {
  font-size: 1.25rem;
  color: #fff;
  margin: 0;
}

.analytics-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.analytics-controls-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.chart-dropdown-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.chart-type-dropdown {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-focus);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
  transition: var(--transition);
}

.chart-type-dropdown:focus {
  border-color: #34d399;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.chart-type-dropdown option {
  background: #111827;
  color: #f3f4f6;
  padding: 6px 10px;
}

.chart-quick-pills {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.chart-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.chart-pill-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.chart-pill-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-primary-glow);
}

.chart-range-group .filter-select {
  font-size: 13px;
  padding: 8px 12px;
}

/* Analytics KPI Grid */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.analytics-kpi-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.analytics-kpi-card:hover {
  background: rgba(26, 34, 52, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
}

.analytics-kpi-card .kpi-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 6px;
}

.analytics-kpi-card .kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.analytics-kpi-card .kpi-num {
  font-size: 1.75rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
}

.analytics-kpi-card .kpi-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.analytics-kpi-card .kpi-badge.positive {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.analytics-kpi-card .kpi-badge.neutral {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.analytics-kpi-card .kpi-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Chart Canvas Wrapper */
.chart-canvas-wrapper {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  position: relative;
}

.chart-badge-indicator {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.chart-badge-indicator strong {
  color: #fff;
}

.chart-canvas-container {
  position: relative;
  height: 360px;
  width: 100%;
}

/* Day-by-Day Table */
.daily-table-container {
  margin-top: 10px;
}

.daily-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.activity-progress-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-progress-track {
  width: 70px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.activity-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-full);
}

.intensity-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.intensity-badge.high {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.intensity-badge.peak {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.intensity-badge.normal {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

/* ==========================================================================
   DATE SELECTOR & RESPONSIVE CONTROLS
   ========================================================================== */

.analytics-date-dropdown {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
  transition: var(--transition);
  min-width: 200px;
}

.analytics-date-dropdown:focus {
  border-color: #34d399;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

.analytics-date-dropdown option {
  background: #111827;
  color: #f3f4f6;
  padding: 6px 10px;
}

.feedback-date-wrap {
  display: flex;
  align-items: center;
}

.feedback-date-wrap .filter-select {
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  font-weight: 600;
  min-width: 170px;
}

.chart-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chart-date-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: #6ee7b7;
}

.chart-date-badge strong {
  color: #fff;
  margin-left: 4px;
}

.responsive-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   RESPONSIVENESS (MOBILE & TABLET ADAPTATION)
   ========================================================================== */

@media (max-width: 992px) {
  .analytics-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .analytics-controls-row {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .analytics-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .analytics-control-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .chart-type-dropdown,
  .analytics-date-dropdown {
    width: 100%;
    min-width: 100%;
  }

  .chart-quick-pills {
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .chart-pill-btn {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    font-size: 11px;
  }

  .analytics-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .chart-canvas-container {
    height: 280px;
  }

  .feedback-stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .feedback-date-wrap {
    width: 100%;
  }

  .feedback-date-wrap .filter-select {
    width: 100%;
  }

  .feedback-filter-pills {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .feedback-filter-btn {
    flex-shrink: 0;
    font-size: 12px;
    padding: 6px 12px;
  }

  .daily-table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .analytics-kpi-grid {
    grid-template-columns: 1fr;
  }

  .feedback-stats-row {
    grid-template-columns: 1fr;
  }

  .chart-canvas-container {
    height: 230px;
  }

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

  .analytics-subtitle {
    font-size: 0.8rem;
  }

  .stat-card-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .analytics-kpi-card .kpi-num {
    font-size: 1.5rem;
  }
}



