/* ═══════════════════════════════════════════════════════════
   Shelf Price Label System — Main CSS
   Font: Cairo (Arabic RTL), Direction: RTL
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
  --clr-primary:    #6366f1;
  --clr-primary-dk: #4f46e5;
  --clr-secondary:  #8b5cf6;
  --clr-accent:     #06b6d4;
  --clr-success:    #10b981;
  --clr-warning:    #f59e0b;
  --clr-danger:     #ef4444;
  --clr-bg:         #f1f5f9;
  --clr-card:       #ffffff;
  --clr-text:       #1e293b;
  --clr-text-2:     #475569;
  --clr-muted:      #94a3b8;
  --clr-border:     #e2e8f0;
  --sidebar-w:      260px;
  --sidebar-bg:     #1e1b4b;
  --sidebar-hover:  rgba(255,255,255,0.08);
  --sidebar-active: rgba(99,102,241,0.25);
  --topbar-h:       64px;
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:         0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 10px 40px rgba(0,0,0,.12);
  --transition:     0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Cairo', 'Segoe UI', sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  direction: rtl;
  min-height: 100vh;
  display: flex;
}

a { color: var(--clr-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--clr-primary-dk); }

img { max-width: 100%; }

input, select, textarea, button { font-family: inherit; }

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--clr-muted); }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; right: 0;
  z-index: 900;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
}

.brand-name {
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.3;
}

/* Nav */
.sidebar-nav { flex: 1; padding: 1rem .75rem; display: flex; flex-direction: column; gap: .15rem; overflow-y: auto; }

.nav-section-label {
  font-size: .7rem;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .75rem .5rem .25rem;
  margin-top: .5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .9rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  border-inline-start: 3px solid var(--clr-primary);
}

.nav-item i { width: 18px; text-align: center; font-size: 1rem; flex-shrink: 0; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}

.user-info { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; }

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .9rem;
  flex-shrink: 0;
}

.user-name { color: #fff; font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,.45); font-size: .75rem; }

.logout-btn {
  color: rgba(255,255,255,.5);
  font-size: 1.1rem;
  padding: .4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
}
.logout-btn:hover { color: var(--clr-danger); background: rgba(239,68,68,.15); }

/* ══════════════════════════════════════════════════════════
   MAIN WRAPPER
   ══════════════════════════════════════════════════════════ */
.main-wrapper {
  margin-right: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--clr-card);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0; z-index: 800;
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--clr-text-2); font-size: 1.2rem;
  padding: .4rem; border-radius: var(--radius-sm);
  display: none;
}
.sidebar-toggle:hover { background: var(--clr-bg); color: var(--clr-text); }

.topbar-title { font-weight: 700; font-size: 1.05rem; flex: 1; }

.topbar-right { display: flex; align-items: center; gap: 1rem; }

.topbar-date { color: var(--clr-muted); font-size: .85rem; }

/* ─── Main Content ───────────────────────────────────────── */
.main-content { padding: 1.75rem; flex: 1; }

/* ═══════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* ─── Page Header ───────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.page-title { font-size: 1.5rem; font-weight: 800; color: var(--clr-text); }
.page-subtitle { color: var(--clr-muted); font-size: .875rem; margin-top: .15rem; }

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--clr-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.card-header h3 { font-size: 1rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .5rem; }

.card-body { padding: 1.5rem; }
.card-filter { padding: .75rem 1rem; border-bottom: 1px solid var(--clr-border); background: var(--clr-bg); }
.p-0 { padding: 0 !important; }
.mt-3 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1.5rem;
  font-size: .9rem;
  font-weight: 500;
  border-inline-start: 4px solid;
}

.alert-success { background: #ecfdf5; color: #065f46; border-color: var(--clr-success); }
.alert-error   { background: #fef2f2; color: #991b1b; border-color: var(--clr-danger); }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: var(--clr-accent); }

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary  { background: var(--clr-primary); color: #fff; }
.btn-primary:hover { background: var(--clr-primary-dk); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.35); }

.btn-secondary { background: var(--clr-text-2); color: #fff; }
.btn-secondary:hover { background: var(--clr-text); color: #fff; }

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

.btn-ghost { color: var(--clr-text-2); background: transparent; }
.btn-ghost:hover { background: var(--clr-bg); color: var(--clr-text); }

.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: .35rem .85rem; font-size: .8rem; }
.btn-xs { padding: .2rem .6rem; font-size: .75rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-danger { background: var(--clr-danger); color: #fff; border-color: var(--clr-danger); }
.btn-danger:hover { background: #dc2626; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,.35); }

/* ─── Bulk Action Toolbar ─────────────────────────────────── */
.bulk-toolbar {
  display: none;
  align-items: center;
  gap: .75rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #fff;
  padding: .7rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: .75rem;
  animation: slideDown .25s ease;
  flex-wrap: wrap;
}
.bulk-toolbar.visible { display: flex; }

.bulk-info {
  flex: 1;
  font-size: .875rem;
  font-weight: 600;
}
.bulk-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.2);
  border-radius: 99px;
  min-width: 24px;
  height: 24px;
  padding: 0 .5rem;
  font-weight: 800;
  margin-left: .25rem;
}

/* ─── Checkbox Styling ───────────────────────────────────── */
.row-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--clr-primary);
}
.table tr.row-selected td { background: rgba(99,102,241,.06) !important; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}



/* ─── Action Icon Buttons ───────────────────────────────── */
.action-btns { display: flex; align-items: center; gap: .4rem; }

.btn-icon {
  width: 32px; height: 32px;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .875rem;
  transition: all var(--transition);
}

.btn-icon-edit    { background: #eff6ff; color: #3b82f6; }
.btn-icon-edit:hover    { background: #3b82f6; color: #fff; }
.btn-icon-delete  { background: #fef2f2; color: var(--clr-danger); }
.btn-icon-delete:hover  { background: var(--clr-danger); color: #fff; }
.btn-icon-warn    { background: #fffbeb; color: var(--clr-warning); }
.btn-icon-warn:hover    { background: var(--clr-warning); color: #fff; }
.btn-icon-success { background: #ecfdf5; color: var(--clr-success); }
.btn-icon-success:hover { background: var(--clr-success); color: #fff; }

/* ─── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-blue   { background: #eff6ff; color: #1d4ed8; }
.badge-purple { background: #f5f3ff; color: #7c3aed; }
.badge-green  { background: #ecfdf5; color: #065f46; }
.badge-red    { background: #fef2f2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-orange { background: #fffbeb; color: #92400e; }

/* ─── Tables ────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.table th {
  background: #f8fafc;
  color: var(--clr-text-2);
  font-weight: 700;
  padding: .85rem 1rem;
  text-align: right;
  border-bottom: 2px solid var(--clr-border);
  white-space: nowrap;
}

.table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text);
  vertical-align: middle;
}

.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }

.table-sm { width: 100%; border-collapse: collapse; font-size: .8rem; }
.table-sm th, .table-sm td { padding: .5rem .75rem; border: 1px solid var(--clr-border); }
.table-sm th { background: #f8fafc; font-weight: 700; }
.table-sm-wrap { overflow-x: auto; margin-top: .5rem; border-radius: var(--radius-sm); }

/* ─── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row .form-group { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: .4rem;
}

.form-control {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: inherit;
  color: var(--clr-text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  direction: rtl;
}

.form-control:focus {
  outline: none;
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.form-control.is-invalid { border-color: var(--clr-danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

.form-control-sm { padding: .4rem .7rem; font-size: .82rem; }

textarea.form-control { resize: vertical; min-height: 80px; }

.invalid-feedback { color: var(--clr-danger); font-size: .8rem; margin-top: .3rem; }
.text-muted { color: var(--clr-muted) !important; font-size: .8rem; }

.form-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--clr-border);
  margin-top: 1.5rem;
}

.required { color: var(--clr-danger); }

/* Input with icon */
.input-icon-wrap { position: relative; }
.input-icon-wrap .form-control { padding-inline-start: 2.5rem; }
.input-icon-btn {
  position: absolute;
  inset-inline-start: .6rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--clr-muted); font-size: 1rem;
  transition: color var(--transition);
}
.input-icon-btn:hover { color: var(--clr-text); }

/* ─── Filter Bar ─────────────────────────────────────────── */
.filter-bar {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.filter-group { display: flex; flex-direction: column; gap: .3rem; }
.filter-group label { font-size: .78rem; font-weight: 700; color: var(--clr-text-2); }
.filter-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.search-wrap { position: relative; }

/* ─── Stats Grid ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--clr-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  transition: transform var(--transition), box-shadow var(--transition);
  border-top: 3px solid var(--clr);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-icon {
  width: 48px; height: 48px;
  background: color-mix(in srgb, var(--clr) 12%, transparent);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  color: var(--clr);
  flex-shrink: 0;
}

.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { color: var(--clr-muted); font-size: .8rem; margin-top: .2rem; }

/* ─── Quick Actions ──────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.quick-card {
  background: var(--clr-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  display: flex; flex-direction: column; align-items: center;
  gap: .75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  transition: all var(--transition);
}

.quick-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--clr-text); }

.quick-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
}

.quick-label { font-weight: 700; font-size: .85rem; }

/* ─── Section Title ──────────────────────────────────────── */
.section-title {
  font-size: 1rem; font-weight: 800;
  color: var(--clr-text);
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--clr-border);
}

/* ─── Company/User Avatars ───────────────────────────────── */
.company-avatar, .user-avatar-sm {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .85rem;
  flex-shrink: 0;
}

.company-logo-sm {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--clr-border);
}

.logo-preview {
  max-height: 80px; max-width: 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--clr-border);
  padding: .25rem;
}

.group-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem;
}

/* ─── Price Cells ───────────────────────────────────────── */
.price-cell { font-weight: 700; font-size: .95rem; }
.price-discount { color: var(--clr-danger); font-weight: 700; }

/* ─── File Upload ───────────────────────────────────────── */
.file-upload-area {
  border: 2px dashed var(--clr-border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  background: #fafbfc;
}

.file-upload-area:hover, .file-upload-area.dragging {
  border-color: var(--clr-primary);
  background: rgba(99,102,241,.03);
}

.file-upload-input {
  position: absolute; inset: 0; opacity: 0;
  cursor: pointer; width: 100%; height: 100%;
}

.file-upload-icon { font-size: 2.5rem; color: var(--clr-primary); margin-bottom: .5rem; display: block; }
.file-upload-area p { color: var(--clr-text-2); }
.file-upload-area .link { color: var(--clr-primary); font-weight: 600; }
.file-upload-area small { color: var(--clr-muted); }

.file-upload-selected {
  display: flex; align-items: center; gap: .75rem;
  color: var(--clr-success); font-weight: 600;
}
.file-upload-selected i { font-size: 1.5rem; }

/* ─── Info Box ───────────────────────────────────────────── */
.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.info-box h4 { font-size: .9rem; color: #1e40af; margin-bottom: .5rem; }
.info-box p  { font-size: .85rem; color: #1e40af; }
.info-box code { background: rgba(30,64,175,.1); padding: .1rem .35rem; border-radius: 3px; font-size: .8rem; }

/* ═══════════════════════════════════════════════════════════
   LABEL SELECTION PAGE
   ═══════════════════════════════════════════════════════════ */
.labels-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.25rem;
  align-items: start;
}

/* Product List */
.product-list {
  max-height: 60vh;
  overflow-y: auto;
  border-top: 1px solid var(--clr-border);
}

.product-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  cursor: pointer;
  transition: background var(--transition);
}

.product-item:hover { background: #f8fafc; }
.product-item:has(.product-cb:checked) { background: #eff8ff; }

.product-item input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--clr-primary);
  cursor: pointer; flex-shrink: 0;
}

.product-item-info { flex: 1; min-width: 0; }
.product-item-name { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-item-meta { display: flex; align-items: center; gap: .4rem; margin-top: .2rem; font-size: .78rem; color: var(--clr-muted); }

.product-item-price { text-align: start; flex-shrink: 0; font-size: .82rem; }
.price-old { text-decoration: line-through; color: var(--clr-muted); display: block; }
.price-new { color: var(--clr-danger); font-weight: 800; font-size: 1rem; display: block; }
.price-normal { color: var(--clr-primary); font-weight: 800; font-size: 1rem; display: block; }

.select-all-row { display: flex; gap: .5rem; margin-top: .5rem; }

/* Template Options */
.template-options { display: flex; flex-direction: column; gap: .75rem; }

.template-option {
  display: block; cursor: pointer;
}

.template-option input { display: none; }

.template-preview {
  border-radius: var(--radius);
  padding: .75rem 1rem;
  min-height: 80px;
  display: flex; flex-direction: column; justify-content: center;
  border: 2px solid transparent;
  transition: all var(--transition);
  position: relative; overflow: hidden;
}

.template-option input:checked + .template-preview {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* Preview — Classic */
.template-classic {
  background: #fff; border-color: var(--clr-border);
}
.template-classic .tpl-name-demo { font-size: .75rem; font-weight: 600; color: #475569; }
.template-classic .tpl-price-demo { font-size: 1.6rem; font-weight: 900; color: var(--clr-primary); }

/* Preview — Discount */
.template-discount {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
}
.template-discount .tpl-name-demo { font-size: .75rem; font-weight: 600; }
.template-discount .tpl-price-demo { text-decoration: line-through; opacity: .7; font-size: .85rem; }
.template-discount .tpl-discount-demo { font-size: 1.6rem; font-weight: 900; }

/* Preview — Premium */
.template-premium {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #ffd700;
}
.template-premium .tpl-name-demo { font-size: .75rem; color: rgba(255,255,255,.8); }
.template-premium .tpl-price-demo { font-size: 1.6rem; font-weight: 900; color: #ffd700; }

.template-label { font-weight: 700; font-size: .9rem; margin-top: .4rem; }
.template-desc  { font-size: .78rem; color: var(--clr-muted); }

/* ═══════════════════════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════════════════════ */
body.auth-body {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
  min-height: 100vh;
}

.auth-container { position: relative; width: 100%; padding: 1rem; display: flex; justify-content: center; }

.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
  animation: slideUp .4s ease;
}

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

.auth-logo { text-align: center; margin-bottom: 2rem; }

.auth-logo-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
}

.auth-logo h1 { font-size: 1.3rem; font-weight: 800; color: var(--clr-text); }
.auth-logo p  { color: var(--clr-muted); font-size: .85rem; margin-top: .25rem; }

.auth-form .form-group { margin-bottom: 1.1rem; }

.auth-hint {
  text-align: center;
  margin-top: 1.25rem;
  color: var(--clr-muted);
  font-size: .78rem;
  padding: .5rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}

/* BG Shapes */
.auth-bg-shapes { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.shape {
  position: absolute; border-radius: 50%;
  opacity: .12; background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
}
.shape-1 { width: 400px; height: 400px; top: -150px; right: -100px; }
.shape-2 { width: 300px; height: 300px; bottom: -100px; left: -80px; animation: float 6s ease-in-out infinite; }
.shape-3 { width: 200px; height: 200px; bottom: 30%; right: 5%; animation: float 8s ease-in-out infinite reverse; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-20px); }
}

/* ═══════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════ */
.d-flex          { display: flex; }
.d-inline        { display: inline; }
.align-items-center { align-items: center; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; }
.flex-wrap { flex-wrap: wrap; }
.text-center { text-align: center !important; }
.text-muted  { color: var(--clr-muted); }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.p-4  { padding: 1.5rem; }
.mb-2 { margin-bottom: .5rem; }
.mt-2 { margin-top: .5rem; }
.fw-bold { font-weight: 700; }
code { background: #f1f5f9; padding: .1rem .4rem; border-radius: 4px; font-size: .8rem; color: #7c3aed; }

/* ─── Sidebar Overlay (mobile) ───────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 850;
  background: rgba(0,0,0,.5);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }
  .main-wrapper { margin-right: 0; }
  .sidebar-toggle { display: flex !important; }
  .labels-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .main-content { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .table { font-size: .8rem; }
  .table th, .table td { padding: .6rem .75rem; }
}
