/* ============================================================
   MenuCap Dashboard — Styles
   Dark sidebar + Warm cream content area
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Serif+Display:ital@0;1&display=swap');

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

:root {
  /* Brand */
  --warm:      #cc0000;
  --warm-dk:   #a30000;
  --warm-lt:   #ffcccc;
  --warm-mid:  #ff9999;
  /* Content bg */
  --cream:     #FAF8F5;
  --cream-2:   #F3EFE9;
  --cream-3:   #EDE8E0;
  /* Text */
  --ink:       #1C1A18;
  --ink-2:     #3D3A35;
  --ink-3:     #7A756C;
  --ink-4:     #B5B0A8;
  --ink-5:     #D6D2CB;
  /* Borders */
  --border:    #E2DDD6;
  --border-2:  #F0EBE4;
  --white:     #FFFFFF;
  /* Sidebar */
  --sb-bg:     #17150F;
  --sb-hover:  rgba(255,255,255,0.07);
  --sb-active: rgba(200,75,47,0.18);
  --sb-text:   rgba(255,255,255,0.55);
  --sb-text-a: #FAF8F5;
  --sb-w:      240px;
  /* Misc */
  --topbar-h:  62px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 4px rgba(28,26,24,0.07);
  --shadow:    0 4px 18px rgba(28,26,24,0.09);
  --shadow-lg: 0 10px 40px rgba(28,26,24,0.12);
  --trans:     all 0.22s ease;
}

html { font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sb-w);
  min-height: 100vh;
  background: var(--sb-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.05);
  will-change: transform;
  overflow: hidden;
  /* Sayfa geçişinde flash önleme */
  visibility: hidden;
  opacity: 0;
}

.sb-logo {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sb-logo img { width: 30px; height: 30px; object-fit: contain; }
.sb-logo-text {
  font-family: 'DM Serif Display', serif;
  font-size: 1.2rem; color: #FAF8F5;
}

.sb-restaurant-info {
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 10px;
}
.sb-rest-avatar {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--warm), #E07050);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.sb-rest-name {
  font-size: 0.875rem; font-weight: 600; color: var(--sb-text-a);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-rest-type {
  font-size: 0.72rem; color: var(--sb-text);
}

.sb-nav {
  flex: 1; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}

.sb-section-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.25);
  padding: 14px 10px 6px;
}

.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sb-text);
  font-size: 0.875rem; font-weight: 500;
  transition: var(--trans);
  cursor: pointer;
  position: relative;
}
.sb-item:hover { background: var(--sb-hover); color: var(--sb-text-a); }
.sb-item.active {
  background: var(--sb-active);
  color: #FFA080;
}
.sb-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--warm); border-radius: 0 3px 3px 0;
}
.sb-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.sb-item.active .sb-icon, .sb-item:hover .sb-icon { opacity: 1; }
.sb-badge {
  margin-left: auto;
  padding: 2px 7px; background: var(--warm); color: white;
  font-size: 0.65rem; font-weight: 700; border-radius: 50px;
}

.sb-divider {
  height: 1px; background: rgba(255,255,255,0.06);
  margin: 6px 12px;
}

.sb-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  transition: var(--trans); cursor: pointer;
}
.sb-user:hover { background: var(--sb-hover); }
.sb-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(200,75,47,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; color: var(--warm); flex-shrink: 0;
}
.sb-user-name { font-size: 0.8rem; font-weight: 500; color: var(--sb-text-a); }
.sb-user-role { font-size: 0.7rem; color: var(--sb-text); }
.sb-logout { margin-left: auto; color: var(--sb-text); font-size: 0.8rem; }
.sb-logout:hover { color: #FF8080; }

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  margin-left: var(--sb-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; min-height: 100vh;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 6px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.breadcrumb-root { color: var(--ink-3); }
.breadcrumb-sep { color: var(--ink-5); }
.breadcrumb-current { font-weight: 600; color: var(--ink); }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: none; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); transition: var(--trans);
}
.topbar-btn:hover { border-color: var(--warm); color: var(--warm); background: var(--warm-lt); }

.topbar-preview-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; background: var(--ink); color: #FAF8F5;
  border-radius: var(--radius-sm); font-size: 0.83rem; font-weight: 600;
  transition: var(--trans); border: none;
}
.topbar-preview-btn:hover { background: var(--ink-2); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1; padding: 32px 28px;
  max-width: 1200px; width: 100%;
}

.page-header { margin-bottom: 28px; }
.page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem; color: var(--ink);
  margin-bottom: 4px;
}
.page-subtitle { font-size: 0.9rem; color: var(--ink-3); }
.page-header-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 28px; flex-wrap: wrap; gap: 16px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; background: var(--warm); color: #fff;
  font-weight: 600; font-size: 0.875rem; border-radius: var(--radius-sm);
  border: none; transition: var(--trans);
  box-shadow: 0 2px 8px rgba(200,75,47,0.25);
}
.btn-primary:hover { background: var(--warm-dk); transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; background: var(--white); color: var(--ink-2);
  font-weight: 600; font-size: 0.875rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); transition: var(--trans);
}
.btn-secondary:hover { border-color: var(--warm); color: var(--warm); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: transparent; color: var(--ink-3);
  font-size: 0.83rem; font-weight: 500; border-radius: var(--radius-sm);
  border: none; transition: var(--trans);
}
.btn-ghost:hover { background: var(--cream-2); color: var(--ink); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: #FEF2F2; color: #B91C1C;
  font-size: 0.83rem; font-weight: 600; border-radius: var(--radius-sm);
  border: 1.5px solid #FECACA; transition: var(--trans);
}
.btn-danger:hover { background: #FEE2E2; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-sm { padding: 18px; border-radius: var(--radius); }

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
  transition: var(--trans);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card-accent {
  position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 var(--radius-lg) 0 80px;
  opacity: 0.08;
}
.stat-card.warm .stat-card-accent { background: var(--warm); }
.stat-card.green .stat-card-accent { background: #16A34A; }
.stat-card.blue .stat-card-accent { background: #2563EB; }
.stat-card.amber .stat-card-accent { background: #D97706; }

.stat-card-label {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-3);
}
.stat-card-value {
  font-family: 'DM Serif Display', serif;
  font-size: 2.2rem; color: var(--ink); line-height: 1;
}
.stat-card-change {
  font-size: 0.78rem; display: flex; align-items: center; gap: 4px;
}
.stat-card-change.up { color: #16A34A; }
.stat-card-change.down { color: #DC2626; }
.stat-card-icon {
  position: absolute; top: 20px; right: 20px;
  font-size: 1.3rem; opacity: 0.5;
}

/* ============================================================
   CHART
   ============================================================ */
.chart-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.chart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.chart-title { font-weight: 700; font-size: 1rem; color: var(--ink); }
.chart-subtitle { font-size: 0.8rem; color: var(--ink-3); margin-top: 2px; }

.bar-chart {
  display: flex; align-items: flex-end; gap: 10px;
  height: 140px; justify-content: space-between;
}
.bar-group {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  height: 100%; justify-content: flex-end;
}
.bar-wrap {
  flex: 1; width: 100%; max-width: 40px; display: flex; align-items: flex-end;
}
.bar-fill {
  position: relative;
  width: 100%; border-radius: 5px 5px 0 0;
  background: var(--cream-3);
  transition: all 0.6s ease;
  min-height: 8px;
}
.bar-fill:hover::after {
  content: attr(title);
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.bar-fill.active { background: var(--warm); }
.bar-fill:hover { opacity: 0.8; }
.bar-label { font-size: 0.7rem; color: var(--ink-4); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.table-title { font-weight: 700; font-size: 0.975rem; }

.data-table {
  width: 100%; border-collapse: collapse;
}
.data-table th {
  padding: 12px 20px;
  background: var(--cream-2); border-bottom: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-3);
  text-align: left;
}
.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-2);
  font-size: 0.875rem; color: var(--ink-2);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--cream); }

/* ============================================================
   MENU MANAGEMENT
   ============================================================ */
.menu-layout {
  display: grid; grid-template-columns: 260px 1fr;
  gap: 20px; align-items: start;
}
.category-sidebar {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  position: sticky; top: calc(var(--topbar-h) + 20px);
}
.cat-sidebar-header, .category-sidebar-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.cat-sidebar-header h3 { margin: 0; font-size: 1.1rem; }
.category-sidebar-title { font-weight: 700; font-size: 0.875rem; }
.cat-list { padding: 8px; }
.cat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  transition: var(--trans);
}
.cat-item:hover { background: var(--cream-2); }
.cat-item.active { background: var(--warm-lt); }
.cat-item-icon { font-size: 1.1rem; }
.cat-item-name { font-size: 0.875rem; font-weight: 500; flex: 1; }
.cat-item-count {
  font-size: 0.75rem; color: var(--ink-4);
  background: var(--cream-2); padding: 2px 7px; border-radius: 50px;
}
.cat-item.active .cat-item-name { color: var(--warm); }
.cat-item.active .cat-item-count { background: var(--warm-mid); color: var(--warm-dk); }

/* Items Toolbar */
.items-toolbar {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between;
}
.search-input {
  flex: 1; min-width: 200px; max-width: 300px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.85rem; outline: none; transition: var(--trans);
}
.search-input:focus { border-color: var(--warm); box-shadow: 0 0 0 3px var(--warm-lt); }

.filter-toggles {
  display: flex; gap: 6px; background: var(--cream-2); padding: 4px; border-radius: 8px;
}
.filter-btn {
  border: none; background: transparent; padding: 6px 14px; border-radius: 6px;
  font-size: 0.8rem; font-weight: 500; color: var(--ink-3); cursor: pointer; transition: var(--trans);
}
.filter-btn:hover { color: var(--ink); }
.filter-btn.active { background: var(--white); color: var(--warm); box-shadow: var(--shadow-sm); }

/* Items grid */
.items-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.item-card-admin {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--trans);
}
.item-card-admin:hover { box-shadow: var(--shadow); border-color: var(--cream-3); }
.item-card-admin.inactive { opacity: 0.5; }

.item-card-img {
  width: 100%; height: 140px; object-fit: cover;
  display: block; background: var(--cream-2);
}
.item-card-no-img {
  height: 60px; background: var(--cream-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.item-card-body { padding: 14px; }
.item-card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 6px;
}
.item-card-name { font-weight: 700; font-size: 0.9rem; color: var(--ink); line-height: 1.3; }
.item-card-price { font-family: 'DM Serif Display', serif; font-size: 1rem; color: var(--warm); font-weight: 700; white-space: nowrap; }
.item-card-desc { font-size: 0.78rem; color: var(--ink-3); line-height: 1.5; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-card-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.item-cal-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; background: var(--cream-2); border-radius: 50px;
  font-size: 0.72rem; color: var(--ink-3);
}
.item-featured-badge {
  padding: 3px 8px; background: #FEF3C7; color: #92400E;
  border-radius: 50px; font-size: 0.72rem; font-weight: 700;
}
.item-inactive-badge {
  padding: 3px 8px; background: #F3F4F6; color: var(--ink-3);
  border-radius: 50px; font-size: 0.72px; font-weight: 600;
}
.item-cat-badge {
  padding: 3px 8px; background: rgba(59,130,246,0.1); color: #1d4ed8;
  border-radius: 50px; font-size: 0.72rem; font-weight: 500;
}

/* Emoji Picker */
.emoji-picker-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.emoji-selected-display {
  display: flex; align-items: center; justify-content: center;
  padding: 12px; font-size: 2.5rem; background: var(--cream-2);
  border-bottom: 1px solid var(--border);
  cursor: default; letter-spacing: 2px;
}
.emoji-grid {
  max-height: 220px; overflow-y: auto;
  padding: 10px; display: flex; flex-wrap: wrap; gap: 4px;
  background: var(--white);
}
.emoji-group-label {
  width: 100%; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-4);
  padding: 8px 2px 4px; margin-top: 4px;
}
.emoji-btn {
  width: 36px; height: 36px; border-radius: 6px;
  border: 1.5px solid transparent; background: transparent;
  font-size: 1.4rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: var(--trans); flex-shrink: 0;
  line-height: 1;
}
.emoji-btn:hover { background: var(--cream-2); border-color: var(--border); }
.emoji-btn.selected { background: rgba(200,75,47,0.12); border-color: var(--warm); }



.item-card-actions {
  display: flex; gap: 6px; padding: 10px 14px;
  border-top: 1px solid var(--border-2);
  background: var(--cream);
}
.item-action-btn {
  flex: 1; padding: 7px; border-radius: 6px;
  font-size: 0.78rem; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--white);
  color: var(--ink-3); transition: var(--trans);
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.item-action-btn:hover { border-color: var(--warm); color: var(--warm); background: var(--warm-lt); }
.item-action-btn.delete:hover { border-color: #DC2626; color: #DC2626; background: #FEF2F2; }

/* ============================================================
   FORM ELEMENTS (dashboard)
   ============================================================ */
.db-form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.db-form-label {
  font-size: 0.82rem; font-weight: 600; color: var(--ink-2);
}
.db-form-input, .db-form-textarea, .db-form-select {
  padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem;
  color: var(--ink); background: var(--white);
  transition: var(--trans); width: 100%;
}
.db-form-input::placeholder, .db-form-textarea::placeholder { color: var(--ink-4); }
.db-form-input:focus, .db-form-textarea:focus, .db-form-select:focus {
  outline: none; border-color: var(--warm);
  box-shadow: 0 0 0 3px rgba(200,75,47,0.1);
}
.db-form-textarea { resize: vertical; min-height: 80px; }
.db-form-select { cursor: pointer; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle-label { font-size: 0.875rem; color: var(--ink-2); }
.toggle {
  position: relative; width: 40px; height: 22px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0; background: var(--ink-5); border-radius: 50px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; left: 3px; top: 3px;
  transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--warm); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(28,26,24,0.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--white); border-radius: 20px;
  width: 100%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(28,26,24,0.2);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { transform: scale(0.94) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.modal-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--cream-2); border: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 1.1rem; transition: var(--trans);
}
.modal-close:hover { background: var(--cream-3); color: var(--ink); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============================================================
   QR PAGE
   ============================================================ */
.qr-showcase {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px;
}
.qr-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px;
  text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 20px;
}
.qr-canvas-wrap {
  padding: 20px; background: var(--white);
  border: 2px solid var(--border); border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
}
.qr-info { background: var(--cream-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; width: 100%; }
.qr-url { font-family: 'Courier New', monospace; font-size: 0.82rem; color: var(--ink-3); word-break: break-all; }
.qr-url strong { color: var(--warm); }
.qr-actions { display: flex; gap: 10px; }
.qr-actions .btn-primary, .qr-actions .btn-secondary { flex: 1; justify-content: center; }

.qr-tips { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.qr-tip-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-2); }
.qr-tip-item:last-child { border-bottom: none; padding-bottom: 0; }
.qr-tip-num { width: 28px; height: 28px; background: var(--warm-lt); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; font-weight: 700; color: var(--warm); flex-shrink: 0; }
.qr-tip-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 3px; }
.qr-tip-body { font-size: 0.82rem; color: var(--ink-3); line-height: 1.6; }

/* ============================================================
   STATS CHARTS
   ============================================================ */
.stats-section-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 20px;
}

.top-items-list { display: flex; flex-direction: column; gap: 12px; }
.top-item-row { display: flex; align-items: center; gap: 12px; }
.top-item-rank { width: 24px; height: 24px; background: var(--cream-2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; color: var(--ink-3); flex-shrink: 0; }
.top-item-rank.gold { background: #FEF3C7; color: #92400E; }
.top-item-info { flex: 1; }
.top-item-name { font-size: 0.875rem; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.top-item-cat { font-size: 0.75rem; color: var(--ink-3); }
.top-item-bar-wrap { width: 100px; height: 6px; background: var(--cream-2); border-radius: 3px; }
.top-item-bar { height: 100%; background: var(--warm); border-radius: 3px; }
.top-item-num { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); min-width: 30px; text-align: right; }

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-grid {
  display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start;
}
.settings-nav { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: calc(var(--topbar-h) + 20px); }
.settings-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; font-size: 0.875rem; font-weight: 500; color: var(--ink-3);
  border-bottom: 1px solid var(--border-2); cursor: pointer; transition: var(--trans);
}
.settings-nav-item:last-child { border-bottom: none; }
.settings-nav-item:hover { background: var(--cream); color: var(--ink); }
.settings-nav-item.active { background: var(--warm-lt); color: var(--warm); font-weight: 600; }
.settings-section { display: none; }
.settings-section.active { display: block; }
.settings-card-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 20px; }
.settings-divider { height: 1px; background: var(--border); margin: 24px 0; }

/* Color picker */
.color-picker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; transition: var(--trans);
}
.color-swatch.selected { border-color: var(--ink); transform: scale(1.1); }

/* Subscription card */
.sub-card {
  background: linear-gradient(135deg, var(--warm), var(--warm-dk));
  border-radius: var(--radius-lg); padding: 28px; color: white;
  margin-bottom: 20px; position: relative; overflow: hidden;
}
.sub-card::after {
  content: ''; position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.sub-card-plan { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; margin-bottom: 6px; }
.sub-card-title { font-family: 'DM Serif Display', serif; font-size: 1.6rem; margin-bottom: 4px; }
.sub-card-date { font-size: 0.83rem; opacity: 0.75; }
.sub-card-amount { position: absolute; top: 28px; right: 28px; text-align: right; }
.sub-card-price { font-family: 'DM Serif Display', serif; font-size: 2rem; }
.sub-card-period { font-size: 0.8rem; opacity: 0.7; }

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast-container {
  position: fixed; top: 20px; right: 24px; z-index: 999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--ink); color: #FAF8F5;
  padding: 12px 18px; border-radius: 10px;
  font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.3s ease;
  min-width: 240px;
}
.toast.success { background: #166534; }
.toast.error { background: #991B1B; }
.toast.warning { background: #92400E; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center; padding: 60px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-icon { font-size: 3rem; }
.empty-title { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.empty-desc { font-size: 0.875rem; color: var(--ink-3); max-width: 320px; line-height: 1.6; }

/* ============================================================
   MOBILE BURGER (dashboard)
   ============================================================ */
.db-burger {
  display: none; position: fixed;
  top: 14px; left: 14px; z-index: 200;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--sb-bg); border: none;
  flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
}
.db-burger span { display: block; width: 18px; height: 2px; background: white; border-radius: 2px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-section-grid { grid-template-columns: 1fr; }
  .qr-showcase { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .menu-layout { grid-template-columns: 1fr; }
  .category-sidebar { position: static; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { position: static; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); visibility: visible; opacity: 1; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,0.3); transition: transform 0.22s ease; z-index: 300; }
  .main-wrapper { margin-left: 0; }
  .db-burger { display: flex; }
  .topbar { padding: 0 20px 0 60px; }
  .page-content { padding: 24px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header-row { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   IMAGE UPLOAD AREA
   ============================================================ */
.img-upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--trans);
  overflow: hidden;
  background: var(--cream-2);
}
.img-upload-area:hover { border-color: var(--warm); background: rgba(200,75,47,0.04); }
.img-upload-area.drag-over { border-color: var(--warm); background: rgba(200,75,47,0.08); }
.img-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 0.82rem;
  pointer-events: none;
  padding: 20px;
  text-align: center;
}

/* Category item delete button */
.cat-item-del {
  margin-left: auto;
  opacity: 0;
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: var(--trans);
  flex-shrink: 0;
}
.cat-item:hover .cat-item-del { opacity: 1; }
.cat-item-del:hover { background: rgba(200,75,47,0.15); color: var(--warm); }

/* Item card image wrap */
.item-card-img-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; }
.item-card-admin .item-card-img-wrap { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }

