/* =========================================================
   Azrar Sanitaire — Stock Manager
   Modern responsive design system
   ========================================================= */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; color: var(--text); }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }

/* ---------- Design tokens ---------- */
:root {
  --bg: #f5f6fa;
  --bg-pattern: radial-gradient(circle at 1px 1px, rgba(79, 70, 229, .045) 1px, transparent 0);
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #f8fafc;
  --border: #e8ecf2;
  --border-strong: #cbd5e1;
  --text: #0b1020;
  --text-muted: #5b6577;
  --text-soft: #94a3b8;

  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --primary-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --success: #10b981;
  --success-2: #059669;
  --success-soft: #d1fae5;
  --success-grad: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);

  --warning: #f59e0b;
  --warning-2: #d97706;
  --warning-soft: #fef3c7;
  --warning-grad: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-soft: #fee2e2;
  --danger-grad: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);

  --info-grad: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);

  --radius-sm: 10px;
  --radius:    14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow:    0 1px 3px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, .12);
  --ring: 0 0 0 4px rgba(99, 102, 241, .15);

  --sidebar-w: 260px;
  --topbar-h:  68px;

  --transition: 200ms cubic-bezier(.4, 0, .2, 1);
}

body { background-image: var(--bg-pattern); background-size: 24px 24px; }

/* ---------- App layout ---------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #0b1226 0%, #111a35 100%);
  border-right: 1px solid #1e2a4a;
  display: flex;
  flex-direction: column;
  z-index: 30;
  color: #cbd5e1;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--topbar-h);
  padding: 12px 16px;
  border-bottom: 1px solid #1e2a4a;
  position: relative;
}
.sidebar__brand::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,.4) 50%, transparent);
}
.sidebar__brand img {
  max-height: 40px;
  width: auto;
  transition: transform var(--transition);
  filter: brightness(0) invert(1);
}
.sidebar__brand:hover img { transform: scale(1.05); }

.sidebar__nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-weight: 500;
  font-size: .9rem;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover {
  background: rgba(255, 255, 255, .05);
  color: #f1f5f9;
  transform: translateX(2px);
}
.nav-item--active {
  background: linear-gradient(135deg, rgba(99, 102, 241, .22), rgba(139, 92, 246, .18));
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .25);
}
.nav-item--active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--primary-grad);
  border-radius: 0 4px 4px 0;
}
.nav-item--active .nav-icon { color: #ffffff; }
.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #64748b;
  transition: color var(--transition), transform var(--transition);
}
.nav-item:hover .nav-icon { color: #f1f5f9; }
.nav-item--active .nav-icon { transform: scale(1.05); color: #ffffff; }

.sidebar__footer {
  padding: 16px;
  border-top: 1px solid #1e2a4a;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: rgba(255, 255, 255, .03);
}
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}
.user-info { min-width: 0; }
.user-name {
  font-weight: 600;
  font-size: .85rem;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: .75rem;
  color: #94a3b8;
}
.sidebar .btn--ghost {
  color: #94a3b8;
  background: rgba(255, 255, 255, .04);
}
.sidebar .btn--ghost:hover {
  background: rgba(255, 255, 255, .08);
  color: #f1f5f9;
}

/* ---------- Main + topbar ---------- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  z-index: 20;
}
.topbar__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  flex: 1;
  min-width: 0;
  background: linear-gradient(135deg, var(--text) 0%, #475569 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar__toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px;
  flex-direction: column;
  justify-content: space-around;
}
.topbar__toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.content {
  padding: 28px;
  max-width: 100%;
  animation: fadeInUp .35s var(--transition);
}
@media (min-width: 1280px) {
  .content { padding: 36px 44px; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-3) 100%);
}
.card__title { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.card__subtitle { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }
.card__body { padding: 24px; }
.card__body--flush { padding: 0; }

/* ---------- Stat cards ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--primary-grad);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: transparent;
}
.stat:hover::before { opacity: 1; }
.stat__main { min-width: 0; flex: 1; }
.stat__label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.stat__value {
  font-size: 1.85rem;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text);
  letter-spacing: -.02em;
  line-height: 1.1;
}
.stat__hint {
  font-size: .75rem;
  color: var(--text-soft);
  margin-top: 4px;
}
.stat__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
}
.stat__icon svg { width: 22px !important; height: 22px !important; display: block; }
.stat__icon--primary { background: var(--primary-grad); }
.stat__icon--success { background: var(--success-grad); }
.stat__icon--warning { background: var(--warning-grad); }
.stat__icon--danger  { background: var(--danger-grad); }
.stat__icon--info    { background: var(--info-grad); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
  cursor: pointer;
}
.btn:hover { background: var(--border); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn--primary {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35);
}
.btn--primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(99, 102, 241, .42);
  transform: translateY(-1px);
}
.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger {
  background: var(--danger-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(239, 68, 68, .28);
}
.btn--danger:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(239, 68, 68, .35);
  transform: translateY(-1px);
}
.btn--sm { padding: 6px 12px; font-size: .8rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 8px; }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--full { grid-column: 1 / -1; }
.form-label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
}
.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
}
.input,
.select,
input[type="text"].input,
input[type="number"].input,
input[type="password"].input,
input[type="date"].input,
select.input,
textarea.input {
  width: 100%;
  padding: 10px 14px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus,
.select:focus,
input.input:focus,
select.input:focus,
textarea.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.input[readonly] {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.form-actions .btn { min-width: 120px; }

/* select2 — match the design */
.select2-container--default .select2-selection--single {
  height: 40px !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm) !important;
  display: flex;
  align-items: center;
  padding: 0 6px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px !important;
  color: var(--text) !important;
  padding-left: 8px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px !important; }
.select2-dropdown {
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary) !important;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 600px;
}
.table thead th {
  text-align: left;
  padding: 14px 20px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.table thead th:not(.no-sort) {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}
.table thead th:not(.no-sort):hover { color: var(--text); }
.table thead th:not(.no-sort)::after {
  content: '⇅';
  margin-left: 6px;
  opacity: .35;
  font-size: .85em;
  font-weight: 400;
}
.table thead th[data-sort="asc"]::after  { content: '↑'; opacity: 1; color: var(--primary); }
.table thead th[data-sort="desc"]::after { content: '↓'; opacity: 1; color: var(--primary); }
.table tbody td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:nth-child(even) { background: rgba(241, 245, 249, .35); }
.table tbody tr:hover { background: var(--primary-soft); }
.table tfoot td {
  padding: 14px 20px;
  font-weight: 600;
  background: var(--surface-2);
  border-top: 2px solid var(--border);
}
.table .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state h3 {
  color: var(--text);
  margin-bottom: 6px;
}

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 1px solid transparent;
}
.badge--admin   { background: var(--primary-soft); color: var(--primary); border-color: rgba(99, 102, 241, .2); }
.badge--normal  { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
.badge--success { background: var(--success-soft); color: #047857; border-color: rgba(16, 185, 129, .25); }
.badge--success::before { content: "●"; font-size: .7em; color: var(--success); }
.badge--warning { background: var(--warning-soft); color: #b45309; border-color: rgba(245, 158, 11, .25); }
.badge--danger  { background: var(--danger-soft); color: #b91c1c; border-color: rgba(239, 68, 68, .25); }

/* ---------- Page header ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-head h2 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.page-head__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Toolbar (search + actions) ---------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}
.toolbar .search input {
  padding-left: 38px;
}
.toolbar .search::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  transition: background var(--transition);
}
.pagination a:hover { background: var(--surface-2); }
.pagination .current-page,
.pagination span.current-page {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  font-size: .9rem;
}
.alert--error   { background: var(--danger-soft);  border-color: #fecaca; color: #991b1b; }
.alert--success { background: var(--success-soft); border-color: #a7f3d0; color: #065f46; }
.alert--info    { background: var(--primary-soft); border-color: #c7d2fe; color: var(--primary); }

/* ---------- Repeater rows (product lines in addbnachat) ---------- */
.product-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--surface);
}
.product-row .form-group { gap: 4px; }
.product-row .row-remove {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--danger);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-row .row-remove:hover { background: var(--danger-soft); }

/* ---------- Login page ---------- */
body.auth {
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(139, 92, 246, .15), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(6, 182, 212, .12), transparent 60%),
    linear-gradient(135deg, #f5f7fb 0%, #eef2ff 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background-image: var(--bg-pattern), radial-gradient(1200px 600px at 90% -10%, rgba(139, 92, 246, .15), transparent 60%);
}
body.auth::before,
body.auth::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}
body.auth::before {
  width: 480px; height: 480px;
  background: var(--primary-grad);
  top: -160px; right: -160px;
  animation: floatA 12s ease-in-out infinite alternate;
}
body.auth::after {
  width: 420px; height: 420px;
  background: linear-gradient(135deg, #06b6d4, #14b8a6);
  bottom: -160px; left: -160px;
  animation: floatB 14s ease-in-out infinite alternate;
}
@keyframes floatA {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-30px, 40px) scale(1.06); }
}
@keyframes floatB {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.08); }
}
.auth-card {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 36px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}
.auth-card__brand {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}
.auth-card__brand img { max-height: 64px; width: auto; }
.auth-card h1 {
  text-align: center;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-card__subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: .92rem;
  margin-bottom: 28px;
}
.auth-card .form-group { margin-bottom: 18px; }
.auth-card .btn { width: 100%; padding: 13px; font-size: .95rem; font-weight: 600; }

/* ---------- Footer ---------- */
.app-footer {
  padding: 20px 24px;
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
}

/* ---------- Sidebar backdrop (always positioned so it doesn't occupy a grid cell) ---------- */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .4);
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.sidebar-backdrop--show { opacity: 1; pointer-events: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }
  .sidebar--open { transform: translateX(0); }
  .topbar__toggle { display: flex; }
  .content { padding: 16px; }
  .product-row { grid-template-columns: 1fr; }
}

/* ---------- Print pages ---------- */
.print-page {
  max-width: 800px;
  margin: 24px auto;
  background: var(--surface);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: 'Inter', sans-serif;
}
.print-page h1 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 24px;
}
.print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--text);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.print-header img { max-height: 80px; }
.print-meta { text-align: right; font-size: .9rem; }
.print-meta .ref { font-weight: 700; font-size: 1rem; }
.print-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}
.print-info .block h4 {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.print-info .block p { margin: 0; font-size: .95rem; }
.print-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 32px;
}
.print-table th, .print-table td {
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  text-align: left;
}
.print-table thead th {
  background: var(--surface-2);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: .04em;
}
.print-signature {
  margin-top: 64px;
  text-align: right;
  font-weight: 600;
}
.print-actions {
  max-width: 800px;
  margin: 16px auto;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
@media print {
  body { background: #fff; }
  .print-actions, .no-print { display: none !important; }
  .print-page { box-shadow: none; margin: 0; padding: 20px; }
  @page { size: A4; margin: 14mm; }
}
