:root {
  --brand-primary: #DFF24B;
  --brand-secondary: #E4F277;
  --brand-primary-soft: #ECF2BB;
  --text-main: #0D0D0D;
  --text-secondary: #666666;
  --page-background: #FFFFFF;
  --surface: #FFFFFF;
  --border: #E0E0E0;
  --success: #16803C;
  --warning: #D97706;
  --error: #DC2626;

  /* Mapped aliases */
  --brand: var(--brand-primary, #DFF24B);
  --brand-light: var(--brand-primary-soft, #ECF2BB);
  --brand-dark: var(--brand-secondary, #E4F277);
  --ink: var(--text-main, #0D0D0D);
  --ink-light: #222222;
  --muted: var(--text-secondary, #666666);
  --muted-light: #888888;
  --line: var(--border, #E0E0E0);
  --card: var(--surface, #FFFFFF);
  --bg: var(--page-background, #FFFFFF);
  --sidebar: #0D0D0D;
  --sidebar-hover: #1f1f1f;
  --sidebar-active: var(--brand-primary, #DFF24B);
  --sidebar-text: #999999;
  --sidebar-text-active: #ffffff;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 12px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 24px -4px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { 
  box-sizing: border-box; 
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: "Outfit", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.seller-root {
  display: flex;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* Login View Revamp */
.login-view {
  flex: 1;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top right, #ECF2BB, transparent),
              radial-gradient(circle at bottom left, #f0f9ff, transparent);
  padding: 24px;
}

.panel {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  text-align: center;
}

.panel h1 { 
  margin: 0 0 12px; 
  font-size: 2rem;
  font-weight: 800;
  color: var(--sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.panel h1 i { color: var(--brand); }
.panel p { margin: 0 0 32px; color: var(--muted); font-size: 1.1rem; }

.panel label { 
  display: block; 
  margin: 0 0 8px; 
  font-size: 0.9rem; 
  font-weight: 600; 
  color: var(--ink);
  text-align: left;
}

.panel input {
  margin-bottom: 20px;
}

/* App View Layout */
.app-view {
  display: flex;
  width: 100%;
}

/* Sidebar Revamp */
.sidebar {
  width: 280px;
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
}

.sidebar .head {
  padding: 0 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.sidebar .head h2 { 
  margin: 0; 
  font-size: 1.25rem; 
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.sidebar .head h2 i { color: var(--brand); }
.sidebar .head p { 
  margin: 4px 0 0; 
  color: var(--sidebar-text); 
  font-size: 0.85rem;
  font-weight: 500;
}

.tabs { display: flex; flex-direction: column; gap: 4px; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.tab-btn i { font-size: 1.1rem; width: 24px; text-align: center; }

.tab-btn:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.tab-btn.active {
  background: var(--brand);
  color: #fff;
}

.tab-btn.active i { color: #fff; }

.tab-content {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tab-content.active {
  display: block;
}

/* Workspace & Topbar */
.workspace {
  flex: 1;
  padding: 32px;
  min-width: 0;
  background: #fcfcfd;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  padding: 8px;
  width: 40px;
  height: 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  background: #fff;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.topbar h2 { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--sidebar); }
.topbar p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

.actions { display: flex; align-items: center; gap: 16px; }

#sellerSortSelect {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background-color: #fff;
  cursor: pointer;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.stats-grid.secondary-stats {
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 32px;
  gap: 16px;
}

.stats-grid.secondary-stats article {
  padding: 16px;
  background: #fcfcfd;
  border-style: dashed;
}

.stats-grid.secondary-stats p {
  font-size: 0.75rem;
}

.stats-grid.secondary-stats strong {
  font-size: 1.25rem;
}

.stats-grid article {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.stats-grid article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.btn.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-sm i { font-size: 0.9rem; margin-right: 4px; }
.btn-sm:only-child i { margin: 0; }

.stats-grid p { 
  margin: 0 0 8px; 
  color: var(--muted); 
  font-size: 0.9rem; 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-grid strong { 
  font-size: 2rem; 
  font-weight: 800; 
  color: var(--sidebar);
}

/* Inputs & Buttons */
input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d0d5dd;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.ghost {
  background: #fff;
  color: #344054;
  border-color: #d0d5dd;
}

.btn.ghost:hover {
  background: #f9fafb;
}

/* Cards & Tables */
.table-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.table-card h3 { 
  margin: 0 0 4px; 
  font-size: 1.25rem; 
  font-weight: 700;
  color: var(--sidebar);
}

.table-card > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hint {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hint::before {
  content: "\f05a";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--brand);
}

/* Products Layout */
.products-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}

.pricing-card {
  position: sticky;
  top: 32px;
  background: linear-gradient(180deg, #fff, #f9fafb);
  height: fit-content;
}

.price-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.price-sheet > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
}

.price-sheet span { color: var(--muted); font-weight: 500; font-size: 0.9rem; }
.price-sheet strong { color: var(--ink); font-weight: 700; }

.price-sheet div.highlight {
  background: var(--brand-light);
  border-color: var(--brand);
}

.price-sheet div.highlight strong {
  color: var(--brand-dark);
}

.price-preview {
  margin-top: 20px;
  padding: 20px;
  background: var(--brand);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: center;
}

.price-preview span { display: block; color: var(--ink); font-size: 0.85rem; margin-bottom: 4px; }
.price-preview strong { display: block; font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.price-preview small { display: block; margin-top: 8px; color: var(--ink); font-weight: 600; }

/* Orders Workflow */
.order-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  overflow-x: auto;
}

.order-tab {
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: var(--transition);
}

.order-tab:hover { color: var(--brand); }

.order-tab.active {
  color: var(--brand);
}

.order-tab.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--brand);
}

.order-tab span {
  background: #f2f4f7;
  color: #344054;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  margin-left: 6px;
}

.orders-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.orders-summary-grid article {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.orders-summary-grid p { margin: 0 0 4px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.orders-summary-grid strong { font-size: 1.25rem; font-weight: 800; color: var(--sidebar); }

.order-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.order-card:hover {
  box-shadow: var(--shadow);
  border-color: #d0d5dd;
}

.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.order-card-top h4 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.order-card-sub { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

.order-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.order-meta-grid div {
  background: #f9fafb;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #f2f4f7;
}

.order-meta-grid span { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; margin-bottom: 2px; }
.order-meta-grid strong { font-size: 0.95rem; color: var(--ink); }

.order-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pill.pending { background: #fffaeb; color: #b54708; border: 1px solid #fedf89; }
.pill.approved { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.pill.rejected { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }

/* Responsive */
/* Additional Components */
.card-header-with-icon {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.card-header-with-icon i {
  font-size: 1.5rem;
  color: var(--brand);
  background: var(--brand-light);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.card-header-with-icon h3 { margin: 0; }
.card-header-with-icon p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.orders-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-box input {
  padding-left: 40px;
}

.toolbar-actions {
  display: flex;
  gap: 12px;
}

.image-inputs-grid input {
  font-size: 0.85rem;
}

.photo-upload-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.photo-upload-card {
  position: relative;
  min-height: 154px;
  border: 1.5px dashed #d0d5dd;
  border-radius: var(--radius);
  background: #fcfcfd;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
}

.photo-upload-card:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.photo-upload-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-upload-card .photo-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #ECF2BB;
  color: var(--brand);
  font-size: 1.2rem;
}

.photo-upload-card strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.photo-upload-card small {
  font-weight: 700;
  color: var(--muted-light);
}

.photo-upload-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: 1;
}

.photo-upload-card.has-image {
  border-style: solid;
  border-color: var(--brand);
}

.photo-upload-card.has-image::after {
  content: "Change";
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(16, 24, 40, 0.82);
  color: #fff;
  padding: 5px 9px;
  font-size: 0.75rem;
  font-weight: 800;
}

.photo-upload-card.has-image img {
  display: block;
}

.upload-msg {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.upload-msg.error {
  color: #c53b2f;
}

.upload-msg.success {
  color: #1d7d34;
}

.orders-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  margin-bottom: 20px;
}

.orders-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.orders-head-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f0fdf9;
  color: #0e7490;
  border: 1px solid #cffafe;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Responsive */
@media (max-width: 1200px) {
  .menu-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    z-index: 2000;
    height: 100vh;
    width: 280px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.show { left: 0; }
  .sidebar .head p, .sidebar .tab-btn span { display: block; }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    z-index: 1999;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 768px) {
  .workspace { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: stretch; gap: 16px; }
  .actions { width: 100%; justify-content: space-between; }
  .orders-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .order-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .orders-summary-grid { grid-template-columns: 1fr; }
  .order-meta-grid { grid-template-columns: 1fr; }
  .order-actions-grid { grid-template-columns: 1fr; }
  .photo-upload-grid { grid-template-columns: 1fr; }
}.profile-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-item label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-item strong {
  font-size: 1.1rem;
  color: var(--sidebar);
}

.profile-address label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Shipping Label Styling (Rigid 4x6 Thermal Optimized) */
.shipping-label {
  width: 4in;
  height: 6in;
  background: #fff;
  color: #000;
  font-family: "Outfit", sans-serif;
  border: 4px solid #000;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 auto;
  display: grid;
  grid-template-rows: 140px 100px auto 116px auto;
  box-sizing: border-box;
}

.label-header-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  border-bottom: 3px solid #000;
  overflow: hidden;
}

.label-cell {
  padding: 8px;
  border-right: 3px solid #000;
  overflow: hidden;
}

.label-cell:last-child {
  border-right: none;
}

.label-cell label {
  display: block;
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.address-box {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.1;
  word-wrap: break-word;
  max-height: 100px;
  overflow: hidden;
}

.address-box.big {
  font-size: 1rem;
  max-height: 110px;
}

.payment-header {
  background: #000;
  color: #fff;
  padding: 4px;
  text-align: center;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  margin: 2px;
}

.partner-info {
  font-size: 0.75rem;
  padding: 0 4px;
}

.partner-info h4 { margin: 2px 0; font-size: 0.85rem; }
.partner-info p { margin: 1px 0; font-weight: 600; }

.badge-pickup {
  background: #000;
  color: #fff;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.6rem;
}

.qr-box {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
}

#lblQRCode canvas, #lblQRCode img {
  width: 100px !important;
  height: 100px !important;
}

.logo-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px;
}

.thermal-dot-logo {
  width: 170px;
  max-width: 100%;
  height: auto;
  display: block;
}

.label-barcode {
  display: block;
  width: 100%;
  height: 68px;
  margin-top: 4px;
}

.label-table {
  width: 100%;
  border-collapse: collapse;
}

.label-table th {
  background: #fff;
  border-bottom: 3px solid #000;
  padding: 4px 8px;
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.label-table td {
  padding: 6px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  vertical-align: top;
}

.label-footer {
  border-top: 3px solid #000;
  padding: 8px;
  text-align: center;
  background: #fff;
}

.total-label {
  font-size: 0.8rem;
  font-weight: 700;
  display: block;
}

#lblTotalAmount {
  font-size: 2rem;
  margin: 0;
  font-weight: 800;
}

/* Printing logic */
@media print {
  body * { visibility: hidden; }
  #flashfitLabel, #flashfitLabel * { visibility: visible; }
  #flashfitLabel {
    position: fixed;
    left: 0;
    top: 0;
    width: 4in;
    height: 6in;
    border: 4px solid #000;
    border-radius: 0;
  }
}

/* Mobile-first app polish: presentation only, no functional hooks changed */
html {
  width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  overflow-x: hidden;
}

img,
canvas,
svg,
video {
  max-width: 100%;
}

button,
input,
select,
textarea,
a {
  -webkit-tap-highlight-color: transparent;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .full,
.form-group.full,
textarea.full {
  grid-column: 1 / -1;
}

.form-row {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.dashboard-visuals {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.chart-card,
.chart-container {
  min-width: 0;
}

.chart-container {
  position: relative;
  width: 100%;
  min-height: 280px;
}

.chart-container canvas {
  width: 100% !important;
  max-width: 100%;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.chart-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-stat {
  min-width: 116px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mini-stat strong {
  display: block;
  margin-top: 3px;
  color: var(--sidebar);
  font-size: 1.1rem;
}

.table-responsive,
.responsive-table,
#productsTable,
#ordersTable,
#earningsTable,
#reviewsTable,
#shopProfileCard {
  max-width: 100%;
  min-width: 0;
}

.table-responsive,
.responsive-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive table,
.responsive-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.table-responsive th,
.table-responsive td,
.responsive-table th,
.responsive-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-responsive th,
.responsive-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #f8fafc;
}

.table-responsive td,
.responsive-table td {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.msg,
.empty-orders,
.hint,
.order-card,
.table-card,
.profile-item,
.profile-address {
  overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
  .workspace {
    padding: 22px;
  }

  .stats-grid,
  .stats-grid.secondary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .products-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .pricing-card {
    position: static;
  }

  .orders-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  :root {
    --radius: 14px;
    --radius-lg: 18px;
  }

  body {
    background: #f3f6fb;
  }

  .seller-root,
  .app-view {
    display: block;
    min-height: 100svh;
  }

  .login-view {
    min-height: 100svh;
    padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
  }

  .panel {
    padding: 28px 20px;
    border-radius: 22px;
  }

  .panel h1 {
    flex-direction: column;
    gap: 4px;
    font-size: 1.55rem;
  }

  .panel p {
    margin-bottom: 24px;
    font-size: 0.98rem;
  }

  .workspace {
    width: 100%;
    min-height: 100svh;
    padding: max(12px, env(safe-area-inset-top)) 12px calc(104px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #fff7ed 0, #f7f8fb 160px, #f7f8fb 100%);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: -12px -12px 14px;
    padding: calc(12px + env(safe-area-inset-top)) 14px 12px;
    border: 0;
    border-bottom: 1px solid rgba(234, 236, 240, 0.9);
    border-radius: 0 0 22px 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  }

  .topbar-left {
    gap: 10px;
    min-width: 0;
  }

  .menu-toggle {
    display: none;
  }

  .topbar h2 {
    font-size: clamp(1.08rem, 5vw, 1.32rem);
    line-height: 1.15;
  }

  .topbar p {
    max-width: 100%;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) repeat(2, auto);
    gap: 8px;
    width: 100%;
  }

  #sellerSortSelect {
    min-width: 0;
    height: 42px;
    padding: 8px 10px;
    font-size: 0.84rem;
  }

  .actions .btn {
    min-width: 44px;
    height: 42px;
    padding: 0 12px;
    font-size: 0;
    border-radius: 14px;
  }

  .actions .btn i {
    margin: 0;
    font-size: 1rem;
  }

  .sidebar {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1500;
    width: 100%;
    height: auto;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    border-top: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 -12px 34px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(18px);
  }

  .sidebar.show {
    left: 0;
  }

  .sidebar .head,
  .sidebar-overlay,
  .sidebar-overlay.show {
    display: none;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }

  .tab-btn {
    min-width: 0;
    min-height: 58px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 7px 3px;
    color: #667085;
    border-radius: 15px;
    font-size: 0.68rem;
    line-height: 1.05;
    text-align: center;
  }

  .tab-btn i {
    width: auto;
    font-size: 1.05rem;
  }

  .tab-btn span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tab-btn.active {
    background: #ECF2BB;
    color: var(--brand-dark);
    box-shadow: inset 0 0 0 1px #ECF2BB;
  }

  .tab-btn.active i {
    color: var(--brand-dark);
  }

  .tab-content.active {
    opacity: 1;
  }

  .stats-grid,
  .stats-grid.secondary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .stats-grid article,
  .stats-grid.secondary-stats article {
    min-height: 106px;
    padding: 15px;
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  }

  .stats-grid article:hover {
    transform: none;
  }

  .stats-grid p,
  .stats-grid.secondary-stats p {
    margin-bottom: 7px;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
  }

  .stats-grid strong,
  .stats-grid.secondary-stats strong {
    font-size: clamp(1.35rem, 8vw, 1.8rem);
    line-height: 1.08;
  }

  .table-card {
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  }

  .table-card h3 {
    font-size: 1.05rem;
    line-height: 1.25;
  }

  .table-card > p,
  .card-header-with-icon p,
  .hint {
    font-size: 0.84rem;
  }

  .card-header-with-icon {
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 16px;
  }

  .card-header-with-icon i {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 14px;
    font-size: 1.1rem;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .form-row,
  .orders-toolbar,
  .toolbar-actions,
  .orders-card-head,
  .order-card-top,
  .chart-head {
    flex-direction: column;
    align-items: stretch;
  }

  input,
  select,
  textarea,
  .btn,
  .order-tab {
    min-height: 46px;
    font-size: 0.95rem;
  }

  input,
  select,
  textarea {
    padding: 12px 13px;
    border-radius: 14px;
  }

  textarea {
    min-height: 112px;
    resize: vertical;
  }

  .btn {
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    font-weight: 800;
  }

  .products-layout {
    display: block;
  }

  .pricing-card {
    position: static;
    margin-top: 12px;
  }

  .price-sheet > div {
    padding: 11px;
    gap: 12px;
  }

  .price-sheet span,
  .price-sheet strong {
    font-size: 0.88rem;
  }

  .price-preview {
    padding: 16px;
    border-radius: 18px;
  }

  .photo-upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .photo-upload-card {
    min-height: 126px;
    border-radius: 16px;
    padding: 12px 8px;
  }

  .photo-upload-card strong {
    font-size: 0.86rem;
  }

  .photo-upload-card small {
    font-size: 0.72rem;
  }

  .orders-toolbar {
    gap: 10px;
    margin-bottom: 16px;
  }

  .search-box {
    max-width: none;
    width: 100%;
  }

  .toolbar-actions {
    width: 100%;
  }

  .order-tabs {
    gap: 8px;
    margin: 0 -16px 16px;
    padding: 0 16px 8px;
    border-bottom: 0;
    scroll-snap-type: x proximity;
  }

  .order-tab {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    scroll-snap-align: start;
  }

  .order-tab.active {
    border-color: #ECF2BB;
    background: #ECF2BB;
  }

  .order-tab.active::after {
    display: none;
  }

  .orders-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .orders-summary-grid article {
    padding: 13px;
    border-radius: 16px;
  }

  .order-card {
    padding: 15px;
    border-radius: 20px;
  }

  .order-card-top {
    gap: 8px;
    margin-bottom: 12px;
  }

  .order-card-top h4 {
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .order-meta-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .order-meta-grid div {
    padding: 11px;
    border-radius: 14px;
  }

  .order-actions-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .orders-head-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
  }

  .orders-head-badge {
    justify-content: center;
    border-radius: 14px;
  }

  .chart-container {
    min-height: 230px;
  }

  .chart-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-stat {
    min-width: 0;
  }

  .table-responsive,
  .responsive-table {
    margin: 0 -4px;
    padding-bottom: 4px;
  }

  .table-responsive table,
  .responsive-table table {
    min-width: 680px;
  }

  .pill {
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
  }

  .profile-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  .profile-item,
  .profile-address {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
  }

  .profile-address {
    margin-top: 14px !important;
    padding-top: 13px !important;
  }

  .msg,
  .empty-orders {
    border-radius: 14px;
    font-size: 0.9rem;
  }

  .modal,
  .dialog,
  [role="dialog"] {
    max-width: calc(100vw - 24px);
    max-height: calc(100svh - 24px);
    overflow: auto;
  }
}

@media (max-width: 380px) {
  .workspace {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .stats-grid,
  .stats-grid.secondary-stats,
  .orders-summary-grid,
  .chart-metrics {
    grid-template-columns: minmax(0, 1fr);
  }

  .tabs {
    gap: 2px;
  }

  .tab-btn {
    min-height: 56px;
    font-size: 0.62rem;
    padding-left: 2px;
    padding-right: 2px;
  }

  .photo-upload-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   FLASHFIT SMART PRODUCT BUILDER STYLES (MEESHO/FLIPKART STYLE)
   ========================================================================== */

.product-form-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.ai-assist-trigger-btn {
  background: linear-gradient(135deg, #18181b 0%, #27272a 100%) !important;
  color: #DFF24B !important;
  border: 1px solid #3f3f46 !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  padding: 8px 16px !important;
  font-size: 0.85rem !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ai-assist-trigger-btn:hover {
  background: #000 !important;
  color: #efff63 !important;
  border-color: #DFF24B !important;
  transform: translateY(-1px);
}

/* AI Suggestions Banner */
.ai-assist-banner {
  background: #f7fee7;
  border: 1.5px solid #bef264;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  animation: fadeIn 0.25s ease-in-out;
}

.ai-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #365314;
  font-size: 0.92rem;
}

.ai-close-btn {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: #4d7c0f;
  cursor: pointer;
}

.ai-suggestions-content {
  margin: 10px 0 12px;
  font-size: 0.85rem;
  color: #3f6212;
  line-height: 1.5;
}

.ai-tag-pill {
  display: inline-flex;
  align-items: center;
  background: #ecfccb;
  border: 1px solid #d9f99d;
  color: #1a2e05;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
  font-size: 0.8rem;
}

.ai-banner-actions {
  display: flex;
  gap: 8px;
}

/* Builder Sections */
.builder-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 20px;
  transition: border-color 0.2s ease;
}

.builder-section:focus-within {
  border-color: #cbd5e1;
}

.builder-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #0f172a;
  color: #DFF24B;
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.builder-section-head h4 {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.builder-section-head p {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
}

.req {
  color: #dc2626;
  font-weight: 800;
}

/* Searchable Category Selector */
.add-category-link-btn {
  background: transparent;
  border: none;
  color: #0284c7;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.add-category-link-btn:hover {
  color: #0369a1;
  text-decoration: underline;
}

.category-search-wrapper {
  position: relative;
  width: 100%;
}

.category-search-input-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 12px;
  transition: all 0.2s ease;
  position: relative;
}

.category-search-input-box:focus-within {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(223, 242, 75, 0.35);
}

.category-search-input-box .search-icon {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-right: 8px;
}

.category-search-input-box .chevron-icon {
  color: #94a3b8;
  font-size: 0.75rem;
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.category-search-input-box input {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 10px 0 !important;
  font-size: 0.92rem !important;
  flex: 1;
  width: 100%;
}

.category-clear-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
}

.category-clear-btn:hover {
  color: #475569;
}

.category-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.15);
  z-index: 100;
}

.category-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f8fafc;
  font-size: 0.88rem;
  transition: background 0.15s ease;
}

.category-dropdown-item:last-child {
  border-bottom: none;
}

.category-dropdown-item:hover,
.category-dropdown-item.active {
  background: #f8fafc;
}

.category-dropdown-item.selected {
  background: #f0fdf4;
  font-weight: 700;
  color: #15803d;
}

.category-item-parent {
  font-size: 0.75rem;
  color: #64748b;
  margin-right: 6px;
}

.category-item-name {
  font-weight: 600;
  color: #0f172a;
}

.category-item-badge {
  font-size: 0.72rem;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
}

.category-item-empty {
  padding: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

.selected-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  color: #DFF24B;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 8px;
}

.selected-cat-pill .pill-remove-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.selected-cat-pill .pill-remove-btn:hover {
  opacity: 1;
}

/* Dynamic Specifications Grid */
.dynamic-specs-grid .form-group {
  margin-bottom: 14px;
}

.attr-add-custom-link {
  font-size: 0.78rem;
  color: #0284c7;
  font-weight: 700;
  background: none;
  border: none;
  padding: 0;
  margin-left: 8px;
  cursor: pointer;
}

.attr-add-custom-link:hover {
  text-decoration: underline;
}

/* Variant Builders */
.variant-builder-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
}

.variant-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.variant-block-header label {
  font-weight: 700;
  font-size: 0.85rem;
  margin: 0;
  color: #0f172a;
}

/* Color Swatches */
.color-swatch-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.color-swatch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.color-swatch-chip:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.color-swatch-chip.selected {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.color-swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

/* Size Chips */
.size-chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.size-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 34px;
  padding: 0 10px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.size-chip:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.size-chip.selected {
  background: #DFF24B;
  color: #0f172a;
  border-color: #0f172a;
}

/* Variant Matrix */
.variant-matrix-wrapper {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
}

.variant-matrix-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant-matrix-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
}

.variant-matrix-pill i {
  color: #94a3b8;
  font-size: 0.7rem;
}

/* Modals */
.ff-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.15s ease-out;
}

.ff-modal-dialog {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ff-modal-header {
  padding: 18px 20px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
}

.ff-modal-header h3 {
  margin: 0 0 2px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.ff-modal-header p {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

.ff-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.ff-modal-close:hover {
  color: #0f172a;
}

.ff-modal-body {
  padding: 18px 20px;
}

.ff-modal-footer {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
  .product-form-head {
    flex-direction: column;
    align-items: stretch;
  }
  .ai-assist-trigger-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .builder-section {
    padding: 14px 14px;
  }
}
