/* ============================================================
   2DA Informatique — Catalogue PWA v2
   Mobile-First · Dark/Light Mode · Accessibilité ARIA
   ============================================================ */

/* ---- Import polices (direct, sans media=print trick) ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  --red:      #E63329;
  --blue:     #1B4FBF;
  --blue-lt:  #2563eb;
  --navy:     #0F1B3C;

  --bg:       #f4f6fb;
  --surface:  #ffffff;
  --surface2: #f0f4ff;
  --border:   #dde3f0;
  --text:     #0f1b3c;
  --text2:    #4b5578;
  --text3:    #8793b2;
  --accent:   #1B4FBF;
  --accent-h: #2563eb;
  --danger:   #dc2626;
  --warn:     #d97706;
  --success:  #16a34a;
  --info:     #0284c7;

  --header-h: 56px;
  --radius:   12px;
  --radius-sm:8px;
  --shadow:   0 2px 12px rgba(15,27,60,.08);
  --shadow-md:0 4px 24px rgba(15,27,60,.13);
  --transition: .18s cubic-bezier(.4,0,.2,1);

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-head: 'Space Grotesk', var(--font-body);
}

[data-theme="dark"] {
  --bg:       #0a1020;
  --surface:  #111827;
  --surface2: #1a2540;
  --border:   #1e2d4a;
  --text:     #e8edf8;
  --text2:    #8fa3cc;
  --text3:    #4a5f87;
  --accent:   #4f8ef7;
  --accent-h: #6da4ff;
  --shadow:   0 2px 12px rgba(0,0,0,.35);
  --shadow-md:0 4px 24px rgba(0,0,0,.5);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { font-family: var(--font-head); line-height: 1.25; }

/* ---- Skip Link ---- */
.skip-link {
  position: fixed; top: -100%; left: 16px;
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-weight: 600; z-index: 9999;
  transition: top .2s;
}
.skip-link:focus { top: 8px; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky; top: 0; z-index: 200;
  height: var(--header-h);
  background: var(--navy);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  display: flex; align-items: center;
}
.header-inner {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 0 16px;
}
.btn-menu {
  background: none; border: none; color: #fff;
  padding: 8px; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  transition: background var(--transition);
  flex-shrink: 0;
}
.btn-menu:hover { background: rgba(255,255,255,.12); }

.logo { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.logo-2da {
  font-family: var(--font-head); font-size: 1.2rem; font-weight: 700;
  color: var(--red); letter-spacing: .04em; flex-shrink: 0;
}
.logo-info { font-size: .9rem; color: rgba(255,255,255,.9); font-weight: 500; white-space: nowrap; }
.logo-badge {
  background: rgba(255,255,255,.18); color: #fff;
  font-size: .7rem; padding: 2px 8px; border-radius: 20px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.btn-icon {
  background: none; border: none; color: rgba(255,255,255,.8);
  cursor: pointer; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  transition: background var(--transition), color var(--transition);
}
.btn-icon:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-icon svg { width: 20px; height: 20px; }

/* ============================================================
   DRAWER MOBILE
   ============================================================ */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(280px, 85vw);
  background: var(--surface);
  z-index: 310;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  box-shadow: 4px 0 32px rgba(0,0,0,.3);
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  background: var(--navy);
  padding: 16px;
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; flex-shrink: 0;
}
.drawer-close {
  margin-left: auto; background: none; border: none;
  color: rgba(255,255,255,.7); cursor: pointer;
  padding: 8px; border-radius: 8px;
  display: flex; align-items: center;
  transition: color var(--transition), background var(--transition);
}
.drawer-close:hover { color: #fff; background: rgba(255,255,255,.12); }

.drawer-nav { padding: 12px 0; flex: 1; }
.drawer-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  color: var(--text); font-weight: 500; font-size: .95rem;
  transition: background var(--transition), color var(--transition);
  cursor: pointer; border: none; background: none; width: 100%;
  text-align: left; text-decoration: none; min-height: 52px;
}
.drawer-item:hover, .drawer-item:focus-visible {
  background: var(--surface2); color: var(--accent);
}
.drawer-item.active {
  background: var(--surface2); color: var(--accent);
  border-right: 3px solid var(--accent);
}
.drawer-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.drawer-divider { height: 1px; background: var(--border); margin: 8px 0; }

/* ============================================================
   ALERT BANNER
   ============================================================ */
.alert-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
}
.alert-inner { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  font-size: .8rem; font-weight: 600;
}
.alert-rupture { background: #fef2f2; color: #dc2626; }
.alert-faible  { background: #fffbeb; color: #d97706; }
[data-theme="dark"] .alert-rupture { background: #3b0f0f; color: #f87171; }
[data-theme="dark"] .alert-faible  { background: #2d1e00; color: #fbbf24; }
.alert-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-wrap {
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: var(--header-h); z-index: 100;
}
.search-box {
  position: relative; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 14px;
  width: 20px; height: 20px; color: var(--text3);
  pointer-events: none; z-index: 1;
}
.search-input {
  width: 100%; height: 48px;
  padding: 0 44px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 24px; font-size: 1rem; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font-body);
  -webkit-appearance: none;
}
.search-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,79,191,.15);
}
.search-input::placeholder { color: var(--text3); }
.search-clear {
  position: absolute; right: 14px;
  background: none; border: none; color: var(--text3);
  cursor: pointer; padding: 4px; border-radius: 50%;
  display: flex; align-items: center;
  transition: color var(--transition);
}
.search-clear:hover { color: var(--text); }

/* Dropdown AJAX */
.search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  z-index: 500; max-height: 65vh; overflow-y: auto;
  display: none;
}
.search-dropdown.open { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:focus {
  background: var(--surface2);
}
.sri-cat { font-size: .72rem; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.sri-name { font-weight: 600; font-size: .92rem; color: var(--text); line-height: 1.3; }
.sri-price { font-weight: 700; color: var(--accent); font-size: .9rem; white-space: nowrap; margin-left: auto; }
.sri-stock { font-size: .75rem; }
.sri-stock.ok     { color: var(--success); }
.sri-stock.faible { color: var(--warn); }
.sri-stock.rupture{ color: var(--danger); }
.search-no-result { padding: 20px 16px; text-align: center; color: var(--text3); font-size: .9rem; }
.search-loading { padding: 16px; text-align: center; }
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   FILTRES CHIPS
   ============================================================ */
.filters-bar {
  padding: 8px 16px;
  overflow-x: auto; white-space: nowrap;
  display: flex; gap: 8px;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.filters-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px; font-size: .82rem; font-weight: 500;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text2); cursor: pointer; white-space: nowrap;
  transition: all var(--transition); flex-shrink: 0;
  text-decoration: none; min-height: 36px;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-chip .badge {
  background: rgba(255,255,255,.25); color: inherit;
  padding: 1px 6px; border-radius: 10px; font-size: .72rem; font-weight: 700;
}
.filter-chip:not(.active) .badge { background: var(--surface2); color: var(--text3); }

/* ============================================================
   LAYOUT
   ============================================================ */
.main { padding: 16px; }

/* Desktop layout */
.layout-desktop { padding: 16px; }

/* ============================================================
   GRILLE PRODUITS
   ============================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.product-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.product-card.rupture { border-left: 3px solid var(--danger); }
.product-card.faible  { border-left: 3px solid var(--warn); }

.product-cat {
  font-size: .72rem; color: var(--text3); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-name {
  font-size: .88rem; font-weight: 600; color: var(--text); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-ref { font-size: .75rem; color: var(--text3); }

.product-prices { margin-top: auto; }
.price-sell { font-size: 1.05rem; font-weight: 700; color: var(--accent); }
.price-cost { font-size: .78rem; color: var(--text3); text-decoration: line-through; }
.price-label-sm { font-size: .72rem; color: var(--text3); }

.product-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px;
}
.stock-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .73rem; font-weight: 600; border-radius: 20px; padding: 3px 8px;
}
.stock-ok      { background: #dcfce7; color: #15803d; }
.stock-faible  { background: #fef9c3; color: #a16207; }
.stock-rupture { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .stock-ok      { background: #052e16; color: #4ade80; }
[data-theme="dark"] .stock-faible  { background: #1c1400; color: #fbbf24; }
[data-theme="dark"] .stock-rupture { background: #1f0707; color: #f87171; }
.stock-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.btn-edit {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); font-size: 1rem;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.btn-edit:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text2); }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h2 { font-size: 1.2rem; margin-bottom: 8px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 24px; flex-wrap: wrap;
}
.page-btn {
  display: inline-flex; align-items: center;
  height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-weight: 500; font-size: .9rem;
  transition: all var(--transition); text-decoration: none;
}
.page-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn.disabled { opacity: .4; pointer-events: none; }
.page-info { font-size: .9rem; color: var(--text2); padding: 0 4px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center; padding: 20px 16px;
  color: var(--text3); font-size: .8rem;
  border-top: 1px solid var(--border); margin-top: 24px;
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed; top: calc(var(--header-h) + 12px); right: 12px;
  z-index: 9000; display: flex; flex-direction: column; gap: 8px;
  max-width: calc(100vw - 24px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 500; min-width: 220px;
  box-shadow: var(--shadow-md); animation: slideIn .25s ease;
  border-left: 4px solid transparent; pointer-events: all;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }
.toast-success { background: #f0fdf4; color: #15803d; border-color: #22c55e; }
.toast-error   { background: #fef2f2; color: #b91c1c; border-color: #ef4444; }
.toast-warning { background: #fffbeb; color: #b45309; border-color: #f59e0b; }
.toast-info    { background: #eff6ff; color: #1d4ed8; border-color: #3b82f6; }
[data-theme="dark"] .toast-success { background: #052e16; color: #4ade80; }
[data-theme="dark"] .toast-error   { background: #1f0707; color: #f87171; }
[data-theme="dark"] .toast-warning { background: #1c1400; color: #fbbf24; }
[data-theme="dark"] .toast-info    { background: #0c1e44; color: #60a5fa; }
.toast-close {
  margin-left: auto; background: none; border: none;
  color: inherit; cursor: pointer; opacity: .6; font-size: 1.1rem;
}

/* ============================================================
   RÉSULTATS META
   ============================================================ */
.results-meta {
  padding: 8px 16px; font-size: .82rem; color: var(--text3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.results-meta strong { color: var(--text); }
.link-sm { color: var(--accent); font-weight: 500; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-main { max-width: 1000px; margin: 0 auto; padding: 16px; }

.admin-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
  text-align: center; box-shadow: var(--shadow);
}
.stat-num   { display: block; font-size: 2rem; font-weight: 700; font-family: var(--font-head); }
.stat-label { font-size: .78rem; color: var(--text2); font-weight: 500; margin-top: 4px; display: block; }
.stat-danger .stat-num { color: var(--danger); }
.stat-warn   .stat-num { color: var(--warn); }
.stat-info   .stat-num { color: var(--info); }

.admin-grid { display: flex; flex-direction: column; gap: 16px; }

.admin-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 8px;
}
.card-desc { color: var(--text2); font-size: .88rem; margin-bottom: 16px; line-height: 1.5; }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-group label { font-size: .88rem; font-weight: 600; color: var(--text); }
.form-group small { font-size: .78rem; color: var(--text3); }
.form-input {
  width: 100%; height: 44px; padding: 0 12px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .95rem; color: var(--text);
  font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(27,79,191,.15);
}
.form-row { display: flex; flex-direction: column; gap: 0; }
.required { color: var(--danger); }
.input-suffix { display: flex; align-items: center; gap: 8px; }
.input-suffix .form-input { flex: 1; }
.input-suffix span { color: var(--text2); font-weight: 500; white-space: nowrap; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 600; cursor: pointer; border: none;
  transition: all var(--transition); font-family: var(--font-body);
  text-decoration: none; white-space: nowrap; min-width: 44px;
}
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover  { filter: brightness(1.1); color: #fff; }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger    { background: #fee2e2; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm  { height: 36px; padding: 0 14px; font-size: .84rem; }
.btn-full { width: 100%; }

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 28px 16px; text-align: center; cursor: pointer;
  transition: all var(--transition); margin-bottom: 12px;
  background: var(--bg);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent); background: rgba(27,79,191,.05);
}
.drop-icon { font-size: 2.2rem; margin-bottom: 10px; }
.drop-zone p { color: var(--text2); font-size: .9rem; margin-bottom: 4px; }
.drop-hint { font-size: .8rem !important; color: var(--text3) !important; }
.link-label { color: var(--accent); cursor: pointer; font-weight: 600; }
.file-input { display: none; }

.file-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface2);
  border-radius: var(--radius-sm); font-size: .85rem;
  border: 1px solid var(--border);
}

/* Table */
.mini-table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 12px; }
.mini-table th { padding: 8px 10px; background: var(--surface2); color: var(--text2); font-weight: 600; text-align: left; font-size: .8rem; }
.mini-table td { padding: 8px 10px; border-top: 1px solid var(--border); color: var(--text); }
.mini-table tr:hover td { background: var(--surface2); }

.import-history { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.import-history h3 { font-size: .92rem; font-weight: 600; margin-bottom: 8px; color: var(--text2); }

/* Offline / Install banners */
.offline-banner {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: #1c1400; color: #fbbf24; padding: 10px 16px;
  text-align: center; font-size: .88rem; font-weight: 600;
  z-index: 8000; border-top: 2px solid #f59e0b;
}
.offline-banner.show { display: block; }

.install-banner {
  margin: 12px 16px;
  background: var(--blue); color: #fff;
  border-radius: var(--radius); padding: 14px 16px;
  align-items: center; gap: 12px;
  display: none;
}
.install-banner.show { display: flex; }
.install-banner p { flex: 1; font-size: .9rem; }
.install-banner .btn { background: #fff; color: var(--blue); flex-shrink: 0; }

/* Sidebar desktop */
.sidebar-desktop { display: none; }
.content-desktop { width: 100%; }

/* ============================================================
   TABLET 640px+
   ============================================================ */
@media (min-width: 640px) {
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
  .form-row { flex-direction: row; gap: 12px; }
  .form-row .form-group { flex: 1; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
}

/* ============================================================
   DESKTOP 992px+
   ============================================================ */
@media (min-width: 992px) {
  :root { --header-h: 60px; }

  .layout-desktop { display: flex; gap: 24px; padding: 20px 24px; align-items: flex-start; }

  .sidebar-desktop {
    display: block; width: 220px; flex-shrink: 0;
  }
  .sidebar-panel {
    background: var(--surface); border-radius: var(--radius);
    border: 1px solid var(--border); padding: 16px;
    box-shadow: var(--shadow); position: sticky; top: calc(var(--header-h) + 16px);
  }
  .sidebar-title {
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text3); margin-bottom: 8px; margin-top: 12px;
    display: block;
  }
  .sidebar-title:first-child { margin-top: 0; }
  .sidebar-links { display: flex; flex-direction: column; gap: 2px; }
  .sidebar-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 7px 10px; border-radius: var(--radius-sm);
    font-size: .87rem; color: var(--text2); text-decoration: none;
    transition: all var(--transition);
  }
  .sidebar-link:hover { background: var(--surface2); color: var(--accent); }
  .sidebar-link.active { background: rgba(27,79,191,.1); color: var(--accent); font-weight: 600; }

  .content-desktop { flex: 1; min-width: 0; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

  .btn-menu { display: none; }

  .admin-main { padding: 24px; }
  .admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

  .search-wrap { padding: 14px 24px; }
  .filters-bar { padding: 10px 24px; }
}

@media (min-width: 1200px) {
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .sidebar-desktop { width: 240px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Print */
@media print {
  .header, .drawer, .drawer-overlay, .filters-bar, .search-wrap,
  .btn-edit, .install-banner, .offline-banner, .toast-container { display: none !important; }
  .product-card { break-inside: avoid; border: 1px solid #ccc; }
  body { background: #fff; color: #000; }
}
