/* ==========================================================================
   تسویه | استایل اصلی — تم سفید و نارنجی
   ========================================================================== */

:root {
  --primary: #FF6B1A;
  --primary-dark: #E55A0F;
  --primary-darker: #C24A08;
  --primary-light: #FFE8D6;
  --primary-lighter: #FFF4EC;
  --white: #FFFFFF;
  --bg: #FAFAFA;
  --text: #2D2D2D;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --success: #10B981;
  --success-light: #D1FAE5;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  --shadow: 0 2px 8px rgba(255,107,26,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 250px;
  --header-h: 62px;
  --transition: all .2s ease;
}

/* ---------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Vazirmatn', 'IRANSans', Tahoma, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-dark); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-darker); }
img { max-width: 100%; }
h1,h2,h3,h4,h5,h6 { margin: 0 0 .5rem; font-weight: 700; line-height: 1.5; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2rem 0; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #f6c9a8; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ---------------------------------------------------------------- Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-inline-end: 1px solid var(--border);
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  overflow-y: auto;
  z-index: 900;
  transition: transform .25s ease;
}
.main {
  flex: 1;
  margin-inline-start: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 800;
}
.content { padding: 22px; flex: 1; }
.footer-app {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

/* Sidebar brand */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 800;
  box-shadow: var(--shadow);
}
.brand-name { font-size: 17px; font-weight: 800; color: var(--text); }
.brand-sub { font-size: 11px; color: var(--text-muted); display: block; line-height: 1.4; }

/* Sidebar nav */
.nav { padding: 10px 10px 30px; }
.nav-title {
  font-size: 11px; color: var(--text-muted); padding: 14px 12px 6px;
  letter-spacing: .3px; font-weight: 700;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: #4b5563; font-size: 13.5px; font-weight: 500;
}
.nav a .ico { width: 20px; text-align: center; font-size: 15px; opacity: .85; }
.nav a:hover { background: var(--primary-lighter); color: var(--primary-dark); }
.nav a.active {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: var(--shadow);
}
.nav a.active .ico { opacity: 1; }
.nav a .badge-count {
  margin-inline-start: auto; background: var(--danger); color: #fff;
  font-size: 10px; padding: 1px 7px; border-radius: 20px;
}
.nav a.active .badge-count { background: rgba(255,255,255,.28); }

/* Topbar */
.topbar-title { font-size: 16px; font-weight: 700; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.topbar-search { position: relative; }
.topbar-search input {
  width: 230px; border: 1px solid var(--border); border-radius: 30px;
  padding: 7px 36px 7px 14px; font-family: inherit; font-size: 13px; background: var(--bg);
}
.topbar-search input:focus { outline: none; border-color: var(--primary); background: #fff; }
.topbar-search .search-ico { position: absolute; inset-inline-start: 12px; top: 7px; color: var(--text-muted); }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  border: 1px solid var(--border); border-radius: 30px; background: #fff; cursor: pointer;
  position: relative;
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.dropdown-menu {
  position: absolute; top: 46px; inset-inline-end: 0; min-width: 190px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 6px; display: none; z-index: 950;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text); }
.dropdown-menu a:hover { background: var(--primary-lighter); color: var(--primary-dark); }
.dropdown-menu hr { margin: 5px 0; }
.sidebar-toggle {
  display: none; background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--text);
}
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 850;
}
.overlay.show { display: block; }

/* ---------------------------------------------------------------- Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(180deg,#fff,#fffaf6);
}
.card-header h3 { margin: 0; font-size: 15px; }
.card-header .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: #fcfcfc; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); transition: var(--transition);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  font-size: 22px; background: var(--primary-light); color: var(--primary-dark); flex-shrink: 0;
}
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.red   { background: var(--danger-light);  color: var(--danger); }
.stat-icon.blue  { background: var(--info-light);    color: var(--info); }
.stat-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-label { color: var(--text-muted); font-size: 12.5px; }
.stat-value { font-size: 20px; font-weight: 800; line-height: 1.4; }
.stat-foot { font-size: 11.5px; color: var(--text-muted); }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: var(--transition); white-space: nowrap; text-align: center;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg,var(--primary),var(--primary-dark)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg,var(--primary-dark),var(--primary-darker)); color: #fff; }
.btn-outline { background: #fff; border-color: var(--primary); color: var(--primary-dark); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #f3f4f6; color: var(--text); }
.btn-light { background: var(--primary-lighter); color: var(--primary-dark); border-color: var(--primary-light); }
.btn-light:hover { background: var(--primary-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-white { background: #fff; color: var(--primary-dark); border-color: rgba(255,255,255,.6); }
.btn-white:hover { background: var(--primary-lighter); color: var(--primary-darker); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 7px 9px; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; color: #374151; }
.form-group label .req { color: var(--danger); }
.form-control, input[type=text], input[type=number], input[type=password], input[type=email],
input[type=tel], input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; color: var(--text); background: #fff;
  transition: var(--transition);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,107,26,.13);
}
input[type=number] { direction: ltr; text-align: right; }
textarea { min-height: 90px; resize: vertical; }
.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .addon {
  padding: 9px 12px; background: var(--primary-lighter); border: 1px solid var(--border);
  border-inline-start: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted); font-size: 12.5px; white-space: nowrap;
}
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.checkbox, .radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.checkbox input, .radio input { width: auto; accent-color: var(--primary); }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 150px; flex: 1; }

/* ---------------------------------------------------------------- Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.table th, table.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: middle; }
table.table th {
  background: var(--primary-lighter); color: var(--primary-darker); font-weight: 700;
  font-size: 12.5px; white-space: nowrap; position: sticky; top: 0;
}
table.table tbody tr:hover { background: #fffaf6; }
table.table tbody tr:nth-child(even) { background: #fdfdfd; }
table.table tbody tr:nth-child(even):hover { background: #fffaf6; }
table.table td .actions-cell { display: flex; gap: 5px; }
table.table.compact th, table.table.compact td { padding: 7px 9px; font-size: 12.5px; }
.table-empty { text-align: center; padding: 40px 10px; color: var(--text-muted); }
.table-empty .ico { font-size: 40px; display: block; margin-bottom: 8px; opacity: .4; }

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: var(--success-light); color: #047857; }
.badge-danger  { background: var(--danger-light);  color: #B91C1C; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-info    { background: var(--info-light);    color: #1D4ED8; }
.badge-muted   { background: #F3F4F6;              color: #4B5563; }
.badge-primary { background: var(--primary-light); color: var(--primary-darker); }

/* ---------------------------------------------------------------- Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 13.5px; border: 1px solid transparent; }
.alert-success { background: var(--success-light); color: #065F46; border-color: #A7F3D0; }
.alert-danger  { background: var(--danger-light);  color: #991B1B; border-color: #FECACA; }
.alert-warning { background: var(--warning-light); color: #92400E; border-color: #FDE68A; }
.alert-info    { background: var(--primary-lighter); color: var(--primary-darker); border-color: var(--primary-light); }
.license-banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 18px;
  font-size: 13px; font-weight: 600;
}
.license-banner--warning { background: var(--warning-light); color: #92400E; }
.license-banner--danger  { background: var(--danger-light);  color: #991B1B; }
.license-banner .btn { margin-inline-start: auto; }

/* ---------------------------------------------------------------- Toast */
#toast-container { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 3000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 250px; max-width: 360px; padding: 12px 16px; border-radius: var(--radius-sm);
  color: #fff; font-size: 13px; box-shadow: var(--shadow-md);
  animation: slideIn .25s ease; display: flex; gap: 8px; align-items: center;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info    { background: var(--info); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(17,24,39,.55); z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: 18px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: pop .2s ease;
}
.modal.lg { max-width: 860px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-header h3 { margin: 0; font-size: 15px; }
.modal-close { margin-inline-start: auto; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ---------------------------------------------------------------- Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px; cursor: pointer; font-weight: 600; font-size: 13.5px;
  color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab:hover { color: var(--primary-dark); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---------------------------------------------------------------- Auth pages */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg,#fff8f2 0%,#fff 50%,#ffefe4 100%);
}
.auth-card {
  width: 100%; max-width: 440px; background: #fff; border-radius: 18px;
  box-shadow: 0 12px 40px rgba(255,107,26,.14); border: 1px solid var(--primary-light);
  padding: 32px 28px;
}
.auth-card.wide { max-width: 680px; }
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo .brand-logo { width: 58px; height: 58px; font-size: 28px; margin: 0 auto 10px; border-radius: 16px; }
.auth-logo h1 { font-size: 22px; color: var(--primary-dark); margin-bottom: 2px; }
.auth-logo p { color: var(--text-muted); font-size: 13px; margin: 0; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-muted); }

/* ---------------------------------------------------------------- Plans */
.plans { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 16px; }
.plan {
  background: #fff; border: 2px solid var(--border); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; position: relative; transition: var(--transition);
}
.plan:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.plan.featured { border-color: var(--primary); background: linear-gradient(180deg,#fff,#fff6ef); }
.plan .ribbon {
  position: absolute; top: -12px; inset-inline-start: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 11px; padding: 3px 14px; border-radius: 20px; font-weight: 700;
}
.plan h3 { color: var(--primary-dark); margin-bottom: 6px; }
.plan .price { font-size: 24px; font-weight: 800; color: var(--text); }
.plan .old-price { text-decoration: line-through; color: var(--text-muted); font-size: 13px; font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 14px 0; text-align: right; }
.plan ul li { padding: 5px 0; font-size: 12.5px; color: #4b5563; border-bottom: 1px dashed var(--border); }
.plan ul li::before { content: '✓ '; color: var(--success); font-weight: 700; }

/* ---------------------------------------------------------------- Invoice builder */
.invoice-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.product-search { position: relative; flex: 1; min-width: 260px; }
.product-search input { padding-inline-start: 38px; }
.autocomplete {
  position: absolute; top: calc(100% + 4px); inset-inline: 0; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  max-height: 330px; overflow-y: auto; z-index: 400; display: none;
}
.autocomplete.show { display: block; }
.autocomplete-item { padding: 9px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #f3f4f6; }
.autocomplete-item:hover, .autocomplete-item.selected { background: var(--primary-lighter); }
.autocomplete-item .p-name { font-weight: 600; font-size: 13px; }
.autocomplete-item .p-meta { font-size: 11.5px; color: var(--text-muted); }
.autocomplete-item .p-price { margin-inline-start: auto; font-weight: 700; color: var(--primary-dark); font-size: 12.5px; }
.autocomplete-item .p-thumb { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; background: #f3f4f6; }

table.invoice-items input, table.invoice-items select { padding: 6px 8px; font-size: 12.5px; }
table.invoice-items .qty-cell { width: 110px; }
table.invoice-items .price-cell { width: 130px; }
table.invoice-items .row-total { font-weight: 700; white-space: nowrap; }
.remove-row { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: 17px; }

.invoice-summary { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.summary-box { background: var(--primary-lighter); border: 1px solid var(--primary-light); border-radius: var(--radius); padding: 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; border-bottom: 1px dashed var(--primary-light); }
.summary-row.total { font-size: 17px; font-weight: 800; color: var(--primary-darker); border: 0; padding-top: 12px; }
.combo-unit { display: flex; gap: 4px; align-items: center; }
.combo-unit input { width: 58px; text-align: center; }

@media (max-width: 900px) { .invoice-summary { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Barcode / Voice */
.scanner-box {
  position: relative; width: 100%; max-width: 460px; margin: 0 auto;
  border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4/3;
}
.scanner-box video, .scanner-box canvas, .scanner-box .drawingBuffer { width: 100%; height: 100%; object-fit: cover; }
.scanner-guide {
  position: absolute; inset: 18% 12%; border: 2px dashed rgba(255,255,255,.85);
  border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0,0,0,.35);
}
.scanner-line { position: absolute; inset-inline: 0; height: 2px; background: var(--primary); animation: scanline 2s linear infinite; }
@keyframes scanline { 0% { top: 18%; } 50% { top: 80%; } 100% { top: 18%; } }

.voice-box { text-align: center; padding: 20px 0; }
.mic-btn {
  width: 110px; height: 110px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg,var(--primary),var(--primary-dark)); color: #fff;
  font-size: 42px; box-shadow: 0 8px 24px rgba(255,107,26,.4); transition: var(--transition);
}
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.recording { background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  70% { box-shadow: 0 0 0 24px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.voice-text {
  background: #fff; border: 1px dashed var(--primary); border-radius: var(--radius);
  padding: 14px; min-height: 70px; margin-top: 16px; font-size: 14px; text-align: right;
}
.voice-items { margin-top: 14px; }
.voice-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 7px;
}
.voice-item.unmatched { border-color: var(--warning); background: var(--warning-light); }
.voice-item input { width: 80px; text-align: center; }

/* ---------------------------------------------------------------- Labels */
.labels-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 10px; }
.label-card {
  border: 1px dashed var(--border); border-radius: 8px; padding: 10px; text-align: center;
  background: #fff; page-break-inside: avoid;
}
.label-card .l-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.label-card .l-price { font-size: 14px; font-weight: 800; color: var(--primary-dark); }
.label-card .l-code { font-size: 11px; letter-spacing: 1px; direction: ltr; }
.label-card svg { max-width: 100%; height: 52px; }

/* ---------------------------------------------------------------- Misc */
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary-dark); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-end { text-align: left; }
.fw-bold { font-weight: 700; }
.fs-sm { font-size: 12px; }
.fs-lg { font-size: 17px; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.p-0{padding:0}.p-2{padding:16px}
.d-flex{display:flex}.gap-1{gap:8px}.gap-2{gap:16px}
.align-center{align-items:center}.justify-between{justify-content:space-between}
.flex-wrap{flex-wrap:wrap}
.w-100{width:100%}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
@media(max-width:860px){.grid-2,.grid-3{grid-template-columns:1fr}}
.hidden{display:none !important}
.pagination { display: flex; gap: 5px; justify-content: center; padding: 14px 0; flex-wrap: wrap; }
.page-link {
  min-width: 34px; height: 34px; display: grid; place-items: center; padding: 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: #fff;
}
.page-link:hover { border-color: var(--primary); color: var(--primary-dark); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .45; pointer-events: none; }
.progress { height: 8px; background: #f1f1f1; border-radius: 10px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg,var(--primary),var(--primary-dark)); }
.avatar-lg { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary-light); }
.chart-box { position: relative; height: 300px; }
.kbd {
  display: inline-block; padding: 1px 7px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; background: #f9fafb; font-size: 11px; font-family: monospace; direction: ltr;
}
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state .ico { font-size: 52px; opacity: .35; display: block; margin-bottom: 10px; }
.spinner {
  width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.6); z-index: 4000; display: none; place-items: center; }
.loader-overlay.show { display: grid; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 992px) {
  .sidebar { transform: translateX(100%); box-shadow: var(--shadow-md); }
  body.rtl .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-inline-start: 0; }
  .sidebar-toggle { display: block; }
  .topbar-search input { width: 150px; }
  .content { padding: 14px; }
}
@media (max-width: 600px) {
  .topbar-search { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 22px 16px; }
}
