/* ===== Bioplus QR Platform — App Styles ===== */
:root {
  /* ── Brand ──────────────────────────────── */
  --primary:        #0056A6;
  --primary-hover:  #004080;
  --secondary:      #0B7CC1;
  --teal:           #00A6B2;
  --success:        #3CB371;
  --gradient:       linear-gradient(135deg, #0056A6 0%, #00A6B2 100%);

  /* ── Layout ─────────────────────────────── */
  --sidebar-width:  260px;
  --sidebar-bg:     #162030;
  --sidebar-text:   rgba(255,255,255,.82);
  --sidebar-active: #0056A6;
  --topbar-height:  60px;

  /* ── UI tokens ──────────────────────────── */
  --accent:         #0056A6;
  --accent-light:   #dbeeff;
  --card-radius:    12px;

  /* ── Surfaces ───────────────────────────── */
  --bg-page:        #F8FAFC;
  --bg-card:        #FFFFFF;
  --text-primary:   #1F2D3D;
  --text-secondary: #6B7280;
  --border:         #E5E7EB;
}

/* ── Reset / Base ─────────────────────────── */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
}

/* ── Layout shell ─────────────────────────── */
.admin-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1040;
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
}

/* ── Sidebar brand ────────────────────────── */
.sidebar-brand {
  background: var(--gradient);
  padding: 20px 16px;
  flex-shrink: 0;
}

.brand-name  { color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.brand-version { color: rgba(255,255,255,.65); font-size: 11px; }
.brand-icon  { color: #fff; }

/* ── Sidebar nav ─────────────────────────── */
.sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  transition: background .15s, color .15s;
  margin-bottom: 2px;
}
.sidebar .nav-link:hover  { background: rgba(255,255,255,.09); color: #fff; }
.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}
.sidebar .nav-link.active i { opacity: 1; }

.sidebar-section-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.38);
  font-weight: 700;
  padding: 14px 14px 4px;
}

/* ── Sidebar user footer ──────────────────── */
.sidebar-user { background: rgba(255,255,255,.06); border-radius: 10px; }

.avatar-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Topbar ──────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.topbar .page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.2px;
}

/* ── Page content ────────────────────────── */
.page-content { padding: 24px; flex: 1; }

/* ── Stat Cards ──────────────────────────── */
.stat-card {
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 20px;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover {
  box-shadow: 0 6px 24px rgba(0,86,166,.10);
  transform: translateY(-1px);
}
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}
.stat-card .stat-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Cards ───────────────────────────────── */
.card {
  border-radius: var(--card-radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: none;
}
.card-header {
  background: var(--bg-card);
  border-bottom: 1px solid #f0f2f5;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-primary);
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
}

/* ── Tables ──────────────────────────────── */
.table { font-size: 13.5px; }
.table th {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.table-light { --bs-table-bg: #f8fafc; }

/* ── Badges ──────────────────────────────── */
.badge { font-weight: 600; font-size: 11px; }

/* ── Buttons ─────────────────────────────── */
.btn { font-size: 13px; font-weight: 600; border-radius: 8px; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Forms ───────────────────────────────── */
.form-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.form-control, .form-select {
  font-size: 13.5px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,86,166,.12);
}
.form-text { font-size: 12px; color: var(--text-secondary); }

/* ── QR Preview ──────────────────────────── */
.qr-preview-box {
  width: 200px; height: 200px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc;
}
.qr-preview-box img { max-width: 180px; max-height: 180px; border-radius: 8px; }

/* ── QR thumbnail in list ────────────────── */
.qr-thumb {
  width: 56px; height: 56px;
  border-radius: 6px;
  border: 1px solid var(--border);
  object-fit: contain;
  background: #fff;
}

/* ── Product image ───────────────────────── */
.product-img {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
}

/* ── Color picker ────────────────────────── */
.color-picker-group { display: flex; align-items: center; gap: 8px; }
.color-picker-group input[type="color"] {
  width: 40px; height: 38px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  cursor: pointer; padding: 2px;
}

/* ── Tag pills ───────────────────────────── */
.tag-pill {
  display: inline-block;
  background: var(--accent-light);
  color: var(--primary);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px; font-weight: 600;
  margin: 2px;
}

/* ── Login ───────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 30px 60px rgba(0,0,0,.25);
}
.login-logo {
  width: 64px; height: 64px;
  background: var(--gradient);
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Chart wrapper ───────────────────────── */
.chart-wrapper { position: relative; height: 280px; }

/* ── Activity feed ───────────────────────── */
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #f3f4f6;
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}

/* ── Scrollbar ───────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

/* ── Mobile sidebar ──────────────────────── */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1039;
  }
  .sidebar-overlay.show { display: block; }
}
