/* ================================================
   B2B Chat v2 — Professional B2B Design System
   FULLY RESPONSIVE VERSION
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary:       #1e3a8a;
  --primary-dark:  #172d6e;
  --primary-mid:   #1d4ed8;
  --primary-light: #2563eb;
  --accent:        #f97316;
  --success:       #059669;
  --success-bg:    #ecfdf5;
  --danger:        #dc2626;
  --danger-bg:     #fef2f2;
  --warning:       #d97706;
  --warning-bg:    #fffbeb;
  --info:          #0284c7;
  --info-bg:       #f0f9ff;
  --sidebar-w:     252px;
  --topbar-h:      62px;
  --bg:            #f1f5f9;
  --card-bg:       #ffffff;
  --text:          #0f172a;
  --text-secondary:#475569;
  --muted:         #94a3b8;
  --border:        #e2e8f0;
  --border-focus:  #93c5fd;
  --radius:        10px;
  --radius-lg:     14px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 12px rgba(0,0,0,.08),0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:     0 12px 28px rgba(0,0,0,.12),0 4px 8px rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

/* ========================
   TOPBAR
======================== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--primary);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.topbar-brand {
  color: #fff; font-size: 19px; font-weight: 800;
  text-decoration: none; flex: 1;
  letter-spacing: -.3px;
}
.topbar-brand span { color: #93c5fd; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  color: rgba(255,255,255,.85); font-size: 16px;
  text-decoration: none; background: transparent; border: none;
  cursor: pointer; transition: background .15s;
  position: relative;
}
.topbar-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar-badge {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--primary);
}
.avatar-wrap { cursor: pointer; }
.avatar-wrap img, .avatar-wrap .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  object-fit: cover;
}
.avatar {
  background: var(--primary-light); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
#menuToggle {
  background: none; border: none; cursor: pointer;
  color: #fff; font-size: 18px; padding: 6px;
  display: flex; align-items: center;
}

/* ========================
   SIDEBAR
======================== */
.sidebar {
  position: fixed; top: var(--topbar-h); left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  background: var(--primary-dark);
  overflow-y: auto; z-index: 900;
  display: flex; flex-direction: column;
  padding-bottom: 20px;
  transition: transform .25s ease;
}
.sidebar-user {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 6px;
}
.sidebar-user-inner {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
  color: #f1f5f9; font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  color: rgba(255,255,255,.4); font-size: 11px; margin-top: 1px;
}
.sidebar-menu { list-style: none; padding: 4px 8px; flex: 1; }
.sidebar-section {
  padding: 14px 12px 5px;
  color: rgba(255,255,255,.3); font-size: 10px;
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  list-style: none;
}
.sidebar-menu li a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 7px;
  color: rgba(255,255,255,.65); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: all .15s; margin-bottom: 1px;
}
.sidebar-menu li a i {
  width: 18px; text-align: center; font-size: 14px; flex-shrink: 0;
}
.sidebar-menu li a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-menu li a.active {
  background: var(--primary-light); color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.sidebar-menu li a.logout-link { color: rgba(255,100,100,.7); }
.sidebar-menu li a.logout-link:hover { background: rgba(220,38,38,.15); color: #fca5a5; }

/* ========================
   MAIN CONTENT
======================== */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ========================
   PAGE HEADER
======================== */
.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ========================
   CARDS
======================== */
.sc-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 22px;
  box-shadow: var(--shadow-sm);
}
.sc-card-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.sc-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.sc-card-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ========================
   STAT CARDS
======================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-icon.blue  { background: #eff6ff; color: var(--primary-light); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.orange{ background: #fff7ed; color: var(--accent); }
.stat-icon.purple{ background: #faf5ff; color: #7c3aed; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }

/* ========================
   TABLES
======================== */
.sc-table-wrap { overflow-x: auto; }
.sc-table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.sc-table thead th {
  padding: 10px 14px; background: #f8fafc;
  font-weight: 600; font-size: 11.5px; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid var(--border); white-space: nowrap;
  text-align: left;
}
.sc-table tbody td {
  padding: 13px 14px; border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.sc-table tbody tr:last-child td { border-bottom: none; }
.sc-table tbody tr:hover { background: #f8fafc; }
.fw-600 { font-weight: 600; }

/* ========================
   BADGES
======================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); }
.badge-primary  { background: #eff6ff; color: var(--primary-light); }
.badge-info     { background: var(--info-bg);    color: var(--info); }
.badge-secondary{ background: #f1f5f9; color: #64748b; }

/* ========================
   BUTTONS
======================== */
.btn-sc {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; text-decoration: none;
  border: 1.5px solid transparent; transition: all .15s;
  white-space: nowrap; font-family: inherit;
}
.btn-sc:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--primary-light); color: #fff;
  border-color: var(--primary-light);
}
.btn-primary:hover { background: var(--primary-mid); border-color: var(--primary-mid); }
.btn-success {
  background: var(--success); color: #fff; border-color: var(--success);
}
.btn-success:hover { background: #047857; border-color: #047857; }
.btn-danger {
  background: var(--danger); color: #fff; border-color: var(--danger);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-outline {
  background: transparent; color: var(--text-secondary);
  border-color: var(--border);
}
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; color: var(--text); }
.btn-orange {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-orange:hover { background: #ea6c00; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.w-100  { width: 100%; justify-content: center; }

/* ========================
   FORMS
======================== */
.sc-form-group { margin-bottom: 18px; }
.sc-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.sc-label span { color: var(--danger); margin-left: 2px; }
.sc-input, .sc-select, .sc-textarea {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13.5px; color: var(--text);
  background: #fff; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
}
.sc-input:focus, .sc-select:focus, .sc-textarea:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.sc-input::placeholder { color: var(--muted); }
.sc-textarea { resize: vertical; min-height: 90px; }
.sc-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  background-size: 14px; padding-right: 32px;
}
.sc-input-prefix { position: relative; }
.sc-input-prefix span {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none;
}
.sc-input-prefix .sc-input { padding-left: 32px; }
.input-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.sc-divider {
  border: none; border-top: 1px solid var(--border); margin: 20px 0;
}
.sc-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sc-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ========================
   ALERTS
======================== */
.sc-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 9px; margin-bottom: 16px;
  font-size: 13.5px; font-weight: 500;
}
.sc-alert i { margin-top: 2px; flex-shrink: 0; }
.sc-alert-success { background: var(--success-bg); color: #065f46; border: 1px solid #a7f3d0; }
.sc-alert-danger  { background: var(--danger-bg);  color: #991b1b; border: 1px solid #fecaca; }
.sc-alert-warning { background: var(--warning-bg); color: #92400e; border: 1px solid #fde68a; }
.sc-alert-info    { background: var(--info-bg);    color: #075985; border: 1px solid #bae6fd; }

/* ========================
   PRODUCT CARDS
======================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--card-bg); border-radius: var(--radius-lg);
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card-img {
  width: 100%; height: 190px; object-fit: cover; display: block;
  background: #f8fafc;
}
.product-card-imgph {
  width: 100%; height: 190px; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  font-size: 52px; color: #cbd5e1;
}
.product-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.product-category {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  color: var(--primary-light); letter-spacing: .5px; margin-bottom: 4px;
}
.product-name { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.product-desc {
  font-size: 12px; color: var(--muted); margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.product-price { font-size: 20px; font-weight: 800; color: var(--primary-light); margin-bottom: 4px; }
.product-stock-in  { font-size: 11.5px; color: var(--success); font-weight: 500; }
.product-stock-out { font-size: 11.5px; color: var(--danger);  font-weight: 500; }
.product-footer { margin-top: auto; padding-top: 12px; }
.qty-control {
  display: flex; align-items: center; gap: 0; border: 1.5px solid var(--border);
  border-radius: 7px; overflow: hidden; width: fit-content;
}
.qty-btn {
  width: 32px; height: 32px; background: #f8fafc; border: none;
  font-size: 16px; font-weight: 700; color: var(--text-secondary);
  cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: #f1f5f9; color: var(--text); }
.qty-input {
  width: 44px; height: 32px; text-align: center;
  border: none; border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  font-size: 13px; font-weight: 600; font-family: inherit;
  color: var(--text);
}
.qty-input::-webkit-inner-spin-button { display: none; }

/* Supplier product table image */
.product-thumb {
  width: 44px; height: 44px; border-radius: 8px;
  object-fit: cover; background: #f1f5f9;
}
.product-thumb-ph {
  width: 44px; height: 44px; border-radius: 8px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex; align-items: center; justify-content: center;
  color: #cbd5e1; font-size: 18px;
}

/* ========================
   FILTER BAR
======================== */
.filter-bar {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  margin-bottom: 18px; display: flex; align-items: center;
  flex-wrap: wrap; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.filter-bar-title {
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .5px;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label { font-size: 12px; font-weight: 600; color: var(--muted); }
.filter-input-sm {
  padding: 7px 11px; border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 13px; color: var(--text); background: #fff;
  font-family: inherit; transition: border-color .15s;
}
.filter-input-sm:focus { outline: none; border-color: var(--primary-light); }
.filter-sep { width: 1px; height: 28px; background: var(--border); }
.filter-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent; transition: all .15s;
  background: #f1f5f9; color: var(--text-secondary); border-color: var(--border);
}
.filter-tag:hover, .filter-tag.active {
  background: var(--primary-light); color: #fff; border-color: var(--primary-light);
}
.price-range-wrap { display: flex; align-items: center; gap: 8px; }
.price-range-wrap input[type=range] {
  -webkit-appearance: none; width: 120px; height: 4px;
  border-radius: 99px; background: linear-gradient(to right, var(--primary-light) 0%, var(--primary-light) 50%, var(--border) 50%);
  outline: none;
}
.price-range-wrap input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--primary-light);
  cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* ========================
   AUTH PAGES
======================== */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #1d4ed8 100%);
}
.auth-card {
  background: var(--card-bg); border-radius: 18px;
  padding: 40px 36px; width: 100%; max-width: 430px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h1 {
  font-size: 30px; font-weight: 800; color: var(--primary); letter-spacing: -.5px;
}
.auth-logo h1 span { color: var(--primary-light); }
.auth-logo p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
  color: var(--muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-footer a { color: var(--primary-light); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.pass-toggle { position: relative; }
.pass-toggle .sc-input { padding-right: 40px; }
.pass-toggle-btn {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px;
}
.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.otp-input {
  width: 52px; height: 56px; text-align: center;
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 22px; font-weight: 700; font-family: inherit;
  color: var(--primary); transition: border-color .15s;
}
.otp-input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

/* ========================
   PROFILE AVATAR UPLOAD
======================== */
.avatar-upload {
  display: flex; align-items: center; gap: 20px; margin-bottom: 20px;
}
.avatar-upload-preview {
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--border);
  background: var(--bg);
}
.avatar-upload-preview.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: #fff;
  background: var(--primary-light);
}
.avatar-upload-info { flex: 1; }
.avatar-upload-info .btn-sc { margin-bottom: 6px; }
.avatar-upload-hint { font-size: 11.5px; color: var(--muted); }

/* ========================
   EMPTY STATES
======================== */
.empty-state {
  text-align: center; padding: 60px 30px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-state-icon { font-size: 52px; color: #cbd5e1; margin-bottom: 4px; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text); }
.empty-state-text  { font-size: 13px; color: var(--muted); max-width: 340px; }

/* ========================
   REFERRAL BOX
======================== */
.ref-box {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  border-radius: var(--radius-lg); padding: 20px 24px; color: #fff;
  margin-bottom: 22px; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.ref-box-label {
  font-size: 11px; opacity: .75; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px;
}
.ref-box-url {
  font-size: 13px; font-weight: 600; word-break: break-all;
  opacity: .9;
}
.ref-copy-btn {
  background: rgba(255,255,255,.18); border: 1.5px solid rgba(255,255,255,.25);
  color: #fff; padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background .15s; font-family: inherit;
  display: inline-flex; align-items: center; gap: 7px;
}
.ref-copy-btn:hover { background: rgba(255,255,255,.28); }

/* ========================
   ORDER DETAIL - STATUS TRACKING
======================== */
.order-status-track {
  display: flex; align-items: center; gap: 0;
  margin: 24px 0; flex-wrap: wrap;
}
.track-step {
  flex: 1; min-width: 80px; text-align: center; position: relative;
}
.track-step::after {
  content: ''; position: absolute; top: 18px; left: 50%; right: -50%;
  height: 2px; background: var(--border); z-index: 0;
}
.track-step:last-child::after { display: none; }
.track-dot {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--border); background: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px; font-size: 14px; color: var(--muted);
  position: relative; z-index: 1; transition: all .2s;
}
.track-step.done .track-dot {
  background: var(--success); border-color: var(--success); color: #fff;
}
.track-step.current .track-dot {
  background: var(--primary-light); border-color: var(--primary-light);
  color: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}
.track-label { font-size: 11px; font-weight: 600; color: var(--muted); }
.track-step.done .track-label, .track-step.current .track-label { color: var(--text); }

/* ========================
   UTILITY CLASSES
======================== */
.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-center  { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* ========================
   RESPONSIVE: LARGE DESKTOP (1440px+)
======================== */
@media (min-width: 1440px) {
  :root {
    --sidebar-w: 260px;
  }
  .main-content {
    padding: 32px;
  }
  .page-title {
    font-size: 24px;
  }
  .sc-card {
    padding: 28px;
  }
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

/* ========================
   RESPONSIVE: DESKTOP (1024px - 1439px)
======================== */
@media (min-width: 1024px) and (max-width: 1439px) {
  :root {
    --sidebar-w: 252px;
  }
  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .sc-row-3 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ========================
   RESPONSIVE: TABLET (768px - 1023px)
======================== */
@media (max-width: 1023px) {
  :root {
    --sidebar-w: 0;
    --topbar-h: 56px;
  }

  /* Sidebar & Navigation */
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    box-shadow: 2px 0 12px rgba(0,0,0,.15);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar {
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
  }

  /* Main Content */
  .main-content {
    margin-left: 0;
    margin-top: var(--topbar-h);
    padding: 20px;
  }

  /* Topbar adjustments */
  .topbar {
    height: var(--topbar-h);
  }
  .topbar-brand {
    font-size: 17px;
  }
  #menuToggle {
    display: flex;
  }

  /* Page Header */
  .page-title {
    font-size: 20px;
  }
  .page-header {
    flex-direction: column;
  }

  /* Cards */
  .sc-card {
    padding: 18px;
  }
  .sc-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Grid Layouts */
  .sc-row-2,
  .sc-row-3 {
    grid-template-columns: 1fr;
  }

  /* Stats */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .stat-value {
    font-size: 22px;
  }

  /* Products */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
  }
  .product-card-img,
  .product-card-imgph {
    height: 160px;
  }

  /* Tables */
  .sc-table {
    font-size: 12px;
  }
  .sc-table thead th {
    padding: 8px 10px;
    font-size: 10px;
  }
  .sc-table tbody td {
    padding: 10px 8px;
  }

  /* Forms */
  .sc-input,
  .sc-select,
  .sc-textarea {
    padding: 8px 11px;
    font-size: 13px;
  }

  /* Buttons */
  .btn-sc {
    padding: 7px 14px;
    font-size: 12px;
  }

  /* Filter Bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    width: 100%;
  }
  .filter-input-sm {
    width: 100%;
  }
  .filter-sep {
    display: none;
  }

  /* Auth Card */
  .auth-card {
    padding: 28px 24px;
    max-width: 360px;
  }
  .auth-logo h1 {
    font-size: 26px;
  }

  /* Avatar Upload */
  .avatar-upload {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* ========================
   RESPONSIVE: MOBILE LANDSCAPE (480px - 767px)
======================== */
@media (max-width: 767px) and (min-width: 480px) {
  :root {
    --sidebar-w: 0;
    --topbar-h: 56px;
  }

  body {
    font-size: 13px;
  }

  /* Topbar */
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .topbar-brand {
    font-size: 15px;
  }
  .topbar-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  /* Sidebar */
  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }
  .sidebar.open {
    transform: translateX(0);
    z-index: 950;
  }

  /* Main Content */
  .main-content {
    margin-left: 0;
    margin-top: var(--topbar-h);
    padding: 16px;
    min-height: calc(100vh - var(--topbar-h));
  }

  /* Page Header */
  .page-title {
    font-size: 18px;
  }
  .page-subtitle {
    font-size: 12px;
  }

  /* Cards */
  .sc-card {
    padding: 16px;
    margin-bottom: 14px;
  }
  .sc-card-header {
    margin-bottom: 14px;
  }
  .sc-card-title {
    font-size: 14px;
  }

  /* Stat Cards */
  .stat-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 10px;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .stat-value {
    font-size: 20px;
  }
  .stat-label {
    font-size: 11px;
  }

  /* Product Grid */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .product-card-img,
  .product-card-imgph {
    height: 140px;
  }
  .product-card-body {
    padding: 12px;
  }
  .product-name {
    font-size: 13px;
  }
  .product-price {
    font-size: 18px;
  }

  /* Tables - Scrollable */
  .sc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sc-table {
    font-size: 12px;
  }
  .sc-table thead th {
    padding: 8px;
    font-size: 9.5px;
  }
  .sc-table tbody td {
    padding: 8px;
  }

  /* Forms */
  .sc-row-2,
  .sc-row-3 {
    grid-template-columns: 1fr;
  }
  .sc-input,
  .sc-select,
  .sc-textarea {
    padding: 8px 10px;
    font-size: 13px;
  }

  /* Buttons */
  .btn-sc {
    padding: 7px 12px;
    font-size: 12px;
  }
  .btn-lg {
    padding: 10px 16px;
    font-size: 13px;
  }

  /* Filter Bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 10px;
  }
  .filter-input-sm {
    width: 100%;
  }
  .filter-sep {
    display: none;
  }
  .filter-tags {
    gap: 4px;
  }

  /* Badges */
  .badge {
    padding: 2px 7px;
    font-size: 10.5px;
  }

  /* Auth */
  .auth-card {
    padding: 24px 16px;
    max-width: 100%;
    border-radius: 14px;
  }
  .auth-logo h1 {
    font-size: 24px;
  }
  .auth-logo p {
    font-size: 12px;
  }

  /* Avatar Upload */
  .avatar-upload {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .avatar-upload-preview {
    width: 72px;
    height: 72px;
  }

  /* Order Status Track */
  .order-status-track {
    flex-direction: column;
    gap: 12px;
  }
  .track-step {
    min-width: 100%;
    text-align: left;
    padding-left: 50px;
    position: relative;
  }
  .track-step::after {
    display: none;
  }
  .track-dot {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
  }
  .track-label {
    margin-top: 2px;
  }
}

/* ========================
   RESPONSIVE: MOBILE PORTRAIT (320px - 479px)
======================== */
@media (max-width: 479px) {
  :root {
    --sidebar-w: 0;
    --topbar-h: 52px;
    --radius: 8px;
    --radius-lg: 12px;
  }

  * {
    -webkit-tap-highlight-color: transparent;
  }

  html, body {
    font-size: 13px;
  }

  body {
    overflow-x: hidden;
  }

  /* Topbar */
  .topbar {
    padding: 0 10px;
    height: var(--topbar-h);
    gap: 6px;
  }
  .topbar-brand {
    font-size: 14px;
    font-weight: 700;
  }
  .topbar-right {
    gap: 4px;
  }
  .topbar-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
    border-radius: 6px;
  }
  .topbar-badge {
    width: 6px;
    height: 6px;
    top: 4px;
    right: 4px;
  }

  #menuToggle {
    display: flex;
    padding: 4px;
    font-size: 16px;
  }

  /* Sidebar */
  .sidebar {
    width: 100%;
    max-width: 260px;
    transform: translateX(-100%);
    z-index: 950;
    box-shadow: 2px 0 16px rgba(0,0,0,.2);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar::after {
    content: '';
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.4);
    z-index: -1;
  }
  .sidebar-user {
    padding: 16px 12px 12px;
  }
  .sidebar-user-name {
    font-size: 12px;
  }
  .sidebar-user-role {
    font-size: 10px;
  }
  .sidebar-menu li a {
    padding: 8px 10px;
    font-size: 12px;
    gap: 8px;
  }

  /* Main Content */
  .main-content {
    margin-left: 0;
    margin-top: var(--topbar-h);
    padding: 14px;
    min-height: calc(100vh - var(--topbar-h));
  }

  /* Page Structure */
  .page-header {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }
  .page-title {
    font-size: 16px;
    font-weight: 700;
  }
  .page-subtitle {
    font-size: 11px;
    color: var(--muted);
  }

  /* Cards */
  .sc-card {
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 10px;
  }
  .sc-card-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
  }
  .sc-card-title {
    font-size: 13px;
    font-weight: 700;
  }
  .sc-card-subtitle {
    font-size: 11px;
  }

  /* Stat Grid */
  .stat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
    gap: 10px;
    border-radius: 10px;
  }
  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 8px;
  }
  .stat-value {
    font-size: 18px;
  }
  .stat-label {
    font-size: 10px;
    margin-top: 2px;
  }

  /* Product Grid */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .product-card {
    border-radius: 10px;
  }
  .product-card-img,
  .product-card-imgph {
    height: 130px;
  }
  .product-card-body {
    padding: 10px;
  }
  .product-category {
    font-size: 9px;
  }
  .product-name {
    font-size: 12px;
    line-height: 1.3;
  }
  .product-desc {
    font-size: 11px;
    margin-bottom: 8px;
    -webkit-line-clamp: 1;
  }
  .product-price {
    font-size: 16px;
  }
  .product-stock-in,
  .product-stock-out {
    font-size: 10px;
  }

  /* Quantity Control */
  .qty-control {
    height: 30px;
  }
  .qty-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  .qty-input {
    width: 40px;
    height: 30px;
    font-size: 12px;
  }

  /* Tables */
  .sc-table-wrap {
    border-radius: 10px;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .sc-table {
    font-size: 11px;
    min-width: 600px;
  }
  .sc-table thead th {
    padding: 7px;
    font-size: 9px;
    white-space: normal;
  }
  .sc-table tbody td {
    padding: 7px;
    font-size: 11px;
  }

  /* Forms */
  .sc-form-group {
    margin-bottom: 14px;
  }
  .sc-label {
    font-size: 12px;
    margin-bottom: 5px;
  }
  .sc-input,
  .sc-select,
  .sc-textarea {
    padding: 7px 9px;
    font-size: 13px;
    border-radius: 8px;
    -webkit-appearance: none;
    -moz-appearance: none;
  }
  .sc-input:focus,
  .sc-select:focus,
  .sc-textarea:focus {
    box-shadow: 0 0 0 2px rgba(37,99,235,.1);
  }
  .sc-textarea {
    min-height: 80px;
  }
  .sc-row-2,
  .sc-row-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Buttons */
  .btn-sc {
    padding: 8px 12px;
    font-size: 11px;
    border-radius: 8px;
    gap: 5px;
    width: 100%;
    justify-content: center;
  }
  .btn-sm {
    padding: 5px 8px;
    font-size: 10px;
  }
  .btn-lg {
    padding: 10px 14px;
    font-size: 12px;
  }
  .btn-sc i {
    font-size: 12px;
  }

  /* Badges */
  .badge {
    padding: 2px 6px;
    font-size: 10px;
    border-radius: 99px;
  }

  /* Alerts */
  .sc-alert {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 12px;
  }
  .sc-alert i {
    font-size: 14px;
  }

  /* Filter Bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
    border-radius: 10px;
    margin-bottom: 14px;
  }
  .filter-bar-title {
    font-size: 11px;
  }
  .filter-group {
    width: 100%;
    flex-direction: column;
  }
  .filter-group label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .filter-input-sm {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 6px;
  }
  .filter-sep {
    display: none;
  }
  .filter-tags {
    gap: 4px;
    flex-wrap: wrap;
  }
  .filter-tag {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
  }

  /* Auth Pages */
  .auth-wrapper {
    padding: 16px;
    min-height: 100vh;
  }
  .auth-card {
    padding: 20px;
    border-radius: 12px;
    max-width: 100%;
    box-shadow: var(--shadow);
  }
  .auth-logo {
    margin-bottom: 20px;
  }
  .auth-logo h1 {
    font-size: 22px;
  }
  .auth-logo p {
    font-size: 11px;
    margin-top: 4px;
  }
  .auth-divider {
    margin: 16px 0;
    font-size: 11px;
  }
  .auth-footer {
    font-size: 12px;
    margin-top: 12px;
  }
  .auth-footer a {
    text-decoration: none;
  }

  /* OTP Inputs */
  .otp-inputs {
    gap: 6px;
    margin: 16px 0;
  }
  .otp-input {
    width: 44px;
    height: 50px;
    font-size: 18px;
    border-radius: 8px;
  }

  /* Avatar Upload */
  .avatar-upload {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .avatar-upload-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
  }
  .avatar-upload-info {
    width: 100%;
  }

  /* Empty States */
  .empty-state {
    padding: 40px 20px;
    gap: 10px;
  }
  .empty-state-icon {
    font-size: 44px;
  }
  .empty-state-title {
    font-size: 14px;
  }
  .empty-state-text {
    font-size: 12px;
  }

  /* Referral Box */
  .ref-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 10px;
  }
  .ref-box-label {
    font-size: 10px;
  }
  .ref-box-url {
    font-size: 12px;
    word-break: break-word;
  }
  .ref-copy-btn {
    width: 100%;
    justify-content: center;
    font-size: 12px;
    padding: 8px;
  }

  /* Order Status Track */
  .order-status-track {
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
  }
  .track-step {
    min-width: 100%;
    text-align: left;
    padding-left: 44px;
    position: relative;
  }
  .track-step::after {
    display: none;
  }
  .track-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    margin: 0;
    font-size: 12px;
  }
  .track-label {
    font-size: 10px;
    margin-top: 2px;
  }

  /* Utilities */
  .inline-actions {
    flex-direction: column;
    gap: 8px;
  }
  .inline-actions .btn-sc {
    width: 100%;
    margin: 0;
  }

  /* Product Thumb */
  .product-thumb {
    width: 40px;
    height: 40px;
  }
  .product-thumb-ph {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  /* Avatar in lists */
  .avatar-wrap img,
  .avatar-wrap .avatar {
    width: 30px;
    height: 30px;
  }
}

  /* Order Status Track */
  .order-status-track {
    margin: 16px 0;
  }
  .track-step {
    min-width: 60px;
  }
  .track-label {
    font-size: 10px;
  }
}

/* ========================
   RESPONSIVE: MOBILE (320px - 479px)
======================== */
@media (max-width: 479px) {
  :root {
    --sidebar-w: 0;
    --topbar-h: 52px;
  }

  html,
  body {
    font-size: 13px;
  }

  /* Topbar */
  .topbar {
    height: var(--topbar-h);
    padding: 0 10px;
    gap: 6px;
  }
  .topbar-brand {
    font-size: 14px;
    letter-spacing: -0.3px;
  }
  .topbar-right {
    gap: 4px;
  }
  .topbar-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  /* Sidebar - Mobile Drawer */
  .sidebar {
    width: 100%;
    max-width: 280px;
    transform: translateX(-100%);
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    z-index: 950;
    box-shadow: 2px 0 20px rgba(0,0,0,.2);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Main Content */
  .main-content {
    margin-left: 0;
    margin-top: var(--topbar-h);
    padding: 14px;
    min-height: calc(100vh - var(--topbar-h));
  }

  /* Page Header */
  .page-header {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }
  .page-title {
    font-size: 18px;
    font-weight: 700;
  }
  .page-subtitle {
    font-size: 11px;
  }

  /* Cards */
  .sc-card {
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
  }
  .sc-card-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
  }
  .sc-card-title {
    font-size: 13px;
  }
  .sc-card-subtitle {
    font-size: 11px;
  }

  /* Stats */
  .stat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
    gap: 10px;
    border-radius: 10px;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .stat-value {
    font-size: 18px;
  }
  .stat-label {
    font-size: 10.5px;
  }

  /* Product Cards */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .product-card {
    border-radius: 10px;
    overflow: hidden;
  }
  .product-card-img,
  .product-card-imgph {
    height: 180px;
  }
  .product-card-body {
    padding: 12px;
  }
  .product-category {
    font-size: 10px;
  }
  .product-name {
    font-size: 13px;
    margin-bottom: 3px;
  }
  .product-desc {
    font-size: 11px;
    margin-bottom: 8px;
  }
  .product-price {
    font-size: 16px;
    margin-bottom: 3px;
  }
  .product-stock-in,
  .product-stock-out {
    font-size: 10px;
  }

  /* Quantity Control */
  .qty-control {
    width: 100%;
  }
  .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .qty-input {
    width: 40px;
    height: 28px;
    font-size: 12px;
  }

  /* Tables */
  .sc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
  }
  .sc-table {
    font-size: 11px;
  }
  .sc-table thead th {
    padding: 6px;
    font-size: 9px;
  }
  .sc-table tbody td {
    padding: 6px;
  }

  /* Product Thumbs */
  .product-thumb {
    width: 36px;
    height: 36px;
  }
  .product-thumb-ph {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  /* Badges */
  .badge {
    padding: 2px 6px;
    font-size: 10px;
  }

  /* Forms */
  .sc-form-group {
    margin-bottom: 14px;
  }
  .sc-label {
    font-size: 13px;
    margin-bottom: 5px;
  }
  .sc-input,
  .sc-select,
  .sc-textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border-radius: 8px;
  }
  .sc-textarea {
    min-height: 80px;
  }
  .input-hint {
    font-size: 10.5px;
  }

  /* Grid Rows */
  .sc-row-2,
  .sc-row-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Buttons */
  .btn-sc {
    width: 100%;
    justify-content: center;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 8px;
  }
  .btn-sm {
    width: auto;
    padding: 6px 10px;
    font-size: 11px;
  }
  .btn-lg {
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Alerts */
  .sc-alert {
    padding: 10px 12px;
    font-size: 12px;
    margin-bottom: 12px;
  }

  /* Filter Bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
  }
  .filter-bar-title {
    font-size: 11px;
  }
  .filter-group {
    flex-direction: column;
    width: 100%;
  }
  .filter-group label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .filter-input-sm {
    width: 100%;
    padding: 8px;
  }
  .filter-sep {
    display: none;
  }
  .filter-tags {
    gap: 4px;
  }
  .filter-tag {
    padding: 3px 8px;
    font-size: 11px;
  }

  /* Auth Pages */
  .auth-wrapper {
    padding: 16px;
  }
  .auth-card {
    padding: 20px 14px;
    max-width: 100%;
    border-radius: 14px;
  }
  .auth-logo {
    margin-bottom: 20px;
  }
  .auth-logo h1 {
    font-size: 22px;
  }
  .auth-logo p {
    font-size: 11.5px;
  }
  .auth-divider {
    margin: 16px 0;
    font-size: 11px;
  }
  .auth-footer {
    margin-top: 16px;
    font-size: 12px;
  }

  /* OTP Inputs */
  .otp-inputs {
    gap: 6px;
    margin: 16px 0;
  }
  .otp-input {
    width: 44px;
    height: 48px;
    font-size: 20px;
    border-radius: 8px;
  }

  /* Avatar Upload */
  .avatar-upload {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .avatar-upload-preview {
    width: 68px;
    height: 68px;
    border-width: 2px;
  }
  .avatar-upload-preview.placeholder {
    font-size: 28px;
  }
  .avatar-upload-info .btn-sc {
    margin-bottom: 4px;
    width: 100%;
  }
  .avatar-upload-hint {
    font-size: 10px;
  }

  /* Empty States */
  .empty-state {
    padding: 40px 20px;
    gap: 10px;
  }
  .empty-state-icon {
    font-size: 44px;
    margin-bottom: 2px;
  }
  .empty-state-title {
    font-size: 15px;
  }
  .empty-state-text {
    font-size: 12px;
    max-width: 280px;
  }

  /* Referral Box */
  .ref-box {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 10px;
  }
  .ref-box-label {
    font-size: 10px;
  }
  .ref-box-url {
    font-size: 12px;
  }
  .ref-copy-btn {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Order Status Track */
  .order-status-track {
    gap: 6px;
    margin: 14px 0;
  }
  .track-step {
    min-width: 50px;
  }
  .track-step::after {
    top: 16px;
  }
  .track-dot {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    font-size: 12px;
  }
  .track-label {
    font-size: 9px;
  }

  /* Utility Classes */
  .mt-8 { margin-top: 6px; }
  .mt-12 { margin-top: 8px; }
  .mt-20 { margin-top: 12px; }
  .mb-8 { margin-bottom: 6px; }
  .mb-16 { margin-bottom: 10px; }

  /* Text Center */
  .text-center {
    text-align: center;
  }

  /* Price Range */
  .price-range-wrap {
    width: 100%;
    gap: 6px;
  }
  .price-range-wrap input[type=range] {
    width: 100%;
    max-width: 100px;
  }
}

/* ========================
   RESPONSIVE: SMALL MOBILE (320px - 359px)
======================== */
@media (max-width: 359px) {
  :root {
    --topbar-h: 48px;
  }

  body {
    font-size: 12px;
  }

  .topbar {
    height: var(--topbar-h);
    padding: 0 8px;
  }
  .topbar-brand {
    font-size: 13px;
  }
  .topbar-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .main-content {
    margin-top: var(--topbar-h);
    padding: 12px;
  }

  .page-title {
    font-size: 16px;
  }

  .sc-card {
    padding: 12px;
    margin-bottom: 10px;
  }

  .btn-sc {
    padding: 8px 10px;
    font-size: 12px;
  }

  .sc-input,
  .sc-select,
  .sc-textarea {
    padding: 7px 8px;
    font-size: 12px;
  }

  .auth-card {
    padding: 16px 12px;
  }

  .auth-logo h1 {
    font-size: 20px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 12px;
  }

  .sc-table {
    font-size: 10px;
  }

  .sc-table thead th,
  .sc-table tbody td {
    padding: 5px;
  }
}

/* ========================
   PRINT STYLES
======================== */
@media print {
  .topbar,
  .sidebar,
  #menuToggle,
  .btn-sc,
  .filter-bar {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    margin-top: 0;
    padding: 0;
  }

  body {
    background: #fff;
  }

  .sc-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .product-card,
  .stat-card {
    page-break-inside: avoid;
  }
}

/* ========================
   ACCESSIBILITY
======================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  /* Optional: Add dark mode support here if needed */
}

/* ========================
   B2B CHAT — EXTRA RESPONSIVE FIXES
======================== */

/* Cart page two-column → single column on mobile */
.cart-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 1023px) {
  .cart-layout {
    grid-template-columns: 1fr !important;
  }

  /* Cart item row — stack on small screens */
  .cart-item-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Mobile center all auth content */
  .auth-wrapper {
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  .auth-card {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
  }

  /* Page header buttons full-width on mobile */
  .page-header .btn-sc {
    width: 100%;
    justify-content: center;
  }

  /* Stat grid 2 cols on tablet */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Main content padding */
  .main-content {
    padding: 14px;
  }

  /* Product grid min 2 cols on tablet */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  }
}

@media (max-width: 767px) {
  /* Cart item — make it flex column on phone */
  .cart-layout {
    grid-template-columns: 1fr !important;
  }

  /* OTP inputs smaller on tiny screens */
  .otp-input {
    width: 38px !important;
    height: 44px !important;
    font-size: 18px !important;
  }
  .otp-inputs {
    gap: 6px !important;
  }

  /* Stat grid → 1 col on phone */
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Product grid 2 cols min */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card-img,
  .product-card-imgph {
    height: 140px;
  }

  /* Tables — horizontal scroll */
  .sc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Topbar brand visible */
  .topbar-brand {
    font-size: 16px;
  }

  /* Auth card padding tighter */
  .auth-card {
    padding: 22px 16px;
    border-radius: 16px;
  }

  /* Buttons row wrap */
  .inline-actions {
    flex-wrap: wrap;
  }

  /* sc-row-2, sc-row-3 always single col */
  .sc-row-2,
  .sc-row-3 {
    grid-template-columns: 1fr !important;
  }

  /* Page header stack */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Sidebar user info */
  .sidebar-user-name {
    font-size: 13px;
  }
}

@media (max-width: 479px) {
  /* Phone — full width everything */
  .main-content {
    padding: 10px;
  }

  .sc-card {
    padding: 14px 12px;
    border-radius: 12px;
  }

  /* Stat grid 1 col on tiny phone */
  .stat-grid {
    grid-template-columns: 1fr;
  }

  /* Product grid 1 col on tiny phones */
  .product-grid {
    grid-template-columns: 1fr;
  }

  /* Auth full screen */
  .auth-wrapper {
    padding: 10px;
  }
  .auth-card {
    padding: 20px 14px;
  }
  .auth-logo h1 {
    font-size: 24px;
  }

  /* Table font tiny */
  .sc-table {
    font-size: 11px;
  }
  .sc-table thead th {
    padding: 7px 8px;
    font-size: 10px;
  }
  .sc-table tbody td {
    padding: 8px 6px;
  }

  /* Qty control */
  .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .qty-input {
    width: 42px;
    height: 28px;
    font-size: 13px;
  }

  /* Filter bar */
  .filter-bar {
    gap: 8px;
  }
  .filter-input-sm,
  .sc-select {
    font-size: 12px;
    padding: 7px 10px;
  }

  /* Inline-actions buttons */
  .btn-sc {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Badge */
  .badge {
    font-size: 10px;
    padding: 3px 7px;
  }

  /* Page title */
  .page-title {
    font-size: 17px;
  }
  .page-subtitle {
    font-size: 12px;
  }

  /* Topbar */
  .topbar {
    padding: 0 10px;
    gap: 8px;
  }
  .topbar-brand {
    font-size: 15px;
  }
}
