/* ==========================================================================
   Barcode Cloud Images — dashboard design system
   Navy = structure. Orange = action & live state. Nothing else shouts.
   ========================================================================== */
:root {
  --navy: #021e47;
  --navy-2: #0b2d63;
  --navy-3: #16407f;
  --orange: #fc8503;
  --orange-ink: #c46500;
  --orange-wash: #fff3e3;
  --surface: #eef2f7;
  --paper: #ffffff;
  --ink: #0d1a2e;
  --muted: #5c6b82;
  --faint: #8c99ad;
  --line: #dde4ee;
  --line-strong: #c7d1df;
  --ok: #138a5b;
  --ok-wash: #e4f5ec;
  --bad: #c9352b;
  --bad-wash: #fde9e7;

  --font-ui: "Archivo", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Archivo", system-ui, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --sidebar-w: 248px;
  --topbar-h: 68px;

  --bs-body-font-family: var(--font-ui);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--surface);
  --bs-primary: var(--navy);
  --bs-primary-rgb: 2, 30, 71;
  --bs-link-color: var(--navy-3);
  --bs-link-hover-color: var(--orange-ink);
  --bs-border-color: var(--line);
  --bs-focus-ring-color: rgba(252, 133, 3, .35);
}

html[dir="rtl"] body { font-family: var(--font-ar); }
body {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.55;
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

/* ---------- Type scale (1.25 ratio) ---------- */
.display-title {
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--navy);
  margin: 0;
}
html[dir="rtl"] .display-title { font-stretch: 100%; }
.section-title { font-weight: 700; font-size: 1.05rem; color: var(--navy); margin: 0; }
.text-muted, .muted { color: var(--muted) !important; }
.small-label { font-size: .8125rem; color: var(--muted); font-weight: 500; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.barcode-text { font-variant-numeric: tabular-nums; letter-spacing: .06em; font-weight: 600; }

a { text-decoration: none; }
:focus-visible { outline: 3px solid rgba(252, 133, 3, .55); outline-offset: 2px; }

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  color: #c9d5e8;
  position: fixed; inset-block: 0; inset-inline-start: 0;
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}
.sidebar-brand { padding: 22px 22px 18px; display: block; }
.sidebar-brand img { height: 34px; width: auto; filter: brightness(0) invert(1); }
.sidebar-brand img.keep-color { filter: none; }
.brand-mark { display: flex; align-items: center; gap: 10px; }
.brand-mark .mark {
  width: 36px; height: 36px; border-radius: 9px; background: #fff; display: grid; place-items: center; overflow: hidden;
}
.brand-mark .mark img { height: 26px; filter: none; }
.brand-mark .word { line-height: 1.05; }
.brand-mark .word b { display: block; color: #fff; font-stretch: 125%; font-weight: 800; letter-spacing: .02em; font-size: 1.02rem; }
.brand-mark .word span { color: var(--orange); font-size: .68rem; letter-spacing: .32em; font-weight: 700; font-style: italic; }

.nav-group-label { padding: 14px 22px 6px; font-size: .75rem; color: #7f93b3; font-weight: 600; }
.side-nav { list-style: none; margin: 0; padding: 0 12px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; margin-bottom: 2px; border-radius: var(--r-sm);
  color: #c9d5e8; font-weight: 500;
  position: relative;
}
.side-nav a i { width: 18px; text-align: center; color: #8ea4c6; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: var(--navy-2); color: #fff; }
.side-nav a.active i { color: var(--orange); }
.side-nav a.active::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px;
  background: var(--orange); border-radius: 0 3px 3px 0;
}
html[dir="rtl"] .side-nav a.active::before { border-radius: 3px 0 0 3px; }
.side-nav .badge-live {
  margin-inline-start: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--orange);
  box-shadow: 0 0 0 0 rgba(252,133,3,.6); animation: pulse 1.6s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(252,133,3,0); } 100% { box-shadow: 0 0 0 0 rgba(252,133,3,0); } }

.sidebar-foot { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; color: #fff; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--orange); color: var(--navy);
  display: grid; place-items: center; font-weight: 800;
}
.user-chip small { color: #8ea4c6; display: block; font-size: .75rem; }
.foot-actions { display: flex; gap: 6px; margin-top: 12px; }
.foot-actions .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; color: #c9d5e8; border: 1px solid rgba(255,255,255,.12); font-size: .8125rem; padding: 6px; }
.foot-actions .btn:hover { color: #fff; background: rgba(255,255,255,.06); }

.main { flex: 1; margin-inline-start: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

/* ---------- Topbar + the barcode lookup (signature element) ---------- */
.topbar {
  height: var(--topbar-h); background: var(--paper); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
  position: sticky; top: 0; z-index: 1030;
}
.topbar .menu-toggle { display: none; }
.lookup {
  position: relative; flex: 0 1 440px; margin-inline-start: auto;
}
.lookup input {
  width: 100%; height: 42px; border-radius: var(--r-md);
  border: 1.5px solid var(--line-strong); background: var(--surface);
  padding-inline: 44px 92px; font-weight: 600; letter-spacing: .05em; color: var(--navy);
}
.lookup input::placeholder { letter-spacing: 0; font-weight: 400; color: var(--faint); }
.lookup input:focus { outline: none; border-color: var(--navy); background: #fff; }
.lookup .icon { position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%); color: var(--navy); }
.lookup kbd {
  position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%);
  background: #fff; color: var(--muted); border: 1px solid var(--line); font-size: .72rem; padding: 2px 7px;
}
.lookup .scanline {
  position: absolute; left: 10px; right: 10px; top: 50%; height: 2px; border-radius: 2px;
  background: var(--orange); box-shadow: 0 0 10px var(--orange); opacity: 0; pointer-events: none;
}
.lookup.scanning .scanline { animation: scan .7s ease-in-out infinite alternate; opacity: 1; }
@keyframes scan { from { transform: translateY(-14px); } to { transform: translateY(14px); } }
.lookup.miss input { border-color: var(--bad); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px);} 75% { transform: translateX(4px);} }

.lang-switch { color: var(--navy); font-weight: 700; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 12px; }
.lang-switch:hover { border-color: var(--navy); }

.content { padding: 28px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 64ch; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: var(--r-sm); padding: .5rem 1rem; }
.btn-primary { --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy); --bs-btn-hover-bg: var(--navy-2); --bs-btn-hover-border-color: var(--navy-2); --bs-btn-active-bg: var(--navy-3); }
.btn-action { background: var(--orange); border-color: var(--orange); color: var(--navy); }
.btn-action:hover, .btn-action:focus { background: #ff9524; border-color: #ff9524; color: var(--navy); }
.btn-ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--navy); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); background: #fff; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; border-radius: var(--r-sm); border: 1px solid transparent; color: var(--muted); background: transparent; }
.btn-icon:hover { background: var(--surface); color: var(--navy); border-color: var(--line); }
.btn-icon.danger:hover { color: var(--bad); background: var(--bad-wash); }

/* ---------- Panels (one radius family, hierarchy by weight not by shadow) ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-body { padding: 22px; }
.panel-flush { padding: 0; }

/* ---------- Dashboard ledger band ---------- */
.ledger {
  background: var(--navy); color: #fff; border-radius: var(--r-lg); overflow: hidden;
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr);
  position: relative;
}
.ledger::after { /* barcode stripe along the bottom edge: the brand, quietly */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: repeating-linear-gradient(90deg, var(--orange) 0 2px, transparent 2px 5px, var(--orange) 5px 6px, transparent 6px 9px, var(--orange) 9px 12px, transparent 12px 14px);
  opacity: .9;
}
.ledger-cell { padding: 24px 26px 28px; border-inline-start: 1px solid rgba(255,255,255,.1); }
.ledger-cell:first-child { border-inline-start: 0; }
.ledger-cell .value { font-stretch: 125%; font-weight: 800; font-size: 2rem; line-height: 1.1; }
.ledger-cell:first-child .value { font-size: 2.8rem; }
.ledger-cell .label { color: #9fb2cf; font-size: .875rem; margin-top: 6px; }
.ledger-cell .sub { color: var(--orange); font-size: .8125rem; font-weight: 600; margin-top: 10px; display: inline-flex; gap: 6px; align-items: center; }
html[dir="rtl"] .ledger-cell .value { font-stretch: 100%; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table-bc { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; }
.table-bc th {
  font-size: .78rem; font-weight: 600; color: var(--muted); text-align: start;
  padding: 11px 16px; background: #f7f9fc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table-bc td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-bc tbody tr:hover { background: #fafbfd; }
.table-bc tbody tr:last-child td { border-bottom: 0; }
.table-bc .thumb {
  width: 48px; height: 48px; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line);
  object-fit: contain; padding: 3px;
}
.thumb-empty { width: 48px; height: 48px; border-radius: var(--r-sm); background: var(--surface); display: grid; place-items: center; color: var(--faint); }
.cell-title { font-weight: 600; color: var(--ink); display: block; max-width: 340px; }
.cell-title-ar { font-family: var(--font-ar); color: var(--muted); font-size: .875rem; display: block; unicode-bidi: plaintext; text-align: start; }
.cell-title-ar.empty { color: var(--faint); font-style: italic; direction: ltr; font-family: var(--font-ui); }
.crumbs { color: var(--muted); font-size: .8125rem; }

/* ---------- Status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-wash); color: var(--ok); }
.pill-bad { background: var(--bad-wash); color: var(--bad); }
.pill-warn { background: var(--orange-wash); color: var(--orange-ink); }
.pill-muted { background: var(--surface); color: var(--muted); }
.pill-live { background: var(--orange-wash); color: var(--orange-ink); }
.pill-live::before { animation: pulse 1.6s infinite; }

/* completeness meter */
.meter { width: 64px; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; }
.meter > span { display: block; height: 100%; background: var(--navy); }
.meter.lo > span { background: var(--orange); }

/* ---------- Toolbar & forms ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 380px; }
.toolbar .search i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.toolbar .search input { padding-inline-start: 36px; }
.form-control, .form-select { background-color: #fff; border-color: var(--line-strong); border-radius: var(--r-sm); padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { background-color: #fff; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(2,30,71,.12); }
.form-label { font-weight: 600; font-size: .8125rem; color: var(--navy); margin-bottom: .35rem; }
.form-text { color: var(--muted); }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.form-switch .form-check-input:checked { background-color: var(--orange); border-color: var(--orange); }
input[dir="rtl"], textarea[dir="rtl"] { font-family: var(--font-ar); }

.segmented { display: inline-flex; background: var(--surface); border-radius: var(--r-sm); padding: 3px; }
.segmented button { border: 0; background: transparent; padding: 5px 12px; border-radius: 5px; font-weight: 600; font-size: .8125rem; color: var(--muted); }
.segmented button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 2px rgba(2,30,71,.12); }

/* ---------- Pagination ---------- */
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; gap: 10px; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages button { min-width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm); font-weight: 600; color: var(--navy); }
.pager .pages button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager .pages button:disabled { opacity: .4; }

/* ---------- Product detail ---------- */
.product-hero { display: grid; grid-template-columns: 300px 1fr; gap: 28px; }
.product-image {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); aspect-ratio: 1; display: grid; place-items: center; padding: 18px; position: relative;
}
.product-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.storage-tag { position: absolute; top: 10px; inset-inline-start: 10px; }
.barcode-card { background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 12px; text-align: center; margin-top: 14px; }
.barcode-card svg { max-width: 100%; height: auto; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; }
.kv dt { color: var(--muted); font-weight: 500; font-size: .875rem; }
.kv dd { margin: 0; font-weight: 500; }
.tag { display: inline-block; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: .8125rem; margin: 0 4px 4px 0; }

/* ---------- Category tree ---------- */
.tree { list-style: none; margin: 0; padding: 0; }
.tree .tree { padding-inline-start: 26px; border-inline-start: 1px dashed var(--line-strong); margin-inline-start: 13px; }
.tree-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); }
.tree-row:hover { background: var(--surface); }
.tree-row .toggle { width: 22px; height: 22px; border: 0; background: transparent; color: var(--muted); padding: 0; }
.tree-row .toggle.leaf { visibility: hidden; }
.tree-row .names { flex: 1; min-width: 0; }
.tree-row .names b { font-weight: 600; }
.tree-row .names .ar { font-family: var(--font-ar); color: var(--muted); margin-inline-start: 10px; }
.tree-row .names .ar.empty { color: var(--orange-ink); font-size: .78rem; font-family: var(--font-ui); }
.tree-row .count { color: var(--muted); font-size: .8125rem; min-width: 70px; text-align: end; }
.tree-row .src { font-size: .72rem; color: var(--faint); }
.tree li.collapsed > .tree { display: none; }

/* ---------- Keys / secrets ---------- */
.key-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.key-row code { flex: 1; color: var(--navy); font-size: .875rem; background: none; word-break: break-all; }
.secret-reveal code { display: block; background: var(--navy); color: #fff; padding: 14px; border-radius: var(--r-sm); font-size: .9rem; word-break: break-all; text-align: start; }

.field-group { margin-bottom: 18px; }
.field-group h6 { font-size: .8125rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; text-transform: capitalize; }
.field-option {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer; margin-bottom: 6px; background: #fff;
}
.field-option:has(input:checked) { border-color: var(--navy); background: #f4f7fc; }
.field-option code { margin-inline-start: auto; font-size: .75rem; color: var(--faint); }

/* ---------- Extractor ---------- */
.job-live { border: 2px solid var(--orange); }
.progress-track { height: 10px; background: var(--surface); border-radius: 5px; overflow: hidden; }
.progress-track > span { display: block; height: 100%; background: var(--orange); transition: width .5s ease; }
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.counters div { padding: 12px 14px; border-inline-end: 1px solid var(--line); }
.counters div:last-child { border-inline-end: 0; }
.counters b { display: block; font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.counters span { font-size: .78rem; color: var(--muted); }
.log-feed { background: var(--navy); color: #c9d5e8; border-radius: var(--r-md); padding: 12px 14px; max-height: 260px; overflow-y: auto; font-size: .8125rem; }
.log-feed div { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.log-feed .t { color: #7f93b3; margin-inline-end: 8px; }
.log-feed .error { color: #ffb4a8; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 40px; margin-bottom: 16px; }
.steps li::before {
  content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8125rem;
}
.steps li b { color: var(--navy); }

/* ---------- Docs ---------- */
.code-block { background: #0a1730; color: #dbe6f7; border-radius: var(--r-md); padding: 16px 18px; font-size: .8125rem; overflow-x: auto; position: relative; direction: ltr; text-align: left; }
.code-block .copy { position: absolute; top: 8px; right: 8px; background: rgba(255,255,255,.08); color: #dbe6f7; border: 0; border-radius: 5px; font-size: .75rem; padding: 4px 8px; }
.code-block .k { color: #fcb562; } .code-block .s { color: #9fe0b9; } .code-block .c { color: #7f93b3; }
.endpoint { display: flex; gap: 10px; align-items: center; font-weight: 600; direction: ltr; }
.method { font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 4px; }
.method.get { background: var(--ok-wash); color: var(--ok); }
.method.post { background: var(--orange-wash); color: var(--orange-ink); }
.nav-tabs-bc { border-bottom: 1px solid var(--line); gap: 4px; }
.nav-tabs-bc .nav-link { border: 0; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 2px solid transparent; }
.nav-tabs-bc .nav-link.active { color: var(--navy); border-bottom-color: var(--orange); background: transparent; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state i { font-size: 1.8rem; color: var(--line-strong); margin-bottom: 12px; display: block; }
.empty-state b { color: var(--navy); display: block; margin-bottom: 4px; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-art {
  background: var(--navy); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art .code { direction: ltr;
  position: relative; display: inline-flex; align-items: stretch; height: 260px; margin: 40px 0;
}
.auth-art .code span { display: block; background: #fff; width: var(--w); margin-inline-end: var(--g); opacity: .92; border-radius: 1px; }
.auth-art .code span.o { background: var(--orange); opacity: 1; }
.auth-art .code-digits { color: #9fb2cf; letter-spacing: .5em; font-weight: 600; margin-top: -30px; direction: ltr; text-align: left; font-variant-numeric: tabular-nums; }
.auth-art .code::after {
  content: ""; position: absolute; left: -12px; right: -12px; height: 3px; top: 0; border-radius: 2px;
  background: var(--orange); box-shadow: 0 0 18px 2px rgba(252,133,3,.75);
  animation: hero-scan 2.4s ease-in-out .4s 2 alternate both;
}
@keyframes hero-scan { from { top: 0; opacity: 1; } to { top: 100%; opacity: 1; } }
.auth-art h1 { font-stretch: 125%; font-weight: 800; font-size: clamp(1.8rem, 1.2rem + 1.6vw, 2.6rem); line-height: 1.12; max-width: 14ch; margin: 0 0 14px; }
html[dir="rtl"] .auth-art h1 { font-stretch: 100%; }
.auth-art p { color: #9fb2cf; max-width: 42ch; margin: 0; }
.auth-art .facts { display: flex; gap: 34px; position: relative; z-index: 1; }
.auth-art .facts b { display: block; font-size: 1.4rem; font-stretch: 125%; color: var(--orange); }
.auth-art .facts span { color: #9fb2cf; font-size: .8125rem; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .inner { width: 100%; max-width: 380px; }
.auth-form img.logo { height: 56px; margin-bottom: 30px; }
.auth-form .form-control { height: 46px; }
.auth-form .btn { height: 46px; }
.recaptcha-note { font-size: .72rem; color: var(--faint); margin-top: 18px; }
.grecaptcha-badge { visibility: hidden; }

/* ---------- SweetAlert theming ---------- */
.swal2-popup { border-radius: var(--r-lg) !important; font-family: var(--font-ui) !important; }
html[dir="rtl"] .swal2-popup { font-family: var(--font-ar) !important; }
.swal2-title { color: var(--navy) !important; font-size: 1.25rem !important; }
.swal2-styled.swal2-confirm { background: var(--navy) !important; border-radius: var(--r-sm) !important; }
.swal2-styled.swal2-deny, .swal2-styled.swal2-confirm.is-danger { background: var(--bad) !important; }
.swal2-styled.swal2-cancel { background: var(--surface) !important; color: var(--navy) !important; border-radius: var(--r-sm) !important; }

/* ---------- Modals ---------- */
.modal-content { border: 0; border-radius: var(--r-lg); }
.modal-header { border-bottom: 1px solid var(--line); padding: 18px 22px; }
.modal-title { font-weight: 700; color: var(--navy); }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--line); padding: 14px 22px; }

.tooltip { --bs-tooltip-bg: var(--navy); font-family: var(--font-ui); }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
  .ledger { grid-template-columns: 1fr 1fr; }
  .ledger-cell:nth-child(3) { border-inline-start: 0; }
  .ledger-cell:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.1); }
}
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  body.nav-open .sidebar { transform: none; }
  .main { margin-inline-start: 0; }
  .topbar .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px; }
  .product-hero { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .lookup kbd { display: none; }
  .lookup input { padding-inline-end: 14px; }
}
@media (max-width: 575px) {
  .ledger { grid-template-columns: 1fr; }
  .ledger-cell { border-inline-start: 0 !important; border-top: 1px solid rgba(255,255,255,.1); }
  .ledger-cell:first-child { border-top: 0; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
}
.nav-backdrop { display: none; }
body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(2,30,71,.4); z-index: 1035; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* logo plate in sidebar keeps the real brand colours on navy */
.brand-plate { background: #fff; border-radius: var(--r-md); padding: 10px 14px; display: block; margin: 18px 16px 10px; }
.brand-plate img { height: 42px; margin: 0 auto; width: auto; display: block; }

.pill.no-dot::before { display: none; }
.subtitle-ar { font-family: var(--font-ar); font-size: 1.1rem; color: var(--navy); margin: 6px 0 0; }
.img-fallback { display: none; }
.product-image.broken img { display: none; }
.product-image.broken .img-fallback { display: block; }

/* ---------- Translations ---------- */
.stack-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface); }
.stack-bar span { display: block; height: 100%; }
.legend-row { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.legend-row a { color: var(--muted); font-size: .875rem; display: inline-flex; gap: 7px; align-items: center; }
.legend-row a:hover { color: var(--navy); }
.legend-row a b { color: var(--navy); }
.legend-row i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-row i.flag { background: repeating-linear-gradient(45deg, var(--orange) 0 3px, #fff 3px 5px); border: 1px solid var(--orange); }
.review-table td { vertical-align: top; }
.review-table .ar-input {
  font-family: var(--font-ar); font-size: 1.02rem; direction: rtl; text-align: right;
  border: 1px solid transparent; background: transparent; padding: 6px 10px; border-radius: var(--r-sm); width: 100%; min-width: 260px; color: var(--ink);
}
.review-table .ar-input:hover { border-color: var(--line); background: #fff; }
.review-table .ar-input:focus { border-color: var(--navy); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(2,30,71,.1); }
.review-table tr.saved .ar-input { border-color: var(--ok); background: var(--ok-wash); }
.review-table tr.done { opacity: .45; }
.review-table .flags { margin-top: 4px; }
.status-chip { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-inline-start: 8px; }
.status-chip.machine { background: var(--orange-wash); color: var(--orange-ink); }
.status-chip.reviewed, .status-chip.manual { background: var(--ok-wash); color: var(--ok); }
.status-chip.none { background: var(--surface); color: var(--muted); }
.ai-btn { color: var(--orange-ink); font-weight: 600; font-size: .8125rem; background: none; border: 0; padding: 0; }
.ai-btn:hover { color: var(--navy); }
.ai-btn:disabled { color: var(--faint); }
