/* ═══════════════════════════════════════════════════════
   QRMenu — Design System
   Font: Syne (display) + DM Sans (body) + DM Mono (data)
═══════════════════════════════════════════════════════ */

:root {
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;

  /* Light theme */
  --bg:         #F7F6F2;
  --bg-card:    #FFFFFF;
  --bg-sidebar: #0F0F0F;
  --border:     rgba(0,0,0,0.08);
  --border-med: rgba(0,0,0,0.14);
  --text:       #111111;
  --text-2:     #555555;
  --text-3:     #999999;
  --accent:     #FF6B35;
  --accent-h:   #E5531E;
  --accent-bg:  rgba(255,107,53,0.08);
  --success:    #22c55e;
  --success-bg: rgba(34,197,94,0.09);
  --danger:     #ef4444;
  --danger-bg:  rgba(239,68,68,0.09);
  --warning:    #f59e0b;
  --warning-bg: rgba(245,158,11,0.09);
  --info:       #3b82f6;
  --info-bg:    rgba(59,130,246,0.09);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --sidebar-w:  240px;
  --topbar-h:   60px;
  --transition: 0.18s ease;
}

[data-theme="dark"] {
  --bg:         #111111;
  --bg-card:    #1A1A1A;
  --bg-sidebar: #0A0A0A;
  --border:     rgba(255,255,255,0.07);
  --border-med: rgba(255,255,255,0.12);
  --text:       #F0EFE9;
  --text-2:     #A0A09A;
  --text-3:     #606060;
  --accent-bg:  rgba(255,107,53,0.12);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.5);
}

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

/* ── App Shell ──────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  font-weight: 400;
  transition: all var(--transition);
  position: relative;
}
.nav-item i { width: 16px; text-align: center; font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.nav-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}
.nav-item.nav-preview { color: rgba(255,255,255,0.35); font-size: 13px; }
.nav-ext { margin-left: auto; font-size: 10px; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 8px 0; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-chip { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,0.85); }
.user-role { font-size: 11px; color: rgba(255,255,255,0.35); text-transform: capitalize; }
.btn-logout {
  background: none; border: none;
  color: rgba(255,255,255,0.3);
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
}
.btn-logout:hover { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ── Main Content ───────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.sidebar-toggle {
  background: none; border: none;
  color: var(--text-2);
  font-size: 18px;
  display: none;
  /* Zona e klikimit 44x44px — standard mobile */
  width: 44px; height: 44px;
  min-width: 44px;
  align-items: center; justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition);
}
.sidebar-toggle:active { background: var(--accent-bg); }
.page-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  flex: 1;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  background: none; border: 1px solid var(--border-med);
  color: var(--text-2);
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.theme-toggle:hover { background: var(--bg); color: var(--text); }

.page-body { padding: 24px; flex: 1; }

/* ── Stat Cards ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: 4px;
}
.stat-icon.orange  { background: var(--accent-bg);   color: var(--accent); }
.stat-icon.green   { background: var(--success-bg);  color: var(--success); }
.stat-icon.blue    { background: var(--info-bg);     color: var(--info); }
.stat-icon.purple  { background: rgba(139,92,246,.1); color: #8b5cf6; }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-2); }

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}
.card-body { padding: 20px; }

/* ── Table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: var(--bg);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg); }

/* ── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-green   { background: var(--success-bg); color: var(--success); }
.badge-red     { background: var(--danger-bg);  color: var(--danger); }
.badge-orange  { background: var(--accent-bg);  color: var(--accent); }
.badge-blue    { background: var(--info-bg);    color: var(--info); }
.badge-gray    { background: rgba(0,0,0,0.05);  color: var(--text-2); }
.plan-pro        { background: rgba(59,130,246,0.12);  color: #3B82F6; }
.plan-unlimited  { background: rgba(139,92,246,0.14);  color: #8B5CF6; border: 1px solid rgba(139,92,246,0.28); font-weight: 600; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,107,53,0.3); }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-med);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* ── Forms ──────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.form-control {
  background: var(--bg);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.form-control::placeholder { color: var(--text-3); }
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { appearance: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ── Alerts ─────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 20px;
}
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.2); }

/* ── Toasts ─────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all var(--transition);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { border-left: 3px solid var(--success); color: var(--success); }
.toast-error   { border-left: 3px solid var(--danger);  color: var(--danger); }

/* ── Modal ──────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { transform: scale(0.95) translateY(10px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.modal-close {
  background: none; border: none;
  color: var(--text-3); font-size: 18px;
  padding: 4px; border-radius: 6px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body  { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ── Empty State ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ── Section header ─────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

/* ── Color picker ───────────────────────────────────── */
.color-field {
  display: flex; align-items: center; gap: 8px;
}
.color-field input[type=color] {
  width: 36px; height: 36px;
  border-radius: 6px; border: 1px solid var(--border-med);
  padding: 2px; cursor: pointer; background: none;
}
.color-field input[type=text] { flex: 1; font-family: var(--font-mono); }

/* ── Image preview ──────────────────────────────────── */
.img-preview {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ── QR Box ─────────────────────────────────────────── */
.qr-box {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-med);
}
.qr-box img { width: 160px; height: 160px; border-radius: 8px; }
.qr-url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  word-break: break-all;
  text-align: center;
}

/* ── Product grid ───────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-md); }
.product-card.inactive { opacity: 0.55; }
.product-card-img { width: 100%; height: 160px; object-fit: cover; background: var(--bg); }
.product-card-body { padding: 12px; }
.product-card-name { font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.product-card-cat  { font-size: 11px; color: var(--text-3); margin-bottom: 8px; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; }
.product-price { font-family: var(--font-mono); font-weight: 500; color: var(--accent); }
.product-actions { display: flex; gap: 4px; }

/* ── Category list ──────────────────────────────────── */
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: box-shadow var(--transition);
}
.cat-item:hover { box-shadow: var(--shadow-sm); }
.cat-icon { font-size: 20px; width: 36px; text-align: center; }
.cat-name { flex: 1; font-weight: 500; font-size: 14px; }
.cat-meta { font-size: 12px; color: var(--text-3); }
.cat-actions { display: flex; gap: 4px; }

/* ── Login Page ─────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-visual {
  background: #0F0F0F;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-box { width: 100%; max-width: 380px; }
.login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.login-logo-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 20px; color: #fff;
}
.login-logo-name { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.login-heading  { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.login-sub      { color: var(--text-2); font-size: 14px; margin-bottom: 32px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-deco {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 24px;
}
.login-deco-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px;
  opacity: 0.06;
}
.login-deco-cell {
  width: 60px; height: 60px;
  border: 1px solid #fff;
  border-radius: 8px;
}
.login-quote {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  text-align: center;
  max-width: 260px;
  line-height: 1.6;
  z-index: 1;
}
.login-brand-big {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  color: rgba(255,255,255,0.06);
  position: absolute;
  bottom: 40px; right: 30px;
  letter-spacing: -3px;
}

/* ── Dashboard grid ─────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
@media (max-width: 768px) {
  .dash-grid { grid-template-columns: 1fr; }
}
.dash-qr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Responsive ─────────────────────────────────────── */

/* Overlay i errët kur sidebar është hapur në mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
  /* Sidebar — rrëshqet nga e majta */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 100;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }

  /* Main — pa margin pasi sidebar është overlay */
  .main-content { margin-left: 0 !important; }

  /* Hamburger i dukshëm */
  .sidebar-toggle { display: flex !important; }

  /* Topbar — pak më kompakt */
  .topbar { padding: 0 12px; gap: 4px; }
  .page-title { font-size: 16px; }

  /* Layout */
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }

  /* Tabela — scroll horizontal */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 500px; }

  /* Cards — padding më i vogël */
  .card-body { padding: 14px; }
  .modal { margin: 12px; max-height: calc(100vh - 24px); }
  .modal-body { max-height: 60vh; overflow-y: auto; }

  /* Section header — stack vertikalisht */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .section-header > div {
    width: 100%;
    flex-wrap: wrap;
  }

  /* Product/cat rows — hiq disa kolona */
  .prod-row { padding: 8px 10px; gap: 8px; }
  .cat-row  { padding: 8px 10px; gap: 8px; }

  /* Page body */
  .page-body { padding: 12px; }

  /* QR box */
  .qr-box img { width: 130px; height: 130px; }

  /* Dashboard grid — stack vertikalisht */
  .dash-grid { grid-template-columns: 1fr; }

  /* QR card body — stack vertikalisht */
  .qr-box { width: 100%; display:flex; flex-direction:column; align-items:center; }
  .dash-qr-actions { justify-content: flex-start; }
  .dash-qr-actions .btn-label { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 12px; }
  .stat-value { font-size: 24px; }
  .btn { font-size: 13px; }
}

/* ── Chart container ────────────────────────────────── */
.chart-wrap { position: relative; height: 240px; }

/* ── Subscription badge ─────────────────────────────── */
.plan-basic      { background: rgba(107,114,128,0.1); color: #6B7280; }
.plan-enterprise { background: rgba(139,92,246,0.1);  color: #8B5CF6; }
