/* NEXUS Admin — Mobile First "Warm Blue" Premium Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #F9F9F7; /* Warm off-white/cream */
  --bg-card: #FFFFFF;
  --bg-input: #F3F4F6;
  --text: #111827;
  --text-muted: #6B7280;
  --accent: #2563EB; /* Premium Lucky Blue */
  --accent-gradient: linear-gradient(135deg, #3B82F6, #1E3A8A);
  --success: #10B981;
  --error: #EF4444;
  --border: #E5E7EB;
  --radius: 16px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-elevated: 0 8px 30px rgba(37, 99, 235, 0.08);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Top Nav */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: rgba(255,255,255,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: #111827; }
.logo i { color: var(--accent); font-size: 1.5rem; }

.icon-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  transition: all 0.2s ease; background: var(--bg-card);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Container */
.container { max-width: 800px; margin: 0 auto; padding: 20px 16px; padding-bottom: 80px; }

/* Login */
.admin-login {
  max-width: 400px; margin: 80px auto 0; padding: 40px 24px;
  background: var(--bg-card); border-radius: 20px; border: 1px solid var(--border);
  box-shadow: var(--shadow-elevated); text-align: center;
}
.admin-login i { font-size: 3rem; background: var(--accent-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 16px; display: inline-block; }
.admin-login h2 { font-size: 1.6rem; margin-bottom: 8px; font-weight: 800; }

.input-field {
  width: 100%; padding: 16px; background: var(--bg-input);
  border: 1px solid transparent; border-radius: 12px; color: var(--text);
  font-size: 1rem; font-family: 'Inter', sans-serif; outline: none;
  transition: all 0.2s; margin-bottom: 16px;
}
.input-field:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }

.primary-btn {
  width: 100%; padding: 16px 24px; background: var(--accent-gradient); color: #fff;
  border: none; border-radius: 12px; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s ease; font-family: 'Inter', sans-serif;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35); }
.primary-btn:active { transform: translateY(0); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Tabs - Mobile Friendly Bottom or Top */
.tabs {
  display: flex; gap: 8px; margin-bottom: 24px;
  background: var(--bg-card); padding: 6px; border-radius: 14px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); overflow-x: auto;
}
.tab-btn {
  flex: 1; min-width: 90px; padding: 12px; background: none; border: none; color: var(--text-muted);
  border-radius: 10px; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: 0.2s;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.tab-btn i { font-size: 1.2rem; }
.tab-btn.active { background: rgba(37, 99, 235, 0.1); color: var(--accent); }

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

/* Cards & Stats */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); padding: 20px; border-radius: 16px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.stat-card .lbl { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.stat-card .val { font-size: 1.6rem; font-weight: 800; color: var(--text); }
.stat-card .val.highlight { color: var(--accent); }

/* Menu Items Mobile Layout */
.admin-item {
  background: var(--bg-card); padding: 16px; border-radius: 16px;
  border: 1px solid var(--border); margin-bottom: 12px;
  box-shadow: var(--shadow-sm); transition: transform 0.2s;
}
.admin-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.admin-item-header h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.editable-price { font-weight: 800; font-size: 1.1rem; color: var(--accent); background: rgba(37, 99, 235, 0.05); padding: 4px 10px; border-radius: 8px; border: 1px solid transparent; width: 90px; text-align: right; outline: none; font-family: 'Inter', sans-serif; transition: all 0.2s; }
.editable-price:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

.admin-item-controls {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}

.stock-control { display: flex; align-items: center; background: var(--bg-input); border-radius: 10px; overflow: hidden; }
.stock-btn { background: none; border: none; padding: 10px 16px; font-size: 1.2rem; font-weight: 600; cursor: pointer; color: var(--text); }
.stock-btn:hover { background: rgba(0,0,0,0.05); }
.stock-input { width: 50px; text-align: center; border: none; background: transparent; font-weight: 700; font-size: 1rem; color: var(--text); outline: none; }

.status-badge { padding: 6px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.in-stock { background: rgba(16, 185, 129, 0.15); color: #065F46; }
.sold-out-badge { background: rgba(239, 68, 68, 0.15); color: #991B1B; }

.delete-btn { background: none; border: none; color: var(--error); font-size: 1.2rem; cursor: pointer; padding: 8px; border-radius: 8px; }
.delete-btn:hover { background: rgba(239, 68, 68, 0.1); }

/* Charts & Analytics */
.chart-container {
  height: 180px; display: flex; align-items: flex-end; gap: 4px;
  background: var(--bg-card); padding: 20px 16px; border-radius: 16px;
  border: 1px solid var(--border); margin-top: 16px; box-shadow: var(--shadow-sm);
}
.chart-bar { flex: 1; background: var(--accent-gradient); border-radius: 4px 4px 0 0; position: relative; opacity: 0.8; transition: opacity 0.2s; }
.chart-bar:hover { opacity: 1; }
.chart-bar-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 0.65rem; color: var(--text-muted); font-weight: 600; }

.top-item-row {
  display: flex; align-items: center; padding: 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.top-item-rank { font-weight: 800; color: var(--accent); font-size: 1.1rem; width: 30px; }

/* Toast */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: #111827; color: #fff; padding: 14px 28px; border-radius: 30px;
  font-size: 0.95rem; font-weight: 600; z-index: 1000; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2); pointer-events: none; white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Utilities */
.veg-dot { display: inline-block; width: 10px; height: 10px; background: #10B981; border-radius: 50%; border: 2px solid #065F46; }
.nonveg-dot { display: inline-block; width: 10px; height: 10px; background: #EF4444; border-radius: 50%; border: 2px solid #991B1B; }

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

/* Add Item Form */
.admin-form { background: var(--bg-card); padding: 20px; border-radius: 16px; border: 1px solid var(--border); margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.admin-form h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; color: var(--accent); }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 140px; }
.radio-group { display: flex; gap: 16px; padding: 10px 0; font-size: 0.9rem; }
.radio-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text); }
.radio-group input { accent-color: var(--accent); }

/* Range Selector */
.range-selector { display: flex; gap: 8px; margin-bottom: 20px; }
.range-btn { padding: 10px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: 0.2s; }
.range-btn.active { background: rgba(37, 99, 235, 0.1); color: var(--accent); border-color: var(--accent); }

/* Analytics Grid */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }

/* Top Items */
.top-items-list { margin-bottom: 24px; }
.top-items-list h4 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* Peak Hours */
.peak-hours-chart { margin-bottom: 24px; }
.peak-hours-chart h4 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.chart-bars { height: 180px; display: flex; align-items: flex-end; gap: 4px; background: var(--bg-card); padding: 20px 16px 30px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }

/* Export Section */
.export-section { background: var(--bg-card); padding: 24px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.export-section h4 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.month-picker { width: 100%; padding: 14px 16px; background: var(--bg-input); border: 1px solid transparent; border-radius: 12px; color: var(--text); font-size: 1rem; font-family: 'Inter', sans-serif; outline: none; transition: all 0.2s; margin-top: 12px; }
.month-picker:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }

/* Loading State */
.loading-text { text-align: center; color: var(--text-muted); padding: 40px 20px; font-size: 0.9rem; }

/* Sold Out State */
.admin-item.sold-out { opacity: 0.6; }

textarea.input-field { resize: vertical; min-height: 60px; }

@media (max-width: 480px) {
  .top-item-row { padding: 12px; }
  .chart-container { gap: 2px; }
  .admin-item-controls { flex-direction: column; align-items: stretch; }
  .stock-control { justify-content: center; margin-bottom: 10px; }
  .status-badge { text-align: center; }
  .delete-btn { width: 100%; border: 1px solid rgba(239, 68, 68, 0.2); }
}
