/* ══════════════════════════════════════════
   LogiFlow - main.css
   CSS Variables, Reset, Base, Shared Components
   ══════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --primary:        #1a3c6e;
  --primary-dark:   #112951;
  --primary-light:  #2d5fa3;
  --secondary:      #f0a500;
  --success:        #17a464;
  --warning:        #e07b00;
  --danger:         #d93025;
  --info:           #0d7cc8;
  --bg-main:        #f4f6fb;
  --bg-surface:     #ffffff;
  --bg-sidebar:     #0f2544;
  --text-primary:   #1a1f36;
  --text-secondary: #4a5568;
  --text-muted:     #a0aec0;
  --text-invert:    #ffffff;
  --border:         #e2e8f0;
  --border-focus:   #2d5fa3;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.16);
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --transition:     .2s ease;
  --sidebar-w:      240px;
  --topbar-h:       64px;
  --font:           'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  direction: rtl;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Typography ── */
h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--text-secondary); }
small { font-size: .8rem; color: var(--text-muted); }

/* ── Utility: Flex ── */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* ── Utility: Spacing ── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-16  { padding: 16px; }
.p-24  { padding: 24px; }

/* ── Utility: Text ── */
.text-center  { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary-color { color: var(--primary); }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }

/* ══════════════════════════════════════════
   SHARED COMPONENTS
   ══════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); color: #fff; }

.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-main); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(.9); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.9); }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { filter: brightness(.9); }

.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover:not(:disabled) { background: rgba(26,60,110,.08); }

/* ── Inputs ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: .875rem; font-weight: 500; color: var(--text-secondary); }
.form-control {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(45,95,163,.15);
}
.form-control::placeholder { color: var(--text-muted); }
.form-error {
  font-size: .8rem;
  color: var(--danger);
  margin-top: 4px;
}

/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid var(--border);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 600; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-muted   { background: var(--bg-main); color: var(--text-muted); }
.badge-primary { background: #dbeafe; color: var(--primary); }

/* ── Status badges mapping ── */
.status-pending       { background: #fef3c7; color: #92400e; }
.status-confirmed     { background: #dbeafe; color: #1e40af; }
.status-assigned      { background: #e0e7ff; color: #3730a3; }
.status-shopping      { background: #fce7f3; color: #9d174d; }
.status-purchased     { background: #d1fae5; color: #065f46; }
.status-sorting       { background: #fef3c7; color: #92400e; }
.status-packing       { background: #fce7f3; color: #9d174d; }
.status-ready_for_ship { background: #d1fae5; color: #065f46; }
.status-shipped       { background: #dbeafe; color: #1e40af; }
.status-delivered     { background: #d1fae5; color: #065f46; }
.status-cancelled     { background: #fee2e2; color: #991b1b; }
.status-issue_raised  { background: #fee2e2; color: #991b1b; }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform var(--transition);
  box-shadow: var(--shadow-lg);
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-close {
  background: none; border: none;
  font-size: 1.4rem; color: var(--text-muted);
  transition: color var(--transition);
}
.modal-close:hover { color: var(--danger); }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.alert-danger  { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.alert-warning { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.alert-info    { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }

/* ── Toast Notifications ── */
#toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: all;
  animation: slideDown .3s ease;
  min-width: 280px;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }
.toast-info    { background: var(--info); color: #fff; }
@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Loading Spinner ── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-dark { border-color: rgba(26,60,110,.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.skeleton-text { height: 16px; width: 100%; }
.skeleton-title { height: 22px; width: 60%; }
.skeleton-card { height: 120px; width: 100%; border-radius: var(--radius-md); }

/* ── Empty State ── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: .5; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }

/* ══════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════ */

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; right: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo span {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.sidebar-logo i { color: var(--secondary); font-size: 1.3rem; }
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-user-name { font-size: .875rem; font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: .75rem; color: rgba(255,255,255,.5); }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  color: rgba(255,255,255,.7);
  font-size: .875rem;
  font-weight: 500;
  transition: all var(--transition);
  border-right: 3px solid transparent;
}
.sidebar-nav-item:hover,
.sidebar-nav-item.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-right-color: var(--secondary);
}
.sidebar-nav-item i { width: 18px; text-align: center; font-size: 1rem; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-footer .sidebar-nav-item { padding: 10px 0; }

/* ── Topbar ── */
.topbar {
  position: fixed;
  top: 0; left: 0;
  right: var(--sidebar-w);
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 1rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg-main);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: all var(--transition);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--border); color: var(--primary); }
.topbar-badge {
  position: absolute;
  top: -2px; left: -2px;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}

/* ── Main Content ── */
.main-content {
  margin-right: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-h));
}
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.5rem; margin-bottom: 4px; }
.page-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--text-muted);
}
.page-breadcrumb a { color: var(--text-muted); }
.page-breadcrumb a:hover { color: var(--primary); }
.page-breadcrumb .sep::before { content: '/'; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat-label { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.stat-change { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
.stat-icon.blue    { background: #dbeafe; color: var(--info); }
.stat-icon.green   { background: #d1fae5; color: var(--success); }
.stat-icon.yellow  { background: #fef3c7; color: var(--warning); }
.stat-icon.red     { background: #fee2e2; color: var(--danger); }

/* ── Tables ── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
thead { background: var(--bg-main); }
thead th {
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-main); }
tbody td { padding: 12px 16px; color: var(--text-primary); vertical-align: middle; }

/* ── Progress Bar ── */
.progress-track {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 20px 0;
}
.progress-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.progress-step::before {
  content: '';
  position: absolute;
  top: 14px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.progress-step:first-child::before { display: none; }
.progress-step.done::before { background: var(--success); }
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  z-index: 1;
  position: relative;
}
.progress-step.done .step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.progress-step.active .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-label { font-size: .7rem; color: var(--text-muted); margin-top: 6px; text-align: center; }
.progress-step.done .step-label,
.progress-step.active .step-label { color: var(--text-primary); font-weight: 500; }

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}
.page-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

/* ── Hidden utility ── */
.hidden { display: none !important; }

/* ── Sidebar Overlay (mobile) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
  cursor: pointer;
}
.sidebar-overlay.active { display: block; }

/* ── Burger Button ── */
.burger-btn {
  display: none;
  width: 38px; height: 38px;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1.15rem;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.burger-btn:hover { background: var(--bg-main); border-color: var(--primary); color: var(--primary); }

/* ── Header Balance Chips (desktop) ── */
.topbar-balance-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}
.balance-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.balance-chip.money { background: #d1fae5; color: #065f46; }
.balance-chip.points { background: #fef3c7; color: #92400e; }
.balance-chip i { font-size: .75rem; }

/* ── Input with icon ── */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-icon .form-control { padding-left: 42px; }
.input-with-icon .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: .9rem;
  pointer-events: none;
}

/* ── File Upload Zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-main);
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(26,60,110,.04);
}
.upload-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone i { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 10px; }
.upload-zone p { font-size: .875rem; color: var(--text-muted); margin: 0; }
.upload-zone .preview-img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin: 0 auto 8px;
  display: none;
}
.upload-zone.has-file .preview-img { display: block; }
.upload-zone.has-file .upload-placeholder { display: none; }

/* ── Payment Method Cards ── */
.payment-method-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.payment-method-card:hover { border-color: var(--primary-light); }
.payment-method-card.selected {
  border-color: var(--primary);
  background: rgba(26,60,110,.04);
}
.payment-method-card h4 { margin-bottom: 8px; font-size: .95rem; }

/* ── Wizard Steps ── */
.wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
.wizard-step {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-main);
  border-left: 1px solid var(--border);
  position: relative;
}
.wizard-step:last-child { border-left: none; }
.wizard-step.active {
  background: var(--primary);
  color: #fff;
}
.wizard-step.done {
  background: #d1fae5;
  color: #065f46;
}
.wizard-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.1);
  font-size: .75rem;
  margin-bottom: 4px;
}
.wizard-step.active .wizard-step-num { background: rgba(255,255,255,.25); }
.wizard-step.done .wizard-step-num { background: var(--success); color: #fff; }

/* ── Shop Select Cards ── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.shop-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
}
.shop-card:hover { border-color: var(--primary-light); }
.shop-card.selected { border-color: var(--primary); background: rgba(26,60,110,.05); }
.shop-card i { font-size: 1.5rem; color: var(--text-muted); margin-bottom: 6px; }
.shop-card.selected i { color: var(--primary); }
.shop-card p { font-size: .8rem; font-weight: 600; color: var(--text-primary); margin: 0; }

/* ── Product Item Row ── */
.product-item-row {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.product-item-row .remove-item-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
}

@media (max-width: 1023px) {
  :root { --sidebar-w: 200px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  :root { --sidebar-w: 0px; }

  .burger-btn { display: flex; }

  .sidebar {
    transform: translateX(100%);
    width: 260px;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }

  .topbar {
    right: 0;
    padding: 0 14px;
  }
  /* إخفاء شرائح الرصيد في الموبايل بأولوية عالية لمنع تجاوز inline style */
  .topbar-balance-chips { display: none !important; }

  /* تصغير عنوان الصفحة في الهيدر */
  .topbar-title { font-size: .82rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .main-content {
    margin-right: 0;
    padding: 14px;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-value { font-size: 1.3rem; }

  .modal { width: 95%; padding: 20px; }

  .wizard-steps { flex-direction: row; }
  .wizard-step { font-size: .7rem; padding: 10px 4px; }
  .wizard-step-label { display: none; }

  table { font-size: .8rem; }
  thead th, tbody td { padding: 8px 10px; }

  .shop-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.2rem; }
  .topbar-title { font-size: .78rem; max-width: 90px; }
  .wizard-steps { overflow-x: auto; }
}

