/* ===== Merchant Dashboard ===== */
.merchant-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 9900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
}
.merchant-page-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.merchant-page {
  width: min(100vw, 850px);
  min-height: 100vh;
  background: #0d1220;
  display: flex;
  flex-direction: column;
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.merchant-page-overlay.visible .merchant-page {
  transform: translateY(0);
}

.merchant-header {
  padding: 30px 24px 20px;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), transparent);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.merchant-header h1 {
  font-size: 1.5rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.merchant-header h1 span {
  color: #22c55e;
}

.merchant-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}
.merchant-close-btn:hover {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
  border-color: rgba(239,68,68,0.4);
}

.merchant-body {
  padding: 24px;
  flex: 1;
}

/* Store Setup / Settings */
.merchant-setup-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}
.merchant-setup-box h2 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 16px;
}
.merchant-form-group {
  margin-bottom: 16px;
}
.merchant-form-group label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
}
.merchant-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  transition: border-color 0.2s;
}
.merchant-input:focus {
  outline: none;
  border-color: #22c55e;
}
.merchant-btn {
  background: #22c55e;
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
}
.merchant-btn:hover {
  background: #16a34a;
  transform: translateY(-2px);
}
.merchant-btn-outline {
  background: transparent;
  color: #22c55e;
  border: 1px solid #22c55e;
}
.merchant-btn-outline:hover {
  background: rgba(34, 197, 94, 0.1);
}

/* Stats */
.merchant-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.m-stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}
.m-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: #22c55e;
  margin-bottom: 4px;
}
.m-stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* Items List */
.merchant-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.merchant-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.m-item-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.m-item-img {
  height: 140px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
}
.m-item-info {
  padding: 12px;
}
.m-item-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-item-price {
  font-size: 0.85rem;
  color: #22c55e;
  font-weight: 700;
}
.m-item-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.m-item-actions button {
  flex: 1;
  padding: 6px;
  border-radius: 6px;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 600;
}
.btn-m-del {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.btn-m-del:hover { background: #ef4444; color: #fff; }

/* Add Item Modal inside Merchant */
.m-add-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}
.m-add-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.m-add-modal {
  width: 90%;
  max-width: 500px;
  background: #141b2d;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  padding: 24px;
  transform: scale(0.9);
  transition: 0.3s;
  max-height: 90vh;
  overflow-y: auto;
}
.m-add-overlay.active .m-add-modal {
  transform: scale(1);
}

/* ===== Inventory / Accounting Panel ===== */
.inv-overlay {
  position: fixed;
  inset: 0;
  z-index: 9950;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}
.inv-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.inv-panel {
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  width: 100%;
  max-width: 900px;
  min-height: 500px;
  margin: auto;
  overflow: hidden;
}
.inv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: rgba(124,58,237,0.15);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.inv-header h1 {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.inv-close-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.inv-close-btn:hover { background: rgba(239,68,68,0.4); }

/* Tabs */
.inv-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.2);
  overflow-x: auto;
}
.inv-tab {
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.5);
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}
.inv-tab:hover { color: #fff; background: rgba(255,255,255,0.05); }
.inv-tab.active {
  background: rgba(124,58,237,0.25);
  border-color: rgba(124,58,237,0.5);
  color: #a78bfa;
}

/* Body */
.inv-body { padding: 20px 24px; }
.inv-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.inv-section-header h2 { color: #fff; font-size: 16px; }

/* Buttons */
.inv-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.inv-btn:hover { background: rgba(255,255,255,0.15); }
.inv-btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
  border-color: #7c3aed !important;
}
.inv-btn-primary:hover { background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important; }
.inv-btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: #f59e0b !important;
}
.inv-btn-sm { padding: 5px 12px; font-size: 12px; }

/* Table */
.inv-table-wrapper { overflow-x: auto; border-radius: 12px; border: 1px solid rgba(255,255,255,0.07); }
.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.inv-table th {
  background: rgba(124,58,237,0.15);
  color: rgba(255,255,255,0.7);
  padding: 10px 14px;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.inv-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #e2e8f0;
  vertical-align: middle;
}
.inv-table tr:hover td { background: rgba(255,255,255,0.03); }

/* Qty Buttons */
.inv-qty-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.inv-qty-btn:hover { background: rgba(124,58,237,0.3); }

/* Inline input */
.inv-inline-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  color: #fff;
  padding: 4px 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  outline: none;
}
.inv-inline-input:focus { border-color: #7c3aed; }

/* Stats Grid */
.inv-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 600px) { .inv-stats-grid { grid-template-columns: 1fr; } }
.inv-stat-card {
  padding: 16px;
  border-radius: 14px;
  text-align: center;
}
.inv-stat-card.green { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); }
.inv-stat-card.red { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); }
.inv-stat-card.gold { background: rgba(251,191,36,0.1); border: 1px solid rgba(251,191,36,0.2); }
.inv-stat-icon { font-size: 24px; margin-bottom: 6px; }
.inv-stat-value { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.inv-stat-label { font-size: 13px; color: rgba(255,255,255,0.6); }
.inv-stat-sub { font-size: 11px; color: rgba(255,255,255,0.35); margin-top: 4px; }

/* Modal */
.inv-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
  padding: 20px;
}
.inv-modal-overlay.visible { opacity: 1; }
.inv-modal {
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
}
.inv-form-group { margin-bottom: 14px; }
.inv-form-group label { display: block; color: rgba(255,255,255,0.7); font-size: 13px; margin-bottom: 6px; }
.inv-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  padding: 10px 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.inv-input:focus { border-color: #7c3aed; }
.inv-input option { background: #1e293b; }

/* Bar Chart */
.inv-chart-section { margin: 20px 0; }
.inv-chart-section h3 { color: #fff; margin-bottom: 16px; font-size: 15px; }
.inv-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 8px;
  height: 160px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 16px 12px 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.inv-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 4px;
}
.inv-bar-pair {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
}
.inv-bar {
  width: 14px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
}
.inv-bar.sales-bar { background: linear-gradient(to top, #22c55e, #4ade80); }
.inv-bar.expense-bar { background: linear-gradient(to top, #ef4444, #f87171); }
.inv-bar-label { font-size: 10px; color: rgba(255,255,255,0.4); text-align: center; }
.inv-chart-legend { display: flex; gap: 16px; justify-content: center; margin-top: 10px; font-size: 12px; color: rgba(255,255,255,0.6); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 4px; }

/* Report sections */
.inv-report-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
}
.inv-report-section h3 { color: #fff; margin-bottom: 12px; font-size: 15px; }

