:root{
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

html.is-chrome{
  font-size:15px;
}

body{
  margin:0;
  background:#f6f7fb;
  color:#0f172a;
  font-size:18px;
  line-height:1.5;
}

.app{
  max-width:820px;
  margin:0 auto;
  padding:14px;
}

a{
  color:inherit;
}

/* ===== Base form ===== */

.row{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:12px;
}

.row:first-child{
  margin-top:0;
}

.label{
  font-size:16px;
  opacity:.8;
  font-weight:700;
}

.input{
  width:100%;
  box-sizing:border-box;
  padding:14px 14px;
  border:1px solid rgba(15,23,42,.15);
  border-radius:12px;
  font-size:18px;
  outline:none;
  background:#fff;
}

.input:focus{
  border-color:rgba(37,99,235,.7);
}

form .btn.primary{
  margin-top:10px;
}

/* ===== Auth pages ===== */

.authBody{
  min-height:100vh;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.10), transparent 30%),
    radial-gradient(circle at bottom right, rgba(139,92,246,.10), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, #f3f6fb 100%);
}

.authShell{
  max-width:1180px;
  margin:0 auto;
  padding:24px 16px 40px;
}

.authTopbar{
  display:flex;
  justify-content:flex-end;
  margin-bottom:16px;
}

.authLangBtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:46px;
  padding:0 14px;
  border-radius:14px;
  text-decoration:none;
  border:1px solid rgba(15,23,42,.08);
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(12px);
  box-shadow:0 10px 30px rgba(15,23,42,.06);
  font-weight:700;
}

.authHeroCard{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:22px;
  align-items:stretch;
}

.authHeroText{
  background:linear-gradient(135deg,#ffffff 0%,#f8fbff 100%);
  border:1px solid rgba(15,23,42,.08);
  border-radius:30px;
  padding:32px;
  box-shadow:0 18px 45px rgba(15,23,42,.07);
}

.authBadge{
  display:inline-flex;
  align-items:center;
  min-height:32px;
  padding:0 12px;
  border-radius:999px;
  background:#eff6ff;
  color:#2563eb;
  font-size:13px;
  font-weight:800;
  letter-spacing:.02em;
}

.authHeroTitle{
  margin:18px 0 10px;
  font-size:48px;
  line-height:1.02;
  font-weight:900;
  letter-spacing:-.04em;
}

.authHeroSub{
  font-size:18px;
  color:#475569;
  margin:0;
  max-width:640px;
}

.authFeatureList{
  margin-top:24px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.authFeatureItem{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:16px;
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  box-shadow:0 8px 20px rgba(15,23,42,.04);
  font-weight:700;
}

.authGlassCard{
  background:rgba(255,255,255,.78);
  backdrop-filter:blur(16px);
  border:1px solid rgba(15,23,42,.08);
  border-radius:30px;
  padding:28px;
  box-shadow:0 18px 45px rgba(15,23,42,.08);
}

.authCardHeader h2{
  margin:0;
  font-size:34px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.03em;
}

.authCardHeader p{
  margin:10px 0 0;
  color:#64748b;
  font-size:15px;
}

.authForm{
  margin-top:18px;
}

.authPrimaryBtn{
  margin-top:14px;
  width:100%;
  min-height:54px;
  border:0;
  border-radius:16px;
  background:linear-gradient(135deg,#2563eb 0%,#1d4ed8 100%);
  color:#fff;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:18px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 12px 24px rgba(37,99,235,.22);
}

.authLinks{
  margin-top:16px;
  font-size:16px;
  color:#475569;
}

.authLinks a{
  text-decoration:underline;
  font-weight:700;
}

html[dir="rtl"] .authHeroCard,
html[dir="rtl"] .authFeatureItem,
html[dir="rtl"] .authLangBtn,
html[dir="rtl"] .authPrimaryBtn{
  direction:rtl;
}

html[dir="rtl"] .authHeroText,
html[dir="rtl"] .authGlassCard{
  text-align:right;
}

/* ===== Header / app ===== */

.header{
  padding:10px 6px 12px;
  border-radius:16px;
  margin-bottom:12px;
  position:sticky;
  top:0;
  z-index:20;
}

.header-colored{
  background:#2563eb;
  color:#fff;
}

.headerRow{
  display:flex;
  align-items:center;
  gap:10px;
}

.headerRow h1{
  font-size:26px;
  margin:0;
}

.sub{
  opacity:.9;
  margin:0;
  font-size:14px;
}

.card{
  background:#fff;
  border-radius:16px;
  padding:14px;
  box-shadow:0 8px 22px rgba(2,6,23,.08);
  margin-bottom:12px;
}

.searchRow{
  display:flex;
  gap:10px;
  align-items:stretch;
  flex-wrap:wrap;
  margin-top:10px;
}

.searchInput{
  flex:1;
  min-width:180px;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

.statusRow{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  margin-top:10px;
}

.status{
  font-size:16px;
  min-height:20px;
}

.status.ok{color:#16a34a;}
.status.warn{color:#d97706;}
.status.error{color:#dc2626;}
.status.info{color:#2563eb;}

.btn{
  border:1px solid rgba(15,23,42,.12);
  background:#fff;
  border-radius:12px;
  padding:14px 16px;
  font-size:18px;
  color:#0a0a0a;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  text-decoration:none;
}

.btn.primary{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

.btn.danger{
  background:#ef4444;
  color:#fff;
  border-color:#ef4444;
}

.btn.green{
  background:#16a34a;
  color:#fff;
  border-color:#16a34a;
}

.hidden{
  display:none!important;
}

/* ===== Scanner ===== */

.scanner{
  margin-top:12px;
  position:relative;
}

.video{
  width:100%;
  border-radius:14px;
  background:#0b1220;
}

.hint{
  margin-top:8px;
  font-size:14px;
  opacity:.75;
}

.zoom{
  width:100%;
  margin-top:10px;
}

.scanBox{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(80vw,420px);
  height:140px;
  border:3px solid rgba(255,255,255,.95);
  border-radius:14px;
  box-shadow:0 0 0 9999px rgba(0,0,0,.25);
  pointer-events:none;
}

/* ===== Product result ===== */

.resultHead{
  display:flex;
  gap:12px;
  align-items:center;
}

.prodimg{
  width:96px;
  height:96px;
  object-fit:cover;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
}

.resultTitle h2{
  margin:0;
  font-size:22px;
  font-weight:900;
}

.price{
  margin-top:6px;
  font-size:38px;
  font-weight:900;
}

.grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin-top:12px;
}

.kv{
  display:flex;
  justify-content:space-between;
  gap:10px;
  font-size:16px;
}

.kv span:first-child{
  opacity:.75;
  font-weight:700;
}

.desc{
  margin-top:12px;
  font-size:16px;
  line-height:1.35;
}

.muted{
  opacity:.75;
}

.footer{
  text-align:center;
  padding:6px 0 18px;
  opacity:.75;
}

.debug{
  margin-top:10px;
  white-space:pre-wrap;
  background:#0b1220;
  color:#e5e7eb;
  padding:10px;
  border-radius:10px;
  font-size:12px;
}

.debug.hidden{
  display:none!important;
}

/* ===== Drawer ===== */

.drawer-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index:999;
}

.drawer{
  position:fixed;
  top:0;
  bottom:0;
  width:280px;
  max-width:85vw;
  background:#fff;
  z-index:1000;
  box-shadow:0 10px 30px rgba(2,6,23,.3);
  transform:translateX(-105%);
  transition:transform .18s ease;
}

html[dir="rtl"] .drawer{
  right:0;
  left:auto;
  transform:translateX(105%);
}

html[dir="rtl"] .drawer.open{
  transform:translateX(0)!important;
}

html[dir="ltr"] .drawer.open,
.drawer.open{
  transform:translateX(0)!important;
}

.drawerHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px;
  border-bottom:1px solid rgba(15,23,42,.08);
}

.drawerTitle{
  font-weight:900;
}

.drawerBody{
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.drawerItem{
  display:block;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.10);
  text-decoration:none;
  background:#fff;
}

.drawerItem:active{
  transform:scale(.99);
}

/* ===== Icons ===== */

.icon{
  font-family:'Material Symbols Rounded';
  font-weight:normal;
  font-style:normal;
  font-size:22px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  vertical-align:middle;
}

.icon.blue{color:#2563eb;}
.icon.green{color:#10b981;}
.icon.orange{color:#f59e0b;}
.icon.purple{color:#8b5cf6;}
.icon.red{color:#ef4444;}
.icon.gray{color:#64748b;}

/* ===== Legacy dashboard helpers ===== */

.dashboardGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:16px;
}

.dashboardBtn{
  display:flex;
  align-items:center;
  gap:10px;
  padding:16px 14px;
  border-radius:14px;
  background:#fff;
  border:1px solid rgba(15,23,42,.10);
  text-decoration:none;
  font-weight:700;
  min-height:58px;
  box-sizing:border-box;
}

.dashboardBtn.primary{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

.dashboardBtn .icon{
  flex:0 0 auto;
}

.statsCard{
  margin-top:16px;
  padding:14px 16px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.08);
}

.statsLabel{
  font-size:14px;
  opacity:.75;
  margin-bottom:4px;
}

.statsValue{
  font-size:34px;
  font-weight:900;
  line-height:1.1;
}

/* ===== SaaS dashboard ===== */

.app-dashboard{
  max-width:1120px;
}

.saasShell{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.saasHero{
  background:linear-gradient(135deg,#ffffff 0%,#f8fbff 100%);
  border:1px solid rgba(15,23,42,.08);
  border-radius:28px;
  padding:22px;
  box-shadow:0 18px 45px rgba(15,23,42,.07);
}

.saasHeroTop{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  flex-wrap:wrap;
}

.eyebrow{
  font-size:13px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:#64748b;
  margin-bottom:8px;
}

.saasTitle{
  margin:0;
  font-size:42px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.03em;
}

.saasSubtitle{
  margin-top:10px;
  font-size:18px;
  color:#475569;
}

.slugText{
  color:#64748b;
}

.glassBtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:52px;
  padding:0 16px;
  border-radius:16px;
  text-decoration:none;
  border:1px solid rgba(15,23,42,.08);
  background:rgba(255,255,255,.75);
  backdrop-filter:blur(12px);
  box-shadow:0 10px 30px rgba(15,23,42,.06);
  color:#0f172a;
  font-weight:700;
}

.statsGrid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-top:18px;
}

.statCard{
  position:relative;
  overflow:hidden;
  border-radius:22px;
  padding:18px;
  display:flex;
  align-items:center;
  gap:14px;
  min-height:108px;
  border:1px solid rgba(15,23,42,.06);
  box-shadow:0 10px 30px rgba(15,23,42,.05);
}

.statBlue{
  background:linear-gradient(135deg,#eff6ff 0%,#dbeafe 100%);
}

.statGreen{
  background:linear-gradient(135deg,#ecfdf5 0%,#d1fae5 100%);
}

.statOrange{
  background:linear-gradient(135deg,#fff7ed 0%,#ffedd5 100%);
}

.statIconWrap{
  width:56px;
  height:56px;
  border-radius:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.75);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.5);
}

.statIconWrap .icon{
  font-size:28px;
  color:#0f172a;
}

.statMeta{
  min-width:0;
}

.statLabel{
  color:#475569;
  font-size:14px;
  margin-bottom:6px;
}

.statValue{
  font-size:34px;
  line-height:1;
  font-weight:900;
  letter-spacing:-.03em;
}

.panelCard{
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:24px;
  padding:20px;
  box-shadow:0 14px 40px rgba(15,23,42,.06);
}

.panelHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
}

.panelTitle{
  margin:0;
  font-size:24px;
  line-height:1.15;
  font-weight:850;
  letter-spacing:-.02em;
}

.panelSub{
  margin-top:6px;
  color:#64748b;
  font-size:14px;
}

.actionGrid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
}

.actionCard{
  display:flex;
  align-items:flex-start;
  gap:12px;
  text-decoration:none;
  color:#0f172a;
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:20px;
  padding:16px;
  min-height:96px;
  box-shadow:0 10px 24px rgba(15,23,42,.04);
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.actionCard:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 28px rgba(15,23,42,.08);
  border-color:rgba(37,99,235,.18);
}

.actionCard .icon{
  font-size:26px;
  margin-top:1px;
}

.actionPrimary{
  background:linear-gradient(135deg,#2563eb 0%,#1d4ed8 100%);
  color:#fff;
  border-color:#2563eb;
}

.actionPrimary .icon{
  color:#fff;
}

.actionTitle{
  font-size:17px;
  font-weight:800;
  line-height:1.2;
  margin-bottom:4px;
}

.actionDesc{
  font-size:13px;
  line-height:1.35;
  color:#64748b;
}

.actionPrimary .actionDesc{
  color:rgba(255,255,255,.86);
}

.dashboardTwoCol{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:16px;
}

.miniChart{
  display:flex;
  align-items:flex-end;
  gap:10px;
  min-height:180px;
  padding-top:8px;
}

.barGroup{
  flex:1 1 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}

.barValue{
  font-size:12px;
  color:#64748b;
}

.barCol{
  width:100%;
  max-width:38px;
  border-radius:14px 14px 8px 8px;
  background:linear-gradient(180deg,#60a5fa 0%,#2563eb 100%);
  box-shadow:0 8px 18px rgba(37,99,235,.22);
}

.barLabel{
  font-size:12px;
  color:#64748b;
  text-align:center;
}

.recentList{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.recentItem{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:10px 0;
  border-bottom:1px solid rgba(15,23,42,.06);
}

.recentItem:last-child{
  border-bottom:0;
  padding-bottom:0;
}

.recentDot{
  width:10px;
  height:10px;
  border-radius:999px;
  background:#2563eb;
  margin-top:7px;
  flex:0 0 auto;
}

.recentBody{
  min-width:0;
}

.recentTitle{
  font-weight:750;
  line-height:1.3;
}

.recentTime{
  font-size:13px;
  color:#64748b;
  margin-top:4px;
}

/* ===== Products page ===== */

.productsTopBar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  flex-wrap:wrap;
}

.productsToolbar{
  display:grid;
  grid-template-columns:1fr auto;
  gap:14px;
  margin-top:18px;
  align-items:center;
}

.searchShell{
  position:relative;
}

.searchShellIcon{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  left:16px;
  z-index:2;
}

html[dir="rtl"] .searchShellIcon{
  left:auto;
  right:16px;
}

.productsSearchInput{
  width:100%;
  box-sizing:border-box;
  padding-left:50px;
}

html[dir="rtl"] .productsSearchInput{
  padding-left:14px;
  padding-right:50px;
}

.addNewBtn{
  min-width:180px;
  justify-content:center;
}

.productsSummary{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.summaryPill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(15,23,42,.08);
  background:#f8fafc;
  border-radius:999px;
  padding:10px 14px;
  font-size:14px;
  color:#475569;
}

.productsGrid{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:16px;
}

.productSwipeWrap{
  position:relative;
  overflow:hidden;
  border-radius:20px;
}

.swipeDeleteArea{
  position:absolute;
  top:0;
  bottom:0;
  right:0;
  width:116px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#ef4444;
  border-radius:20px;
  z-index:1;
}

html[dir="rtl"] .swipeDeleteArea{
  right:auto;
  left:0;
}

.swipeCard{
  position:relative;
  z-index:2;
  background:#fff;
  transition:transform .2s ease;
  touch-action:pan-y;
}

.productCardModern{
  background:#fff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:20px;
  box-shadow:0 12px 28px rgba(15,23,42,.05);
  overflow:hidden;
}

.productCardLink{
  display:flex;
  align-items:center;
  gap:16px;
  padding:14px 14px 0;
  text-decoration:none;
  color:#0f172a;
}

html[dir="rtl"] .productCardLink{
  flex-direction:row-reverse;
}

.productCardMedia{
  flex:0 0 112px;
  width:112px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.productCardThumb{
  width:112px;
  height:112px;
  object-fit:cover;
  border-radius:16px;
  border:1px solid rgba(15,23,42,.08);
  background:#fff;
  display:block;
  flex-shrink:0;
}

.productCardBody{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:10px;
}

.productCardHead{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
}

html[dir="rtl"] .productCardHead{
  flex-direction:row-reverse;
}

.productNameBlock{
  min-width:0;
  flex:1 1 auto;
}

.productName{
  font-size:18px;
  font-weight:850;
  line-height:1.3;
  word-break:break-word;
}

.productAltName{
  font-size:14px;
  color:#64748b;
  margin-top:4px;
  word-break:break-word;
}

.productPrice{
  flex:0 0 auto;
  white-space:nowrap;
  font-size:20px;
  font-weight:900;
  letter-spacing:-.02em;
  text-align:end;
}

.productPrice span{
  font-size:13px;
  font-weight:800;
  opacity:.85;
  margin-inline-start:4px;
}

.productMetaRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:2px;
}

.metaPill{
  display:inline-flex;
  align-items:center;
  gap:7px;
  border-radius:999px;
  padding:7px 12px;
  background:#f8fafc;
  border:1px solid rgba(15,23,42,.08);
  color:#475569;
  font-size:13px;
  max-width:100%;
}

.stockBadgeOk{
  background:#ecfdf5;
  border-color:#bbf7d0;
  color:#166534;
}

.stockBadgeLow{
  background:#fff7ed;
  border-color:#fed7aa;
  color:#c2410c;
}

.stockBadgeZero{
  background:#fef2f2;
  border-color:#fecaca;
  color:#b91c1c;
}

.productUpdated{
  margin-top:2px;
  display:flex;
  align-items:center;
  gap:7px;
  color:#64748b;
  font-size:13px;
}

.productCardActions{
  margin-top:12px;
  padding:0 14px 14px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
  align-items:stretch;
}

.productCardActions .miniActionBtn{
  width:100%;
  min-height:40px;
  padding:0 12px;
  font-size:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-align:center;
  box-sizing:border-box;
  white-space:nowrap;
}

.productCardActions .miniActionBtn .icon{
  flex:0 0 auto;
}

.productCardActions .miniActionBtn span:last-child{
  display:inline-flex;
  align-items:center;
}

html[dir="rtl"] .productCardActions{
  direction:rtl;
}

.emptyStateCard{
  margin-top:18px;
  min-height:260px;
  border:1px dashed rgba(15,23,42,.14);
  border-radius:24px;
  background:linear-gradient(180deg,#f8fafc 0%,#ffffff 100%);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px;
}

.emptyStateCard h2{
  margin:12px 0 8px;
  font-size:24px;
}

.emptyStateCard p{
  max-width:720px;
}

/* ===== Product editor ===== */

.productEditor{
  max-width:900px;
  margin:auto;
}

.editorHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:20px;
}

.editorGrid{
  display:grid;
  grid-template-columns:2fr 1fr;
  gap:24px;
}

.editorLeft .label{
  margin-top:12px;
}

.twoCols{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.imageUploader{
  text-align:center;
}

.editorPreview{
  width:200px;
  height:200px;
  object-fit:cover;
  border-radius:18px;
  border:1px solid #eee;
}

.editorButtons{
  margin-top:20px;
  display:flex;
  gap:12px;
}

/* ===== RTL global helpers ===== */

html[dir="rtl"] .saasHeroTop,
html[dir="rtl"] .panelHead,
html[dir="rtl"] .productsTopBar,
html[dir="rtl"] .editorHeader{
  direction:rtl;
}

html[dir="rtl"] .actionCard,
html[dir="rtl"] .statCard,
html[dir="rtl"] .recentItem,
html[dir="rtl"] .summaryPill,
html[dir="rtl"] .metaPill,
html[dir="rtl"] .glassBtn,
html[dir="rtl"] .dashboardBtn,
html[dir="rtl"] .btn,
html[dir="rtl"] .authLangBtn,
html[dir="rtl"] .authPrimaryBtn{
  flex-direction:row-reverse;
}

html[dir="rtl"] .productCardActions{
  direction:rtl;
}

html[dir="rtl"] .statsGrid,
html[dir="rtl"] .actionGrid,
html[dir="rtl"] .dashboardTwoCol,
html[dir="rtl"] .dashboardGrid{
  direction:rtl;
}

html[dir="rtl"] .panelCard,
html[dir="rtl"] .card,
html[dir="rtl"] .authHeroText,
html[dir="rtl"] .authGlassCard,
html[dir="rtl"] .productEditor{
  text-align:right;
}

/* ===== Responsive ===== */

@media (max-width: 900px){
  .statsGrid{
    grid-template-columns:1fr;
  }

  .actionGrid{
    grid-template-columns:1fr 1fr;
  }

  .dashboardTwoCol{
    grid-template-columns:1fr;
  }

  .authHeroCard{
    grid-template-columns:1fr;
  }
}

@media (max-width: 720px){
  .productsToolbar{
    grid-template-columns:1fr;
  }

  .addNewBtn{
    width:100%;
  }

  .productCardLink{
    align-items:flex-start;
    gap:12px;
    padding:12px 12px 0;
  }

  .productCardMedia{
    flex:0 0 88px;
    width:88px;
  }

  .productCardThumb{
    width:88px;
    height:88px;
  }

  .productCardHead{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }

  html[dir="rtl"] .productCardHead{
    align-items:flex-end;
  }

  .productPrice{
    white-space:normal;
    text-align:start;
    font-size:18px;
  }

  html[dir="rtl"] .productPrice{
    text-align:end;
  }

  .productCardActions{
    padding:0 12px 12px;
  }
}

@media (max-width: 700px){
  .editorGrid{
    grid-template-columns:1fr;
  }
}

.editorTextarea{
  min-height:110px;
  resize:vertical;
}

.productForm{
  margin-top:16px;
}

.editorButtons{
  margin-top:24px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  padding-bottom:20px;
}

.editorButtons .dashboardBtn,
.editorButtons .btn{
  min-height:54px;
}

.editorRight{
  display:flex;
  align-items:flex-start;
  justify-content:center;
}

.imageUploader{
  width:100%;
  text-align:center;
  border:1px solid rgba(15,23,42,.08);
  border-radius:22px;
  padding:18px;
  background:linear-gradient(180deg,#ffffff 0%,#f8fafc 100%);
}

html[dir="rtl"] .editorButtons{
  justify-content:flex-start;
}

@media (max-width:700px){
  .editorButtons{
    flex-direction:column;
  }

  .editorButtons .dashboardBtn,
  .editorButtons .btn{
    width:100%;
    justify-content:center;
  }

  .editorPreview{
    width:160px;
    height:160px;
  }
}

.productsActionsRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.scanBtnAdmin{
  background:#16a34a;
  color:#fff;
  border-color:#16a34a;
}

@media (max-width: 720px){
  .productsActionsRow{
    flex-direction:column;
    width:100%;
  }

  .productsActionsRow .dashboardBtn,
  .productsActionsRow .btn{
    width:100%;
    justify-content:center;
  }
}

#adminScannerWrap,#scannerWrap{
  margin-top:14px;
}

.productMatchedGlow .productCardModern{
  box-shadow:0 0 0 3px rgba(37,99,235,.22),0 18px 32px rgba(37,99,235,.16);
  border-color:rgba(37,99,235,.35);
}

.heatmap{
  overflow:auto;
  padding-top:6px;
}

.heatmapRow{
  display:grid;
  grid-template-columns:80px repeat(24,minmax(16px,1fr));
  gap:4px;
  margin-bottom:4px;
  align-items:center;
}

.heatmapDayLabel{
  font-size:12px;
  color:#64748b;
  white-space:nowrap;
}

.heatmapCell{
  height:18px;
  border-radius:4px;
  background:rgba(15,23,42,.05);
}

.heatmapHeader .heatmapCell{
  height:auto;
  background:transparent;
  text-align:center;
  font-size:11px;
  color:#94a3b8;
}

@media (max-width:720px){
  .productsActionsRow{
    flex-direction:column;
    width:100%;
  }

  .productsActionsRow .dashboardBtn,
  .productsActionsRow .btn{
    width:100%;
    justify-content:center;
  }

  .heatmapRow{
    grid-template-columns:64px repeat(24,16px);
  }
}

.productsMiniActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.productsSearchStack{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.miniActionBtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:0 14px;
  border-radius:14px;
  text-decoration:none;
  border:1px solid rgba(15,23,42,.10);
  background:#fff;
  color:#0f172a;
  font-size:15px;
  font-weight:700;
  box-sizing:border-box;
  box-shadow:0 8px 20px rgba(15,23,42,.04);
}

.miniActionPrimary{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

.miniActionGreen{
  background:#16a34a;
  color:#fff;
  border-color:#16a34a;
}

.miniActionDanger{
  background:#ef4444;
  color:#fff;
  border-color:#ef4444;
}

.miniActionBlue{
  background:#0ea5e9;
  color:#fff;
  border-color:#0ea5e9;
}

.productsControlRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.perPageWrap{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:14px;
  color:#475569;
  font-weight:700;
}

.perPageSelect{
  width:96px;
  min-height:42px;
  padding:8px 10px;
  font-size:14px;
}

.pagerWrap{
  margin-top:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}

.pagerInfo{
  font-size:14px;
  font-weight:800;
  color:#475569;
  padding:0 8px;
}

.pagerDisabled{
  opacity:.45;
  pointer-events:none;
}

.importActionsGrid{
  margin-top:16px;
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.quickEditWrap{
  margin-top:18px;
}

.quickEditCard{
  padding:0;
}

.quickEditGrid{
  margin-top:14px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.quickEditGrid .row{
  margin-top:0;
}

.scanInlineInfo{
  margin-top:10px;
}

@media (max-width: 720px){
  .productsMiniActions{
    width:100%;
  }

  .productsMiniActions .miniActionBtn{
    flex:1 1 calc(50% - 10px);
    min-width:130px;
  }

  .quickEditGrid{
    grid-template-columns:1fr;
  }

  .productCardActions .miniActionBtn{
    min-height:38px;
    font-size:13px;
    padding:0 10px;
  }
}

/* =========================================
   FINAL DARK/LIGHT MODE FIXES
========================================= */

html,
body,
.card,
.panelCard,
.productCardModern,
.authHeroText,
.authGlassCard,
.input,
.btn,
.glassBtn,
.actionCard,
.dashboardBtn,
.drawer,
.drawerItem,
.summaryPill,
.metaPill,
.statsCard,
.tableWrap,
.analyticsTable th,
.analyticsTable td{
  transition:
    background-color .18s ease,
    color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

html.light{
  color-scheme: light;
}

html.dark{
  color-scheme: dark;
}

html.dark{
  --bg:#0b1220;
  --card:#0f172a;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --border:rgba(148,163,184,.18);
  --border-strong:rgba(148,163,184,.28);
  --glass-bg:rgba(15,23,42,.72);
  --glass-border:rgba(148,163,184,.14);
  --primary:#3b82f6;
  --success:#22c55e;
  --danger:#ef4444;
  --info:#38bdf8;
  --chip:#111827;
}

html.dark body{
  background:var(--bg);
  color:var(--text);
}

html.dark .authBody{
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(139,92,246,.16), transparent 28%),
    linear-gradient(180deg, #0b1220 0%, #111827 100%);
}

html.dark .authHeroText,
html.dark .authGlassCard{
  background:rgba(15,23,42,.78);
  border-color:var(--border);
  box-shadow:0 18px 45px rgba(0,0,0,.24);
}

html.dark .authBadge{
  background:rgba(59,130,246,.16);
  color:#93c5fd;
}

html.dark .authHeroSub,
html.dark .authCardHeader p,
html.dark .authLinks{
  color:var(--muted);
}

html.dark .authFeatureItem{
  background:#111827;
  border-color:var(--border);
  color:var(--text);
}

html.dark .authLangBtn{
  background:rgba(15,23,42,.72);
  color:var(--text);
  border-color:var(--border);
}

html.dark .header-colored{
  background:linear-gradient(135deg,#1d4ed8 0%,#2563eb 100%);
  color:#fff;
}

html.dark .card,
html.dark .panelCard,
html.dark .productCardModern,
html.dark .statsCard,
html.dark .dashboardBtn,
html.dark .drawer,
html.dark .drawerItem,
html.dark .tableWrap{
  background:var(--card);
  color:var(--text);
  border-color:var(--border);
}

html.dark .drawerHead{
  border-bottom-color:var(--border);
}

html.dark .input,
html.dark select.input,
html.dark textarea.input{
  background:#111827;
  color:var(--text);
  border-color:var(--border-strong);
}

html.dark .input::placeholder,
html.dark textarea.input::placeholder{
  color:var(--muted);
}

html.dark .btn{
  background:#111827;
  color:var(--text);
  border-color:var(--border);
}

html.dark .btn.primary{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}

html.dark .btn.green{
  background:var(--success);
  color:#fff;
  border-color:var(--success);
}

html.dark .btn.danger{
  background:var(--danger);
  color:#fff;
  border-color:var(--danger);
}

html.dark .glassBtn{
  background:rgba(255,255,255,.06) !important;
  color:#f8fafc !important;
  border:1px solid rgba(255,255,255,.14) !important;
  box-shadow:0 8px 18px rgba(0,0,0,.22);
}

html.dark .glassBtn .icon{
  color:#f8fafc !important;
}

html.dark .glassBtn:hover{
  background:rgba(255,255,255,.10) !important;
}

html.dark .miniActionBtn{
  background:#111827;
  color:var(--text);
  border-color:var(--border);
}

html.dark .miniActionPrimary{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}

html.dark .miniActionGreen{
  background:var(--success);
  color:#fff;
  border-color:var(--success);
}

html.dark .miniActionDanger{
  background:var(--danger);
  color:#fff;
  border-color:var(--danger);
}

html.dark .miniActionBlue{
  background:var(--info);
  color:#fff;
  border-color:var(--info);
}

html.dark .summaryPill,
html.dark .metaPill,
html.dark .statsCard{
  background:var(--chip);
  color:var(--text);
  border-color:var(--border);
}

html.dark .productAltName,
html.dark .productUpdated,
html.dark .recentTime,
html.dark .panelSub,
html.dark .statLabel,
html.dark .authHeroSub,
html.dark .muted,
html.dark .sub{
  color:var(--muted);
}

html.dark .productCardLink,
html.dark .actionCard,
html.dark .dashboardBtn{
  color:var(--text);
}

html.dark .productCardThumb,
html.dark .prodimg,
html.dark .editorPreview{
  background:#111827;
  border-color:var(--border);
}

html.dark .emptyStateCard{
  background:linear-gradient(180deg,#111827 0%,#0f172a 100%);
  border-color:var(--border-strong);
}

html.dark .analyticsTable th{
  background:#111827;
  color:var(--text);
}

html.dark .analyticsTable td,
html.dark .analyticsTable th{
  border-bottom-color:var(--border);
}

html.dark .heatmapCell{
  background:rgba(148,163,184,.08);
}

html.dark .heatmapHeader .heatmapCell{
  background:transparent;
  color:var(--muted);
}

html.dark .video{
  background:#020617;
}

html.dark .scanBox{
  box-shadow:0 0 0 9999px rgba(0,0,0,.45);
}

html.dark .status.ok{color:#4ade80;}
html.dark .status.warn{color:#fbbf24;}
html.dark .status.error{color:#f87171;}
html.dark .status.info{color:#60a5fa;}

html.dark a{
  color:inherit;
}

html.dark .actionPrimary,
html.dark .dashboardBtn.primary{
  color:#fff;
}

html.dark .actionPrimary .actionDesc,
html.dark .dashboardBtn.primary .actionDesc{
  color:rgba(255,255,255,.88);
}

html.dark .statCard{
  color:#0f172a;
}

html.dark .statCard .statLabel{
  color:#334155;
}

html.dark .statCard .statValue{
  color:#0f172a;
}

html.dark .statCard .icon{
  color:#0f172a;
}

html.dark .langBtn,
html.dark .themeBtn,
html.dark .glassBtn {
  color: #e5e7eb;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
}

html.dark .langBtn:hover,
html.dark .themeBtn:hover,
html.dark .glassBtn:hover {
  background: rgba(255,255,255,0.12);
}

html.dark .langBtn.active,
html.dark .themeBtn.active {
  color: #ffffff;
  background: #2563eb;
  border-color: #2563eb;
}

html.dark .langBtn .icon,
html.dark .themeBtn .icon,
html.dark .glassBtn .icon {
  color: #e5e7eb;
}

.indexApp{
  max-width:900px;
}

.indexHeader{
  border-radius:22px;
  padding:14px 12px;
  box-shadow:0 14px 30px rgba(37,99,235,.18);
}

.indexHeaderRow{
  align-items:center;
}

.indexHeaderText{
  flex:1;
  min-width:0;
}

.indexTitle{
  margin:0;
  font-size:26px;
  line-height:1.05;
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.indexStoreName{
  margin-top:4px !important;
  font-size:14px;
  color:rgba(255,255,255,.88);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.indexTopActions{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

.indexIconBtn{
  width:52px;
  height:52px;
  padding:0;
  justify-content:center;
}

.indexLangBtn{
  min-width:72px;
  height:52px;
  justify-content:center;
  font-weight:800;
}

.indexSearchCard,
.indexAdsCard{
  border-radius:22px;
}

.indexSearchRow .input{
  min-height:56px;
}

.indexSoundBtn{
  min-width:132px;
  justify-content:center;
}

.indexDrawer{
  width:320px;
  max-width:88vw;
  border-top-right-radius:24px;
  border-bottom-right-radius:24px;
  overflow:hidden;
}

html[dir="rtl"] .indexDrawer{
  border-top-left-radius:24px;
  border-top-right-radius:0;
  border-bottom-left-radius:24px;
  border-bottom-right-radius:0;
}

.indexDrawerHead{
  padding:18px 16px;
}

.indexDrawerBody{
  padding:14px;
  gap:12px;
}

.indexDrawerItem{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:56px;
  padding:0 14px;
  font-weight:800;
  border-radius:16px;
}

html[dir="rtl"] .indexDrawerItem{
  flex-direction:row-reverse;
}

html.dark .indexHeader{
  background:linear-gradient(135deg,#1d4ed8 0%, #2563eb 55%, #1e40af 100%);
  box-shadow:0 18px 34px rgba(0,0,0,.32);
}

html.dark .indexIconBtn,
html.dark .indexLangBtn{
  background:rgba(15,23,42,.88);
  border-color:rgba(255,255,255,.18);
  color:#f8fafc;
  box-shadow:0 8px 18px rgba(0,0,0,.22);
}

html.dark .indexIconBtn .icon,
html.dark .indexLangBtn{
  color:#f8fafc;
}

html.dark .indexSearchCard,
html.dark .indexAdsCard{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
  border-color:rgba(148,163,184,.16);
  box-shadow:0 14px 36px rgba(0,0,0,.30);
}

html.dark .indexDrawer{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
  border-right:1px solid rgba(148,163,184,.16);
  box-shadow:0 18px 45px rgba(0,0,0,.42);
}

html[dir="rtl"].dark .indexDrawer{
  border-right:0;
  border-left:1px solid rgba(148,163,184,.16);
}

html.dark .indexDrawerHead{
  background:rgba(255,255,255,.03);
  border-bottom:1px solid rgba(148,163,184,.14);
}

html.dark .indexDrawerItem{
  background:rgba(255,255,255,.03);
  border-color:rgba(148,163,184,.14);
  color:#e5e7eb;
}

html.dark .indexDrawerItem:hover,
html.dark .indexDrawerItem:active{
  background:rgba(59,130,246,.14);
  border-color:rgba(59,130,246,.32);
}

html.dark .drawer-backdrop{
  background:rgba(2,6,23,.62);
  backdrop-filter:blur(2px);
}

html.dark .indexSoundBtn{
  background:#172554;
  border-color:#1d4ed8;
  color:#dbeafe;
}

html.dark .searchRow .btn,
html.dark .actions .btn{
  box-shadow:none;
}

html.dark #result.card{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
}

html.dark .resultTitle h2,
html.dark .price,
html.dark .kv span:last-child{
  color:var(--text);
}

@media (max-width: 640px){
  .indexHeader{
    padding:12px 10px;
  }

  .indexTitle{
    font-size:23px;
  }

  .indexIconBtn{
    width:48px;
    height:48px;
  }

  .indexLangBtn{
    min-width:64px;
    height:48px;
  }

  .indexTopActions{
    gap:8px;
  }

  .indexDrawer{
    width:300px;
  }

  .indexSoundBtn{
    min-width:118px;
  }
}

html.dark .saasHero{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
  border-color:rgba(148,163,184,.16);
  box-shadow:0 18px 40px rgba(0,0,0,.34);
}

html.dark .saasTitle{
  color:#f8fafc !important;
}

html.dark .eyebrow{
  color:#94a3b8 !important;
}

html.dark .saasSubtitle{
  color:#cbd5e1 !important;
}

html.dark .panelCard{
  background:linear-gradient(180deg,#0b0f19 0%, #0b1220 100%);
  border-color:rgba(148,163,184,.16);
  color:#e5e7eb;
}

html.dark .panelTitle{
  color:#f8fafc !important;
}

html.dark .actionCard{
  background:#111827;
  border-color:rgba(148,163,184,.14);
  color:#f8fafc !important;
  box-shadow:0 10px 24px rgba(0,0,0,.20);
}

html.dark .actionTitle{
  color:#f8fafc !important;
}

html.dark .actionDesc{
  color:#cbd5e1 !important;
}

html.dark .actionPrimary{
  background:linear-gradient(135deg,#2563eb 0%, #1d4ed8 100%) !important;
  border-color:#2563eb !important;
  color:#fff !important;
}

html.dark .actionPrimary .actionTitle,
html.dark .actionPrimary .actionDesc,
html.dark .actionPrimary .icon{
  color:#fff !important;
}

html.dark .barValue,
html.dark .barLabel,
html.dark .recentTime{
  color:#94a3b8 !important;
}

html.dark .recentTitle{
  color:#f8fafc !important;
}

html.dark .recentItem{
  border-bottom-color:rgba(148,163,184,.12);
}

html.dark .statBlue,
html.dark .statGreen,
html.dark .statOrange{
  color:#0f172a;
}

html.dark .statBlue .statLabel,
html.dark .statGreen .statLabel,
html.dark .statOrange .statLabel{
  color:#334155 !important;
}

html.dark .statBlue .statValue,
html.dark .statGreen .statValue,
html.dark .statOrange .statValue{
  color:#0f172a !important;
}

@media (max-width: 640px){
  html.dark .glassBtn{
    min-height:48px;
  }

  html.dark .saasTitle{
    font-size:30px;
  }
}

html.dark .productsSearchInput{
  background:#111827;
  color:#f8fafc;
}

html.dark .searchShellIcon{
  color:#94a3b8;
}

html.dark .productName{
  color:#f8fafc;
}

html.dark .productPrice{
  color:#f8fafc;
}

html.dark .perPageWrap{
  color:#cbd5e1;
}

html.dark .pagerInfo{
  color:#cbd5e1;
}

html.dark .productUpdated{
  color:#94a3b8;
}

html.dark .productCardModern{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
  border-color:rgba(148,163,184,.14);
}

html.dark .swipeCard{
  background:#0f172a;
  border-radius:20px;
}

html.dark .swipeDeleteArea{
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);
}

html.dark .summaryPill{
  background:#111827;
  color:#e5e7eb;
  border-color:rgba(148,163,184,.14);
}

html.dark .metaPill{
  background:#0b1220;
  color:#e5e7eb;
  border-color:rgba(148,163,184,.14);
}

html.dark .emptyStateCard h2{
  color:#f8fafc;
}

html.dark .themeToggleBtn{
  color:#f8fafc;
}

html.dark .productSwipeWrap{
  border-radius:20px;
  overflow:hidden;
}

html.dark .swipeDeleteArea{
  background:linear-gradient(180deg,#ef4444 0%, #dc2626 100%);
  border-radius:20px;
  box-shadow:none;
}

html.dark .productCardLink{
  background:transparent;
  color:#f8fafc;
}

html.dark .productPrice span{
  color:#cbd5e1;
}

html.dark .swipeDeleteArea .btn.danger{
  background:transparent;
  border:none;
  box-shadow:none;
  color:#fff;
  font-weight:800;
}

html.dark .productEditor{
  color:#e5e7eb;
}

html.dark .editorHeader .panelTitle{
  color:#f8fafc !important;
}

html.dark .editorHeader .panelSub{
  color:#cbd5e1 !important;
}

html.dark .imageUploader{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
  border-color:rgba(148,163,184,.14);
}

html.dark .editorTextarea{
  background:#111827;
  color:#f8fafc;
  border-color:rgba(148,163,184,.22);
}

html.dark .productForm .input{
  background:#111827;
  color:#f8fafc;
  border-color:rgba(148,163,184,.22);
}

html.dark .productForm .label{
  color:#cbd5e1;
}

html.dark .editorButtons .dashboardBtn.primary{
  background:linear-gradient(135deg,#2563eb 0%,#1d4ed8 100%);
  color:#fff;
  border-color:#2563eb;
}

html.dark .quickEditCard{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
  border-color:rgba(148,163,184,.14);
}

html.dark .quickEditWrap .productName{
  color:#f8fafc;
}

html.dark .quickEditWrap .productAltName{
  color:#94a3b8;
}

html.dark #quickSaveStatus{
  color:#cbd5e1;
}

html.dark #scanStatus{
  color:#cbd5e1;
}

html.dark .quickEditGrid .input{
  background:#111827;
  color:#f8fafc;
  border-color:rgba(148,163,184,.22);
}

html.dark .quickEditGrid .label{
  color:#cbd5e1;
}

html.dark #openEditLink{
  background:#111827;
  color:#f8fafc;
  border-color:rgba(148,163,184,.14);
}

html.dark #openEditLink .icon{
  color:#60a5fa;
}

html.dark .importActionsGrid .btn{
  box-shadow:none;
}

html.dark .importActionsGrid .btn.danger{
  background:#dc2626;
  color:#fff;
  border-color:#dc2626;
}

html.dark .importActionsGrid .btn.primary{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

html.dark .importActionsGrid .btn.green{
  background:#16a34a;
  color:#fff;
  border-color:#16a34a;
}

html.dark .importActionsGrid .btn .icon{
  color:inherit;
}

html.dark input[type="file"].input{
  background:#111827;
  color:#e5e7eb;
  border-color:rgba(148,163,184,.22);
}

html.dark .statsCard .muted{
  color:#cbd5e1;
}

html.dark .imageManagerCard{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
  border-color:rgba(148,163,184,.14);
  box-shadow:0 12px 28px rgba(0,0,0,.24);
}

html.dark .imageManagerThumb{
  background:#111827;
  border-color:rgba(148,163,184,.14) !important;
}

html.dark .imageManagerName{
  color:#cbd5e1;
}

html.dark .imageManagerGrid .card{
  color:#e5e7eb;
}

html.dark .uploadImagesCard{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
  border-color:rgba(148,163,184,.14);
  box-shadow:0 12px 28px rgba(0,0,0,.24);
}

html.dark .uploadImagesCard .panelTitle{
  color:#f8fafc !important;
}

html.dark .uploadImagesCard .panelSub{
  color:#cbd5e1 !important;
}

html.dark .uploadImagesCard .label{
  color:#cbd5e1;
}

html.dark .uploadImagesCard input[type="file"].input{
  background:#111827;
  color:#e5e7eb;
  border-color:rgba(148,163,184,.22);
}

.tableWrap{
  border:1px solid rgba(15,23,42,.08);
  border-radius:18px;
  background:#fff;
}

.analyticsTable th,
.analyticsTable td{
  padding:14px 16px;
  text-align:start;
  border-bottom:1px solid rgba(15,23,42,.08);
}

.analyticsTable thead th{
  background:#f8fafc;
  font-size:14px;
  font-weight:800;
  color:#334155;
}

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

html.dark .missingImagesTableWrap,
html.dark .tableWrap{
  background:linear-gradient(180deg,#0f172a 0%, #111827 100%);
  border-color:rgba(148,163,184,.14);
}

html.dark .missingImagesTable th,
html.dark .analyticsTable th{
  background:#111827;
  color:#f8fafc;
  border-bottom-color:rgba(148,163,184,.14);
}

html.dark .missingImagesTable td,
html.dark .analyticsTable td{
  color:#e5e7eb;
  border-bottom-color:rgba(148,163,184,.12);
}

html.dark .missingImagesTable tbody tr:hover td{
  background:rgba(255,255,255,.02);
}

html.dark .statsCard{
  background:#111827;
  border-color:rgba(148,163,184,.14);
  color:#e5e7eb;
}

html.dark .statsCard .statsLabel{
  color:#94a3b8;
}

html.dark .statsCard .statsValue{
  color:#f8fafc;
}

html.dark .printToolbar .miniActionBtn{
  box-shadow:none;
}

html.dark .printToolbar .glassBtn{
  color:#f8fafc !important;
}

.chartCardCanvasWrap{
  position:relative;
  width:100%;
  min-height:260px;
}

.chartCardCanvas{
  width:100% !important;
  height:260px !important;
}

html.dark .chartCardCanvasWrap{
  background:transparent;
}

html.dark .heatmapHeaderCell{
  color:#94a3b8;
}

.scanBoxWide{
  width:min(78vw,460px);
  height:120px;
  border-radius:16px;
}

#btnRotateAssist.primary{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

html.dark #btnRotateAssist.primary{
  background:#2563eb;
  color:#fff;
  border-color:#2563eb;
}

@media (max-width:640px){
  .scanBoxWide{
    width:min(84vw,420px);
    height:108px;
  }
}

/* ===== Scan analytics RTL fixes ===== */

.analyticsRecentLink{
  text-decoration:none;
  color:inherit;
}

.scanAnalyticsPage .recentItem{
  align-items:flex-start;
}

.scanAnalyticsPage .recentBody{
  min-width:0;
  flex:1 1 auto;
}

.scanAnalyticsPage .recentTitle,
.scanAnalyticsPage .recentTime{
  word-break:break-word;
}

.scanAnalyticsPage .heatmap{
  overflow:auto;
}

.scanAnalyticsPage .heatmapRow{
  display:grid;
  grid-template-columns:80px repeat(24,minmax(18px,1fr));
  gap:4px;
  align-items:center;
  min-width:620px;
}

.scanAnalyticsPage .heatmapDayLabel{
  font-size:12px;
  color:#64748b;
  white-space:nowrap;
}

.scanAnalyticsPage .heatmapCell{
  height:18px;
  border-radius:4px;
  background:rgba(15,23,42,.05);
}

.scanAnalyticsPage .heatmapHeader .heatmapCell{
  height:auto;
  background:transparent;
  text-align:center;
  font-size:11px;
  color:#94a3b8;
}

html[dir="rtl"] .scanAnalyticsPage .productsTopBar,
html[dir="rtl"] .scanAnalyticsPage .panelHead,
html[dir="rtl"] .scanAnalyticsPage .recentItem,
html[dir="rtl"] .scanAnalyticsPage .productsMiniActions{
  direction:rtl;
}

html[dir="rtl"] .scanAnalyticsPage .recentItem{
  flex-direction:row-reverse;
  text-align:right;
}

html[dir="rtl"] .scanAnalyticsPage .recentBody{
  text-align:right;
}

html[dir="rtl"] .scanAnalyticsPage .heatmapRow{
  grid-template-columns:repeat(24,minmax(18px,1fr)) 80px;
}

html[dir="rtl"] .scanAnalyticsPage .heatmapDayLabel{
  text-align:left;
}

html[dir="rtl"] .scanAnalyticsPage .heatmapHeader .heatmapDayLabel{
  order:2;
}

html[dir="rtl"] .scanAnalyticsPage .heatmapHeader .heatmapCell,
html[dir="rtl"] .scanAnalyticsPage .heatmapRow .heatmapCell{
  direction:ltr;
}

@media (max-width:720px){
  .scanAnalyticsPage .heatmapRow{
    grid-template-columns:64px repeat(24,16px);
    min-width:480px;
  }

  html[dir="rtl"] .scanAnalyticsPage .heatmapRow{
    grid-template-columns:repeat(24,16px) 64px;
  }
}

/* SAMSUNG_ADMIN_HOME_SCREEN_FIT_V7_2026_05_25
   Fixes Samsung Internet Add-to-Home-Screen/standalone rendering for admin, login, and register pages only.
   Normal browser view is not changed. Public customer pages are not targeted. */
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
  @media screen and (max-width: 767px) {
    body.authBody,
    .app.app-dashboard,
    .app-dashboard {
      width: 100% !important;
      max-width: 100% !important;
      overflow-x: hidden !important;
      font-size: 15px !important;
      line-height: 1.35 !important;
      -webkit-text-size-adjust: 100% !important;
      text-size-adjust: 100% !important;
    }

    @supports selector(body:has(.app-dashboard)) {
      body:has(.app-dashboard) {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
      }
    }

    body.authBody *,
    .app-dashboard *,
    body.authBody *::before,
    body.authBody *::after,
    .app-dashboard *::before,
    .app-dashboard *::after {
      box-sizing: border-box !important;
      max-width: 100%;
    }

    .authShell,
    .app.app-dashboard,
    .app-dashboard {
      width: 100% !important;
      max-width: 100% !important;
      margin-left: auto !important;
      margin-right: auto !important;
      padding: 8px !important;
    }

    .authTopbar {
      justify-content: stretch !important;
      width: 100% !important;
      margin-bottom: 10px !important;
    }

    .authTopbar > div {
      width: 100% !important;
      display: grid !important;
      grid-template-columns: 1fr 1fr !important;
      gap: 8px !important;
    }

    .authLangBtn,
    .glassBtn,
    .dashboardBtn,
    .miniActionBtn,
    .authPrimaryBtn,
    .authSecondaryBtn,
    .btn,
    button {
      min-width: 0 !important;
      min-height: 40px !important;
      height: auto !important;
      padding: 0 10px !important;
      border-radius: 12px !important;
      font-size: 14px !important;
      line-height: 1.15 !important;
      justify-content: center !important;
      white-space: normal !important;
    }

    .authHeroCard,
    .statsGrid,
    .actionGrid,
    .dashboardGrid,
    .dashboardTwoCol,
    .editorGrid,
    .quickEditGrid,
    .usersContentGrid,
    .grid2,
    .grid3,
    .twoCols,
    .commentsFiltersGrid,
    .missFiltersGrid,
    .metaGrid,
    .commentMetaGrid,
    .productsToolbar {
      display: grid !important;
      grid-template-columns: 1fr !important;
      gap: 10px !important;
      width: 100% !important;
      max-width: 100% !important;
    }

    .authHeroText,
    .authGlassCard,
    .saasHero,
    .panelCard,
    .card,
    .statsCard,
    .statCard,
    .actionCard,
    .productEditor,
    .emptyStateCard {
      width: 100% !important;
      max-width: 100% !important;
      padding: 12px !important;
      border-radius: 18px !important;
      overflow: hidden !important;
    }

    .authHeroTitle {
      font-size: 30px !important;
      line-height: 1.05 !important;
      letter-spacing: -0.03em !important;
      margin: 12px 0 8px !important;
    }

    .authCardHeader h2,
    .panelTitle,
    .saasTitle {
      font-size: 24px !important;
      line-height: 1.12 !important;
      letter-spacing: -0.02em !important;
      white-space: normal !important;
      overflow: visible !important;
      text-overflow: clip !important;
    }

    .authHeroSub,
    .authCardHeader p,
    .saasSubtitle,
    .panelSub,
    .sub,
    .muted,
    .hint,
    .actionDesc {
      font-size: 13px !important;
      line-height: 1.4 !important;
      word-break: normal !important;
      overflow-wrap: anywhere !important;
    }

    .authFeatureList {
      gap: 8px !important;
      margin-top: 14px !important;
    }

    .authFeatureItem,
    .actionCard {
      gap: 10px !important;
      padding: 10px !important;
      min-height: auto !important;
      align-items: center !important;
    }

    .actionCard .icon,
    .authFeatureItem .icon,
    .glassBtn .icon,
    .miniActionBtn .icon,
    .material-symbols-rounded {
      font-size: 22px !important;
      flex: 0 0 auto !important;
    }

    .actionTitle {
      font-size: 16px !important;
      line-height: 1.2 !important;
    }

    .saasHeroTop,
    .dashboardHeaderRow,
    .branchTopRow,
    .dashboardBranchTools,
    .panelHead,
    .productsTopBar,
    .productsActionsRow,
    .productsControlRow,
    .productsSummary,
    .actions,
    .topActions,
    .toolbarRow {
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      justify-content: flex-start !important;
      gap: 8px !important;
      width: 100% !important;
      max-width: 100% !important;
      overflow: visible !important;
    }

    .branchTopRow .pcTopActionRow,
    .dashboardBranchTools .pcTopActionRow,
    .productsMiniActions,
    .tourActions .productsMiniActions {
      width: 100% !important;
      max-width: 100% !important;
      display: grid !important;
      grid-template-columns: 1fr 1fr !important;
      gap: 8px !important;
      overflow: visible !important;
      justify-content: stretch !important;
    }

    .productsMiniActions .miniActionBtn,
    .branchTopRow .pcTopActionRow .miniActionBtn,
    .dashboardBranchTools .pcTopActionRow .miniActionBtn {
      width: 100% !important;
      min-width: 0 !important;
    }

    .dashboardBranchSelector {
      position: static !important;
      top: auto !important;
      width: 100% !important;
      max-width: 100% !important;
      padding: 8px !important;
      border-radius: 14px !important;
      z-index: auto !important;
    }

    .dashboardBranchForm {
      width: 100% !important;
      max-width: 100% !important;
      display: flex !important;
      flex-direction: column !important;
      align-items: stretch !important;
      gap: 6px !important;
      white-space: normal !important;
    }

    .dashboardBranchSelect,
    .input,
    select,
    textarea {
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      min-height: 42px !important;
      font-size: 15px !important;
      line-height: 1.25 !important;
      padding: 9px 11px !important;
      border-radius: 12px !important;
    }

    .branchScopeBadge {
      width: 100% !important;
      max-width: 100% !important;
      justify-content: center !important;
      white-space: normal !important;
      overflow-wrap: anywhere !important;
      font-size: 12px !important;
    }

    .statCard,
    .statsCard {
      min-height: auto !important;
      gap: 10px !important;
      align-items: center !important;
    }

    .statIconWrap {
      width: 44px !important;
      height: 44px !important;
      border-radius: 14px !important;
      flex: 0 0 44px !important;
    }

    .statValue,
    .statsValue {
      font-size: 26px !important;
      line-height: 1.05 !important;
      word-break: break-word !important;
    }

    .statLabel,
    .statsLabel,
    .label,
    .summaryPill,
    .metaPill,
    .pagerInfo,
    .pageInfo {
      font-size: 12px !important;
      line-height: 1.3 !important;
    }

    .tableWrap,
    .analyticsTableWrap,
    .missingImagesTableWrap,
    .syncTableWrap,
    .heatmap,
    .printPreview,
    .tokenBox {
      width: 100% !important;
      max-width: 100% !important;
      overflow-x: auto !important;
      -webkit-overflow-scrolling: touch !important;
    }

    .table,
    .analyticsTable,
    .missingImagesTable,
    .syncTable {
      min-width: 620px !important;
    }

    .table th,
    .table td,
    .analyticsTable th,
    .analyticsTable td {
      padding: 8px 9px !important;
      font-size: 13px !important;
    }

    .tourCard {
      max-width: calc(100vw - 18px) !important;
      left: 9px !important;
      right: 9px !important;
    }
  }
}

/* Multilanguage + single-store currency controls */
.pcLocaleSelect{
  min-width:72px;
  height:40px;
  border:1px solid rgba(15,23,42,.14);
  border-radius:12px;
  background:#fff;
  color:#0f172a;
  font-weight:800;
  padding:0 10px;
  outline:none;
}
.pcLanguageSelect{min-width:96px;}
.pcCurrencySelect{min-width:74px;}
html.dark .pcLocaleSelect{
  background:#0f172a;
  color:#e5e7eb;
  border-color:rgba(148,163,184,.22);
}
@media(max-width:520px){
  .pcLanguageSelect{max-width:96px;min-width:78px;}
  .pcCurrencySelect{max-width:78px;min-width:66px;}
  .pcLocaleSelect{height:38px;padding:0 6px;font-size:13px;}
}
