/* ================================================
   SELLER PANEL - GLOBAL STYLES (UNIFIED)
   ================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f4f8f5;
  color: #1a202c;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: #4d7c5c; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================================================
   APP LAYOUT (flex - sidebar + main)
   ================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ================================================
   SIDEBAR (Dashboard style — sticky + flex)
   ================================================ */
.sidebar {
  width: 248px;
  background: linear-gradient(180deg, #1f3a24 0%, #14241a 100%);
  color: white;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

.sidebar-header {
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-header .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #4d7c5c, #86b09c);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.sidebar-header .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
}
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-nav .nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: white;
  text-decoration: none;
}
.sidebar-nav .nav-item.active {
  background: rgba(77,124,92,0.2);
  color: white;
  border-left-color: #86b09c;
  font-weight: 700;
}
.sidebar-nav .nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer .seller-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4d7c5c, #86b09c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.sidebar-footer .seller-info {
  flex: 1;
  min-width: 0;
}
.sidebar-footer .seller-name {
  font-size: 13px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-footer .seller-role {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

/* ================================================
   MAIN CONTENT
   ================================================ */
.main-content,
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: 0;  /* important - override old fixed-sidebar margin */
}

.topbar {
  position: sticky;
  top: 0;
  background: white;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid #e2e8f0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.hamburger,
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #475569;
  margin-right: 12px;
}
.topbar h1,
.page-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
  flex: 1;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar-user {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}
.btn-logout,
.logout-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}
.btn-logout:hover,
.logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239,68,68,0.25);
}

.page-content {
  flex: 1;
  padding: 24px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* ================================================
   RESPONSIVE (mobile)
   ================================================ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -248px;
    z-index: 1000;
    transition: left 0.3s;
  }
  .sidebar.open,
  .sidebar.show {
    left: 0;
  }
  .hamburger,
  .menu-toggle { display: block; }
  .topbar-user { display: none; }
  .page-content { padding: 16px; }
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ================================================
   COMMON COMPONENTS
   ================================================ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #4d7c5c, #355e3b);
  color: white;
  border-color: #355e3b;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(77,124,92,0.35);
}
.btn-secondary {
  background: white;
  color: #475569;
  border-color: #e2e8f0;
}
.btn-secondary:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }
.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-color: #059669;
}
.btn-success:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16,185,129,0.35);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border-color: #dc2626;
}
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 6px;
}
.form-group label .required { color: #ef4444; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: all 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: #4d7c5c;
  box-shadow: 0 0 0 3px rgba(77,124,92,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
.help-text { font-size: 11px; color: #94a3b8; margin-top: 4px; }

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f2f5;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border-left: 4px solid #4d7c5c;
  transition: all 0.2s;
}
.stat-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.stat-card.green { border-left-color: #10b981; }
.stat-card.blue { border-left-color: #3b82f6; }
.stat-card.purple { border-left-color: #8b5cf6; }
.stat-card.red { border-left-color: #ef4444; }
.stat-card.orange { border-left-color: #4d7c5c; }
.stat-card.cyan { border-left-color: #06b6d4; }
.stat-card.amber { border-left-color: #4d7c5c; }
.stat-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: #1a202c;
  margin-top: 6px;
}
.stat-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Tables */
.data-table {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  overflow: hidden;
  margin-bottom: 18px;
}
.table-header {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.table-header h3 {
  margin: 0;
  font-size: 15px;
  color: #1a202c;
  font-weight: 700;
}
.table-scroll { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: #475569;
  font-size: 11px;
  text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f2f5;
  color: #1a202c;
}
tr:hover td { background: #f8fafc; }

/* Status badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #e8f0e9; color: #2d4a32; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a202c;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #94a3b8;
}
.modal-close:hover { color: #1a202c; }
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  font-size: 13px;
  font-weight: 600;
  color: #1a202c;
  border-left: 4px solid #4d7c5c;
  animation: slideIn 0.25s;
  min-width: 240px;
  max-width: 360px;
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.info { border-left-color: #3b82f6; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}
.slider::before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: white;
  transition: 0.3s;
  border-radius: 50%;
}
input:checked + .slider { background: #10b981; }
input:checked + .slider::before { transform: translateX(20px); }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #4d7c5c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: #94a3b8;
}
.empty-icon { font-size: 56px; opacity: 0.4; margin-bottom: 12px; }

/* Action button (small) */
.action-btn {
  display: inline-block;
  padding: 5px 10px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 4px;
}
.action-btn:hover { background: #e2e8f0; color: #1a202c; }
.action-btn.primary { background: #4d7c5c; color: white; }
.action-btn.primary:hover { background: #355e3b; }
.action-btn.danger { background: #fee2e2; color: #991b1b; }
.action-btn.danger:hover { background: #fecaca; }

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-warning { background: #e8f0e9; color: #2d4a32; border-left: 4px solid #4d7c5c; }
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.alert-danger { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }