/* ==========================================================================
   LD Store — Morrow SaaS Design System (1:1 with Official Source)
   Typography: DM Sans (Sans) & Manrope (Display)
   Dark Theme: #141A21 (Background), #1C252E (Card), #5ED9BA (Primary), #24443F (Accent)
   Light Theme: oklch(0.975 0.003 235) (Bg), #FFFFFF (Card), oklch(0.52 0.14 175) (Primary)
   ========================================================================== */

/* Local High-Performance Fonts (Offline & Zero-Latency Guarantee) */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('fonts/dm-sans.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/manrope.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root, html.dark {
  color-scheme: dark;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Manrope", sans-serif;

  --radius: 0.5rem;
  --background: #141A21;
  --foreground: #EDF3F4;
  --card: #1C252E;
  --card-foreground: #EDF3F4;
  --popover: #1C252E;
  --popover-foreground: #EDF3F4;
  --primary: #5ED9BA;
  --primary-foreground: #10251F;
  --secondary: #28343E;
  --secondary-foreground: #E4EAEC;
  --muted: #27323B;
  --muted-foreground: #A6B5BE;
  --accent: #24443F;
  --accent-foreground: #A3EEDB;
  --destructive: #FA8585;
  --destructive-foreground: #251719;
  --border: #35424C;
  --input: #485761;
  --ring: #5ED9BA;
  --positive: #75E1B8;
  --positive-surface: #1D4039;
  --warning: #F2C47B;
  --warning-surface: #493B29;
  --info: #91BBF2;
  --info-surface: #273B51;
  --chart-fill: #7493AC;
  --sidebar: #141A21;
  --sidebar-foreground: #EDF3F4;
  --sidebar-primary: #5ED9BA;
  --sidebar-primary-foreground: #10251F;
  --sidebar-accent: #263D3D;
  --sidebar-accent-foreground: #A3EEDB;
  --sidebar-border: #35424C;

  /* Aliases to our existing CSS custom property names */
  --bg-main: var(--background);
  --bg-sidebar: var(--sidebar);
  --bg-topbar: rgba(20, 26, 33, 0.88);
  --bg-card: var(--card);
  --bg-card-hover: #232E3A;
  --bg-card-subtle: rgba(28, 37, 46, 0.75);
  --bg-card-solid: var(--card);
  --bg-input: #182028;
  --bg-modal: var(--card);
  --bg-overlay: rgba(10, 14, 18, 0.82);

  --border-color: var(--border);
  --border-subtle: rgba(53, 66, 76, 0.6);
  --border-hover: rgba(94, 217, 186, 0.4);
  --border-active: var(--primary);

  --primary-hover: #4ec2a5;
  --primary-cyan: var(--primary);
  --primary-teal: var(--positive);
  --primary-mint: var(--accent-foreground);
  --primary-glow: rgba(94, 217, 186, 0.2);
  --primary-gradient: linear-gradient(135deg, #5ED9BA 0%, #3bb998 100%);
  --primary-border: rgba(94, 217, 186, 0.3);

  --text-primary: var(--foreground);
  --text-secondary: var(--muted-foreground);
  --text-muted: #7E909C;
  --text-cyan: var(--primary);
  --text-teal: var(--positive);

  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --success-border: rgba(16, 185, 129, 0.35);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(239, 68, 68, 0.35);
  --warning-bg: var(--warning-surface);
  --warning-border: rgba(242, 196, 123, 0.3);
  --info-bg: var(--info-surface);
  --info-border: rgba(145, 187, 242, 0.3);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 30px -4px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 24px rgba(94, 217, 186, 0.16);
  --accent-color: var(--primary);
}

:root:not(.dark), html.light, body.light {
  color-scheme: light;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Manrope", sans-serif;

  --radius: 0.5rem;
  --background: oklch(0.975 0.003 235);
  --foreground: oklch(0.22 0.018 240);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.22 0.018 240);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.22 0.018 240);
  --primary: oklch(0.52 0.14 175);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.94 0.006 235);
  --secondary-foreground: oklch(0.25 0.018 240);
  --muted: oklch(0.955 0.004 235);
  --muted-foreground: oklch(0.54 0.014 240);
  --accent: oklch(0.94 0.027 175);
  --accent-foreground: oklch(0.36 0.095 175);
  --destructive: oklch(0.57 0.2 24);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.915 0.007 235);
  --input: oklch(0.915 0.007 235);
  --ring: oklch(0.52 0.14 175);
  --positive: oklch(0.43 0.13 158);
  --positive-surface: oklch(0.96 0.038 158);
  --warning: oklch(0.56 0.13 75);
  --warning-surface: oklch(0.97 0.04 78);
  --info: oklch(0.48 0.13 250);
  --info-surface: oklch(0.95 0.025 250);
  --chart-fill: oklch(0.79 0.09 175);
  --sidebar: oklch(0.98 0.002 235);
  --sidebar-foreground: oklch(0.22 0.018 240);
  --sidebar-primary: oklch(0.52 0.14 175);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.93 0.029 175);
  --sidebar-accent-foreground: oklch(0.34 0.08 175);
  --sidebar-border: oklch(0.915 0.007 235);

  /* Aliases to our existing CSS custom property names for light mode */
  --bg-main: var(--background);
  --bg-sidebar: var(--sidebar);
  --bg-topbar: rgba(255, 255, 255, 0.88);
  --bg-card: var(--card);
  --bg-card-hover: oklch(0.985 0.003 235);
  --bg-card-subtle: oklch(0.97 0.005 235);
  --bg-card-solid: var(--card);
  --bg-input: #FFFFFF;
  --bg-modal: var(--card);
  --bg-overlay: rgba(15, 23, 42, 0.45);

  --border-color: var(--border);
  --border-subtle: oklch(0.94 0.005 235);
  --border-hover: oklch(0.75 0.08 175);
  --border-active: var(--primary);

  --primary-hover: oklch(0.46 0.14 175);
  --primary-cyan: var(--primary);
  --primary-teal: var(--positive);
  --primary-mint: oklch(0.36 0.095 175);
  --primary-glow: rgba(20, 131, 112, 0.15);
  --primary-gradient: linear-gradient(135deg, oklch(0.52 0.14 175) 0%, oklch(0.44 0.13 175) 100%);
  --primary-border: oklch(0.85 0.05 175);

  --text-primary: var(--foreground);
  --text-secondary: var(--muted-foreground);
  --text-muted: oklch(0.60 0.014 240);
  --text-cyan: var(--primary);
  --text-teal: var(--positive);

  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.25);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.25);
  --warning-bg: var(--warning-surface);
  --warning-border: oklch(0.90 0.07 75);
  --info-bg: var(--info-surface);
  --info-border: oklch(0.90 0.05 250);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(20, 131, 112, 0.1);
  --accent-color: var(--primary);
}

/* ================= Base Reset & Typography ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  width: 100%;
  font-family: var(--font-sans);
}

button, input, select, textarea {
  font-family: inherit;
}

.font-display,
.brand-text,
.dash-greeting,
.stat-value,
.panel-title,
.card-title,
.modal-title,
.login-title,
.dialog-title,
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display) !important;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* SVG Icon System */
.svg-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease, transform 0.2s ease;
}
.icon-xs { width: 13px; height: 13px; }
.icon-sm { width: 15px; height: 15px; }
.icon-md { width: 18px; height: 18px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

/* Color utilities for SVG */
.text-cyan { color: var(--primary); }
.text-teal { color: var(--positive); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

/* ================= Morrow Sidebar Navigation ================= */
.sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 20px 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  font-family: var(--font-display, inherit);
  user-select: none;
}

.brand-icon-box svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

.brand-text {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
}

.brand-dot {
  color: var(--primary);
  font-weight: 900;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 20px 6px;
  user-select: none;
}

.sidebar-nav {
  padding: 6px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}

.nav-item:hover {
  background: var(--muted);
  color: var(--foreground);
}

.nav-item.active {
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
  border-color: transparent;
  font-weight: 600;
}

.nav-item.active .svg-icon {
  color: var(--sidebar-accent-foreground);
  stroke-width: 2;
}

/* Sidebar Footer & Store Pill */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  background: var(--bg-sidebar);
}

.sidebar-store-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.store-pill-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.store-pill-meta {
  flex: 1;
  min-width: 0;
}

.store-pill-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-pill-sub {
  font-size: 11px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-foreground);
  font-weight: 700;
  font-size: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.user-info-sm {
  flex: 1;
  min-width: 0;
}

.user-name-sm {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-sm {
  font-size: 11px;
  color: var(--muted-foreground);
}

.btn-logout-icon {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-logout-icon:hover {
  color: var(--destructive);
  background: var(--danger-bg);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: var(--danger-bg);
  color: var(--destructive);
  border: 1px solid var(--danger-border);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  opacity: 0.9;
}

/* ================= Main Content Area ================= */
.main-wrapper {
  margin-left: 250px;
  flex: 1 1 auto;
  min-width: 0;
  width: calc(100vw - 250px);
  max-width: calc(100vw - 250px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-x: hidden;
  background: var(--bg-main);
}

/* Morrow Topbar */
.topbar {
  height: 64px;
  background: var(--bg-topbar);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 4px;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  white-space: nowrap;
}

.bc-root {
  color: var(--muted-foreground);
  font-weight: 500;
}

.bc-sep {
  color: var(--border-color);
  font-size: 13px;
}

.bc-page {
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: -0.2px;
}

.page-title {
  display: none; /* Managed by bc-page */
}

/* Morrow Topbar Search */
.topbar-center {
  flex: 1;
  max-width: 340px;
  margin: 0 20px;
}

.topbar-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 12px;
  transition: all 0.15s ease;
}

.topbar-search-box:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.topbar-search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--foreground);
  font-size: 12.5px;
  width: 100%;
}

.topbar-search-box input::placeholder {
  color: var(--muted-foreground);
}

.search-kbd {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

/* Topbar Right Actions */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--positive);
  background: var(--positive-surface);
  border: 1px solid var(--border-color);
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.dot-pulse {
  width: 6px;
  height: 6px;
  background: var(--positive);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--positive);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.balance-pill:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.balance-label {
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.balance-val {
  font-weight: 700;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.btn-icon-only {
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--border-color);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-only:hover {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--border-hover);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-foreground);
  font-weight: 700;
  font-size: 11.5px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-color);
  cursor: default;
  user-select: none;
  margin-left: 4px;
}

/* ================= Page Content Views ================= */
.content-view {
  padding: 24px;
  display: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

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

/* ================= Morrow Dashboard Hero ================= */
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.dash-hero-left {
  display: flex;
  flex-direction: column;
}

.dash-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 4px;
  letter-spacing: 0.1px;
}

.dash-greeting {
  font-size: 26px;
  font-weight: 800;
  color: var(--foreground);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.dash-sub {
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* Morrow Filter Tabs (Segmented Control) */
.filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--muted);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
  max-width: 100%;
}

.tab-btn {
  padding: 6px 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.tab-btn:hover {
  color: var(--foreground);
}

.tab-btn.active {
  background: var(--card);
  color: var(--primary);
  border-color: var(--border-color);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.tab-btn.active .svg-icon {
  color: var(--primary);
  stroke-width: 2.1;
}

/* ================= Morrow 4 KPI Stats Grid ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1.5px);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground);
  letter-spacing: -0.1px;
}

.stat-icon,
.stat-icon-rev,
.stat-icon-profit,
.stat-icon-orders,
.stat-icon-users {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-foreground);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-icon .svg-icon,
.stat-icon svg {
  width: 17px;
  height: 17px;
  color: inherit;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-value-profit {
  color: var(--positive);
}

.stat-value-warn {
  color: var(--warning);
}

.stat-lkr-wrap {
  min-height: 20px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.stat-lkr {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

.stat-lkr-profit {
  color: var(--positive);
  opacity: 0.9;
}

.stat-trend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

.stat-trend-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  line-height: 1.2;
  white-space: nowrap;
}

.trend-up {
  background: var(--positive-surface);
  color: var(--positive);
}

.trend-amber {
  background: var(--warning-surface);
  color: var(--warning);
}

.trend-sky {
  background: var(--info-surface);
  color: var(--info);
}

.stat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================= Dashboard Sales & Trend Chart ================= */
.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  min-width: 36px;
}

.chart-bars-wrap {
  width: 100%;
  height: 130px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  position: relative;
}

.chart-bar {
  width: 12px;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
  min-height: 4px;
}

.chart-bar-rev {
  background: linear-gradient(180deg, #10B981 0%, #059669 100%);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.chart-bar-profit {
  background: linear-gradient(180deg, #2DD4BF 0%, #0D9488 100%);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.25);
}

.chart-bar-col:hover .chart-bar {
  filter: brightness(1.2);
}

.chart-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
  white-space: nowrap;
}

.chart-tooltip {
  position: absolute;
  bottom: 140px;
  background: var(--card);
  border: 1px solid var(--border-color);
  color: var(--foreground);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
  box-shadow: var(--shadow-md);
}

.chart-bar-col:hover .chart-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* ================= Top Products Leaderboard ================= */
.top-prod-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.15s ease;
}

.top-prod-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(2px);
}

.top-prod-rank {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.rank-1 { background: rgba(245, 158, 11, 0.2); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.35); }
.rank-2 { background: rgba(148, 163, 184, 0.2); color: #CBD5E1; border: 1px solid rgba(148, 163, 184, 0.35); }
.rank-3 { background: rgba(217, 119, 6, 0.2); color: #F97316; border: 1px solid rgba(217, 119, 6, 0.35); }
.rank-other { background: var(--muted); color: var(--muted-foreground); }

/* ================= Panels & Cards ================= */
.panel {
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-sub {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

/* ================= Supplier Status Sub-Cards ================= */
.supplier-card {
  background: var(--background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.supplier-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

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

.supplier-card-title {
  font-weight: 700;
  font-size: 14.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
}

.supplier-card-bal {
  font-size: 24px;
  font-weight: 800;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  margin: 4px 0 2px;
}

.supplier-card-sub {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 4px;
}

.supplier-card-desc {
  font-size: 13.5px;
  margin-top: 8px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  user-select: none;
  white-space: nowrap;
}

.btn .svg-icon,
.btn svg {
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-0.5px);
}

.btn-success {
  background: #10B981;
  border: 1px solid #10B981;
  color: #FFFFFF;
  font-weight: 600;
}
.btn-success:hover {
  background: #059669;
  border-color: #059669;
  color: #FFFFFF;
  opacity: 1;
}

.btn-danger {
  background: #EF4444;
  border: 1px solid #EF4444;
  color: #FFFFFF;
  font-weight: 600;
}
.btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
  opacity: 1;
}

.btn-outline {
  background: var(--card);
  border-color: var(--border-color);
  color: var(--foreground);
}
.btn-outline:hover {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 6px;
}

/* ================= Data Tables ================= */
.table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  margin-top: 10px;
  background: var(--card);
  position: relative;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 12.5px;
}

th {
  background: var(--muted);
  padding: 10px 14px;
  color: var(--muted-foreground);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--foreground);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--muted);
}

/* ================= Sticky Actions Column ================= */
.table-container th:last-child,
.table-container td:last-child:not([colspan]),
.th-actions,
.td-actions {
  position: sticky;
  right: 0;
  z-index: 5;
  background: var(--card);
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 10px -2px rgba(0, 0, 0, 0.2);
}

.table-container th:last-child,
.th-actions {
  background: var(--muted);
  z-index: 6;
}

.table-container tr:hover td:last-child:not([colspan]),
.table-container tr:hover .td-actions {
  background: var(--bg-card-hover);
}

.td-actions .btn-sm {
  padding: 5px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ================= Refined Status Badges ================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-cyan { background: var(--info-bg); color: var(--primary-cyan); border: 1px solid var(--info-border); }
.badge-teal { background: rgba(7, 168, 170, 0.12); color: var(--primary-teal); border: 1px solid rgba(7, 168, 170, 0.25); }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge-primary { background: rgba(7, 168, 170, 0.12); color: var(--primary-cyan); border: 1px solid rgba(7, 168, 170, 0.25); }
.badge-secondary { background: rgba(148, 163, 184, 0.1); color: var(--text-secondary); border: 1px solid rgba(148, 163, 184, 0.2); }

/* Provider Badges */
.badge-pandora { background: rgba(56, 189, 248, 0.12); color: #38BDF8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-safwan { background: rgba(167, 139, 250, 0.12); color: #A78BFA; border: 1px solid rgba(167, 139, 250, 0.3); }
.badge-custom-prov { background: rgba(7, 168, 170, 0.12); color: #2DD4BF; border: 1px solid rgba(7, 168, 170, 0.3); }
.badge-custom { background: rgba(168, 85, 247, 0.12); color: #C084FC; border: 1px solid rgba(168, 85, 247, 0.25); }

/* Auto-Routing Micro-Prefix */
.badge-auto-tag {
  display: inline-flex;
  align-items: center;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 4.5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  line-height: 1.1;
  margin-right: 4px;
}

/* Provider Container & Failover */
.provider-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}
.badge-failover {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: 4px;
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.28);
  line-height: 1.2;
  white-space: nowrap;
}

/* Dedicated Modern Stock Status Pills */
.badge-stock {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.15px;
  white-space: nowrap;
  box-sizing: border-box;
}
.badge-stock-dot {
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  top: -0.5px;
}
.badge-stock-in {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-stock-in .badge-stock-dot {
  background: #10b981;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
}
.badge-stock-low {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}
.badge-stock-low .badge-stock-dot {
  background: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}
.badge-stock-out {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-stock-out .badge-stock-dot {
  background: #ef4444;
}
.badge-stock-instant {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.badge-stock-instant .badge-stock-dot {
  background: #0ea5e9;
}
.badge-stock-manual {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.badge-stock-manual .badge-stock-dot {
  background: #64748b;
}

/* Category Badges */
.badge-cat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.badge-cat-chatgpt { background: rgba(16, 185, 129, 0.08); color: #34d399; border-color: rgba(16, 185, 129, 0.22); }
.badge-cat-capcut { background: rgba(7, 168, 170, 0.08); color: var(--primary-cyan); border-color: rgba(7, 168, 170, 0.22); }
.badge-cat-claude { background: rgba(249, 115, 22, 0.08); color: #fb923c; border-color: rgba(249, 115, 22, 0.22); }
.badge-cat-microsoft { background: rgba(56, 189, 248, 0.08); color: #38bdf8; border-color: rgba(56, 189, 248, 0.22); }
.badge-cat-design { background: rgba(236, 72, 153, 0.08); color: #f472b6; border-color: rgba(236, 72, 153, 0.22); }
.badge-cat-ai { background: rgba(167, 139, 250, 0.08); color: #a78bfa; border-color: rgba(167, 139, 250, 0.22); }
.badge-cat-vpn { background: rgba(14, 165, 233, 0.08); color: #38bdf8; border-color: rgba(14, 165, 233, 0.22); }
.badge-cat-streaming { background: rgba(239, 68, 68, 0.08); color: #f87171; border-color: rgba(239, 68, 68, 0.22); }
.badge-cat-dev { background: rgba(59, 130, 246, 0.08); color: #60a5fa; border-color: rgba(59, 130, 246, 0.22); }

/* High-Contrast Light Mode Badge & Tag Overrides (WCAG AA Compliance) */
html.light .rank-2 {
  background: rgba(100, 116, 139, 0.12);
  color: #334155;
  border-color: rgba(100, 116, 139, 0.3);
}

html.light .badge-pandora {
  background: rgba(2, 132, 199, 0.12);
  color: #0369a1;
  border-color: rgba(2, 132, 199, 0.3);
}

html.light .badge-safwan {
  background: rgba(124, 58, 237, 0.12);
  color: #6d28d9;
  border-color: rgba(124, 58, 237, 0.3);
}

html.light .badge-custom-prov {
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.3);
}

html.light .badge-custom {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
  border-color: rgba(147, 51, 234, 0.3);
}

html.light .badge-cat-chatgpt { background: rgba(5, 150, 105, 0.12); color: #065f46; border-color: rgba(5, 150, 105, 0.3); }
html.light .badge-cat-capcut { background: rgba(13, 148, 136, 0.12); color: #0f766e; border-color: rgba(13, 148, 136, 0.3); }
html.light .badge-cat-claude { background: rgba(234, 88, 12, 0.12); color: #c2410c; border-color: rgba(234, 88, 12, 0.3); }
html.light .badge-cat-microsoft { background: rgba(2, 132, 199, 0.12); color: #0369a1; border-color: rgba(2, 132, 199, 0.3); }
html.light .badge-cat-design { background: rgba(219, 39, 119, 0.12); color: #9d174d; border-color: rgba(219, 39, 119, 0.3); }
html.light .badge-cat-ai { background: rgba(124, 58, 237, 0.12); color: #6d28d9; border-color: rgba(124, 58, 237, 0.3); }
html.light .badge-cat-vpn { background: rgba(2, 132, 199, 0.12); color: #0369a1; border-color: rgba(2, 132, 199, 0.3); }
html.light .badge-cat-streaming { background: rgba(220, 38, 38, 0.12); color: #991b1b; border-color: rgba(220, 38, 38, 0.3); }
html.light .badge-cat-dev { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; border-color: rgba(37, 99, 235, 0.3); }

/* Retail & Wholesale Cells */
.retail-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}
.retail-usd {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--success);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}
.retail-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.retail-profit-tag {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(7, 168, 170, 0.1);
  color: var(--primary-cyan);
  border: 1px solid rgba(7, 168, 170, 0.22);
  line-height: 1.2;
}
.wholesale-price {
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}
.wholesale-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.provider-rates-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.rate-pill small {
  font-size: 9px;
  opacity: 0.8;
}
.rate-pill.rate-pandora {
  color: #2DD4BF;
  border-color: rgba(45, 212, 191, 0.25);
  background: rgba(45, 212, 191, 0.08);
}
.rate-pill.rate-safwan {
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.08);
}
.rate-pill.rate-best {
  border-color: #10B981 !important;
  color: #10B981 !important;
  background: rgba(16, 185, 129, 0.14) !important;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.25);
  font-weight: 700;
}

/* Modal Live Provider Comparison Card */
.provider-compare-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pcc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.pcc-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pcc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pcc-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 10px;
  transition: all 0.2s ease;
}
.pcc-col.pcc-best {
  border-color: #10B981;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}
.pcc-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pcc-col.pcc-best .pcc-label {
  color: #10B981;
}
.pcc-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.pcc-col.pcc-best .pcc-price {
  color: #10B981;
}
.pcc-stock {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.pcc-footer {
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Providers Table Live Price Cells */
.prov-price-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}
.prov-price-val {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
}
.prov-price-stock {
  font-size: 11px;
  color: var(--text-muted);
}
.prov-best-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.prov-best-badge.badge-safwan-best {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.prov-best-badge.badge-pandora-best {
  background: rgba(45, 212, 191, 0.12);
  color: #2DD4BF;
  border: 1px solid rgba(45, 212, 191, 0.3);
}

/* Product Name & Micro Tags */
.prod-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prod-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.prod-title {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}
.prod-title:hover {
  color: var(--primary-cyan);
  text-decoration: underline;
}
.prod-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.micro-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 1px 4.5px;
  border-radius: 3px;
  line-height: 1.2;
}
.micro-tag-custom {
  background: rgba(7, 168, 170, 0.12);
  color: var(--primary-cyan);
  border: 1px solid rgba(7, 168, 170, 0.25);
}
.micro-tag-renamed {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.micro-tag-image {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.prod-orig-name {
  font-size: 11px;
  color: var(--text-muted);
}

/* ================= Switch Toggle ================= */
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--input);
  border: 1px solid var(--border-color);
  transition: all .25s ease;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

input:checked + .slider {
  background: var(--primary);
  border-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(16px);
  background-color: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ================= Form Controls ================= */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-select {
  width: 100%;
  padding: 8px 38px 8px 12px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s, background-image 0.2s;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  cursor: pointer;
}

.form-select::-ms-expand {
  display: none;
}

.form-select:hover {
  border-color: var(--border-hover);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.form-select:focus {
  outline: none;
  border-color: var(--border-active);
  box-shadow: 0 0 0 2px var(--primary-glow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235ED9BA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.form-select option {
  background-color: var(--card);
  color: var(--foreground);
  padding: 8px 12px;
}

#edit-prod-profit-curr {
  width: 90px !important;
  padding: 8px 28px 8px 10px !important;
  background-position: right 10px center !important;
}

.prov-assign-select {
  padding: 5px 28px 5px 10px !important;
  font-size: 12px !important;
  width: 145px !important;
  background-position: right 10px center !important;
  background-size: 12px 12px !important;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

/* ================= Modals ================= */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md), 0 0 30px rgba(7, 168, 170, 0.08);
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScale {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ================= Modern Custom Confirmation Dialog ================= */
.modal-confirm-card {
  max-width: 440px !important;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-color);
  animation: modalScale 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirm-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.confirm-icon-badge svg {
  width: 20px;
  height: 20px;
}

/* Warning Variant (amber/orange) */
.modal-confirm-warning {
  border-color: rgba(245, 158, 11, 0.35) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(245, 158, 11, 0.12) !important;
}
.modal-confirm-warning .confirm-icon-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Danger Variant (red) */
.modal-confirm-danger {
  border-color: rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(239, 68, 68, 0.12) !important;
}
.modal-confirm-danger .confirm-icon-badge {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Info Variant (cyan/teal) */
.modal-confirm-info {
  border-color: rgba(7, 168, 170, 0.35) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(7, 168, 170, 0.12) !important;
}
.modal-confirm-info .confirm-icon-badge {
  background: rgba(7, 168, 170, 0.15);
  color: #07A8AA;
  border: 1px solid rgba(7, 168, 170, 0.3);
}

/* ================= Modern Glassmorphic Toast System ================= */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 14px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: #F1F5F9;
  min-width: 300px;
  max-width: 440px;
  background: rgba(11, 16, 29, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
}

.toast-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

/* Success */
.toast-success {
  border-color: rgba(16, 185, 129, 0.28);
}
.toast-success .toast-icon-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.22);
}

/* Danger / Error */
.toast-danger,
.toast-error {
  border-color: rgba(244, 63, 94, 0.28);
}
.toast-danger .toast-icon-badge,
.toast-error .toast-icon-badge {
  background: rgba(244, 63, 94, 0.12);
  color: #F43F5E;
  border: 1px solid rgba(244, 63, 94, 0.3);
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.22);
}

/* Warning */
.toast-warning {
  border-color: rgba(245, 158, 11, 0.28);
}
.toast-warning .toast-icon-badge {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.22);
}

/* Info */
.toast-info {
  border-color: rgba(7, 168, 170, 0.28);
}
.toast-info .toast-icon-badge {
  background: rgba(7, 168, 170, 0.12);
  color: #07A8AA;
  border: 1px solid rgba(7, 168, 170, 0.3);
  box-shadow: 0 0 14px rgba(7, 168, 170, 0.22);
}

.toast-message {
  flex: 1;
  line-height: 1.45;
  color: #E2E8F0;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.toast-close {
  background: transparent;
  border: none;
  color: #64748B;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  margin-right: -4px;
}
.toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
}

/* Bottom Progress Bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.toast-progress-bar {
  height: 100%;
  width: 100%;
  transform-origin: left;
  animation: toastProgress linear forwards;
}

.toast-success .toast-progress-bar {
  background: linear-gradient(90deg, #10B981, #34D399);
}
.toast-danger .toast-progress-bar {
  background: linear-gradient(90deg, #F43F5E, #FB7185);
}
.toast-warning .toast-progress-bar {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}
.toast-info .toast-progress-bar {
  background: linear-gradient(90deg, #07A8AA, #38BDF8);
}

@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Spinner for Sync icon */
@keyframes syncSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.sync-icon-spin {
  animation: syncSpin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform-origin: center;
}

#btn-refresh-all:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Toast Action Content & Buttons */
.toast-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.toast-title {
  font-weight: 700;
  font-size: 13.5px;
  color: #F8FAFC;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toast-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #F1F5F9;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
  text-decoration: none;
}
.toast-action-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}
.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

@media (max-width: 640px) {
  #toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

/* ================= Login Gate ================= */
.login-wrap {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 20px;
}

.login-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 34px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md), 0 0 30px rgba(7, 168, 170, 0.1);
  text-align: center;
}

.login-logo {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(7, 168, 170, 0.1);
  border: 1px solid rgba(7, 168, 170, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-cyan);
  margin: 0 auto 16px;
  box-shadow: 0 0 16px rgba(7, 168, 170, 0.25);
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.login-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* ================= Responsive Breakpoints & Mobile Drawer ================= */
body.modal-locked,
body.drawer-locked {
  overflow: hidden !important;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-close {
  display: none;
}

.mobile-toggle,
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  min-height: 40px;
  min-width: 40px;
}
.mobile-toggle:hover,
.mobile-menu-btn:hover {
  background: var(--bg-card-hover);
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
  }
  .mobile-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    min-height: 40px;
    min-width: 40px;
    margin-left: auto;
  }
  .mobile-drawer-close:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
  }
  .main-wrapper {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
  .mobile-toggle,
  .mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
  .topbar {
    padding: 0 14px;
  }
  .content-view {
    padding: 14px;
  }
}

@media (max-width: 768px) {
  .topbar-center {
    display: none !important;
  }
  .topbar-right {
    gap: 6px;
  }
  .btn-refresh-all span {
    display: none;
  }
  .live-indicator span:last-child {
    display: none;
  }
  .modal-body div[style*="grid-template-columns"],
  .modal-form-grid,
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px !important;
  }
  .td-actions .btn,
  .btn-icon-only {
    min-height: 40px;
    min-width: 40px;
  }
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .topbar-breadcrumb .bc-root,
  .topbar-breadcrumb .bc-sep {
    display: none;
  }
  .modal-card {
    width: 95vw !important;
    margin: 10px auto;
    padding: 14px;
    max-height: 92vh;
  }
  .modal-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .modal-footer .btn {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Promo Tier Rows */
.promo-tier-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  margin-bottom: 6px;
}

.promo-tier-row input {
  padding: 6px 10px;
  font-size: 13px;
}

.promo-tier-row .btn-del-tier {
  padding: 4px 8px;
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-tier-row .btn-del-tier:hover {
  background: var(--danger);
  color: #FFF;
}

/* ================= Delivery Message & Payment Gateway Styles ================= */
.placeholder-chip {
  background: rgba(7, 168, 170, 0.12);
  color: #07A8AA;
  border: 1px solid rgba(7, 168, 170, 0.3);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.placeholder-chip:hover {
  background: rgba(7, 168, 170, 0.25);
  border-color: #07A8AA;
  transform: translateY(-1px);
}
.telegram-bubble {
  background: #182533;
  color: #F5F5F5;
  border-radius: 12px 12px 12px 2px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.telegram-bubble code {
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  color: #72C0DE;
}
.payment-toggle-card {
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.payment-toggle-card:hover {
  border-color: var(--border-hover);
}
.payment-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.payment-toggle-card:hover .payment-icon-box {
  transform: scale(1.05);
}
.bank-account-card {
  background: var(--card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Badges & Notification Pills */
.badge {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 9999px;
  letter-spacing: 0.3px;
}
.badge-danger {
  background: var(--danger-bg);
  color: var(--destructive);
  border: 1px solid var(--danger-border);
}
.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}
.badge-success {
  background: var(--success-bg);
  color: var(--positive);
  border: 1px solid var(--success-border);
}
.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}
.badge-secondary {
  background: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border-color);
}

/* Preset Reason Chips in Rejection Modal */
.btn-preset-reason {
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-preset-reason:hover {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--destructive);
}

/* Clickable stat card interaction */
#card-pending-slips:hover {
  border-color: var(--warning);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(242, 196, 123, 0.2);
}

/* ================= Settings Sub-Cards & Panels ================= */
.settings-subcard {
  background: var(--background);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

/* ================= Telegram Chat Live Customer Preview ================= */
.telegram-chat-preview {
  background: #0E1621;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border-color);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: all 0.2s ease;
}

.telegram-bot-header {
  font-size: 11.5px;
  color: #72C0DE;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.telegram-bot-badge {
  color: rgba(255, 255, 255, 0.4);
}

.telegram-btn-group {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telegram-preview-btn {
  background: #2B5278;
  color: #FFFFFF;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* ================= Light Theme Component Tweaks ================= */
html.light .slider {
  background-color: oklch(0.88 0.01 235);
  border-color: oklch(0.82 0.01 235);
}

html.light .slider:before {
  background-color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
}

html.light input:checked + .slider {
  background: var(--primary);
  border-color: var(--primary);
}

html.light input:checked + .slider:before {
  background-color: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

html.light .telegram-chat-preview {
  background: #E5ECF2;
  border-color: oklch(0.88 0.01 235);
}

html.light .telegram-bot-header {
  color: #246B96;
}

html.light .telegram-bot-badge {
  color: #64748B;
}

html.light .telegram-bubble {
  background: #FFFFFF;
  color: #182533;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}

html.light .telegram-bubble code {
  background: #EEF3F7;
  color: #0284C7;
}

html.light .telegram-preview-btn {
  background: #3390EC;
  color: #FFFFFF;
}

html.light .placeholder-chip {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--border-color);
}

html.light .login-card {
  background: #FFFFFF;
  border-color: var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

html.light .modal-card {
  background: #FFFFFF;
  border-color: var(--border-color);
}

/* Catalog Order Manager Styles */
.arrange-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-surface-2, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  transition: all 0.15s ease;
}
.arrange-order-row:hover {
  background: var(--bg-surface-hover, rgba(255, 255, 255, 0.06));
  border-color: rgba(7, 168, 170, 0.4);
}
.arrange-order-row.dragging {
  opacity: 0.4;
  cursor: grabbing;
  border-style: dashed;
}
.arrange-order-row.drag-over {
  border-top: 2px solid var(--primary);
  background: rgba(7, 168, 170, 0.1);
}
.arrange-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 24px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
}
.arrange-rank-badge.top-10 {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.arrange-handle {
  cursor: grab;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
