/* ============================================================================
   Product Tracker — single common stylesheet (app.css)
   StarAdmin-style admin shell, replicated with open assets.
   All colours/metrics are CSS variables so RTL + theming stay in one place.
   Sections:  1 tokens  2 base  3 navbar  4 sidebar  5 tab host  6 controls
              7 cards/forms  8 tables  9 login  10 responsive  11 RTL
   ========================================================================== */

/* 1 ── design tokens ─────────────────────────────────────────────────────── */
:root {
  --pt-primary-1: #da8cff;
  --pt-primary-2: #9a55ff;
  --pt-primary:   #9a55ff;
  --pt-primary-grad: linear-gradient(to right, #da8cff, #9a55ff);

  --pt-success: #1bcfb4;
  --pt-info:    #198ae3;
  --pt-warning: #fed713;
  --pt-danger:  #fe7c96;

  --pt-canvas:     #f4f5f7;
  --pt-surface:    #ffffff;
  --pt-text:       #001737;
  --pt-muted:      #76838f;
  --pt-border:     #ebedf2;
  --pt-hover:      #f6f4fb;

  --pt-navbar-h:   63px;
  --pt-sidebar-w:  255px;
  --pt-tabbar-h:   44px;
  --pt-radius:     6px;
  --pt-shadow:     0 1px 15px 1px rgba(69,65,78,.08);

  --pt-font: 'Ubuntu', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* 2 ── base ──────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--pt-font);
  font-size: 14px;
  color: var(--pt-text);
  background: var(--pt-canvas);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* app layout grid: navbar on top, sidebar + content below */
.pt-app { min-height: 100vh; }

/* 3 ── navbar ────────────────────────────────────────────────────────────── */
.pt-navbar {
  position: fixed; inset: 0 0 auto 0; height: var(--pt-navbar-h);
  display: flex; align-items: center;
  background: var(--pt-surface);
  border-bottom: 1px solid var(--pt-border);
  z-index: 1030;
}
.pt-brand {
  width: var(--pt-sidebar-w); height: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 0 22px;
  border-right: 1px solid var(--pt-border);
  font-weight: 700; font-size: 18px; letter-spacing: .2px;
}
.pt-brand .dot {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--pt-primary-grad);
  display: inline-block;
}
.pt-navbar-right {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  padding: 0 18px;
}
.pt-hamburger {
  display: none; border: 0; background: transparent;
  font-size: 20px; color: var(--pt-muted); cursor: pointer; padding: 8px;
}
.pt-langswitch { display: flex; border: 1px solid var(--pt-border); border-radius: 20px; overflow: hidden; }
.pt-langswitch a {
  padding: 5px 14px; font-size: 12px; font-weight: 600; color: var(--pt-muted);
}
.pt-langswitch a.active { background: var(--pt-primary-grad); color: #fff; }
.pt-user {
  display: flex; align-items: center; gap: 9px; padding: 6px 10px;
  border-radius: var(--pt-radius); cursor: pointer;
}
.pt-user:hover { background: var(--pt-hover); }
.pt-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--pt-primary-grad); color: #fff;
  display: grid; place-items: center; font-weight: 600;
}

/* 4 ── sidebar ───────────────────────────────────────────────────────────── */
.pt-sidebar {
  position: fixed; top: var(--pt-navbar-h); bottom: 0; left: 0;
  width: var(--pt-sidebar-w);
  background: var(--pt-surface);
  border-right: 1px solid var(--pt-border);
  overflow-y: auto; z-index: 1020;
  transition: transform .2s ease;
}
.pt-nav-cap {
  padding: 18px 22px 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; color: var(--pt-muted);
}
.pt-nav-group > .pt-nav-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; cursor: pointer; color: #3e4b5b; font-weight: 500;
}
.pt-nav-group > .pt-nav-head:hover { background: var(--pt-hover); }
.pt-nav-head .chev { margin-left: auto; font-size: 11px; transition: transform .18s; color: var(--pt-muted); }
.pt-nav-group.open > .pt-nav-head .chev { transform: rotate(90deg); }
.pt-nav-ico { width: 18px; text-align: center; color: var(--pt-primary); }
.pt-nav-sub { max-height: 0; overflow: hidden; transition: max-height .22s ease; }
.pt-nav-group.open > .pt-nav-sub { max-height: 620px; }
.pt-nav-sub a {
  display: block; padding: 9px 22px 9px 52px; font-size: 13px; color: #5a6a7e;
  border-left: 3px solid transparent;
}
.pt-nav-sub a:hover { background: var(--pt-hover); color: var(--pt-primary); }
.pt-nav-sub a.active { color: var(--pt-primary); border-left-color: var(--pt-primary); background: var(--pt-hover); }

/* 5 ── content + tab host ────────────────────────────────────────────────── */
.pt-content {
  margin-left: var(--pt-sidebar-w); padding-top: var(--pt-navbar-h);
  height: 100vh; display: flex; flex-direction: column;
}
.pt-tabbar {
  height: var(--pt-tabbar-h); flex: 0 0 auto;
  display: flex; align-items: stretch; gap: 2px;
  padding: 0 10px; background: var(--pt-surface);
  border-bottom: 1px solid var(--pt-border);
  overflow-x: auto; overflow-y: hidden;
}
.pt-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 6px 0 16px; height: 100%;
  font-size: 13px; color: var(--pt-muted); white-space: nowrap;
  border-bottom: 2px solid transparent; cursor: pointer;
}
.pt-tab:hover { color: var(--pt-text); }
.pt-tab.active { color: var(--pt-primary); border-bottom-color: var(--pt-primary); font-weight: 600; }
.pt-tab .x {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; line-height: 1; color: var(--pt-muted);
}
.pt-tab .x:hover { background: var(--pt-danger); color: #fff; }
.pt-tab.home { padding-right: 16px; }
.pt-tab.home .x { display: none; }

.pt-frames { position: relative; flex: 1 1 auto; background: var(--pt-canvas); }
.pt-frames iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; display: none; background: var(--pt-canvas);
}
.pt-frames iframe.active { display: block; }
.pt-home {
  position: absolute; inset: 0; display: none; padding: 26px; overflow: auto;
}
.pt-home.active { display: block; }

/* 6 ── controls / buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--pt-radius);
  padding: 9px 18px; font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: filter .15s, box-shadow .15s, transform .05s; color: #fff;
  box-shadow: 0 1px 3px rgba(28, 20, 54, .14);
}
.btn:hover { filter: brightness(.96); box-shadow: 0 4px 10px rgba(28, 20, 54, .20); }
.btn:active { filter: brightness(.9); box-shadow: 0 1px 2px rgba(28, 20, 54, .16); transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--pt-primary); outline-offset: 2px; }
.btn-primary { background: var(--pt-primary-grad); }
.btn-success { background: var(--pt-success); }
.btn-info    { background: var(--pt-info); }
.btn-danger  { background: var(--pt-danger); }
.btn-light   { background: #fff; color: var(--pt-text); border-color: var(--pt-border); }
.btn-light:hover { background: var(--pt-hover); filter: none; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.grid td .btn-sm { white-space: nowrap; }
.grid td { white-space: nowrap; }

/* 7 ── cards + form fields ───────────────────────────────────────────────── */
.card {
  background: var(--pt-surface); border-radius: var(--pt-radius);
  box-shadow: var(--pt-shadow); padding: 24px; margin-bottom: 22px;
}
.card-title { font-size: 16px; font-weight: 600; margin: 0 0 18px; }
.form-row { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 4px; }
.form-field { flex: 1 1 220px; margin-bottom: 16px; }
.form-field label { display: block; font-size: 12px; font-weight: 600; color: #111827; margin-bottom: 6px; }
.form-control {
  width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
  color: var(--pt-text); background: #fff;
  border: 1px solid var(--pt-border); border-radius: var(--pt-radius);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: 0; border-color: var(--pt-primary);
  box-shadow: 0 0 0 3px rgba(154,85,255,.14);
}
.form-control[readonly] {
  background: #f3f4f6; color: var(--pt-text); cursor: not-allowed;
  border-style: dashed;
}
.form-control[readonly]:focus { box-shadow: none; border-color: var(--pt-border); }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.pt-translate {
  display: none; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--pt-primary); cursor: pointer;
}
.pt-translate:hover { text-decoration: underline; }
.pt-translate.loading { opacity: .5; pointer-events: none; }
.pt-translate .material-symbols-outlined { font-size: 14px; }
.form-actions .spacer { flex: 1 1 auto; }

/* 8 ── grid tables ───────────────────────────────────────────────────────── */
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th, .grid td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--pt-border); }
.grid thead th { color: var(--pt-muted); font-weight: 600; background: #fafbfc; }
.grid tbody tr:hover { background: var(--pt-hover); }

/* 9 ── login (split-panel, responsive) ───────────────────────────────────── */
.pt-auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 100% 0, rgba(154,85,255,.12), transparent 60%),
    radial-gradient(900px 520px at 0 100%, rgba(218,140,255,.16), transparent 55%),
    var(--pt-canvas);
}
.pt-auth-card {
  width: 100%; max-width: 940px; min-height: 560px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--pt-surface); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(28,20,54,.18);
}

/* brand side */
.pt-auth-brand {
  position: relative; overflow: hidden; color: #fff;
  padding: 46px 42px; display: flex; flex-direction: column;
  background: linear-gradient(150deg, #7a3cf0 0%, #9a55ff 45%, #da8cff 100%);
}
.pt-auth-brand::before {
  content: ""; position: absolute; inset: 0; opacity: .55;
  background-image:
    linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(130% 90% at 15% 0, #000, transparent 72%);
          mask-image: radial-gradient(130% 90% at 15% 0, #000, transparent 72%);
}
.pt-auth-logo { position: relative; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; }
.pt-auth-logo .mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.30);
}
.pt-auth-brand h2 { position: relative; font-size: 30px; line-height: 1.22; font-weight: 700; margin: auto 0 12px; }
.pt-auth-brand .tag { position: relative; margin: 0; opacity: .92; font-size: 14px; max-width: 34ch; }
.pt-auth-badges { position: relative; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.pt-auth-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 6px 12px; border-radius: 20px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24);
}
.pt-auth-badge .material-symbols-outlined { font-size: 16px; }

/* form side */
.pt-auth-form { padding: 44px 44px; display: flex; flex-direction: column; }
.pt-auth-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.pt-auth-mini { display: none; align-items: center; gap: 9px; font-weight: 700; }
.pt-auth-mini .mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: var(--pt-primary-grad);
}
.pt-auth-form h1 { font-size: 23px; margin: 0 0 5px; }
.pt-auth-form .sub { margin: 0 0 26px; color: var(--pt-muted); font-size: 13px; }

.pt-lang { display: inline-flex; border: 1px solid var(--pt-border); border-radius: 20px; overflow: hidden; }
.pt-lang a { padding: 6px 14px; font-size: 12px; font-weight: 600; color: var(--pt-muted); }
.pt-lang a.active { background: var(--pt-primary-grad); color: #fff; }

.pt-field-label { display: block; font-size: 12px; font-weight: 600; color: var(--pt-muted); margin: 0 0 7px; }
.pt-input { position: relative; margin-bottom: 18px; }
.pt-input .lead {
  position: absolute; top: 50%; left: 13px; transform: translateY(-50%);
  color: var(--pt-muted); font-size: 20px; pointer-events: none;
}
.pt-input .form-control { height: 48px; padding-left: 44px; padding-right: 44px; }
.pt-input .pt-eye {
  position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--pt-muted);
  cursor: pointer; padding: 7px; border-radius: 8px; line-height: 0;
}
.pt-input .pt-eye:hover { background: var(--pt-hover); }
.pt-auth .btn { height: 48px; justify-content: center; font-size: 14px; }
.pt-auth-spacer { flex: 1 1 auto; }
.pt-auth-foot { margin-top: 26px; font-size: 12px; color: var(--pt-muted); text-align: center; }

/* stack to a single column on tablet / phone */
@media (max-width: 820px) {
  .pt-auth { padding: 0; }
  .pt-auth-card {
    grid-template-columns: 1fr; max-width: 460px; min-height: 100vh;
    min-height: 100dvh; border-radius: 0; box-shadow: none;
  }
  .pt-auth-brand { display: none; }
  .pt-auth-mini { display: flex; }
  .pt-auth-form { padding: 30px 24px; justify-content: center; }
}
@media (min-width: 560px) and (max-width: 820px) {
  .pt-auth { padding: 24px; place-items: center; }
  .pt-auth-card { min-height: 0; border-radius: 16px; box-shadow: var(--pt-shadow); }
}

/* RTL: mirror the leading icon / reveal button */
[dir="rtl"] .pt-input .lead { left: auto; right: 13px; }
[dir="rtl"] .pt-input .pt-eye { right: auto; left: 8px; }

/* 10 ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .pt-brand { width: auto; border-right: 0; }
  .pt-hamburger { display: inline-block; }
  .pt-sidebar { transform: translateX(-100%); box-shadow: var(--pt-shadow); }
  .pt-sidebar.show { transform: translateX(0); }
  .pt-content { margin-left: 0; }
}

/* 11 ── RTL (Arabic) ─────────────────────────────────────────────────────── */
[dir="rtl"] body { font-family: 'Cairo', var(--pt-font); }
[dir="rtl"] .pt-brand { border-right: 0; border-left: 1px solid var(--pt-border); }
[dir="rtl"] .pt-navbar-right { margin-left: 0; margin-right: auto; }
[dir="rtl"] .pt-sidebar { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--pt-border); }
[dir="rtl"] .pt-content { margin-left: 0; margin-right: var(--pt-sidebar-w); }
[dir="rtl"] .pt-nav-head .chev { margin-left: 0; margin-right: auto; transform: rotate(180deg); }
[dir="rtl"] .pt-nav-group.open > .pt-nav-head .chev { transform: rotate(90deg); }
[dir="rtl"] .pt-nav-sub a { padding: 9px 52px 9px 22px; border-left: 0; border-right: 3px solid transparent; }
[dir="rtl"] .pt-nav-sub a.active { border-right-color: var(--pt-primary); }
[dir="rtl"] .pt-tab { padding: 0 16px 0 6px; }
[dir="rtl"] .grid th, [dir="rtl"] .grid td { text-align: right; }
[dir="rtl"] .form-field label { text-align: right; }

@media (max-width: 991px) {
  [dir="rtl"] .pt-sidebar { transform: translateX(100%); }
  [dir="rtl"] .pt-sidebar.show { transform: translateX(0); }
  [dir="rtl"] .pt-content { margin-right: 0; }
}

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

/* 12 ── toasts + confirm modal (professional notifications) ───────────────── */
.pt-toast-wrap {
  position: fixed; top: 18px; right: 18px; z-index: 2100;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
[dir="rtl"] .pt-toast-wrap { right: auto; left: 18px; }
.pt-toast {
  display: flex; align-items: center; gap: 10px;
  min-width: 240px; max-width: 360px; padding: 13px 16px;
  border-radius: 10px; background: #fff; color: var(--pt-text); font-size: 14px;
  box-shadow: 0 10px 34px rgba(28,20,54,.18);
  border-left: 4px solid var(--pt-info);
  opacity: 0; transform: translateX(14px); transition: opacity .2s, transform .2s;
  pointer-events: auto;
}
[dir="rtl"] .pt-toast { border-left: 0; border-right: 4px solid var(--pt-info); transform: translateX(-14px); }
.pt-toast.show { opacity: 1; transform: none; }
.pt-toast.success { border-color: var(--pt-success); }
.pt-toast.error   { border-color: var(--pt-danger); }
.pt-toast .ic { font-size: 20px; }
.pt-toast.success .ic { color: var(--pt-success); }
.pt-toast.error   .ic { color: var(--pt-danger); }
.pt-toast.info    .ic { color: var(--pt-info); }

.pt-modal-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(20,15,40,.45); display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity .15s;
}
.pt-modal-backdrop.show { opacity: 1; }
.pt-modal {
  width: 100%; max-width: 380px; background: #fff; border-radius: 14px;
  box-shadow: 0 24px 70px rgba(28,20,54,.30); padding: 26px 24px 22px;
  text-align: center; transform: translateY(10px) scale(.98); transition: transform .15s;
}
.pt-modal-backdrop.show .pt-modal { transform: none; }
.pt-modal-ic {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 14px;
  display: grid; place-items: center;
  background: rgba(254,124,150,.14); color: var(--pt-danger);
}
.pt-modal-ic .material-symbols-outlined { font-size: 28px; }
.pt-modal p { margin: 0 0 22px; font-size: 15px; color: var(--pt-text); }
.pt-modal-actions { display: flex; gap: 10px; justify-content: center; }
.pt-modal-actions .btn { min-width: 96px; justify-content: center; }

/* 13 ── table pager ──────────────────────────────────────────────────────── */
.pt-pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 16px; flex-wrap: wrap; font-size: 13px; color: var(--pt-muted);
}
.pt-pager-size { display: flex; align-items: center; gap: 8px; }
.pt-pager-select {
  padding: 6px 10px; border: 1px solid var(--pt-border); border-radius: var(--pt-radius);
  background: #fff; font-family: inherit; font-size: 13px; color: var(--pt-text); cursor: pointer;
}
.pt-pager-right { display: flex; align-items: center; gap: 16px; }
.pt-pager-nav { display: flex; align-items: center; gap: 6px; }
.pt-pager-pages { min-width: 84px; text-align: center; }
.pt-pager-btn {
  width: 32px; height: 32px; border: 1px solid var(--pt-border); background: #fff;
  border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--pt-text);
}
.pt-pager-btn:hover:not(:disabled) { background: var(--pt-hover); }
.pt-pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pt-pager-btn .material-symbols-outlined { font-size: 18px; }
[dir="rtl"] .pt-pager-btn .material-symbols-outlined { transform: scaleX(-1); }

/* 14 ── compact filter area ──────────────────────────────────────────────── */
.card.pt-filters { padding: 12px 16px; }
.card.pt-filters .card-title { font-size: 12px; margin-bottom: 8px; color: var(--pt-muted); text-transform: uppercase; letter-spacing: .4px; }
.pt-filters .form-row { gap: 8px 10px; margin-bottom: 0; }
.pt-filters .form-field { flex: 1 1 140px; min-width: 0; margin-bottom: 8px; }
.pt-filters .form-field label { font-size: 11px; margin-bottom: 2px; }
.pt-filters .form-control { height: 30px; padding: 3px 8px; font-size: 12px; }
.pt-filters .form-actions { margin-top: 2px; gap: 8px; }
.pt-filters .form-actions .btn { height: 30px; padding: 3px 16px; font-size: 12px; }

/* 15 ── product view modal (details + history cards) ─────────────────────── */
.pv-modal { max-width: 620px; width: 100%; padding: 0; text-align: left;
  max-height: 90vh; display: flex; flex-direction: column; }
[dir="rtl"] .pv-modal { text-align: right; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px;
  border-bottom: 1px solid var(--pt-border); }
.pv-head > .material-symbols-outlined { color: var(--pt-primary); font-size: 22px; }
.pv-head-title { font-weight: 600; font-size: 16px; flex: 1 1 auto; }
.pv-close { background: none; border: 0; cursor: pointer; color: var(--pt-muted);
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.pv-close:hover { background: var(--pt-hover); color: var(--pt-text); }
.pv-body { padding: 18px 20px; overflow: auto; }
.pv-details { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column;
  grid-template-rows: repeat(5, auto); gap: 12px 28px; }
.pv-row { font-size: 13.5px; color: var(--pt-text); }
.pv-row .lbl { color: var(--pt-muted); }
.pv-hist-head { display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 12px; padding-top: 16px; border-top: 1px solid var(--pt-border); }
.pv-hist-head h4 { margin: 0; font-size: 18px; }
.pv-sort { display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  font-size: 12px; color: var(--pt-muted); }
.pv-sort .material-symbols-outlined { font-size: 16px; color: var(--pt-primary); }
.pv-cards { display: flex; flex-direction: column; gap: 10px; }
.pv-card { border: 1px solid var(--pt-border); border-radius: 10px; padding: 12px 14px;
  background: #fbfaff; }
.pv-card-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pv-card-top .st { font-weight: 700; }
.pv-card-top .dt { font-size: 12px; color: var(--pt-muted); }
.pv-card .ln { font-size: 13px; margin: 2px 0; }
.pv-card .ln .lbl { color: var(--pt-muted); }
.pv-card .rmk { font-size: 13px; margin-top: 4px; }
.pv-card .usr { font-size: 12px; color: var(--pt-muted); margin-top: 6px; }
.pv-foot { padding: 14px 20px; border-top: 1px solid var(--pt-border); text-align: right; }
[dir="rtl"] .pv-foot { text-align: left; }

/* 16 ── serial assignment method selector ───────────────────────────────── */
.pt-methods { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.pt-methods label {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px;
  border: 1px solid var(--pt-border); border-radius: 9px; cursor: pointer;
  font-size: 13px; user-select: none; transition: border-color .15s, background .15s;
}
.pt-methods label:has(input:checked) {
  border-color: var(--pt-primary); background: rgba(154,85,255,.08); color: var(--pt-primary); font-weight: 600;
}
.pt-methods input { accent-color: var(--pt-primary); }
.pt-methods .material-symbols-outlined { font-size: 18px; }

/* 17 ── print design mode toggle (sidebar) ──────────────────────────────── */
.dm-badge {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 9px;
  background: var(--pt-border); color: var(--pt-muted); margin-left: 6px; letter-spacing: .3px;
}
[dir="rtl"] .dm-badge { margin-left: 0; margin-right: 6px; }
.dm-toggle.on .dm-badge { background: var(--pt-success); color: #fff; }

/* 18 ── status / warranty pill ──────────────────────────────────────────── */
.pt-pill { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }

/* 19 ── file upload (Choose File) button ────────────────────────────────── */
input[type="file"].form-control {
  height: 40px; padding: 5px 8px; display: flex; align-items: center;
  font-size: 12px; color: var(--pt-muted);
}
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 7px 16px;
  border: 1px solid var(--pt-border); border-radius: 8px;
  background: #fff; color: var(--pt-text);
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 3px rgba(28, 20, 54, .14);
  transition: background .15s, box-shadow .15s;
}
input[type="file"]::file-selector-button:hover {
  background: var(--pt-hover); box-shadow: 0 3px 8px rgba(28, 20, 54, .20);
}
[dir="rtl"] input[type="file"]::file-selector-button { margin-right: 0; margin-left: 12px; }

/* ---- section sub-heading (merged frames) ---- */
.pt-subhead {
  font-weight: 700; color: var(--pt-primary);
  margin: 18px 0 10px; padding-bottom: 5px;
  border-bottom: 1px solid var(--pt-border);
}

/* ---- on/off toggle switch ---- */
.pt-switch { display: inline-flex; align-items: center; }
.pt-switch input[type=checkbox] {
  appearance: none; -webkit-appearance: none; margin: 0;
  width: 46px; height: 24px; border-radius: 24px; background: #cbd5e1;
  position: relative; cursor: pointer; transition: background .2s; flex: 0 0 auto;
}
.pt-switch input[type=checkbox]::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.pt-switch input[type=checkbox]:checked { background: var(--pt-primary); }
.pt-switch input[type=checkbox]:checked::before { left: 25px; }
.pt-switch label { cursor: pointer; margin-left: 8px; font-weight: 600; color: #111827; }

/* ============================ Dashboard ============================ */
.dash-section-title { font-size: 15px; font-weight: 700; color: #111827; margin: 22px 0 12px; }
.dash-section-title:first-child { margin-top: 4px; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi { position: relative; overflow: hidden; border-radius: 14px; padding: 20px 22px; color: #fff;
       box-shadow: 0 8px 20px rgba(17,24,39,.12); min-height: 96px; }
.kpi .kpi-num { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: .5px; }
.kpi .kpi-label { font-size: 13px; opacity: .92; margin-top: 4px; }
.kpi .kpi-icon { position: absolute; right: 16px; bottom: 12px; font-size: 46px; opacity: .28; }
.kpi .kpi-trend { position: absolute; right: 16px; top: 16px; font-size: 20px; opacity: .8; }

.kpi-indigo { background: linear-gradient(135deg, #4324c4 0%, #6d3be0 100%); }
.kpi-green  { background: linear-gradient(135deg, #159949 0%, #22b862 100%); }
.kpi-blue   { background: linear-gradient(135deg, #1f7ae0 0%, #3aa0f2 100%); }
.kpi-dark   { background: linear-gradient(135deg, #1f2733 0%, #38445a 100%); }
.kpi-amber  { background: linear-gradient(135deg, #f0920f 0%, #ffb63d 100%); }
.kpi-red    { background: linear-gradient(135deg, #e0392f 0%, #f2635a 100%); }

.dash-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 560px) { .dash-grid2 { grid-template-columns: 1fr; } }

/* dashboard table zebra + header */
table.dash-tbl { width: 100%; border-collapse: collapse; }
table.dash-tbl thead th { background: #2b3446; color: #fff; text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
table.dash-tbl tbody td { padding: 9px 12px; border-bottom: 1px solid var(--pt-border); font-size: 13px; }
table.dash-tbl tbody tr:nth-child(even) { background: #f7f8fb; }
table.dash-tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.dash-tbl .zero { color: var(--pt-success); }
