/* Navigation - Hamburger Menu */
.nav-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  flex-wrap: wrap;
}

.nav-brand {
  font-weight: 700;
  color: #fff;
  font-size: 1rem;
  margin-right: 0.5rem;
}

.nav-hamburger {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  margin-left: auto;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
}

.nav-spacer { flex: 1; }

.nav-link {
  color: #aaa;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all 0.3s;
  white-space: nowrap;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link.active {
  color: #4fc3f7;
  background: rgba(79, 195, 247, 0.1);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#navUserInfo {
  color: #66bb6a;
  font-size: 0.8rem;
  display: none;
}

.nav-logout-btn {
  padding: 0.3rem 0.7rem;
  background: transparent;
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
}

.nav-logout-btn:hover { color: #fff; border-color: rgba(255,255,255,0.4); }

/* User icon dropdown */
.user-menu-wrapper { position: relative; }

.user-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(102, 187, 106, 0.5);
  background: rgba(102, 187, 106, 0.1);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.user-icon-btn:hover { border-color: #66bb6a; background: rgba(102, 187, 106, 0.2); }

.user-dropdown {
  display: none;
  position: absolute;
  top: 42px;
  right: 0;
  min-width: 180px;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.8rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 1000;
}
.user-dropdown.show { display: block; }

.user-dropdown-name { color: #fff; font-weight: 600; font-size: 0.9rem; }
.user-dropdown-role { color: #4fc3f7; font-size: 0.75rem; text-transform: capitalize; margin-top: 0.2rem; }

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
  border-radius: 5px;
  transition: all 0.2s;
}
.user-dropdown-item:hover { background: rgba(255,255,255,0.08); color: #fff; }

.nav-admin { /* visibility controlled by nav.js */ }

@media (max-width: 768px) {
  .nav-hamburger { display: block; font-size: 1.5rem; padding: 0.5rem; }
  .nav-menu { display: none; flex-direction: column; width: 100%; padding-top: 0.5rem; gap: 0.2rem; }
  .nav-menu.open { display: flex; }
  .nav-menu .nav-link { width: 100%; padding: 0.8rem 1rem; font-size: 0.95rem; border-radius: 8px; }
  .nav-menu .nav-link:active { background: rgba(255,255,255,0.1); }
  .nav-spacer { display: none; }
  .nav-user { width: 100%; padding: 0.5rem 0; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 0.3rem; display: flex; justify-content: space-between; align-items: center; }
  .user-dropdown { right: 0; left: 0; min-width: unset; }
  .noti-panel { position: fixed !important; top: auto !important; bottom: 0 !important; left: 0 !important; right: 0 !important; width: 100% !important; max-width: 100vw !important; max-height: 60vh !important; border-radius: 12px 12px 0 0 !important; margin-top: 0 !important; }
  .nav-noti-wrapper { position: static !important; }
}

/* Role Notice */
.role-notice {
  background: rgba(239, 83, 80, 0.1);
  border: 1px solid rgba(239, 83, 80, 0.3);
  border-radius: 10px;
  padding: 1.5rem;
  text-align: center;
  color: #ef5350;
}

.role-notice strong { color: #fff; }

/* Card Location */
.card-location {
  font-size: 0.75rem;
  color: #4fc3f7;
  margin-bottom: 0.3rem;
}

.card-unavailable {
  opacity: 0.5;
  border-color: rgba(239, 83, 80, 0.3) !important;
}

/* Order Page Styles */
.order-header-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.order-id {
  font-family: monospace;
  font-size: 0.85rem;
  color: #4fc3f7;
  margin-bottom: 0.5rem;
}

.order-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: #aaa;
}

.order-status-badge {
  padding: 0.2rem 0.7rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.status-completed { background: rgba(102, 187, 106, 0.2); color: #66bb6a; }
.status-rejected { background: rgba(239, 83, 80, 0.2); color: #ef5350; }

.order-location-group {
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
}

.order-location-header {
  font-size: 0.9rem;
  color: #4fc3f7;
  font-weight: 600;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.order-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  flex-wrap: wrap;
}

.order-item-info { display: flex; align-items: center; gap: 0.6rem; flex: 1; }
.order-item-qty { font-weight: 600; color: #fff; min-width: 40px; }
.order-item-price { color: #66bb6a; font-weight: 600; min-width: 70px; }
.order-item-status { min-width: 80px; }
.order-item-actions { display: flex; gap: 0.3rem; }

.ois-badge { padding: 0.2rem 0.6rem; border-radius: 10px; font-size: 0.7rem; font-weight: 600; }
.ois-available { background: rgba(102, 187, 106, 0.2); color: #66bb6a; }
.ois-pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.ois-sold { background: rgba(79, 195, 247, 0.2); color: #4fc3f7; }
.ois-revoked { background: rgba(158, 158, 158, 0.2); color: #9e9e9e; }
.ois-insufficient, .ois-not_found { background: rgba(239, 83, 80, 0.2); color: #ef5350; }
.ois-failed { background: rgba(239, 83, 80, 0.3); color: #ef5350; }
.ois-pending { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.ois-completed { background: rgba(102, 187, 106, 0.2); color: #66bb6a; }
.ois-rejected { background: rgba(239, 83, 80, 0.2); color: #ef5350; }

.item-ok { }
.item-sold { opacity: 0.6; }
.item-revoked { opacity: 0.4; text-decoration: line-through; }
.item-warning { border-left: 3px solid #ef5350; padding-left: 0.8rem; }

.order-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.3rem;
  border-radius: 10px;
}

.tab {
  flex: 1;
  padding: 0.8rem 1rem;
  background: transparent;
  border: none;
  color: #888;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
}

.tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab.active {
  color: #fff;
  background: rgba(79, 195, 247, 0.15);
  border: 1px solid rgba(79, 195, 247, 0.3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* Buttons */
.primary-btn {
  padding: 0.6rem 1.4rem;
  background: #4fc3f7;
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.primary-btn:hover {
  background: #81d4fa;
  transform: translateY(-1px);
}

.secondary-btn {
  padding: 0.6rem 1.4rem;
  background: transparent;
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.secondary-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Form Card */
.form-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-card h3 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  color: #aaa;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4fc3f7;
}

.form-group select option {
  background: #1a1a2e;
  color: #fff;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  margin-top: 0.3rem;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 26px;
  cursor: pointer;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, #ffd700, #ff69b4);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Merchant Grid */
.merchant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.merchant-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 1.2rem;
  transition: all 0.2s;
}

.merchant-card:hover {
  border-color: rgba(79, 195, 247, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.merchant-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.merchant-card h3 {
  color: #fff;
  font-size: 1.1rem;
  margin: 0;
}

.merchant-card .merchant-desc {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.merchant-card .merchant-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #aaa;
}

.merchant-card .merchant-stats span {
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.merchant-delete-btn {
  background: transparent;
  border: none;
  color: #ef5350;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: background 0.3s;
}

.merchant-delete-btn:hover {
  background: rgba(239, 83, 80, 0.2);
}

/* Stock Filters */
.stock-filters {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.stock-filters input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
}

.stock-filters input:focus {
  outline: none;
  border-color: #4fc3f7;
}

.stock-filters select {
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  min-width: 180px;
}

.stock-filters select option {
  background: #1a1a2e;
}

/* Stock Table */
.stock-table-wrap {
  overflow-x: auto;
}

.stock-table {
  width: 100%;
  border-collapse: collapse;
}

.stock-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  color: #888;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stock-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.stock-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.stock-card-cell {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.stock-thumb {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: zoom-in;
}

.stock-thumb.foil-shimmer-wrap {
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.stock-card-name {
  font-weight: 500;
  color: #fff;
}

.stock-card-set {
  font-size: 0.75rem;
  color: #888;
}

.stock-foil-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: linear-gradient(135deg, #ffd700, #ff69b4);
  color: #1a1a2e;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  margin-left: 0.4rem;
}

.stock-merchant-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(79, 195, 247, 0.15);
  color: #4fc3f7;
  border-radius: 6px;
  font-size: 0.75rem;
}

.stock-price {
  color: #66bb6a;
  font-weight: 600;
}

.stock-qty {
  text-align: center;
}

.sell-btn {
  padding: 0.4rem 0.8rem;
  background: rgba(102, 187, 106, 0.2);
  color: #66bb6a;
  border: 1px solid rgba(102, 187, 106, 0.4);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s;
}

.sell-btn:hover {
  background: rgba(102, 187, 106, 0.4);
}

.stock-delete-btn {
  padding: 0.4rem 0.6rem;
  background: transparent;
  color: #ef5350;
  border: 1px solid rgba(239, 83, 80, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.3s;
}

.stock-delete-btn:hover {
  background: rgba(239, 83, 80, 0.2);
}

.stock-actions {
  display: flex;
  gap: 0.4rem;
}

/* Sales Summary */
.sales-summary {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(102, 187, 106, 0.08);
  border: 1px solid rgba(102, 187, 106, 0.2);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.sales-stat {
  display: flex;
  flex-direction: column;
}

.sales-stat-label {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
}

.sales-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #66bb6a;
}

.sales-stat-value.profit {
  color: #66bb6a;
}

.sales-stat-value.loss {
  color: #ef5350;
}

/* Sale row date */
.sale-date {
  font-size: 0.8rem;
  color: #aaa;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.empty-state .empty-hint {
  font-size: 0.85rem;
  color: #555;
}

/* Add Stock Search Results */
.add-stock-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.5rem 0;
}

/* Step Sections */
.step-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
  transition: opacity 0.3s;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.step-header h3 {
  color: #fff;
  font-size: 1rem;
  margin: 0;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(79, 195, 247, 0.2);
  color: #4fc3f7;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}

.step-body select {
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  min-width: 220px;
}

.step-body select option {
  background: #1a1a2e;
}

.selected-merchant-label {
  margin-left: 1rem;
  color: #66bb6a;
  font-weight: 500;
}

.search-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.search-row input {
  flex: 1;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
}

.search-row input:focus {
  outline: none;
  border-color: #4fc3f7;
}

.search-row select {
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
}

.search-row select option {
  background: #1a1a2e;
}

/* Pending List */
.pending-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: #4fc3f7;
  background: rgba(79, 195, 247, 0.1);
  padding: 0.2rem 0.8rem;
  border-radius: 12px;
}

.pending-list {
  max-height: 350px;
  overflow-y: auto;
}

.pending-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s;
}

.pending-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.pending-item-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 0;
}

.pending-thumb {
  width: 32px;
  height: 45px;
  object-fit: cover;
  border-radius: 3px;
}

.pending-item-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pending-item-set {
  font-size: 0.7rem;
  color: #888;
}

.pending-item-price {
  color: #66bb6a;
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 60px;
}

.pending-item-qty {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pending-item-qty button {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pending-item-qty button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.pending-item-qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 500;
  color: #fff;
}

.pending-item-total {
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 70px;
  text-align: right;
}

.pending-remove-btn {
  background: transparent;
  border: none;
  color: #ef5350;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem 0.4rem;
}

.pending-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0.5rem;
}

.pending-total {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
}

.pending-total span:first-child {
  color: #aaa;
}

#pendingTotal {
  color: #66bb6a;
  font-weight: 700;
}

.confirm-btn {
  padding: 0.7rem 1.5rem;
  background: #66bb6a;
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.3s;
}

.confirm-btn:hover {
  background: #81c784;
  transform: translateY(-1px);
}

.add-stock-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s;
}

.add-stock-card:hover {
  border-color: rgba(79, 195, 247, 0.4);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.add-stock-card.foil-border {
  border-color: rgba(255, 215, 0, 0.3);
}

.add-stock-card img {
  width: 100%;
  max-width: 160px;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.add-stock-card .asc-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
  margin-bottom: 0.2rem;
}

.add-stock-card .asc-set {
  font-size: 0.7rem;
  color: #888;
  text-align: center;
  margin-bottom: 0.4rem;
}

.add-stock-card .asc-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #66bb6a;
  margin-bottom: 0.6rem;
}

.add-stock-card .asc-qty-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.add-stock-card .asc-qty-row label {
  font-size: 0.75rem;
  color: #aaa;
}

.add-stock-card .asc-qty-row input {
  width: 50px;
  padding: 0.3rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
}

.add-stock-card .asc-add-btn {
  width: 100%;
  padding: 0.5rem;
  background: #66bb6a;
  color: #1a1a2e;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.add-stock-card .asc-add-btn:hover {
  background: #81c784;
}

.add-stock-card .asc-add-btn.added {
  background: #4fc3f7;
}

/* Market Page Styles */
.market-results {
  margin-top: 1rem;
}

.card-ck-price {
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
  color: #aaa;
}

.card-date {
  font-size: 0.7rem;
  color: #666;
  margin-bottom: 0.6rem;
}

.ck-live-price {
  color: #4fc3f7;
  font-weight: 600;
}

.ck-diff {
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.3rem;
}

.ck-diff.diff-up {
  color: #66bb6a;
}

.ck-diff.diff-down {
  color: #ef5350;
}

/* Cart price input */
.cart-price-input {
  width: 70px;
  padding: 0.3rem 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #66bb6a;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.cart-price-input:focus {
  outline: none;
  border-color: #4fc3f7;
}

.market-item-cost {
  font-size: 0.8rem;
  color: #aaa;
  min-width: 70px;
}

.market-item-sale-price {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 100px;
}

/* Confirm All button */
.confirm-all-btn {
  padding: 0.6rem 1.4rem;
  background: #66bb6a;
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.confirm-all-btn:hover {
  background: #81c784;
  transform: translateY(-1px);
}

/* Buyer row */
.buyer-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 0.6rem 0;
}

.buyer-row label {
  color: #aaa;
  font-size: 0.9rem;
}

.buyer-row input {
  flex: 1;
  max-width: 300px;
  padding: 0.5rem 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
}

.buyer-row input:focus {
  outline: none;
  border-color: #4fc3f7;
}

/* Modal (shared) */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 2rem;
  min-width: 380px;
  max-width: 90vw;
}

.modal-content h3 {
  color: #fff;
  margin-bottom: 1rem;
}

#buyCardInfo, #sellCardInfo {
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* Fee Config Card */
.fee-config-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.fee-config-card h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.fee-config-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.fee-config-row label {
  color: #aaa;
  font-size: 0.9rem;
}

.fee-config-row input {
  width: 80px;
  padding: 0.5rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
}

.fee-config-row input:focus {
  outline: none;
  border-color: #4fc3f7;
}

.fee-hint {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.5rem;
}

.fee-save-status {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Summary Content */
.summary-content {
  margin-top: 1rem;
}

.fee-banner {
  padding: 0.6rem 1rem;
  background: rgba(239, 83, 80, 0.1);
  border: 1px solid rgba(239, 83, 80, 0.2);
  border-radius: 8px;
  color: #ef5350;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.fee-banner strong {
  color: #fff;
}

.summary-month-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.summary-month-header {
  margin-bottom: 1rem;
}

.summary-month-header h3 {
  color: #4fc3f7;
  font-size: 1.1rem;
  margin: 0 0 0.6rem 0;
}

.summary-month-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.smt-item {
  font-size: 0.85rem;
  color: #aaa;
  padding: 0.3rem 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.smt-item strong {
  color: #fff;
}

.smt-fee {
  border: 1px solid rgba(239, 83, 80, 0.2);
}

.smt-net {
  border: 1px solid rgba(102, 187, 106, 0.2);
}

.summary-table td,
.summary-table th {
  font-size: 0.85rem;
}

.sale-details {
  padding: 0 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
}

.sale-details.hidden {
  display: none;
}

/* Date inputs in filters */
.stock-filters input[type="date"] {
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
}

.stock-filters input[type="date"]:focus {
  outline: none;
  border-color: #4fc3f7;
}

.stock-filters input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Responsive */
@media (max-width: 768px) {
  .tabs {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .tab {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

  .stock-filters {
    flex-direction: column;
    gap: 0.5rem;
  }

  .stock-filters input,
  .stock-filters select {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 1rem;
  }

  .sales-summary {
    flex-direction: column;
    gap: 0.8rem;
  }

  .nav-bar {
    flex-wrap: wrap;
    padding: 0.5rem 0.8rem;
  }

  .nav-brand {
    font-size: 0.9rem;
  }

  .stock-table {
    font-size: 0.75rem;
  }

  .stock-table th,
  .stock-table td {
    padding: 0.4rem 0.3rem;
  }

  .stock-thumb {
    width: 28px;
    height: 40px;
  }

  .stock-card-cell {
    gap: 0.3rem;
  }

  .stock-card-name {
    font-size: 0.75rem;
  }

  .section-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .section-header button {
    width: 100%;
  }

  /* Add stock card grid */
  .add-stock-results {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
  }

  .add-stock-card {
    padding: 0.6rem;
  }

  .add-stock-card img {
    border-radius: 4px;
  }

  .asc-name {
    font-size: 0.75rem;
  }

  .asc-set {
    font-size: 0.65rem;
  }

  /* Pending list */
  .pending-item {
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.5rem;
  }

  .pending-item-info {
    width: 100%;
  }

  /* Summary */
  .summary-month-card {
    padding: 1rem;
  }

  .summary-month-totals {
    flex-direction: column;
    gap: 0.3rem;
  }

  .summary-table {
    font-size: 0.7rem;
  }

  /* Orders page */
  .order-group {
    padding: 0.8rem;
  }

  .order-item {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  /* Cart items */
  .market-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.8rem;
  }

  .market-item-info {
    width: 100%;
  }

  .market-item-qty {
    align-self: flex-end;
  }

  /* Confirm/Primary buttons full width on mobile */
  .confirm-btn,
  .confirm-all-btn {
    width: 100%;
  }

  /* POS page */
  .pos-layout {
    grid-template-columns: 1fr;
  }

  .pos-binder-box {
    padding: 0.8rem;
  }

  .pos-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
  }

  .pos-cart-row {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .pos-summary-row {
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  /* User menu dropdown */
  .user-dropdown {
    right: 0;
    min-width: 200px;
  }

  /* Search row stack on mobile */
  .search-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  .search-row input,
  .search-row select,
  .search-row button {
    width: 100%;
  }

  /* Modal responsive */
  .modal-content {
    min-width: unset !important;
    width: calc(100vw - 2rem) !important;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Stage tracker smaller on mobile */
  .stage-step {
    min-width: 50px !important;
  }
  .stage-label {
    font-size: 0.6rem !important;
  }

  /* Fee/settings */
  .fee-config-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Pending actions stack */
  .pending-actions {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
}

/* Tablet (iPad) */
@media (min-width: 769px) and (max-width: 1024px) {
  .stock-table {
    font-size: 0.8rem;
  }

  .add-stock-results {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .pos-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}
