/* ============================================
   STORE MANAGER — Design System & Styles
   ============================================ */

/* --- Google Font & Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }
a { text-decoration: none; color: inherit; }

/* ============================================
   THEME TOKENS
   ============================================ */
:root, [data-theme="dark"] {
  --bg:          #0f0f13;
  --surface:     #1a1a24;
  --surface2:    #22222f;
  --surface3:    #2c2c3d;
  --border:      rgba(255,255,255,0.08);
  --border2:     rgba(255,255,255,0.14);
  --text:        #e8e8f0;
  --text-muted:  #8888a8;
  --text-dim:    #555570;
  --accent:      #6366f1;
  --accent-h:    #4f52e8;
  --accent2:     #8b5cf6;
  --success:     #22c55e;
  --danger:      #ef4444;
  --warning:     #f59e0b;
  --card-shadow: 0 4px 24px rgba(0,0,0,0.4);
  --header-bg:   rgba(15,15,19,0.85);
  --sidebar-bg:  #141420;
  --input-bg:    #1e1e2e;
  --overlay:     rgba(0,0,0,0.65);
}

[data-theme="light"] {
  --bg:          #f4f4f8;
  --surface:     #ffffff;
  --surface2:    #f0f0f5;
  --surface3:    #e8e8ef;
  --border:      rgba(0,0,0,0.08);
  --border2:     rgba(0,0,0,0.14);
  --text:        #1a1a2e;
  --text-muted:  #6b6b8a;
  --text-dim:    #aaaacc;
  --accent:      #4f52e8;
  --accent-h:    #3d40d5;
  --accent2:     #7c3aed;
  --success:     #16a34a;
  --danger:      #dc2626;
  --warning:     #d97706;
  --card-shadow: 0 2px 16px rgba(0,0,0,0.1);
  --header-bg:   rgba(255,255,255,0.9);
  --sidebar-bg:  #ffffff;
  --input-bg:    #f4f4f8;
  --overlay:     rgba(0,0,0,0.45);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 14px; font-weight: 600;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(99,102,241,0.3);
  white-space: nowrap;
}
.btn-primary:hover  { opacity: 0.88; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.btn-primary:active { transform: translateY(0); opacity: 1; }
.btn-primary svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px;
  background: var(--surface3); color: var(--text);
  font-size: 14px; font-weight: 600; border: 1px solid var(--border2);
  transition: background 0.2s, transform 0.15s;
}
.btn-secondary:hover  { background: var(--surface2); }
.btn-secondary:active { transform: scale(0.97); }

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px;
  background: var(--danger); color: #fff;
  font-size: 14px; font-weight: 600;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-danger:hover  { opacity: 0.85; transform: translateY(-1px); }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); transition: all 0.25s ease;
  cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { 
  background: rgba(99,102,241,0.08);
  color: var(--accent); 
  border-color: rgba(99,102,241,0.25);
  transform: translateY(-1px);
}
.icon-btn:active { transform: scale(0.96); }

.icon-btn-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  transition: opacity 0.2s, transform 0.15s;
}
.icon-btn-sm svg { width: 16px; height: 16px; }
.icon-btn-sm:hover { opacity: 0.85; transform: scale(1.05); }

.btn-logout {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  background: rgba(239,68,68,0.12); color: #ef4444;
  font-size: 13px; font-weight: 600;
  border: 1px solid rgba(239,68,68,0.2);
  transition: background 0.2s, transform 0.15s;
}
.btn-logout svg { width: 16px; height: 16px; }
.btn-logout:hover { background: rgba(239,68,68,0.22); transform: translateY(-1px); }

/* ============================================
   FORMS & INPUTS
   ============================================ */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.field-group input, .field-group select, .field-group textarea {
  padding: 10px 14px; border-radius: 10px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none; width: 100%;
  -webkit-appearance: none; appearance: none;
}
.field-group input:focus, .field-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}
.field-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238888a8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  background-size: 18px; padding-right: 38px;
}
.req { color: var(--danger); }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon  { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.input-wrap input { padding-left: 38px; }
.toggle-pass {
  position: absolute; right: 10px; color: var(--text-muted);
  background: none; border: none; padding: 4px;
  display: flex; align-items: center; transition: color 0.2s;
}
.toggle-pass:hover { color: var(--text); }
.toggle-pass svg { width: 16px; height: 16px; }

.field-error { font-size: 12px; color: var(--danger); min-height: 16px; }

/* ============================================
   LOGIN SCREEN
   ============================================ */
.login-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); overflow: hidden;
}
.login-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.login-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.25; animation: float 8s ease-in-out infinite;
}
.orb1 { width: 500px; height: 500px; background: #6366f1; top: -150px; left: -100px; animation-delay: 0s; }
.orb2 { width: 400px; height: 400px; background: #8b5cf6; bottom: -100px; right: -80px; animation-delay: 3s; }
.orb3 { width: 300px; height: 300px; background: #22d3ee; top: 40%; left: 55%; animation-delay: 6s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-20px) scale(1.05); }
}

.login-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px; padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  animation: card-in 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.login-logo span { font-size: 20px; font-weight: 800; color: var(--text); }

.login-title { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.login-sub   { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }

.login-form  { display: flex; flex-direction: column; gap: 18px; }
.login-error { color: var(--danger); font-size: 13px; text-align: center;
  background: rgba(239,68,68,0.1); border-radius: 8px; padding: 8px 12px; }
.login-hint  { text-align: center; font-size: 12px; color: var(--text-dim); }
.login-hint strong { color: var(--text-muted); }

/* ============================================
   HEADER
   ============================================ */
.header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
  background: var(--header-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}

.header-logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; user-select: none;
}
.logo-text { font-size: 18px; font-weight: 800; color: var(--text); white-space: nowrap; }

.header-search {
  flex: 1; max-width: 480px; position: relative;
  display: flex; align-items: center;
}
.search-icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
#search-input {
  width: 100%; padding: 9px 36px 9px 38px;
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
#search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.18); }
.search-clear {
  position: absolute; right: 10px; font-size: 18px; color: var(--text-muted);
  background: none; border: none; line-height: 1; padding: 2px 6px;
  transition: color 0.2s; border-radius: 6px;
}
.search-clear:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.sun-icon, .moon-icon { width: 18px; height: 18px; }

/* ============================================
   LAYOUT
   ============================================ */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.layout { display: flex; flex: 1; min-height: 0; }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 20px 16px; display: flex;
  flex-direction: column; gap: 20px;
  overflow-y: auto;
}
.sidebar-section { flex: 1; }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.sidebar-title { font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); }

.category-list { display: flex; flex-direction: column; gap: 2px; }
.category-item {
  display: flex; align-items: center; gap: 8px;
  border-radius: 10px; overflow: hidden; user-select: none;
  transition: background 0.15s;
}
.category-item-btn {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 10px 0 0 10px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: none; border: none; cursor: pointer; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.category-item-btn:hover { background: var(--surface2); color: var(--text); }
.category-item.active .category-item-btn {
  background: rgba(99,102,241,0.12); color: var(--accent); font-weight: 600;
}
.category-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--text-dim); transition: background 0.15s;
}
.category-item.active .category-dot { background: var(--accent); }

.category-item-actions { display: flex; gap: 2px; padding-right: 4px; opacity: 0; transition: opacity 0.15s; }
.category-item:hover .category-item-actions { opacity: 1; }
.cat-action-btn {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: none; border: none;
  transition: background 0.15s, color 0.15s;
}
.cat-action-btn svg { width: 13px; height: 13px; }
.cat-action-btn:hover { background: var(--surface3); }
.cat-action-btn.del:hover { color: var(--danger); }

.sidebar-add-btn { width: 100%; justify-content: center; padding: 10px; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
}

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; }
.active-filter-label { font-size: 20px; font-weight: 700; color: var(--text); }
.toolbar-right { display: flex; align-items: center; gap: 10px; }

.sort-select {
  padding: 9px 36px 9px 14px; border-radius: 10px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); font-size: 14px; font-weight: 500;
  outline: none; transition: border-color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238888a8'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  background-size: 16px; -webkit-appearance: none; appearance: none;
  cursor: pointer;
}
.sort-select:focus { border-color: var(--accent); }

/* ============================================
   PRODUCT LIST
   ============================================ */
.products-list {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

/* Table Header */
.product-list-header {
  display: grid;
  grid-template-columns: 60px 1.5fr 1fr 1fr 180px;
  gap: 16px;
  padding: 10px 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
}
.product-list-header span {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.07em;
}

/* List Row */
.product-row {
  display: grid;
  grid-template-columns: 60px 1.5fr 1fr 1fr 180px;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  animation: row-appear 0.22s ease forwards;
}
.product-row:last-child { border-bottom: none; }
.product-row:hover { background: var(--surface2); }

@keyframes row-appear {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Thumbnail */
.product-thumb-wrap {
  width: 60px; height: 60px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  background: var(--surface3);
  border: 1px solid var(--border);
}
.product-thumb {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.product-row:hover .product-thumb { transform: scale(1.08); }

.product-no-image {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 2px; color: var(--text-dim);
}
.product-no-image svg { width: 24px; height: 24px; opacity: 0.45; }
.product-no-image span { font-size: 9px; }

/* Info */
.product-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.product-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-category-badge {
  display: inline-flex; align-items: center;
  background: rgba(99,102,241,0.13); color: var(--accent);
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 99px; text-transform: uppercase;
  letter-spacing: 0.07em; width: fit-content;
  border: 1px solid rgba(99,102,241,0.22);
}

/* Date */
.product-date { font-size: 12px; color: var(--text-muted); }

/* Price */
.product-price { font-size: 15px; font-weight: 800; color: var(--accent); white-space: nowrap; }

/* Actions */
.product-actions {
  display: flex; gap: 6px; flex-shrink: 0; justify-content: flex-end;
}
.product-action-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--border2); color: var(--text-muted);
  background: var(--surface2); transition: all 0.18s;
  white-space: nowrap;
}
.product-action-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.product-action-btn.edit:hover { background: rgba(99,102,241,0.14); color: var(--accent); border-color: var(--accent); }
.product-action-btn.del:hover  { background: rgba(239,68,68,0.12); color: var(--danger); border-color: var(--danger); }

/* Empty State */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 80px 24px; text-align: center;
}
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--text); }
.empty-state p  { font-size: 14px; color: var(--text-muted); max-width: 300px; }

/* ============================================
   FOOTER / PAGINATION
   ============================================ */
.footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-top: 1px solid var(--border);
  background: var(--header-bg); backdrop-filter: blur(12px);
  flex-wrap: wrap; gap: 12px;
}
.footer-stats { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: 9px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--text-muted);
  border: 1px solid var(--border); transition: all 0.2s;
}
.page-btn:hover:not(:disabled)    { background: var(--surface3); color: var(--text); }
.page-btn.active                   { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-btn:disabled                 { opacity: 0.35; cursor: not-allowed; }
.page-btn svg { width: 14px; height: 14px; }
.page-ellipsis { color: var(--text-dim); font-size: 13px; padding: 0 4px; }

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  background: var(--overlay);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 20px; animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 20px; width: 100%; max-width: 680px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  animation: modal-in 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.modal-sm { max-width: 400px; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 0;
}
.modal-title { font-size: 18px; font-weight: 800; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-muted);
  background: var(--surface2); border: 1px solid var(--border);
  transition: all 0.2s; line-height: 1;
}
.modal-close:hover { background: var(--danger); color: #fff; border-color: transparent; }

.modal-form { padding: 20px 24px 0; display: flex; flex-direction: column; gap: 18px; }
.modal-body { padding: 20px 24px 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 20px 24px; border-top: 1px solid var(--border); margin-top: 20px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Image input tabs */
.image-input-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tab-btn {
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: var(--surface2); border: 1px solid var(--border);
  transition: all 0.2s; cursor: pointer;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.tab-panel { margin-bottom: 10px; }

.file-upload-label {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px;
  border: 1.5px dashed var(--border2); color: var(--text-muted);
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.file-upload-label svg { width: 18px; height: 18px; flex-shrink: 0; }
.file-upload-label:hover { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,0.06); }

.image-preview-wrap { display: flex; justify-content: center; }
#image-preview {
  width: 100%; max-width: 200px; border-radius: 10px;
  border: 1px solid var(--border2); object-fit: cover; max-height: 130px;
}
.image-preview-empty {
  font-size: 12px; color: var(--text-dim); padding: 12px 0;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 999; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-radius: 12px; min-width: 240px; max-width: 340px;
  font-size: 14px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
  pointer-events: auto;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  to   { opacity: 0; transform: translateX(40px); max-height: 0; margin: 0; padding: 0; }
}
.toast.leaving { animation: toast-out 0.3s ease forwards; }
.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--success); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.info    .toast-icon { color: var(--accent); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .sidebar { width: 200px; }
  .product-row, .product-list-header { grid-template-columns: 60px 1fr 130px; }
  .product-date, .product-actions { display: none; }
  /* show inline actions on small */
  .product-row .product-actions { display: flex; }
  .product-row { grid-template-columns: 60px 1fr auto; }
  .product-list-header { grid-template-columns: 60px 1fr auto; }
}
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border);
    padding: 12px 16px; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar-section { flex: 1; min-width: 200px; }
  .category-list { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sidebar-add-btn { white-space: nowrap; }
  .product-row, .product-list-header { grid-template-columns: 60px 1fr auto; }
  .product-date { display: none; }
  .main-content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .header { padding: 10px 16px; gap: 10px; }
  .logo-text { display: none; }
  .btn-logout span { display: none; }
}
@media (max-width: 480px) {
  .product-row { grid-template-columns: 48px 1fr; gap: 10px; padding: 10px 12px; }
  .product-list-header { display: none; }
  .product-thumb-wrap { width: 48px; height: 48px; }
  .product-actions { flex-direction: column; gap: 4px; }
  .product-action-btn { padding: 5px 8px; font-size: 11px; }
  .product-price { font-size: 13px; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .toolbar-right { width: 100%; }
  .sort-select { flex: 1; }
  .footer { flex-direction: column; align-items: center; }
  .login-card { padding: 28px 20px; }
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.loading-spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(99,102,241,0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   EXPORT MODAL
   ============================================ */
.export-list-container {
  max-height: 400px;
  overflow-y: auto;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
}
.export-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.export-item:last-child {
  border-bottom: none;
}
.export-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.export-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.export-item-category {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.export-qty-input {
  width: 70px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  text-align: center;
}
.export-qty-input:focus {
  border-color: var(--accent);
  outline: none;
}
/* Custom Checkbox */
.export-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
