/* ══════════════════════════════════════════════════════════
   EventStock – CSS Principal
   Mobile-first, moderno, responsivo
══════════════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --secondary: #64748b;
  --success: #22c55e;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #06b6d4;
  --info-light: #cffafe;
  --teal: #14b8a6;
  --teal-light: #ccfbf1;
  --purple: #a855f7;
  --purple-light: #f3e8ff;
  --orange: #f97316;
  --orange-light: #ffedd5;
  --deg-color: #8b5cf6;   /* degustação = roxo */
  --sale-color: #0ea5e9;  /* venda = azul */

  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #6366f1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --sidebar-w: 240px;
  --header-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.05);
  --transition: .18s ease;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: inherit; }
img { max-width: 100%; }

/* ── PAGES ── */
.page { display: block; }
.page.hidden { display: none; }
.page.active { display: block; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ══════════════════════════════════════════════════════════
   LOGIN
══════════════════════════════════════════════════════════ */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 24px; font-weight: 800; color: var(--primary);
  margin-bottom: 6px;
}
.login-logo i { font-size: 32px; }
.login-subtitle { color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; }
.login-hint {
  text-align: center; font-size: .78rem; color: var(--text-muted);
  margin-top: 16px; background: var(--bg); padding: 10px; border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════════
   FORM COMPONENTS
══════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="email"], select, textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .92rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
input[readonly] { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }
textarea { resize: vertical; }
.input-password { position: relative; }
.input-password input { padding-right: 42px; }
.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0;
  font-size: .9rem;
}
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600; border: none; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: var(--bg); color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-danger-outline {
  background: transparent; color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn-danger-outline:hover { background: var(--danger-light); }
.btn-success { background: var(--success); color: white; }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 1rem; }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-icon {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition);
  font-size: .9rem;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }

/* ══════════════════════════════════════════════════════════
   HEADER
══════════════════════════════════════════════════════════ */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  box-shadow: var(--shadow);
}
.header-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 800; color: var(--primary);
}
.header-brand i { font-size: 1.3rem; }
.brand-name { display: none; }
@media (min-width: 768px) { .brand-name { display: inline; } }

.header-right {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
}
#event-selector-wrap select {
  font-size: .82rem; padding: 7px 10px;
  max-width: 180px; background: var(--bg);
  border-color: var(--border);
}
.header-user {
  position: relative; display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 6px 10px; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.header-user:hover { background: var(--bg); }
.header-user > span { font-size: .85rem; font-weight: 600; display: none; }
@media (min-width: 480px) { .header-user > span { display: inline; } }
.header-user .fa-chevron-down { font-size: .7rem; color: var(--text-muted); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.user-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; overflow: hidden; z-index: 200;
}
.user-menu.hidden { display: none; }
.user-menu-info { padding: 12px 16px; }
.user-menu-info span { display: block; font-weight: 600; font-size: .9rem; }
.user-menu-info small { color: var(--text-muted); font-size: .78rem; }
.user-menu hr { border: none; border-top: 1px solid var(--border); }
.user-menu button {
  width: 100%; padding: 10px 16px; text-align: left;
  background: none; border: none; cursor: pointer;
  font-size: .88rem; color: var(--text); display: flex; align-items: center; gap: 8px;
  transition: background var(--transition);
}
.user-menu button:hover { background: var(--danger-light); color: var(--danger); }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed; left: -260px; top: var(--header-h);
  width: var(--sidebar-w); height: calc(100vh - var(--header-h));
  background: var(--bg-card); border-right: 1px solid var(--border);
  overflow-y: auto; z-index: 90;
  transition: left .25s ease;
}
.sidebar.open { left: 0; }
.sidebar-inner { padding: 16px 0 24px; }
.sidebar-section { padding: 8px 0; }
.sidebar-label {
  display: block; font-size: .68rem; font-weight: 700;
  color: var(--text-light); letter-spacing: .08em;
  padding: 8px 20px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; font-size: .875rem; font-weight: 500;
  color: var(--text-muted); border-left: 3px solid transparent;
  transition: all var(--transition);
}
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active {
  background: var(--primary-light); color: var(--primary);
  border-left-color: var(--primary); font-weight: 600;
}
.nav-item i { width: 18px; text-align: center; font-size: .9rem; }
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 89; backdrop-filter: blur(2px);
}
.sidebar-overlay.hidden { display: none; }

@media (min-width: 1024px) {
  .sidebar { left: 0; }
  .sidebar-toggle { display: none !important; }
  .app-main { margin-left: var(--sidebar-w); }
  .sidebar-overlay { display: none !important; }
}

/* ══════════════════════════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════════════════════════ */
.app-main {
  margin-top: var(--header-h);
  padding: 20px 16px;
  min-height: calc(100vh - var(--header-h));
}
@media (min-width: 640px) { .app-main { padding: 24px 24px; } }
@media (min-width: 1024px) { .app-main { padding: 28px 32px; } }

/* ── VIEWS ── */
.view { display: block; }
.view.hidden { display: none; }
.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.view-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.view-subtitle { font-size: .88rem; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════
   CONTEXT TABS (Dashboard)
══════════════════════════════════════════════════════════ */
.context-tabs { display: flex; gap: 8px; flex-shrink: 0; }
.ctx-tab {
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg-card);
  font-size: .85rem; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: all var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.ctx-tab.active[id="ctx-degustation"] {
  background: var(--deg-color); color: white; border-color: var(--deg-color);
}
.ctx-tab.active[id="ctx-sale"] {
  background: var(--sale-color); color: white; border-color: var(--sale-color);
}
.ctx-tab:not(.active):hover { background: var(--bg); }

/* ══════════════════════════════════════════════════════════
   SUMMARY CARDS
══════════════════════════════════════════════════════════ */
.stock-summary {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.summary-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 14px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}
.summary-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: white; flex-shrink: 0;
}
.bg-blue { background: var(--primary); }
.bg-green { background: var(--success); }
.bg-orange { background: var(--orange); }
.bg-red { background: var(--danger); }
.bg-teal { background: var(--teal); }
.bg-purple { background: var(--purple); }
.summary-value { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.summary-card small { font-size: .75rem; color: var(--text-muted); }

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

/* ══════════════════════════════════════════════════════════
   PRODUCT CARDS (Dashboard Grid)
══════════════════════════════════════════════════════════ */
.products-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.product-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden; transition: all var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.product-card.low-stock { border-color: var(--danger); }
.product-card.low-stock .card-header { background: var(--danger-light); }

.card-header {
  padding: 12px 14px; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px;
  background: var(--bg);
}
.card-sku {
  font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  color: var(--text-muted); background: var(--border);
  padding: 2px 7px; border-radius: 99px; white-space: nowrap;
}
.low-stock .card-sku { background: var(--danger); color: white; }
.card-name { font-size: .92rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.card-category { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.card-low-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600; color: var(--danger);
  background: var(--danger-light); padding: 3px 8px; border-radius: 99px;
  flex-shrink: 0;
}

.card-body { padding: 14px; }
.card-qty-block {
  display: flex; align-items: center; justify-content: space-between;
}
.ctx-label {
  font-size: .75rem; font-weight: 700; letter-spacing: .04em;
  margin-bottom: 6px; display: flex; align-items: center; gap: 5px;
}
.ctx-label.deg { color: var(--deg-color); }
.ctx-label.sale { color: var(--sale-color); }
.qty-display {
  font-size: 2.2rem; font-weight: 800; line-height: 1;
  transition: all .15s;
}
.qty-display.deg { color: var(--deg-color); }
.qty-display.sale { color: var(--sale-color); }
.card-unit { font-size: .72rem; color: var(--text-muted); }

.card-actions {
  display: flex; align-items: center; gap: 6px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.quick-btn {
  flex: 1; padding: 10px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; font-size: 1rem; font-weight: 700;
  transition: all .15s; display: flex; align-items: center; justify-content: center;
}
.quick-btn:active { transform: scale(.95); }
.quick-btn.minus { background: var(--danger-light); color: var(--danger); }
.quick-btn.minus:hover { background: var(--danger); color: white; }
.quick-btn.plus.deg { background: rgba(139,92,246,.12); color: var(--deg-color); }
.quick-btn.plus.deg:hover { background: var(--deg-color); color: white; }
.quick-btn.plus.sale { background: rgba(14,165,233,.12); color: var(--sale-color); }
.quick-btn.plus.sale:hover { background: var(--sale-color); color: white; }
.card-qty-num {
  min-width: 50px; text-align: center;
  font-size: 1.5rem; font-weight: 800;
}
.card-qty-num.deg { color: var(--deg-color); }
.card-qty-num.sale { color: var(--sale-color); }
.btn-adjust {
  padding: 9px; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted);
  transition: all var(--transition); font-size: .85rem;
}
.btn-adjust:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ══════════════════════════════════════════════════════════
   TRANSFER
══════════════════════════════════════════════════════════ */
.transfer-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 24px; max-width: 640px;
}
.transfer-direction {
  display: flex; align-items: center; gap: 16px;
  margin: 16px 0; flex-wrap: wrap;
}
.direction-block { flex: 1; min-width: 140px; }
.direction-block label {
  display: block; font-size: .78rem; font-weight: 700;
  color: var(--text-muted); margin-bottom: 8px;
}
.direction-selector { display: flex; flex-direction: column; gap: 6px; }
.dir-btn {
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg);
  font-size: .85rem; font-weight: 500; cursor: pointer;
  color: var(--text-muted); transition: all var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.dir-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }
.direction-arrow { font-size: 1.5rem; color: var(--text-muted); flex-shrink: 0; }
.qty-input-group {
  display: flex; align-items: center; gap: 8px;
}
.qty-input-group input { text-align: center; max-width: 90px; font-size: 1.1rem; font-weight: 700; }
.qty-input-group .btn-icon {
  width: 40px; height: 40px; background: var(--bg);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem;
}
.qty-input-group .btn-icon:hover { background: var(--primary); color: white; border-color: var(--primary); }

.transfer-preview {
  background: var(--bg); border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); padding: 16px;
  margin: 16px 0;
}
.transfer-preview h4 { font-size: .88rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.preview-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.preview-col { text-align: center; }
.preview-col-title { font-size: .75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.preview-col-val { font-size: 1.6rem; font-weight: 800; }
.preview-col-val.from { color: var(--danger); }
.preview-col-val.to { color: var(--success); }
.preview-arrow { font-size: 1.2rem; color: var(--text-muted); text-align: center; }

/* ══════════════════════════════════════════════════════════
   FILTER BAR
══════════════════════════════════════════════════════════ */
.filter-bar {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 14px 16px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  margin-bottom: 16px; box-shadow: var(--shadow);
}
.filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 140px; }
.filter-group label { font-size: .76rem; font-weight: 600; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.filter-group select, .filter-group input { font-size: .85rem; padding: 8px 10px; }
.filter-actions { margin-left: auto; display: flex; align-items: flex-end; }

/* ══════════════════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════════════════ */
.table-wrapper {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); overflow-x: auto;
  box-shadow: var(--shadow);
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  padding: 11px 14px; text-align: left;
  font-size: .75rem; font-weight: 700; letter-spacing: .04em;
  color: var(--text-muted); background: var(--bg);
  border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
.data-table tbody td {
  padding: 11px 14px; font-size: .88rem;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.text-center { text-align: center !important; }

/* ── Type badges ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 600;
  white-space: nowrap;
}
.badge-entrada { background: var(--success-light); color: #16a34a; }
.badge-saida { background: var(--danger-light); color: #dc2626; }
.badge-transferencia { background: var(--info-light); color: #0891b2; }
.badge-ajuste { background: var(--warning-light); color: #d97706; }
.badge-deg { background: rgba(139,92,246,.12); color: var(--deg-color); }
.badge-sale { background: rgba(14,165,233,.12); color: var(--sale-color); }
.badge-active { background: var(--success-light); color: #16a34a; }
.badge-inactive { background: var(--danger-light); color: #dc2626; }
.badge-planned { background: var(--warning-light); color: #d97706; }
.badge-admin { background: var(--primary-light); color: var(--primary-dark); }
.badge-op { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── History ── */
.history-count { font-size: .82rem; color: var(--text-muted); margin-bottom: 8px; }

/* ══════════════════════════════════════════════════════════
   REPORT SECTION
══════════════════════════════════════════════════════════ */
.report-section { margin-bottom: 32px; }
.report-ctx-title {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}

/* ══════════════════════════════════════════════════════════
   EXPORT CARDS
══════════════════════════════════════════════════════════ */
.export-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.export-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.export-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: white;
}
.export-card h3 { font-size: 1rem; font-weight: 700; }
.export-card p { font-size: .84rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.export-options { display: flex; flex-direction: column; gap: 8px; }
.export-options select { font-size: .85rem; }

/* ══════════════════════════════════════════════════════════
   MODAIS
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  animation: modalIn .2s ease;
}
.modal-lg { max-width: 620px; }
.modal-sm { max-width: 380px; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 18px 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px; display: flex; justify-content: flex-end; gap: 8px;
  border-top: 1px solid var(--border); background: var(--bg);
  border-radius: 0 0 var(--radius) var(--radius);
}
.confirm-icon {
  text-align: center; font-size: 2.5rem; color: var(--warning);
  margin-bottom: 12px;
}
#confirm-message { text-align: center; color: var(--text-muted); font-size: .92rem; }

/* Transfer confirm modal */
.trf-confirm-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.trf-confirm-table td { padding: 8px 12px; font-size: .88rem; border-bottom: 1px solid var(--border); }
.trf-confirm-table td:first-child { font-weight: 600; color: var(--text-muted); width: 40%; }
.trf-confirm-arrow { text-align: center; font-size: 1.5rem; color: var(--primary); padding: 12px; }

/* ══════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; max-width: 320px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: .88rem; font-weight: 500;
  animation: toastIn .25s ease; max-width: 100%;
}
.toast.removing { animation: toastOut .25s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}
.toast-success { background: #166534; color: #dcfce7; }
.toast-error { background: #991b1b; color: #fee2e2; }
.toast-warning { background: #92400e; color: #fef3c7; }
.toast-info { background: #1e40af; color: #dbeafe; }

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 60px 24px; color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 12px; opacity: .4; display: block; }
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: .88rem; max-width: 320px; margin: 0 auto; }

/* ══════════════════════════════════════════════════════════
   ALERTS
══════════════════════════════════════════════════════════ */
.alert-error {
  background: var(--danger-light); color: var(--danger);
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: .85rem; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.alert-error.hidden { display: none; }

/* ══════════════════════════════════════════════════════════
   UTILITIES
══════════════════════════════════════════════════════════ */
.hidden { display: none !important; }
.admin-only.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.fw-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.gap-8 { gap: 8px; }

/* QTY badge inline */
.qty-tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; padding: 2px 6px; border-radius: 99px;
  font-size: .78rem; font-weight: 700;
}
.qty-tag.plus { background: var(--success-light); color: #16a34a; }
.qty-tag.minus { background: var(--danger-light); color: var(--danger); }

/* Table action buttons */
.tbl-actions { display: flex; align-items: center; gap: 4px; justify-content: center; flex-wrap: nowrap; }
.tbl-btn {
  width: 30px; height: 30px; border-radius: 6px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; transition: all var(--transition);
}
.tbl-btn-edit { background: var(--primary-light); color: var(--primary); }
.tbl-btn-edit:hover { background: var(--primary); color: white; }
.tbl-btn-del { background: var(--danger-light); color: var(--danger); }
.tbl-btn-del:hover { background: var(--danger); color: white; }
.tbl-btn-view { background: var(--info-light); color: var(--info); }
.tbl-btn-view:hover { background: var(--info); color: white; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .view-header { flex-direction: column; align-items: flex-start; }
  .context-tabs { width: 100%; }
  .ctx-tab { flex: 1; justify-content: center; }
  .transfer-direction { flex-direction: column; }
  .direction-arrow { transform: rotate(90deg); }
  .preview-grid { grid-template-columns: 1fr; }
  .preview-arrow { transform: rotate(90deg); }
  .filter-bar { flex-direction: column; }
  .filter-group { min-width: unset; width: 100%; }
  .filter-actions { margin-left: 0; width: 100%; }
  .filter-actions .btn { width: 100%; justify-content: center; }
  .export-options .btn { width: 100%; justify-content: center; }
  .modal { max-height: 95vh; }
  .toast-container { bottom: 10px; right: 10px; left: 10px; max-width: unset; }
}

@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr; }
  .qty-display { font-size: 1.8rem; }
}

/* qty animation */
@keyframes qtyBounce {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}
.qty-bounced { animation: qtyBounce .2s ease; }
