/* ═══════════════════════════════════════════════════════════
   styles.css — общие стили POS-системы
   Подключается на всех страницах, убирает дублирование CSS
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #0d0d0d;
  --surface: #1a1a1a;
  --surface2:#252525;
  --border:  #383838;
  --accent:  #f0c000;
  --green:   #22c55e;
  --green-dk:#16a34a;
  --red:     #ef4444;
  --orange:  #f59e0b;
  --yellow:  #f59e0b;
  --text:    #f0f0f0;
  --muted:   #888888;
  --radius:  12px;
  --font:    'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
}

/* ── Шапка ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}
.header-left  { display: flex; align-items: center; gap: 14px; }
.header-right { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--accent); }
.logo span { color: var(--text); }
.clock { font-size: 20px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }


/* ── Бейджи ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge-red    { background: rgba(239,68,68,.15);   color: var(--red);    }
.badge-green  { background: rgba(34,197,94,.15);   color: var(--green);  }
.badge-orange { background: rgba(245,158,11,.15);  color: var(--orange); }
.badge-blue   { background: rgba(240,192,0,.15);   color: var(--accent); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 22px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s, transform .25s;
  pointer-events: none; z-index: 300; white-space: nowrap;
}
.toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red);   }
.toast.info    { border-color: var(--accent); color: var(--accent); }

/* ── Лоадер ── */
.pos-loader {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.pos-loader-inner { text-align: center; color: var(--muted); font-family: var(--font); }
.pos-spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: posSpinAnim .8s linear infinite; margin: 0 auto 14px;
}
@keyframes posSpinAnim { to { transform: rotate(360deg); } }

/* ── Сайдбар (общий для всех страниц) — по умолчанию свёрнут, открывается бургером ── */
#sidenav {
  position: fixed; top: 0; left: 0; height: 100%; width: 230px;
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 8px; padding-top: 14px; z-index: 20;
  scrollbar-width: none;
  transform: translateX(-100%); transition: transform .2s ease;
  box-shadow: 0 0 32px rgba(0,0,0,.5);
}
#sidenav.show { transform: translateX(0); }
#sidenav::-webkit-scrollbar { display: none; }
.snav-brand {
  padding: 8px 10px 6px; font-size: 14px; font-weight: 700;
  color: var(--accent); letter-spacing: .5px; margin-bottom: 2px;
}
.snav-brand span { color: var(--text); font-weight: 400; }

/* Единый стиль секций, пунктов и разделителей — #sidenav и aside.sidebar */
.sb-section {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
  padding: 5px 10px 3px; margin-top: 2px;
}
.sb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; min-height: 44px;
  color: var(--muted); font-size: 12.5px; font-weight: 500;
  text-decoration: none; cursor: pointer; transition: background .12s, color .12s;
  margin-bottom: 2px; background: none; border: none;
  width: 100%; text-align: left; font-family: var(--font);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-item:hover     { background: var(--surface2); color: var(--text); }
.sb-item.sb-active { background: rgba(59,130,246,.13); color: #3b82f6; font-weight: 600; }
.sb-icon    { font-size: 16px; flex-shrink: 0; line-height: 1; }
.sb-divider { border: none; border-top: 1px solid var(--border); margin: 5px 0; }

/* ── Кнопки (общие) ── */
.btn-sm {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  padding: 7px 14px; min-height: 44px; border-radius: var(--radius); cursor: pointer; font-size: 13px;
  font-family: var(--font); transition: .15s;
}
.btn-sm:hover { border-color: var(--text); color: var(--text); }
.btn-sm.danger:hover { border-color: var(--red); color: var(--red); }

/* ── Оверлей (модалки) ── */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.65); z-index: 100;
  align-items: center; justify-content: center; padding: 20px;
}
.overlay.open { display: flex; }

/* ── Бургер-меню (открывает сайдбар на любой ширине экрана) ── */
.sb-burger {
  display: flex; width: 44px; height: 44px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-size: 19px;
  cursor: pointer; align-items: center; justify-content: center;
}
.sb-burger:hover { border-color: var(--accent); }

.sidenav-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 19;
}
.sidenav-overlay.show { display: block; }

/* ── Медиа ── */
@media (max-width: 768px) {
  header   { padding: 10px 12px; }
  .clock   { display: none; }
  .logo    { font-size: 16px; }
}
