/* ============================================================
   INVENTORY TRACKING APP — Premium Dark Theme
   ============================================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
  /* Backgrounds */
  --bg-primary: #0a0a1a;
  --bg-secondary: #1a1a2e;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(255, 255, 255, 0.06);

  /* Accent Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-header: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-danger: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%);
  --gradient-success: linear-gradient(135deg, #00e676 0%, #00c853 100%);

  /* Solid Accents */
  --accent-primary: #667eea;
  --accent-secondary: #00d2ff;
  --color-success: #00e676;
  --color-danger: #ff5252;
  --color-warning: #ffab40;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-tertiary: rgba(255, 255, 255, 0.4);

  /* Spacing */
  --header-height: 56px;
  --nav-height: 64px;
  --content-padding: 16px;
  --card-radius: 14px;
  --input-radius: 10px;
  --btn-radius: 10px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25);
  --shadow-glow-primary: 0 0 20px rgba(102, 126, 234, 0.25);
  --shadow-glow-success: 0 0 16px rgba(0, 230, 118, 0.2);
  --shadow-glow-danger: 0 0 16px rgba(255, 82, 82, 0.2);

  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(170deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--gradient-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(102, 126, 234, 0.3);
}

.header__title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0.85));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background var(--transition-fast);
}
.header__action:active {
  background: rgba(255, 255, 255, 0.25);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  padding-top: calc(var(--header-height) + 8px);
  padding-bottom: calc(var(--nav-height) + 16px);
  padding-left: var(--content-padding);
  padding-right: var(--content-padding);
  min-height: 100vh;
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border-radius: 12px;
  transition: all var(--transition-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform var(--transition-fast);
}

.bottom-nav__label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.bottom-nav__tab.active .bottom-nav__label {
  color: var(--text-primary);
  font-weight: 600;
}

.bottom-nav__tab.active .bottom-nav__icon {
  transform: scale(1.15) translateY(-1px);
}

.bottom-nav__tab.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow-primary);
}

.bottom-nav__tab:active {
  transform: scale(0.92);
}

/* ============================================================
   CARDS — Glassmorphism
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--card-radius);
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.card:active {
  transform: scale(0.985);
}

.card--interactive:hover,
.card--interactive:focus-within {
  background: var(--bg-card-hover);
}

.card__title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.card__value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============================================================
   STATS ROW (Dashboard)
   ============================================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stats-row .card {
  text-align: center;
  padding: 14px 10px;
}

.stats-row .card__value {
  font-size: 1.35rem;
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
  display: block;
}

.stat--total .card__value { color: var(--accent-secondary); }
.stat--negative .card__value { color: var(--color-danger); }
.stat--positive .card__value { color: var(--color-success); }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  position: relative;
  margin-bottom: 14px;
}

.search-bar__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-bar__input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--input-radius);
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-bar__input::placeholder {
  color: var(--text-tertiary);
}

.search-bar__input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* ============================================================
   INVENTORY TABLE
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--card-radius);
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.inventory-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.inventory-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.inventory-table th {
  background: rgba(102, 126, 234, 0.12);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--bg-card-border);
}

.inventory-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.inventory-table tbody tr {
  transition: background var(--transition-fast);
}

.inventory-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.inventory-table tbody tr:last-child td {
  border-bottom: none;
}

/* Sticky first column (product name) */
.inventory-table th:first-child,
.inventory-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
}

.inventory-table th:first-child {
  background: rgba(102, 126, 234, 0.18);
}

.inventory-table tbody tr:hover td:first-child {
  background: rgba(255, 255, 255, 0.05);
}

/* Totals row */
.inventory-table .row-total {
  background: rgba(102, 126, 234, 0.08);
  font-weight: 700;
}
.inventory-table .row-total td {
  border-top: 2px solid var(--accent-primary);
  padding-top: 13px;
  padding-bottom: 13px;
}

/* Numeric alignment */
.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

/* ============================================================
   VARIANCE STATES
   ============================================================ */
.variance-positive {
  color: var(--color-success);
  background: rgba(0, 230, 118, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
}

.variance-negative {
  color: var(--color-danger);
  background: rgba(255, 82, 82, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
}

.variance-zero {
  color: var(--text-tertiary);
  padding: 3px 8px;
  display: inline-block;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-book {
  background: rgba(102, 126, 234, 0.15);
  color: #8da4ef;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.badge-actual {
  background: rgba(0, 230, 118, 0.12);
  color: #66ffaa;
  border: 1px solid rgba(0, 230, 118, 0.2);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.form-group label .required {
  color: var(--color-danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--input-radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: 12px 14px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='rgba(255,255,255,0.5)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select.form-control option {
  background: #1a1a2e;
  color: #fff;
}

/* ============================================================
   TOGGLE GROUP (Sổ sách / Thực tế)
   ============================================================ */
.toggle-group {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--input-radius);
  padding: 3px;
  margin-bottom: 18px;
}

.toggle-group__btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-align: center;
}

.toggle-group__btn.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-glow-primary);
}

.toggle-group__btn:active {
  transform: scale(0.97);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--btn-radius);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.96);
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background var(--transition-fast);
}

.btn:hover::after {
  background: rgba(255, 255, 255, 0.08);
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-glow-primary);
}

.btn-primary:hover {
  box-shadow: 0 0 30px rgba(102, 126, 234, 0.4);
}

.btn-danger {
  background: var(--gradient-danger);
  color: #fff;
  box-shadow: var(--shadow-glow-danger);
}

.btn-danger:hover {
  box-shadow: 0 0 30px rgba(255, 82, 82, 0.35);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--bg-card-border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
}

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  z-index: 50;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.fab:active {
  transform: scale(0.9) rotate(-90deg);
}

.fab:hover {
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

/* ============================================================
   TRANSACTION ITEM (History)
   ============================================================ */
.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.date-group__header {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 4px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-group__header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.transaction-item {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--card-radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.transaction-item:active {
  transform: scale(0.985);
  background: var(--bg-card-hover);
}

.transaction-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.transaction-item__product {
  font-weight: 600;
  font-size: 0.92rem;
  flex: 1;
  min-width: 0;
}

.transaction-item__product-code {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 400;
}

.transaction-item__amounts {
  display: flex;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.amount-in {
  color: var(--color-success);
}

.amount-out {
  color: var(--color-danger);
}

.transaction-item__note {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-style: italic;
}

.transaction-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.transaction-item__time {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.transaction-item__actions {
  display: flex;
  gap: 4px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal-overlay.show {
  opacity: 1;
}

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: linear-gradient(180deg, #1e1e38 0%, #151528 100%);
  border-radius: 20px 20px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal__title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background var(--transition-fast);
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal__footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 10px;
}

.modal__footer .btn {
  flex: 1;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 400px;
  pointer-events: none;
}

.toast {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastSlideIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
  backdrop-filter: blur(16px);
}

.toast.removing {
  animation: toastSlideOut 0.25s ease-in forwards;
}

.toast--success {
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.25);
  color: var(--color-success);
}

.toast--error {
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.25);
  color: var(--color-danger);
}

.toast--warning {
  background: rgba(255, 171, 64, 0.12);
  border: 1px solid rgba(255, 171, 64, 0.25);
  color: var(--color-warning);
}

.toast__icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-16px) scale(0.95);
  }
}

/* ============================================================
   LOADING / SPINNER
   ============================================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-card {
  height: 80px;
  border-radius: var(--card-radius);
  margin-bottom: 10px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   TAB CONTENT TRANSITIONS
   ============================================================ */
.tab-content {
  animation: fadeInUp 0.3s ease-out forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  animation: fadeIn 0.4s ease-out;
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
  display: block;
}

.empty-state__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.empty-state__desc {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  max-width: 260px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ============================================================
   PRODUCT CARD
   ============================================================ */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--card-radius);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform var(--transition-fast), background var(--transition-fast);
  backdrop-filter: blur(8px);
}

.product-card:active {
  transform: scale(0.985);
  background: var(--bg-card-hover);
}

.product-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.product-card__code {
  font-size: 0.75rem;
  color: var(--accent-secondary);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.product-card__name {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 2px;
}

.product-card__unit {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 6px;
}

.product-card__stocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.product-card__stock-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
  border-radius: 8px;
}

.product-card__stock-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.product-card__stock-value {
  font-size: 1rem;
  font-weight: 600;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-bar .form-control {
  height: 40px;
  font-size: 0.85rem;
}

.filter-bar .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 120px;
}

.filter-bar label {
  font-size: 0.72rem;
  margin-bottom: 4px;
}

/* ============================================================
   STOCK INFO CARD (Input Tab)
   ============================================================ */
.stock-info {
  background: rgba(102, 126, 234, 0.06);
  border: 1px solid rgba(102, 126, 234, 0.12);
  border-radius: var(--card-radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  animation: fadeIn 0.3s ease-out;
}

.stock-info__title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stock-info__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.stock-info__item {
  text-align: center;
}

.stock-info__label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}

.stock-info__value {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ============================================================
   EXPORT BUTTON
   ============================================================ */
.export-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* ============================================================
   LOAD MORE
   ============================================================ */
.load-more {
  text-align: center;
  padding: 16px 0;
}

/* ============================================================
   CONFIRM DIALOG SPECIFIC
   ============================================================ */
.confirm-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
  padding: 8px 0;
}

.confirm-highlight {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================================
   PULL TO REFRESH INDICATOR
   ============================================================ */
.pull-indicator {
  text-align: center;
  padding: 8px 0 0;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity var(--transition-fast);
}

.pull-indicator .spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.gap-1 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; justify-content: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (min-width: 480px) {
  html { font-size: 15px; }
  .main-content { max-width: 540px; margin: 0 auto; }
  .modal { border-radius: 20px; max-height: 80vh; }
  .modal-overlay { align-items: center; }
}

@media (min-width: 768px) {
  html { font-size: 16px; }
  .main-content { max-width: 680px; }
  .stats-row { gap: 14px; }
}

/* ============================================================
   ANIMATIONS — Micro-interactions
   ============================================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.animate-scale-in {
  animation: scaleIn 0.25s ease-out forwards;
}

/* ============================================================
   FORM DUAL INPUTS (Nhập / Xuất side by side)
   ============================================================ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row .form-group {
  margin-bottom: 0;
}

/* ============================================================
   DELETE BUTTON INLINE
   ============================================================ */
.btn-delete-inline {
  color: var(--color-danger);
  opacity: 0.7;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.btn-delete-inline:hover {
  opacity: 1;
  background: rgba(255, 82, 82, 0.1);
}

/* ============================================================
   NUMBER BADGE
   ============================================================ */
/* ============================================================
   LOCK SCREEN STYLE
   ============================================================ */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #1b1b36 0%, #050510 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lock-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), var(--shadow-glow-primary);
  animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.lock-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: pulse 2s infinite ease-in-out;
}

.lock-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff 0%, #00d2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lock-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.lock-error-text {
  animation: pulse 1s infinite alternate;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.error-shake {
  animation: errorShake 0.4s ease-in-out;
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 10px rgba(255, 82, 82, 0.3) !important;
}


