/* ═══════════════════════════════════════════════════════════════════
   GLOBAL GARMENTS DMS — Main Stylesheet v2
   Theme: White background, Green accents (#16a34a / #22c55e)
   ═══════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --blue-500: #3b82f6;
  --red-500: #ef4444;
  --red-50: #fef2f2;
  --amber-500: #f59e0b;
  --amber-50: #fffbeb;
  --purple-500: #8b5cf6;
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --bottom-nav-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: 200ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }
img { max-width: 100%; }

/* ── GLOBAL SVG RULE — NO position, NO width override here ─────── */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }
ul { list-style: none; }

/* ── Utility ───────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-20  { padding: 20px; }
.text-danger  { color: var(--red-500); }
.text-success { color: var(--green-600); }
.text-muted   { color: var(--gray-500); }
.text-sm  { font-size: .82rem; }
.text-xs  { font-size: .75rem; }
.text-lg  { font-size: 1.1rem; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full  { width: 100%; }
.flex    { display: flex; }
.flex-1  { flex: 1; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.divider { height: 1px; background: var(--gray-100); margin: 16px 0; }
.rounded { border-radius: var(--radius-sm); }
.bg-white { background: white; }
.border { border: 1px solid var(--gray-200); }

/* ── Animations ────────────────────────────────────────────────── */
@keyframes spin        { to { transform: rotate(360deg); } }
@keyframes splashPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
@keyframes splashSlide { 0%{transform:translateX(-100%)} 100%{transform:translateX(600%)} }
@keyframes floatShape  { 0%,100%{transform:translate(0,0) scale(1)} 50%{transform:translate(20px,-20px) scale(1.05)} }
@keyframes fadeIn      { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideUp     { from{transform:translateY(60px);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes toastIn     { from{transform:translateX(60px);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes skeleton    { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Splash ────────────────────────────────────────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  display: flex; align-items: center; justify-content: center;
}
.splash-inner { text-align: center; color: white; }
.splash-logo  { margin-bottom: 20px; animation: splashPulse 1.5s ease infinite; }
.splash-logo svg { width: 64px; height: 64px; }
.splash-title { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; }
.splash-sub   { font-size: .9rem; opacity: .8; margin-top: 6px; }
.splash-loader {
  width: 200px; height: 3px; background: rgba(255,255,255,.2);
  border-radius: 99px; margin: 24px auto 0; overflow: hidden;
}
.splash-bar {
  height: 100%; width: 40%; background: white; border-radius: 99px;
  animation: splashSlide 1.2s ease infinite;
}

/* ── Login Page ────────────────────────────────────────────────── */
.page-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 50%, #f0fdf4 100%);
}
.login-bg   { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.login-shapes .shape {
  position: absolute; border-radius: 50%;
  background: linear-gradient(135deg, rgba(22,163,74,.15), rgba(34,197,94,.1));
  animation: floatShape 8s ease-in-out infinite;
}
.login-shapes .s1 { width: 400px; height: 400px; top: -100px; right: -100px; animation-delay: 0s; }
.login-shapes .s2 { width: 300px; height: 300px; bottom: -80px; left: -80px; animation-delay: 3s; }
.login-shapes .s3 { width: 200px; height: 200px; top: 40%; left: 20%; animation-delay: 6s; }
.login-card {
  width: 100%; max-width: 420px; background: white; border-radius: 20px;
  padding: 40px 36px; box-shadow: var(--shadow-xl); position: relative; z-index: 1;
}
.login-logo {
  display: flex; align-items: center; gap: 14px; margin-bottom: 32px;
}
.login-logo svg  { width: 48px; height: 48px; flex-shrink: 0; }
.login-logo h1   { font-size: 1.3rem; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.login-logo p    { font-size: .8rem; color: var(--gray-500); }
.login-card h2   { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.login-desc      { color: var(--gray-500); margin-top: 4px; margin-bottom: 24px; font-size: .9rem; }
.login-row       { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.link-green      { color: var(--green-600); font-size: .85rem; font-weight: 500; }
.otp-inputs      { display: flex; gap: 10px; justify-content: center; }
.otp-inputs input {
  width: 46px; height: 52px; text-align: center; font-size: 1.4rem; font-weight: 700;
  border: 2px solid var(--gray-200); border-radius: 10px; color: var(--gray-900);
  padding: 0; transition: border-color var(--transition);
}
.otp-inputs input:focus { outline: none; border-color: var(--green-500); }

/* ── Form Elements ─────────────────────────────────────────────── */
.form-group         { margin-bottom: 18px; }
.form-group label   { display: block; font-size: .83rem; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-group.required label::after { content: ' *'; color: var(--red-500); }

/* Input with icon wrapper */
.input-icon         { position: relative; display: block; }
.input-icon > svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px !important;
  height: 16px !important;
  color: var(--gray-400);
  pointer-events: none;
  z-index: 1;
  display: block;
}
.input-icon > input,
.input-icon > select { padding-left: 40px; }
.input-icon > .pwd-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); padding: 4px; background: none; border: none;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.input-icon > .pwd-toggle svg {
  width: 16px !important; height: 16px !important;
  position: static; transform: none;
  pointer-events: none;
}

.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint    { font-size: .77rem; color: var(--gray-500); margin-top: 4px; }
.form-section { margin-bottom: 28px; }
.form-section h4 {
  font-size: .85rem; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-100);
}

/* All standard inputs */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--gray-800); background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
input::placeholder { color: var(--gray-400); }
textarea  { resize: vertical; min-height: 88px; }
select    { cursor: pointer; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--green-600); }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: .88rem; font-weight: 600;
  transition: all var(--transition); cursor: pointer;
  border: 1.5px solid transparent; white-space: nowrap; text-decoration: none;
}
.btn svg { width: 15px !important; height: 15px !important; flex-shrink: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: white; border-color: var(--green-600);
  box-shadow: 0 2px 4px rgba(22,163,74,.3);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--green-600), var(--green-700)); box-shadow: 0 4px 8px rgba(22,163,74,.35); transform: translateY(-1px); }
.btn-outline { background: white; color: var(--green-600); border-color: var(--green-500); }
.btn-outline:hover { background: var(--green-50); }
.btn-ghost { background: var(--gray-100); color: var(--gray-700); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-200); }
.btn-danger { background: var(--red-500); color: white; border-color: var(--red-500); }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--amber-500); color: white; border-color: var(--amber-500); }
.btn-sm  { padding: 6px 12px; font-size: .8rem; }
.btn-xs  { padding: 4px 8px;  font-size: .75rem; }
.btn-lg  { padding: 13px 28px; font-size: .95rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px;
  border: 2px solid white; border-top-color: transparent;
  border-radius: 50%; animation: spin .6s linear infinite;
}

/* ── Alerts ────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: .87rem;
  margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px;
}
.alert svg { width: 16px !important; height: 16px !important; flex-shrink: 0; margin-top: 1px; }
.alert-danger  { background: var(--red-50);    color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: var(--green-50);  color: var(--green-700); border: 1px solid var(--green-200); }
.alert-warning { background: var(--amber-50);  color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── App Shell ─────────────────────────────────────────────────── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Top Bar ───────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 100;
  background: white; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  box-shadow: var(--shadow);
}
.topbar-menu {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  color: var(--gray-600); transition: background var(--transition);
  flex-shrink: 0;
}
.topbar-menu svg { width: 20px !important; height: 20px !important; }
.topbar-menu:hover { background: var(--gray-100); }
.topbar-brand { display: flex; align-items: center; gap: 10px; flex: 1; overflow: hidden; }
.topbar-brand svg { width: 28px !important; height: 28px !important; flex-shrink: 0; }
.topbar-brand span { font-size: .95rem; font-weight: 700; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  color: var(--gray-600); transition: background var(--transition), color var(--transition);
  position: relative; flex-shrink: 0;
}
.icon-btn svg { width: 18px !important; height: 18px !important; }
.icon-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.notif-badge {
  position: absolute; top: 5px; right: 5px; width: 16px; height: 16px;
  background: var(--red-500); color: white; border-radius: 99px;
  font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}
.avatar-btn { padding: 3px; border-radius: 99px; display: flex; }
.avatar {
  width: 34px; height: 34px; border-radius: 99px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: white; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: .75rem; }

/* ── Search Bar ────────────────────────────────────────────────── */
.search-bar {
  position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 99;
  background: white; border-bottom: 1px solid var(--gray-200);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-md);
}
.search-bar input { flex: 1; border: 1.5px solid var(--gray-200); padding: 9px 16px; border-radius: 99px; font-size: .9rem; }
.search-bar button svg { width: 18px !important; height: 18px !important; }
.search-results {
  position: absolute; top: 100%; left: 0; right: 0;
  background: white; border-bottom: 1px solid var(--gray-100);
  max-height: 320px; overflow-y: auto; box-shadow: var(--shadow-lg);
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: -280px; width: var(--sidebar-w); height: 100vh; z-index: 200;
  background: white; border-right: 1px solid var(--gray-100);
  display: flex; flex-direction: column; transition: left var(--transition);
  box-shadow: var(--shadow-xl);
}
.sidebar.open { left: 0; }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 199; display: none; }
.sidebar-overlay.show { display: block; }
.sidebar-header {
  padding: 20px 16px 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}
.sidebar-logo { display: flex; align-items: center; gap: 12px; }
.sidebar-logo svg { width: 36px !important; height: 36px !important; flex-shrink: 0; }
.sidebar-brand { font-weight: 700; font-size: .95rem; color: var(--gray-900); }
.sidebar-role  { font-size: .75rem; color: var(--green-600); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sidebar-close { color: var(--gray-400); padding: 4px; display: flex; align-items: center; }
.sidebar-close svg { width: 18px !important; height: 18px !important; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-section-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--gray-400); padding: 10px 8px 6px; margin-top: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--gray-600); font-size: .88rem;
  font-weight: 500; cursor: pointer; transition: all var(--transition); margin-bottom: 2px;
}
.nav-item svg { width: 17px !important; height: 17px !important; flex-shrink: 0; }
.nav-item:hover { background: var(--green-50); color: var(--green-700); }
.nav-item.active { background: var(--green-50); color: var(--green-700); font-weight: 600; }
.sidebar-footer { padding: 12px 10px; border-top: 1px solid var(--gray-100); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); }
.sidebar-user-name  { font-size: .84rem; font-weight: 600; color: var(--gray-800); }
.sidebar-user-email { font-size: .75rem; color: var(--gray-500); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user > button { margin-left: auto; color: var(--gray-400); padding: 4px; display: flex; align-items: center; }
.sidebar-user > button:hover { color: var(--red-500); }
.sidebar-user > button svg { width: 16px !important; height: 16px !important; }

/* ── Main Content ──────────────────────────────────────────────── */
.main-content {
  margin-top: var(--topbar-h); flex: 1;
  min-height: calc(100vh - var(--topbar-h) - var(--bottom-nav-h));
  padding: 20px 16px 80px;
}
@media (min-width: 1024px) {
  .sidebar { left: 0; box-shadow: none; border-right: 1px solid var(--gray-200); }
  .sidebar-close, .sidebar-overlay { display: none !important; }
  .topbar-menu { display: none; }
  .main-content { margin-left: var(--sidebar-w); padding: 24px 28px 40px; }
  .bottom-nav   { display: none !important; }
}

/* ── Bottom Nav ────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-h);
  background: white; border-top: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 4px; z-index: 90; box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  cursor: pointer; flex: 1; max-width: 72px;
  color: var(--gray-500); transition: all var(--transition);
}
.bnav-item svg { width: 20px !important; height: 20px !important; }
.bnav-item span { font-size: .62rem; font-weight: 600; }
.bnav-item.active { color: var(--green-600); }

/* ── Page Header ───────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header-left h1 { font-size: 1.4rem; font-weight: 700; color: var(--gray-900); }
.page-header-left p  { font-size: .85rem; color: var(--gray-500); margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); box-shadow: var(--shadow); }
.card-header {
  padding: 18px 20px 14px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: .95rem; font-weight: 700; color: var(--gray-800); }
.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px; border-top: 1px solid var(--gray-100);
  background: var(--gray-50); border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Stat Cards ────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-bottom: 24px; }
@media (min-width: 1024px) { .stats-grid { grid-template-columns: repeat(4,1fr); } }
.stat-card {
  background: white; border-radius: var(--radius); border: 1px solid var(--gray-100);
  padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green-500), var(--green-400));
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--green-50); display: flex; align-items: center; justify-content: center;
  color: var(--green-600); margin-bottom: 12px;
}
.stat-card .stat-icon svg { width: 22px !important; height: 22px !important; }
.stat-card .stat-value  { font-size: 1.6rem; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-card .stat-label  { font-size: .8rem; color: var(--gray-500); margin-top: 4px; font-weight: 500; }
.stat-card .stat-change { font-size: .78rem; font-weight: 600; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.stat-change.up      { color: var(--green-600); }
.stat-change.down    { color: var(--red-500); }
.stat-change.neutral { color: var(--gray-500); }

/* ── Grid layouts ──────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 1024px) { .dash-grid { grid-template-columns: 2fr 1fr; } }
.dash-grid-3 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px)  { .dash-grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1200px) { .dash-grid-3 { grid-template-columns: repeat(3,1fr); } }

/* ── Map ───────────────────────────────────────────────────────── */
#world-map { height: 360px; border-radius: var(--radius-sm); z-index: 1; }
.leaflet-container { border-radius: var(--radius-sm); }

/* ── Charts ────────────────────────────────────────────────────── */
.chart-wrap { position: relative; }
.chart-wrap canvas { max-height: 260px; }

/* ── Tables ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--gray-50); padding: 11px 14px; text-align: left;
  font-size: .78rem; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-actions .btn svg { width: 14px !important; height: 14px !important; }

/* ── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px; font-size: .73rem; font-weight: 700; text-transform: capitalize;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-green  { background: var(--green-100); color: var(--green-700); }
.badge-red    { background: var(--red-50);    color: #b91c1c; }
.badge-amber  { background: var(--amber-50);  color: #92400e; }
.badge-blue   { background: #eff6ff;          color: #1e40af; }
.badge-gray   { background: var(--gray-100);  color: var(--gray-600); }
.badge-purple { background: #f5f3ff;          color: #5b21b6; }

/* Order/payment status */
.status-draft      { background: var(--gray-100); color: var(--gray-600); display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:.73rem; font-weight:700; }
.status-submitted  { background: #eff6ff;          color: #1e40af;         display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:.73rem; font-weight:700; }
.status-approved   { background: var(--green-100); color: var(--green-700);display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:.73rem; font-weight:700; }
.status-dispatched { background: var(--amber-50);  color: #92400e;         display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:.73rem; font-weight:700; }
.status-delivered  { background: var(--green-100); color: var(--green-800);display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:.73rem; font-weight:700; }
.status-cancelled  { background: var(--red-50);    color: #b91c1c;         display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:.73rem; font-weight:700; }
.status-pending    { background: var(--amber-50);  color: #92400e;         display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:.73rem; font-weight:700; }
.status-paid       { background: var(--green-100); color: var(--green-700);display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:.73rem; font-weight:700; }
.status-partial    { background: #eff6ff;          color: #1e40af;         display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:99px; font-size:.73rem; font-weight:700; }

/* ── Pagination ────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  padding: 16px 20px; border-top: 1px solid var(--gray-100); flex-wrap: wrap;
}
.pagination-info { font-size: .82rem; color: var(--gray-500); margin-right: auto; }
.page-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200); background: white; color: var(--gray-600);
  font-size: .85rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover   { border-color: var(--green-500); color: var(--green-600); }
.page-btn.active  { background: var(--green-600); border-color: var(--green-600); color: white; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Filters Bar ───────────────────────────────────────────────── */
.filters-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filters-bar input, .filters-bar select { flex: 1; min-width: 160px; max-width: 240px; padding: 9px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); }
.filters-bar .filter-search { flex: 2; max-width: 360px; }

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
@media (min-width: 640px) { .modal-overlay { align-items: center; padding: 20px; } }
.modal {
  background: white; border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 680px; max-height: 92vh;
  display: flex; flex-direction: column; animation: slideUp .25s ease;
}
@media (min-width: 640px) { .modal { border-radius: var(--radius); } }
.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); }
.modal-header > button { color: var(--gray-500); padding: 4px; border-radius: 6px; display: flex; align-items: center; }
.modal-header > button svg { width: 18px !important; height: 18px !important; }
.modal-header > button:hover { background: var(--gray-100); }
.modal-body   { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; }
.modal-lg  { max-width: 880px; }
.modal-xl  { max-width: 1100px; }

/* ── Drawers ───────────────────────────────────────────────────── */
.drawer {
  position: fixed; top: 0; right: -420px; width: 400px; max-width: 100%; height: 100vh; z-index: 300;
  background: white; border-left: 1px solid var(--gray-200); box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column; transition: right var(--transition);
}
.drawer.open { right: 0; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 299; }
.drawer-header {
  padding: 20px 20px 16px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.drawer-header h3 { font-weight: 700; }
.drawer-header > div { display: flex; align-items: center; gap: 8px; }
.drawer-header button { display: flex; align-items: center; justify-content: center; }
.drawer-header button svg { width: 18px !important; height: 18px !important; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }

/* ── Notification Items ────────────────────────────────────────── */
.notif-item {
  padding: 14px 16px; border-radius: var(--radius-sm); cursor: pointer;
  transition: background var(--transition); margin-bottom: 6px; border: 1px solid var(--gray-100);
}
.notif-item.unread { background: var(--green-50); border-color: var(--green-100); }
.notif-item:hover  { background: var(--gray-50); }
.notif-item h4   { font-size: .85rem; font-weight: 600; color: var(--gray-800); }
.notif-item p    { font-size: .8rem;  color: var(--gray-500); margin-top: 3px; }
.notif-item time { font-size: .72rem; color: var(--gray-400); margin-top: 5px; display: block; }

/* ── Dropdown Menu ─────────────────────────────────────────────── */
.dropdown-menu {
  position: fixed; top: 58px; right: 12px; width: 220px; z-index: 500;
  background: white; border: 1px solid var(--gray-200); border-radius: var(--radius);
  box-shadow: var(--shadow-xl); padding: 8px 0; animation: fadeIn .15s ease;
}
.dropdown-header { padding: 12px 16px 10px; border-bottom: 1px solid var(--gray-100); margin-bottom: 4px; }
.dropdown-header h4 { font-size: .88rem; font-weight: 700; color: var(--gray-900); }
.dropdown-header p  { font-size: .78rem; color: var(--gray-500); margin-top: 2px; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  color: var(--gray-700); font-size: .87rem; transition: background var(--transition);
}
.dropdown-menu a svg { width: 15px !important; height: 15px !important; color: var(--gray-400); }
.dropdown-menu a:hover { background: var(--gray-50); color: var(--gray-900); }
.dropdown-divider { height: 1px; background: var(--gray-100); margin: 4px 0; }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 80px; right: 16px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 1024px) { .toast-container { bottom: 24px; } }
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 18px; border-radius: var(--radius); box-shadow: var(--shadow-xl);
  max-width: 320px; font-size: .87rem; font-weight: 500;
  animation: toastIn .25s ease; border-left: 4px solid; background: white;
}
.toast svg { width: 16px !important; height: 16px !important; flex-shrink: 0; margin-top: 1px; }
.toast-success { border-color: var(--green-500); color: var(--gray-800); }
.toast-success svg { color: var(--green-500); }
.toast-error   { border-color: var(--red-500); color: var(--gray-800); }
.toast-error   svg { color: var(--red-500); }
.toast-warning { border-color: var(--amber-500); color: var(--gray-800); }
.toast-warning svg { color: var(--amber-500); }
.toast-info    { border-color: var(--blue-500); color: var(--gray-800); }
.toast-info    svg { color: var(--blue-500); }
.toast-close   { margin-left: auto; color: var(--gray-400); padding: 0 0 0 8px; font-size: 1rem; cursor: pointer; }

/* ── Progress / Milestone ──────────────────────────────────────── */
.progress-bar  { height: 8px; background: var(--gray-100); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--green-500), var(--green-400)); border-radius: 99px; transition: width .6s ease; }
.milestone-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: .75rem; font-weight: 700; }
.milestone-bronze   { background: #fef3c7; color: #92400e; }
.milestone-silver   { background: #f1f5f9; color: #475569; }
.milestone-gold     { background: #fef9c3; color: #713f12; }
.milestone-platinum { background: #f5f3ff; color: #5b21b6; }

/* ── Product Grid ──────────────────────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
.product-card { background: white; border: 1.5px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all var(--transition); }
.product-card:hover { border-color: var(--green-400); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card-img { height: 140px; background: var(--gray-50); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card-body { padding: 14px; }
.product-card-name { font-weight: 600; font-size: .87rem; color: var(--gray-900); }
.product-card-sku  { font-size: .75rem; color: var(--gray-400); font-family: var(--font-mono); }
.product-card-price { font-size: 1rem; font-weight: 700; color: var(--green-600); margin-top: 8px; }

/* ── Tabs ──────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 18px; font-size: .87rem; font-weight: 600; color: var(--gray-500);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  white-space: nowrap; transition: all var(--transition);
}
.tab:hover { color: var(--green-600); }
.tab.active { color: var(--green-600); border-bottom-color: var(--green-600); }

/* ── Detail Grid ───────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
@media (min-width: 768px) { .detail-grid { grid-template-columns: repeat(3,1fr); } }
.detail-item label { font-size: .78rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 4px; }
.detail-item span  { font-size: .9rem; color: var(--gray-800); font-weight: 500; }

/* ── Timeline ──────────────────────────────────────────────────── */
.timeline { padding: 4px 0; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.timeline-item:not(:last-child)::before {
  content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: var(--gray-200);
}
.timeline-dot {
  width: 36px; height: 36px; border-radius: 99px; background: var(--green-100);
  color: var(--green-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.timeline-dot svg { width: 16px !important; height: 16px !important; }
.timeline-content h4   { font-size: .88rem; font-weight: 600; color: var(--gray-800); }
.timeline-content p    { font-size: .8rem; color: var(--gray-500); margin-top: 3px; }
.timeline-content time { font-size: .75rem; color: var(--gray-400); margin-top: 4px; display: block; }

/* ── Misc ──────────────────────────────────────────────────────── */
.color-swatch { width: 18px; height: 18px; border-radius: 99px; border: 1.5px solid rgba(0,0,0,.1); display: inline-block; vertical-align: middle; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-400); }
.empty-state svg { width: 56px !important; height: 56px !important; margin-bottom: 12px; color: var(--gray-300); display: block; margin-left: auto; margin-right: auto; }
.empty-state h3 { font-size: 1rem; color: var(--gray-600); font-weight: 600; }
.empty-state p  { font-size: .85rem; margin-top: 6px; }
.skeleton { background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%); background-size: 200% 100%; animation: skeleton 1.5s infinite; border-radius: var(--radius-sm); }
.spinner { width: 24px; height: 24px; border: 3px solid var(--gray-200); border-top-color: var(--green-500); border-radius: 50%; animation: spin .6s linear infinite; }
.summary-box { background: var(--green-50); border: 1px solid var(--green-100); border-radius: var(--radius-sm); padding: 16px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: .9rem; }
.summary-total { font-weight: 800; font-size: 1.1rem; color: var(--green-700); padding-top: 10px; border-top: 1.5px solid var(--green-200); margin-top: 6px; }
.stock-ok   { color: var(--green-600); font-weight: 600; }
.stock-low  { color: var(--amber-500); font-weight: 600; }
.stock-zero { color: var(--red-500); font-weight: 600; }
.install-banner {
  position: fixed; bottom: 70px; left: 12px; right: 12px; z-index: 88;
  background: white; border: 1px solid var(--green-200); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow-lg);
}
@media (min-width: 1024px) { .install-banner { bottom: 24px; left: auto; width: 340px; } }
.install-banner svg { width: 32px !important; height: 32px !important; flex-shrink: 0; }
.install-banner p { flex: 1; font-size: .85rem; color: var(--gray-700); font-weight: 500; }
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 9998; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .page-header  { flex-direction: column; }
  .page-actions { width: 100%; }
  .form-row     { grid-template-columns: 1fr; }
  .detail-grid  { grid-template-columns: repeat(2,1fr); }
  .stats-grid   { grid-template-columns: repeat(2,1fr); }
  .stat-card .stat-value { font-size: 1.3rem; }
  .login-card   { padding: 28px 20px; }
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

/* ── v2 Additions ──────────────────────────────────────────────── */
.sku-pill {
  font-family: var(--font-mono);
  font-size: .78rem;
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: .03em;
}

/* Fix: icon inside table product cell */
.prod-thumb-placeholder {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.prod-thumb-placeholder svg { width: 16px !important; height: 16px !important; color: var(--gray-300); }

/* Order form item card */
.order-item-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}
.order-item-card:hover { border-color: var(--green-200); }

/* Stock info chip */
.stock-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; padding: 3px 8px; border-radius: 99px; }
.stock-chip-ok   { background: var(--green-50);  color: var(--green-700); }
.stock-chip-low  { background: var(--amber-50);  color: #92400e; }
.stock-chip-zero { background: var(--red-50);    color: #b91c1c; }
.stock-chip-bo   { background: #eff6ff;          color: #1e40af; }

/* Distributor price table  */
.dist-price-row { transition: background var(--transition); }
.dist-price-row:hover { background: var(--green-50); }

/* Alert row */
.alert-row-critical td { background: #fff5f5; }
.alert-row-warning  td { background: #fffbeb; }

/* Login page — icon inside input visible fix */
.login-card .input-icon {
  position: relative;
  display: block;
}
.login-card .input-icon > svg {
  position: absolute !important;
  left: 12px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 16px !important;
  height: 16px !important;
  pointer-events: none !important;
  z-index: 2 !important;
  display: block !important;
  color: var(--gray-400) !important;
}
.login-card .input-icon > input {
  padding-left: 40px !important;
}
.login-card .input-icon > .pwd-toggle {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: none !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  z-index: 2 !important;
  color: var(--gray-400) !important;
}
.login-card .input-icon > .pwd-toggle > svg {
  width: 16px !important;
  height: 16px !important;
  position: static !important;
  transform: none !important;
  pointer-events: none !important;
}

/* Suggested features badges */
.feature-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px;
  font-size: .73rem; font-weight: 600;
  background: var(--green-50); color: var(--green-700);
  border: 1px solid var(--green-100);
}
