/* ─── GLOBAL ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background-color: #070b19;
  color: #e2e8f0;
}

/* ─── GLASS CARD ─────────────────────────────────────── */
.glass-card {
  background: rgba(17, 34, 64, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(100, 255, 218, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ─── FORM INPUTS ────────────────────────────────────── */
.form-input {
  background: rgba(13, 33, 55, 0.7);
  border: 1px solid rgba(100, 100, 150, 0.3);
  border-radius: 0.75rem;
  padding: 0.625rem 1rem;
  color: #e2e8f0;
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: rgba(100, 255, 218, 0.5);
  box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.08);
}
.form-input::placeholder { color: #64748b; }

/* ─── TABLE ROWS ─────────────────────────────────────── */
#productTableBody tr {
  border-bottom: 1px solid rgba(100, 100, 150, 0.12);
  transition: background 0.15s;
}
#productTableBody tr:hover {
  background: rgba(100, 255, 218, 0.04);
}
#productTableBody tr:last-child { border-bottom: none; }

/* ─── THUMB CELL (clickable td) ─────────────────────── */
.thumb-cell:hover .product-thumb {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px #64ffda, 0 4px 16px rgba(100,255,218,0.2);
  border-color: #64ffda;
}
.thumb-cell:hover .thumb-placeholder {
  border-color: rgba(100,255,218,0.5);
  background: rgba(100,255,218,0.1);
}

/* ─── PRODUCT THUMBNAIL ──────────────────────────────── */
.product-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(100, 255, 218, 0.15);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  background: #112240;
}
.product-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px #64ffda, 0 4px 16px rgba(100,255,218,0.2);
  border-color: #64ffda;
}
.thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgba(100,255,218,0.07);
  border: 1px dashed rgba(100,255,218,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── QUANTITY INPUT ─────────────────────────────────── */
.qty-input {
  width: 72px;
  background: rgba(13, 33, 55, 0.8);
  border: 1px solid rgba(100, 100, 150, 0.3);
  border-radius: 0.5rem;
  padding: 0.375rem 0.5rem;
  color: #e2e8f0;
  font-size: 0.875rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.qty-input:focus {
  border-color: rgba(100, 255, 218, 0.5);
  box-shadow: 0 0 0 2px rgba(100, 255, 218, 0.08);
}
.qty-input.has-qty {
  border-color: rgba(100, 255, 218, 0.5);
  color: #64ffda;
  font-weight: 600;
}

/* ─── BADGE ──────────────────────────────────────────── */
.badge-brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.badge-HP      { background: rgba(0,150,255,0.15);   color: #60c0ff; border: 1px solid rgba(0,150,255,0.3); }
.badge-Dell    { background: rgba(0,180,200,0.15);   color: #5fddee; border: 1px solid rgba(0,180,200,0.3); }
.badge-Acer    { background: rgba(0,200,100,0.15);   color: #5feea0; border: 1px solid rgba(0,200,100,0.3); }
.badge-Lenovo  { background: rgba(180,100,255,0.15); color: #c880ff; border: 1px solid rgba(180,100,255,0.3); }
.badge-Asus    { background: rgba(255,170,0,0.15);   color: #ffcc55; border: 1px solid rgba(255,170,0,0.3); }
.badge-MSI     { background: rgba(255,60,60,0.15);   color: #ff8080; border: 1px solid rgba(255,60,60,0.3); }
.badge-Samsung { background: rgba(20,120,255,0.15);  color: #6aafff; border: 1px solid rgba(20,120,255,0.3); }
.badge-LG      { background: rgba(200,50,255,0.15);  color: #dd88ff; border: 1px solid rgba(200,50,255,0.3); }
.badge-Toshiba { background: rgba(255,80,0,0.15);    color: #ff9955; border: 1px solid rgba(255,80,0,0.3); }
.badge-Sony    { background: rgba(50,200,150,0.15);  color: #55ddaa; border: 1px solid rgba(50,200,150,0.3); }
.badge-Fujitsu { background: rgba(100,180,50,0.15);  color: #99dd66; border: 1px solid rgba(100,180,50,0.3); }
.badge-Razer   { background: rgba(0,230,100,0.15);   color: #44ff99; border: 1px solid rgba(0,230,100,0.35); }
.badge-default { background: rgba(100,150,200,0.15); color: #90b4d0; border: 1px solid rgba(100,150,200,0.3); }


/* ─── WATT PILL ──────────────────────────────────────── */
.watt-pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(100,255,218,0.1);
  color: #64ffda;
  border: 1px solid rgba(100,255,218,0.2);
}

/* ─── ORDER ITEM ROW ─────────────────────────────────── */
/* ─── OLD ORDER ROW (kept for fallback) ─────────────────── */
.order-item-name  { color: #cbd5e1; flex: 1; }
.order-item-qty   { color: #64ffda; font-weight: 700; white-space: nowrap; }
.order-item-price { color: #fbbf24; font-weight: 600; white-space: nowrap; font-size: 0.75rem; }

/* ─── INVOICE LAYOUT ─────────────────────────────────────── */
/* 5 cột: Mã SP | Tên SP | Đơn giá | SL | Thành tiền */
.invoice-header,
.invoice-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 108px 52px 112px;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.8rem;
}

.invoice-header {
  background: rgba(100,255,218,0.06);
  border: 1px solid rgba(100,255,218,0.15);
  border-radius: 8px 8px 0 0;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1px;
}

.invoice-row {
  border: 1px solid rgba(100,255,218,0.07);
  border-top: none;
  transition: background 0.15s;
}
.invoice-row:last-child { border-radius: 0 0 8px 8px; }
.invoice-row:hover      { background: rgba(100,255,218,0.04); }
.invoice-row-alt        { background: rgba(13,33,55,0.5); }

/* Cột mã sản phẩm */
.invoice-col-sku {
  min-width: 0;
}
.invoice-sku-badge {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: #7cf7ff;
  background: rgba(0,200,240,0.12);
  border: 1px solid rgba(0,200,240,0.25);
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

/* Cột tên sản phẩm */
.invoice-col-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.invoice-brand {
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.82rem;
}
.invoice-spec {
  color: #7dd3fc;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.03em;
}

/* Cột đơn giá */
.invoice-col-price {
  text-align: right;
  color: #94a3b8;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* Cột số lượng */
.invoice-col-qty {
  text-align: center;
  color: #64ffda;
  font-weight: 700;
  font-size: 0.82rem;
}

/* Cột thành tiền */
.invoice-col-total {
  text-align: right;
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

/* Header căn chỉnh theo cột */
.invoice-header .invoice-col-price,
.invoice-header .invoice-col-qty,
.invoice-header .invoice-col-total { text-align: right; }
.invoice-header .invoice-col-qty   { text-align: center; }


/* ─── PAGINATION ─────────────────────────────────────── */
.pg-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(13, 33, 55, 0.7);
  border: 1px solid rgba(100, 100, 150, 0.25);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pg-btn:hover:not(.pg-disabled) {
  background: rgba(100, 255, 218, 0.1);
  border-color: rgba(100, 255, 218, 0.4);
  color: #64ffda;
}
.pg-active {
  background: rgba(100, 255, 218, 0.15) !important;
  border-color: #64ffda !important;
  color: #64ffda !important;
  box-shadow: 0 0 8px rgba(100, 255, 218, 0.15);
}
.pg-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.pg-ellipsis {
  color: #475569;
  padding: 0 4px;
  font-size: 0.85rem;
  line-height: 34px;
}

/* ─── MODAL ──────────────────────────────────────────── */
.modal-content {
  animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
#modalThumbs img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, opacity 0.2s, transform 0.15s;
  background: #112240;
  opacity: 0.65;
}
#modalThumbs img.active, #modalThumbs img:hover {
  border-color: #64ffda;
  opacity: 1;
  transform: scale(1.03);
}

/* ─── FORM ALERT ─────────────────────────────────────── */
.alert-success {
  background: rgba(100,255,218,0.1);
  border: 1px solid rgba(100,255,218,0.3);
  color: #64ffda;
}
.alert-error {
  background: rgba(255,80,80,0.1);
  border: 1px solid rgba(255,80,80,0.3);
  color: #ff8080;
}
.alert-warning {
  background: rgba(255,200,50,0.1);
  border: 1px solid rgba(255,200,50,0.3);
  color: #ffd060;
}

/* ─── SCROLLBAR ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,255,218,0.2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,255,218,0.4); }

/* ─── ANIMATIONS ─────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}
.row-appear { animation: fadeInUp 0.35s ease both; }

/* ─── PARTICLES CANVAS ───────────────────────────────── */
#tsparticles canvas { position: fixed !important; }
