/* ─────────────────────────────────────────
   assets/css/main.css
   ───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@400;500;600&display=swap');

/* ── Theme Variables ── */
:root {
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #eff6ff;
  --secondary:     #f59e0b;
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.14);
  --font:          'Inter', sans-serif;

  /* Light mode */
  --bg:            #f8f9fb;
  --surface:       #ffffff;
  --surface-2:     #f1f3f7;
  --border:        #e5e7eb;
  --text:          #111827;
  --text-2:        #6b7280;
  --text-3:        #9ca3af;
}

[data-theme="dark"] {
  --bg:            #0f1117;
  --surface:       #1a1d27;
  --surface-2:     #242736;
  --border:        #2d3144;
  --text:          #f1f5f9;
  --text-2:        #94a3b8;
  --text-3:        #64748b;
  --primary-light: #1e2a4a;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .2s, color .2s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Typography ── */
h1 { font-size: 1.75rem; font-weight: 600; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem;  font-weight: 500; }
h4 { font-size: .95rem;  font-weight: 500; }

/* ── Layout Utilities ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full  { width: 100%; }
.mt-1  { margin-top: .25rem; }
.mt-2  { margin-top: .5rem; }
.mt-4  { margin-top: 1rem; }
.mb-4  { margin-bottom: 1rem; }
.p-4   { padding: 1rem; }
.text-sm   { font-size: .875rem; }
.text-xs   { font-size: .75rem; }
.text-muted{ color: var(--text-2); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.card-flat {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.btn-danger:hover { background: #fca5a5; }
.btn-success {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn-icon:hover { color: var(--text); background: var(--border); }

/* ── Form Elements ── */
.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-label { font-size: .875rem; font-weight: 500; color: var(--text-2); }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: .6rem .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9rem;
  transition: border .15s, box-shadow .15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .78rem; color: var(--text-3); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* ── Badge / Label ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 500;
}
.badge-new      { background: #dbeafe; color: #1d4ed8; }
.badge-popular  { background: #fef3c7; color: #92400e; }
.badge-vegan    { background: #d1fae5; color: #065f46; }
.badge-spicy    { background: #fee2e2; color: #991b1b; }
.badge-chef     { background: #f3e8ff; color: #6b21a8; }
.badge-success  { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #b91c1c; }
.badge-gray     { background: var(--surface-2); color: var(--text-2); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  text-align: left;
  padding: .7rem 1rem;
  border-bottom: 2px solid var(--border);
  font-weight: 500;
  color: var(--text-2);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.data-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }

/* ── Stat Card ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: #2563eb; }
.stat-icon.green  { background: #f0fdf4; color: #16a34a; }
.stat-icon.amber  { background: #fffbeb; color: #d97706; }
.stat-icon.red    { background: #fef2f2; color: #dc2626; }
.stat-icon.purple { background: #faf5ff; color: #7c3aed; }
.stat-label { font-size: .78rem; color: var(--text-2); margin-bottom: .2rem; }
.stat-value { font-size: 1.5rem; font-weight: 600; }
.stat-sub   { font-size: .78rem; color: var(--text-3); margin-top: .15rem; }

/* ── Alert ── */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.alert-error   { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }

/* ── Toggle Switch ── */
.toggle-wrap { display: flex; align-items: center; gap: .6rem; }
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Color Picker Preview ── */
.color-preview {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-2);
}
.empty-state svg { margin: 0 auto 1rem; opacity: .4; }
.empty-state h3 { font-size: 1rem; color: var(--text); margin-bottom: .4rem; }
.empty-state p  { font-size: .875rem; }

/* ── Loading Spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  h1 { font-size: 1.4rem; }
  .card { padding: 1rem; }
}
