/* ============================================
   ADMIN PANEL — Benefiteo
   ============================================ */
:root {
  --ad-ink: #031b4e;
  --ad-blue: #2448c6;
  --ad-blue-2: #3d5fd9;
  --ad-soft: #5a6b8c;
  --ad-muted: #8a95ab;
  --ad-line: rgba(3, 27, 78, 0.1);
  --ad-bg: #eef1f8;
  --ad-panel: #fff;
  --ad-sidebar: #031b4e;
  --ad-ok: #0a7a4a;
  --ad-warn: #b45309;
  --ad-danger: #b42318;
  --ad-radius: 18px;
  --ad-shadow: 0 8px 28px rgba(3, 27, 78, 0.07);
  --ad-font: "Public Sans", system-ui, sans-serif;
  --ad-display: "Anybody", Impact, sans-serif;
  --ad-nav-w: 268px;
}

*, *::before, *::after { box-sizing: border-box; }
body.ad-body {
  margin: 0;
  font-family: var(--ad-font);
  color: var(--ad-ink);
  background: var(--ad-bg);
  min-height: 100vh;
  overflow-x: clip;
}

.ad-app { display: flex; min-height: 100vh; }

/* Sidebar */
.ad-sidebar {
  width: var(--ad-nav-w);
  flex-shrink: 0;
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(61, 95, 217, 0.35), transparent 60%),
    linear-gradient(180deg, #031b4e 0%, #0a275f 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.ad-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.35rem 1.2rem 1.1rem;
  text-decoration: none;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ad-brand img { height: 28px; width: auto; }
.ad-brand strong {
  display: block;
  font-family: var(--ad-display);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.ad-brand small {
  display: block;
  font-size: 0.7rem;
  color: color-mix(in srgb, #fff 62%, var(--ad-blue) 38%);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.1rem;
}

.ad-nav { padding: 0.85rem 0.75rem 1rem; flex: 1; }
.ad-nav-group { margin-bottom: 0.85rem; }
.ad-nav-label {
  margin: 0 0 0.35rem;
  padding: 0 0.65rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.ad-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.75rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.ad-nav a .shop-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}
.ad-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.ad-nav a.is-active {
  background: color-mix(in srgb, var(--ad-blue) 55%, transparent);
  color: #fff;
  box-shadow: none;
}
.ad-nav a.is-active .shop-icon { opacity: 1; }

.ad-side-api {
  margin: 0 0.75rem 0.75rem;
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  line-height: 1.35;
}
.ad-side-api-label {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 700;
}
.ad-side-api-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}
.ad-side-api-status strong { font-size: 0.88rem; color: #fff; }
.ad-side-api-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}
.ad-side-api.is-ok .ad-side-api-dot {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}
.ad-side-api.is-err .ad-side-api-dot {
  background: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}
.ad-side-api.is-off .ad-side-api-dot { background: #64748b; }
.ad-side-api-msg {
  margin: 0 0 0.55rem;
  color: rgba(255, 255, 255, 0.55);
  word-break: break-word;
}
.ad-side-api-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.55rem;
}
.ad-side-api-stats dt {
  margin: 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.65rem;
}
.ad-side-api-stats dd {
  margin: 0;
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
}
.ad-side-api-sub {
  margin: 0.35rem 0 0.25rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.68rem;
  font-weight: 600;
}
.ad-side-api-list {
  list-style: none;
  margin: 0 0 0.4rem;
  padding: 0;
  max-height: 7.5rem;
  overflow: auto;
}
.ad-side-api-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
}
.ad-side-api-list em { font-style: normal; color: #93c5fd; font-weight: 700; }
.ad-side-api-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.45rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  background: rgba(147, 197, 253, 0.12);
  color: #bfdbfe !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.72rem;
}
.ad-side-api-link:hover {
  background: rgba(147, 197, 253, 0.22);
  text-decoration: none;
}

.ad-side-partners {
  margin-top: 0;
}
.ad-side-partners-list {
  list-style: none;
  margin: 0 0 0.35rem;
  padding: 0;
  max-height: 11rem;
  overflow: auto;
}
.ad-side-partners-list li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ad-side-partners-list a {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.45rem 0.15rem;
  color: rgba(255, 255, 255, 0.88) !important;
  text-decoration: none !important;
  border-radius: 8px;
}
.ad-side-partners-list a:hover,
.ad-side-partners-list a.is-active {
  background: rgba(255, 255, 255, 0.08);
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
.ad-side-partners-list strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}
.ad-side-partners-list span {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.5);
}

.ad-partner-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 0 1rem 0.5rem;
}
.ad-partner-guide-card {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  border: 1px solid #e4eaf3;
}
.ad-partner-guide-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--ad-blue);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.55rem;
}
.ad-partner-guide-card strong {
  display: block;
  font-size: 0.95rem;
  color: #1a2456;
  margin-bottom: 0.35rem;
}
.ad-partner-guide-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #5a6478;
}
.ad-partner-guide-card em {
  font-style: normal;
  font-weight: 700;
  color: #1a2456;
}
.ad-partner-guide-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.75rem 1rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: #fff8eb;
  border: 1px solid #f3e0b5;
}
.ad-partner-guide-note strong {
  display: block;
  color: #8a5a00;
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}
.ad-partner-guide-note p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #6b5420;
}
.ad-partner-tech summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ad-blue);
  font-size: 0.86rem;
}
.ad-partner-tech[open] summary { margin-bottom: 0.25rem; }

.ad-partner-rows {
  list-style: none;
  margin: 0;
  padding: 0 0.35rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ad-partner-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  text-decoration: none !important;
  color: inherit !important;
  background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
  border: 1px solid #e6ebf3;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ad-partner-row:hover {
  border-color: rgba(36, 72, 198, 0.35);
  box-shadow: 0 8px 22px rgba(3, 27, 78, 0.08);
  transform: translateY(-1px);
}
.ad-partner-row.is-warn {
  border-color: rgba(180, 83, 9, 0.28);
  background: linear-gradient(180deg, #fffdf8 0%, #fff7eb 100%);
}
.ad-partner-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ad-blue);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.ad-partner-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.ad-partner-main strong {
  font-size: 1rem;
  color: #1a2456;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.ad-partner-main em {
  font-style: normal;
  font-size: 0.82rem;
  color: #8a95ab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.ad-partner-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ad-partner-due {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  min-width: 5.5rem;
}
.ad-partner-due small {
  font-size: 0.68rem;
  color: #8a95ab;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ad-partner-due b {
  font-size: 0.98rem;
  color: #1a2456;
}
.ad-partner-go {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #dce3ef;
  color: var(--ad-blue);
  font-weight: 700;
  font-size: 0.95rem;
}
.ad-partner-row:hover .ad-partner-go {
  background: var(--ad-blue);
  border-color: var(--ad-blue);
  color: #fff;
}
.ad-partner-inv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
  max-width: 22rem;
}
.ad-partner-inv-actions form {
  display: inline;
  margin: 0;
}
.ad-partner-note-compose {
  margin: 0 0 1rem;
}
.ad-partner-note-compose textarea,
.ad-partner-note-edit textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--ad-line);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  resize: vertical;
  min-height: 4.5rem;
  background: #fff;
}
.ad-partner-note-compose textarea:focus,
.ad-partner-note-edit textarea:focus {
  outline: 2px solid rgba(36, 72, 198, 0.25);
  border-color: var(--ad-blue);
}
.ad-partner-notes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ad-partner-note-card {
  border: 1px solid var(--ad-line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #f8faff;
}
.ad-partner-note-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
}
.ad-partner-note-card header strong {
  font-size: 0.88rem;
}
.ad-partner-note-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

/* Partner detail tables */
.ad-partner-table-wrap.is-sticky-head {
  max-height: min(52vh, 480px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.ad-partner-table-wrap.is-sticky-head thead th {
  top: 0;
  background: #f0f4fb;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.ad-partner-table-wrap .ad-table {
  min-width: 720px;
}
.ad-partner-keys-wrap .ad-table {
  min-width: 560px;
}
.ad-partner-inv-wrap .ad-table {
  min-width: 640px;
}
.ad-partner-inv-wrap td:last-child {
  width: 1%;
  white-space: normal;
}

.ad-ph-studio {
  background:
    radial-gradient(720px 280px at 100% -10%, rgba(61, 95, 217, 0.12), transparent 55%),
    radial-gradient(520px 220px at -10% 0%, rgba(10, 122, 74, 0.06), transparent 50%),
    #fff;
}
.ad-ph-studio-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 1.25rem;
  align-items: end;
  padding: 1.35rem 1.35rem 1.15rem;
  border-bottom: 1px solid var(--ad-line);
}
.ad-ph-kicker {
  margin: 0 0 0.28rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ad-blue);
}
.ad-ph-studio-intro h2 {
  margin: 0;
  font-family: var(--ad-display);
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.ad-ph-studio-intro p {
  margin: 0.45rem 0 0;
  max-width: 42rem;
  color: var(--ad-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}
.ad-ph-live-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
.ad-ph-live-stat {
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(36, 72, 198, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}
.ad-ph-live-stat b {
  display: block;
  font-family: var(--ad-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.ad-ph-live-stat span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-muted);
}
.ad-ph-studio-form { padding: 0; }
.ad-ph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: center;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid #eef2f8;
  background: #f8fafd;
}
.ad-ph-search {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
  margin: 0;
}
.ad-ph-search-ico {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--ad-muted);
  pointer-events: none;
}
.ad-ph-search-ico svg { width: 16px; height: 16px; }
.ad-ph-search input {
  width: 100%;
  padding: 0.62rem 0.85rem 0.62rem 2.2rem;
  border: 1px solid #d8e0ef;
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-weight: 600;
}
.ad-ph-search input:focus {
  outline: 2px solid rgba(36, 72, 198, 0.28);
  border-color: var(--ad-blue);
}
.ad-ph-seg {
  display: inline-flex;
  padding: 0.18rem;
  border-radius: 999px;
  background: #e8edf6;
  gap: 0.15rem;
}
.ad-ph-seg-item { margin: 0; cursor: pointer; }
.ad-ph-seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.ad-ph-seg-item span {
  display: block;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ad-soft);
}
.ad-ph-seg-item:has(input:checked) span {
  background: #fff;
  color: var(--ad-ink);
  box-shadow: 0 2px 8px rgba(3, 27, 78, 0.08);
}
.ad-ph-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ad-ph-filter {
  appearance: none;
  border: 1px solid #d8e0ef;
  background: #fff;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ad-soft);
  cursor: pointer;
}
.ad-ph-filter.is-on {
  background: var(--ad-ink);
  border-color: var(--ad-ink);
  color: #fff;
}
.ad-ph-bulk { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-left: auto; }
.ad-ph-empty {
  margin: 0;
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--ad-soft);
  font-weight: 600;
}
.ad-ph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(312px, 1fr));
  gap: 1rem;
  align-items: stretch;
  padding: 1.1rem 1.25rem 1.35rem;
}
.ad-ph-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid #e2e8f4;
  border-radius: 20px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(3, 27, 78, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.ad-ph-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(3, 27, 78, 0.1);
  border-color: rgba(36, 72, 198, 0.28);
}
.ad-ph-card.is-off {
  opacity: 0.62;
  filter: saturate(0.75);
}
.ad-ph-card[hidden] { display: none !important; }
.ad-ph-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  padding: 1.1rem 1rem 0.9rem;
  background:
    radial-gradient(180px 80px at 80% 0%, rgba(61, 95, 217, 0.14), transparent 70%),
    linear-gradient(180deg, #f4f7fd 0%, #eef3fb 100%);
  border-bottom: 1px solid #eef2f8;
}
.ad-ph-visual img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(3, 27, 78, 0.12));
}
.ad-ph-visual-fallback {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: #fff;
  font-family: var(--ad-display);
  font-size: 1.8rem;
  color: var(--ad-blue);
}
.ad-ph-api {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.28rem 0.5rem 0.28rem 0.28rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dce4f2;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(3, 27, 78, 0.08);
}
.ad-ph-api input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ad-ph-api-ui {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #c5cddc;
  flex: 0 0 auto;
  transition: background 0.18s ease;
}
.ad-ph-api-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(3, 27, 78, 0.2);
  transition: transform 0.18s ease;
}
.ad-ph-api input:checked + .ad-ph-api-ui { background: var(--ad-ok); }
.ad-ph-api input:checked + .ad-ph-api-ui::after { transform: translateX(14px); }
.ad-ph-api-copy { display: grid; line-height: 1.15; }
.ad-ph-api-copy strong { font-size: 0.68rem; letter-spacing: 0.04em; text-transform: uppercase; }
.ad-ph-api-copy em { font-style: normal; font-size: 0.62rem; color: var(--ad-muted); }
.ad-ph-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.95rem 1rem 1.05rem;
  flex: 1;
}
.ad-ph-title h3 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.ad-ph-title code {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.72rem;
  color: var(--ad-muted);
}
.ad-ph-metrics {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #f6f8fd 0%, #eef4ff 100%);
  border: 1px solid #e4ebf7;
}
.ad-ph-comm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
}
.ad-ph-comm > span {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ad-soft);
}
.ad-ph-comm-field {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: #fff;
  border: 1px solid #d5deee;
  border-radius: 12px;
  padding: 0.12rem 0.45rem 0.12rem 0.12rem;
}
.ad-ph-comm-field input {
  width: 3.6rem;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0.28rem 0;
}
.ad-ph-comm-field input:focus { outline: none; }
.ad-ph-comm-field i {
  font-style: normal;
  font-weight: 800;
  color: var(--ad-blue);
}
.ad-ph-preview {
  font-size: 0.78rem;
  color: var(--ad-soft);
  line-height: 1.4;
}
.ad-ph-preview strong { color: var(--ad-ok); }
.ad-ph-denoms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.ad-ph-denoms-head p {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ad-muted);
}
.ad-ph-denoms-head b { color: var(--ad-ink); letter-spacing: 0; text-transform: none; }
.ad-ph-mini {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ad-blue);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0.1rem 0.2rem;
}
.ad-ph-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ad-ph-chips-empty { font-size: 0.8rem; color: var(--ad-muted); }
.ad-ph-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.38rem 0.55rem 0.38rem 0.4rem;
  border-radius: 14px;
  border: 1px solid #e1e7f2;
  background: #f7f9fc;
  cursor: pointer;
  min-width: 0;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.ad-ph-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ad-ph-chip-ui {
  position: relative;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  background: #c5cddc;
  flex: 0 0 auto;
  transition: background 0.18s ease;
}
.ad-ph-chip-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}
.ad-ph-chip.is-on {
  background: #eef8f2;
  border-color: rgba(10, 122, 74, 0.28);
}
.ad-ph-chip.is-on .ad-ph-chip-ui { background: var(--ad-ok); }
.ad-ph-chip.is-on .ad-ph-chip-ui::after { transform: translateX(12px); }
.ad-ph-chip:not(.is-on) { opacity: 0.62; }
.ad-ph-chip-meta { display: grid; min-width: 0; }
.ad-ph-chip-meta strong {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.ad-ph-chip-meta code {
  font-size: 0.62rem;
  color: var(--ad-muted);
}
.ad-ph-sticky {
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 1.1rem 1.1rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(36, 72, 198, 0.16);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(3, 27, 78, 0.12);
  backdrop-filter: blur(10px);
}
.ad-ph-sticky p {
  margin: 0;
  flex: 1 1 240px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ad-soft);
}
.ad-ph-sticky-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
@media (max-width: 860px) {
  .ad-ph-studio-head { grid-template-columns: 1fr; }
  .ad-ph-bulk { margin-left: 0; }
  .ad-ph-grid { grid-template-columns: 1fr; }
}

.ad-shop-row.is-own {
  border-color: rgba(36, 72, 198, 0.35);
  background: linear-gradient(180deg, #f5f8ff 0%, #eef3fc 100%);
}
.ad-shop-row.is-partner .ad-shop-avatar.is-partner,
.ad-shop-avatar.is-partner {
  background: #5a6478;
}
.ad-shop-partner-note {
  margin: 0 1rem 0.85rem;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  background: #f7f9fc;
  border: 1px solid #e4eaf3;
  color: #5a6478;
  font-size: 0.88rem;
  line-height: 1.5;
}
.ad-shop-partner-note a {
  color: var(--ad-blue);
  font-weight: 700;
}
.ad-shop-due-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #fff8f0;
  border: 1px solid rgba(180, 83, 9, 0.28);
  color: #b45309;
  font-size: 0.78rem;
  font-weight: 800;
}
.ad-shop-row.is-suspended {
  opacity: 0.88;
  border-style: dashed;
}
.ad-shop-main .badge {
  margin-left: 0.35rem;
  vertical-align: middle;
}
.ad-partner-detail-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  align-items: center;
}

.ad-shop-rows {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.ad-shop-row {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1.35fr) 15.5rem 17.25rem;
  gap: 0.85rem 1rem;
  align-items: start;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid #e4eaf3;
  background: linear-gradient(180deg, #fff 0%, #f7f9fc 100%);
}
.ad-shop-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ad-blue);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.ad-shop-main {
  min-width: 0;
}
.ad-shop-main strong {
  display: block;
  font-size: 1.05rem;
  color: #1a2456;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-shop-main em {
  display: block;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ad-blue);
  font-weight: 700;
  margin: 0.15rem 0 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-shop-main p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #5a6478;
  max-width: 36rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-shop-nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  width: 100%;
  justify-self: stretch;
  padding-top: 0.2rem;
}
.ad-shop-nums div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ad-shop-nums small {
  font-size: 0.72rem;
  color: #7a8499;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.ad-shop-nums b {
  font-size: 1.05rem;
  color: #1a2456;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-shop-nums b.is-due {
  color: #b45309;
}
.ad-shop-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  padding-top: 0.15rem;
}
.ad-shop-actions .ad-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
/* Niewidoczny placeholder — ta sama szerokość co „Strona ↗”, żeby rzędy się nie rozjeżdżały */
.ad-shop-actions-ph {
  display: inline-block;
  flex: 0 0 auto;
  visibility: hidden;
  width: 5.6rem;
  height: 1.9rem;
  pointer-events: none;
}
.ad-shop-maint {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 0 1rem 1.1rem;
}
.ad-shop-maint-card {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid #e4eaf3;
  background: #f7f9fc;
}
.ad-shop-maint-card strong {
  display: block;
  color: #1a2456;
  margin-bottom: 0.4rem;
}
.ad-shop-maint-card p {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #5a6478;
}
.ad-shop-maint-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
@media (max-width: 1100px) {
  .ad-shop-row {
    grid-template-columns: 2.75rem minmax(0, 1fr) 13.5rem 15.5rem;
  }
}
@media (max-width: 980px) {
  .ad-shop-row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "avatar main"
      "nums nums"
      "actions actions";
  }
  .ad-shop-avatar { grid-area: avatar; }
  .ad-shop-main { grid-area: main; }
  .ad-shop-nums { grid-area: nums; }
  .ad-shop-actions {
    grid-area: actions;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .ad-shop-actions-ph { display: none; }
  .ad-shop-maint { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .ad-partner-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "avatar main go"
      "avatar meta go";
  }
  .ad-partner-avatar { grid-area: avatar; }
  .ad-partner-main { grid-area: main; }
  .ad-partner-meta {
    grid-area: meta;
    justify-content: flex-start;
  }
  .ad-partner-go { grid-area: go; }
  .ad-partner-due { align-items: flex-start; }
}

.ad-side-foot {
  padding: 0.85rem 0.75rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ad-side-foot a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.ad-side-foot a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.ad-side-foot .shop-icon { width: 16px; height: 16px; }
.ad-maint {
  margin: 0 0.15rem 0.45rem;
  padding: 0.7rem 0.75rem 0.6rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ad-maint-switch {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  user-select: none;
}
.ad-maint-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.ad-maint-track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.ad-maint-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.ad-maint-switch input:checked + .ad-maint-track { background: #ef4444; }
.ad-maint-switch input:checked + .ad-maint-track::after { transform: translateX(16px); }
.ad-maint-switch input:focus-visible + .ad-maint-track {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.ad-maint-ip {
  display: block;
  margin: 0.55rem 0 0;
}
.ad-maint-ip span {
  display: block;
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  font-weight: 600;
}
.ad-maint-ip input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
}
.ad-maint-you {
  margin: 0.4rem 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  line-height: 1.35;
}
.ad-maint-you-ip {
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  user-select: all;
}
.ad-maint button {
  margin-top: 0.45rem;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: #fff;
  color: #111;
  cursor: pointer;
}
.ad-maint small {
  display: block;
  margin: 0.4rem 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  line-height: 1.35;
}
.ad-admin-chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.ad-admin-chip span {
  display: block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
}
.ad-admin-chip strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Main */
.ad-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 1.5rem 3rem;
}
.ad-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
}
.ad-top-lead {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}
.ad-top-text { min-width: 0; }
.ad-top-sub {
  margin: 0;
  color: var(--ad-soft);
  font-size: 0.92rem;
  max-width: 48ch;
}
.ad-nav-toggle,
.ad-sidebar-x {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid var(--ad-line);
  color: var(--ad-ink);
  cursor: pointer;
  place-items: center;
  padding: 0;
}
.ad-nav-toggle .shop-icon,
.ad-sidebar-x .shop-icon { width: 20px; height: 20px; }
.ad-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 140;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(3, 27, 78, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}
.ad-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ad-sidebar-top .ad-brand {
  border-bottom: 0;
  flex: 1;
}
.ad-top h1 {
  margin: 0.15rem 0 0.25rem;
  font-family: var(--ad-display);
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  letter-spacing: -0.02em;
  color: var(--ad-ink);
}
.ad-top p:not(.ad-eyebrow):not(.ad-top-sub) {
  margin: 0;
  color: var(--ad-soft);
  font-size: 0.92rem;
  max-width: 48ch;
}
.ad-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ad-blue);
}
.ad-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
  max-width: min(100%, 38rem);
}
.ad-top-section-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
  padding: 0.28rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--ad-line);
  max-width: min(100%, 36rem);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ad-top-section-nav .ad-top-section-link {
  flex: 0 0 auto;
  white-space: nowrap;
}
.ad-top-section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ad-muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ad-top-section-link .shop-icon {
  width: 14px;
  height: 14px;
  opacity: 0.75;
}
.ad-top-section-link:hover {
  color: var(--ad-ink);
  background: #fff;
}
.ad-top-section-link.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--ad-blue, #1d4ed8) 0%, var(--ad-blue-2, #1e3a8a) 100%);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--ad-blue, #1d4ed8) 28%, transparent);
}
.ad-top-section-link.is-active .shop-icon { opacity: 1; color: #fff; }
.ad-top-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(180, 35, 24, 0.92);
  color: #fff;
}
.ad-top-section-link.is-active .ad-top-section-badge {
  background: rgba(255, 255, 255, 0.22);
}

/* Sortable table headers — strzałki w pasku tytułowym kolumn */
th.is-sortable,
th[data-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
th.is-sortable::after,
th[data-sort]::after {
  content: "↕";
  display: inline-block;
  margin-left: 0.28rem;
  font-size: 0.72em;
  opacity: 0.35;
  font-weight: 700;
  vertical-align: 0.05em;
}
th.is-sortable:hover::after,
th[data-sort]:hover::after {
  opacity: 0.7;
}
th[data-sort-dir="asc"]::after {
  content: "↑";
  opacity: 1;
  color: var(--ad-blue);
}
th[data-sort-dir="desc"]::after {
  content: "↓";
  opacity: 1;
  color: var(--ad-blue);
}

/* Cards / panels */
.ad-panel {
  background: var(--ad-panel);
  border: 1px solid var(--ad-line);
  border-radius: var(--ad-radius);
  box-shadow: var(--ad-shadow);
  padding: 1.25rem;
  min-width: 0;
}
.ad-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ad-panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ad-ink);
}
.ad-panel-head .muted {
  font-size: 0.82rem;
  color: var(--ad-muted);
  font-weight: 600;
}

.ad-grid { display: grid; gap: 1rem; }
.ad-grid-2 { grid-template-columns: 1fr; }
.ad-grid-3 { grid-template-columns: 1fr; }
.ad-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) {
  .ad-grid-2 { grid-template-columns: 1.2fr 0.8fr; }
  .ad-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .ad-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Stats */
.ad-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 900px) {
  .ad-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ad-stats.ad-stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ad-stats.ad-stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .ad-stats.ad-stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .ad-stats.ad-stats-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.ad-stat .h a {
  color: var(--ad-blue);
  font-weight: 700;
  text-decoration: none;
}
.ad-stat .h a:hover { text-decoration: underline; }
.ad-stat {
  background: #fff;
  border: 1px solid var(--ad-line);
  border-radius: 16px;
  padding: 1.05rem 1.1rem;
  box-shadow: var(--ad-shadow);
  position: relative;
  overflow: hidden;
}
a.ad-stat {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
a.ad-stat:hover {
  border-color: rgba(36, 72, 198, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(3, 27, 78, 0.1);
}
button.ad-stat {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
button.ad-stat:hover {
  border-color: rgba(36, 72, 198, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(3, 27, 78, 0.1);
}
.ad-stat::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--ad-blue), #9db0ff);
  opacity: 0.85;
}
.ad-stat.ad-stat-accent {
  background: linear-gradient(165deg, #f4f7ff 0%, #fff 55%);
  border-color: rgba(36, 72, 198, 0.22);
}
.ad-stat.ad-stat-accent::after {
  height: 4px;
  background: linear-gradient(90deg, #0a7a4a, var(--ad-blue));
}
.ad-stat.ad-stat-accent .v {
  font-size: 1.75rem;
  color: #0a7a4a;
}
.ad-stat .k {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ad-stat .v {
  margin-top: 0.35rem;
  font-family: var(--ad-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--ad-blue);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.ad-stat .h {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--ad-soft);
  font-weight: 600;
}
.ad-stat.is-warn .v { color: var(--ad-warn); }
.ad-stat.is-ok .v { color: var(--ad-ok); }
.ad-stat.is-danger .v { color: var(--ad-danger); }

/* Dashboard charts */
.ad-dash-charts { margin-bottom: 1rem; }

/* Live shop presence */
.ad-online {
  margin: 0 0 1rem;
  padding: 1rem 1.05rem 1.05rem;
  background:
    radial-gradient(1200px 180px at 0% 0%, rgba(36, 72, 198, 0.08), transparent 55%),
    #fff;
  border: 1px solid var(--ad-line);
  border-radius: 18px;
  box-shadow: var(--ad-shadow);
}
.ad-online-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.ad-online-head h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.ad-online-head p {
  margin: 0.2rem 0 0;
  color: var(--ad-soft);
  font-size: 0.82rem;
  font-weight: 600;
}
.ad-online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ad-ok);
  box-shadow: 0 0 0 0 rgba(10, 122, 74, 0.45);
  animation: ad-online-pulse 1.8s ease-out infinite;
}
@keyframes ad-online-pulse {
  70% { box-shadow: 0 0 0 8px rgba(10, 122, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(10, 122, 74, 0); }
}
.ad-online-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}
@media (min-width: 800px) {
  .ad-online-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ad-online-card {
  position: relative;
  overflow: hidden;
  padding: 0.9rem 1rem 0.85rem;
  border-radius: 14px;
  background: #f7f9fd;
  border: 1px solid rgba(3, 27, 78, 0.08);
}
.ad-online-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--ad-blue);
}
.ad-online-card.is-evouchers::before { background: #7c3aed; }
.ad-online-card.is-kasa::before { background: #0a7a4a; }
.ad-online-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-muted);
}
.ad-online-card strong {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--ad-display);
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ad-ink);
}
.ad-online-card.is-evouchers strong { color: #5b21b6; }
.ad-online-card.is-kasa strong { color: #0a7a4a; }
.ad-online-card em {
  display: block;
  margin-top: 0.1rem;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ad-soft);
}
.ad-online-card.is-live {
  background: #fff;
}

.ad-load {
  position: relative;
  margin: 0 0 1rem;
  padding: 1.05rem 1.05rem 0.95rem;
  overflow: hidden;
  color: #e8eeff;
  background:
    radial-gradient(900px 220px at 8% -20%, rgba(126, 166, 255, 0.35), transparent 55%),
    radial-gradient(700px 240px at 100% 0%, rgba(125, 239, 195, 0.16), transparent 50%),
    linear-gradient(160deg, #071433 0%, #102454 58%, #0b1738 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(3, 18, 56, 0.28);
}
.ad-load::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, #000, transparent 78%);
  pointer-events: none;
}
.ad-load-head, .ad-load-top, .ad-load-portals { position: relative; }
.ad-load-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.ad-load-head h2 {
  margin: 0;
  font-family: var(--ad-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: #fff;
}
.ad-load-head p {
  margin: 0.2rem 0 0;
  color: rgba(232, 238, 255, 0.62);
  font-size: 0.78rem;
  font-weight: 600;
}
.ad-load-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(125, 239, 195, 0.12);
  color: #b8ffe4;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ad-load-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3dffb0;
  box-shadow: 0 0 0 0 rgba(61, 255, 176, 0.7);
  animation: ad-online-pulse 1.6s ease-out infinite;
}
.ad-load-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}
@media (min-width: 900px) {
  .ad-load-top { grid-template-columns: 220px 220px minmax(0, 1fr); }
}
.ad-load-gauge, .ad-load-total, .ad-load-portal {
  background: rgba(5, 14, 38, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}
.ad-load-gauge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem 0.55rem 0.4rem;
}
.ad-load-gauge svg { width: 84px; height: 84px; flex-shrink: 0; }
.ad-load-track { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 7; }
.ad-load-value {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 44px 44px;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.ad-load-value.is-ram { stroke: #8eb6ff; }
.ad-load-value.is-cpu { stroke: #7defc3; }
.ad-load-gauge span, .ad-load-total span, .ad-load-portal header span {
  display: block;
  color: rgba(232, 238, 255, 0.55);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ad-load-gauge strong, .ad-load-total strong {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--ad-display);
  font-size: 1.55rem;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.03em;
}
.ad-load-gauge em, .ad-load-total em, .ad-load-portal em {
  display: block;
  margin-top: 0.25rem;
  font-style: normal;
  color: rgba(232, 238, 255, 0.62);
  font-size: 0.75rem;
  font-weight: 700;
}
.ad-load-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 108px;
  padding: 0.8rem 0.9rem;
}
.ad-load-chart { display: block; width: min(100%, 260px); height: 72px; overflow: visible; }
.ad-load-line { stroke: #fff; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.ad-load-total .ad-load-line { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4)); }
.ad-load-tip { fill: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.85)); }
.ad-load-portals {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-top: 0.7rem;
}
@media (min-width: 800px) {
  .ad-load-portals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ad-load-portal { padding: 0.75rem 0.8rem 0.65rem; }
.ad-load-portal header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.ad-load-portal header strong {
  font-family: var(--ad-display);
  font-size: 1.35rem;
  color: var(--load-color);
  letter-spacing: -0.03em;
}
.ad-load-portal .ad-load-chart { width: 100%; height: 64px; margin-top: 0.2rem; }
.ad-load-portal .ad-load-line {
  stroke: var(--load-color);
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--load-color) 75%, transparent));
}
.ad-load-portal .ad-load-tip { fill: var(--load-color); filter: drop-shadow(0 0 6px var(--load-color)); }
.ad-queue { position: relative; margin-top: 0.9rem; padding-top: 0.85rem; border-top: 1px solid rgba(255,255,255,0.08); }
.ad-queue-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: 0.7rem; }
.ad-queue-head h3 { margin: 0; font-family: var(--ad-display); font-size: 1.05rem; letter-spacing: -0.03em; }
.ad-queue-head p, .ad-queue small, .ad-queue em { color: rgba(232,238,255,0.62); }
.ad-queue-head p { margin: 0; font-size: 0.78rem; }
.ad-queue-lanes { display: grid; gap: 0.7rem; }
@media (min-width: 800px) { .ad-queue-lanes { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ad-queue article {
  padding: 0.75rem 0.85rem 0.7rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
}
.ad-queue span { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(232,238,255,0.55); }
.ad-queue strong { display: block; margin: 0.15rem 0 0.1rem; font-family: var(--ad-display); font-size: 1.7rem; letter-spacing: -0.04em; }
.ad-queue em, .ad-queue small { display: block; font-style: normal; font-size: 0.75rem; line-height: 1.35; }

/* Dashboard period toolbar — compact, no stretched form labels */
.ad-dash-period {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.85rem 1.25rem;
  background: #fff;
  border: 1px solid var(--ad-line);
  border-radius: var(--ad-radius);
  box-shadow: var(--ad-shadow);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
}
.ad-dash-period-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  min-width: 0;
}
.ad-dash-period-lead h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ad-ink);
}
.ad-dash-period-lead p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--ad-muted);
  font-weight: 600;
}
.ad-dash-period-chips {
  margin: 0;
  flex-wrap: wrap;
}
.ad-dash-period-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.55rem 0.65rem;
  margin: 0;
  margin-left: auto;
}
.ad-dash-period-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ad-ink);
  width: auto;
  flex: 0 0 auto;
}
.ad-date-pl {
  width: 10.5rem;
  max-width: 100%;
  height: 40px;
  border: 1.5px solid var(--ad-line);
  border-radius: 12px;
  padding: 0 0.65rem;
  font: inherit;
  font-weight: 600;
  color: var(--ad-ink);
  background: #fff;
  letter-spacing: 0.02em;
}
.ad-date-pl:focus {
  outline: none;
  border-color: rgba(36, 72, 198, 0.45);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.12);
}
.ad-date-pl::placeholder {
  color: var(--ad-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.ad-dash-period-form .ad-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .ad-dash-period {
    flex-direction: column;
    align-items: stretch;
  }
  .ad-dash-period-form {
    margin-left: 0;
    width: 100%;
  }
  .ad-dash-period-form label {
    flex: 1 1 calc(50% - 0.4rem);
    min-width: 8rem;
  }
  .ad-dash-period-form input[type="date"],
  .ad-dash-period-form input.ad-date-pl {
    width: 100%;
    max-width: none;
  }
}
.ad-chart-wrap {
  position: relative;
  height: 280px;
  width: 100%;
  padding: 0.35rem 0.2rem 0.15rem;
}
.ad-chart-wrap.is-empty canvas { opacity: 0.35; }
.ad-chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: var(--ad-soft);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  padding: 1rem;
}
.ad-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.25rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ad-line);
  font-size: 0.84rem;
  color: var(--ad-soft);
  font-weight: 600;
}
.ad-chart-legend strong {
  color: var(--ad-ink);
  font-family: var(--ad-display);
  font-size: 1.05rem;
  margin-right: 0.2rem;
}

/* Alerts */
.ad-alert {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.ad-alert-ok { background: #e7f7ee; color: var(--ad-ok); border: 1px solid rgba(10, 122, 74, 0.18); }
.ad-alert-err { background: #fef3f2; color: var(--ad-danger); border: 1px solid rgba(180, 35, 24, 0.18); }
.ad-alert-warn { background: #fff7ed; color: var(--ad-warn); border: 1px solid rgba(180, 83, 9, 0.18); }

/* Buttons */
.ad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 42px;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ad-btn .shop-icon { width: 16px; height: 16px; }
.ad-btn-primary {
  background: #2448c6;
  background: var(--ad-blue, #2448c6);
  color: #fff;
  border-color: transparent;
}
.ad-btn-primary:hover {
  background: #3d5fd9;
  background: var(--ad-blue-2, #3d5fd9);
  color: #fff;
}
.ad-btn-ghost {
  background: #fff;
  color: #031b4e;
  color: var(--ad-ink, #031b4e);
  border-color: rgba(3, 27, 78, 0.18);
  border-color: var(--ad-line, rgba(3, 27, 78, 0.18));
}
.ad-btn-ghost:hover {
  background: #f3f6ff;
  border-color: rgba(36, 72, 198, 0.35);
  color: #2448c6;
  color: var(--ad-blue, #2448c6);
}
.ad-btn-danger { background: var(--ad-danger, #b42318); color: #fff; }
.ad-btn-danger:hover { background: #912018; color: #fff; }

/* Modal / import: zawsze czytelne przyciski (nie „białe aż do hover”) */
.ad-modal-foot .ad-btn-primary,
#ad-modal-import .ad-btn-primary,
#ad-sku-import.ad-btn-primary {
  background: #2448c6 !important;
  background: var(--ad-blue, #2448c6) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.ad-modal-foot .ad-btn-ghost,
#ad-modal-import .ad-btn-ghost {
  background: #fff !important;
  color: #031b4e !important;
  border: 1.5px solid rgba(3, 27, 78, 0.2) !important;
}
.ad-modal-foot .ad-btn-ghost:hover,
#ad-modal-import .ad-btn-ghost:hover {
  background: #f3f6ff !important;
  color: #2448c6 !important;
  border-color: rgba(36, 72, 198, 0.4) !important;
}
.ad-btn-sm { height: 34px; padding: 0 0.85rem; font-size: 0.8rem; }
.ad-btn-block { width: 100%; }

/* Tables */
.ad-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--ad-line);
  background: #fff;
}
.ad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.ad-table th,
.ad-table td {
  padding: 0.8rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--ad-line);
  vertical-align: middle;
}
.ad-table th {
  background: #f7f9fc;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-muted);
  white-space: nowrap;
}
/* Sticky header inside scrollable table wraps (e.g. Magazyn inventory) */
.ad-table-wrap.is-sticky-head {
  position: relative;
}
.ad-table-wrap.is-sticky-head .ad-table {
  border-collapse: separate;
  border-spacing: 0;
}
.ad-table-wrap.is-sticky-head thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f0f4fb;
  box-shadow: inset 0 -1px 0 var(--ad-line);
}

/* Wysłane eKody: pasek tytułu nad tabelą; thead sticky w scrollu tabeli (bez nachodzenia na wiersze) */
.ad-sc-list-panel {
  padding-top: 0;
  overflow: visible;
}
.ad-sc-sticky-head {
  position: static;
  z-index: 1;
  margin: 0 -1.25rem 0;
  padding: 0.95rem 1.25rem 0.8rem;
  background: #fff;
  border-bottom: 1px solid var(--ad-line);
}
.ad-sc-table-wrap.is-sticky-head {
  max-height: min(70vh, 820px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 14px 14px;
}
.ad-sc-table-wrap.is-sticky-head .ad-sc-table {
  width: 100%;
  min-width: 1380px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.ad-sc-table-wrap.is-sticky-head thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f0f4fb;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  box-shadow: inset 0 -1px 0 var(--ad-line);
  white-space: nowrap;
}

/* Równa siatka: te same paddingi, linie kolumn, % szerokości */
.ad-sc-table th,
.ad-sc-table td {
  padding: 0.72rem 0.8rem;
  border-right: 1px solid #e6ecf6;
  vertical-align: middle;
  box-sizing: border-box;
  overflow: hidden;
}
.ad-sc-table th:last-child,
.ad-sc-table td:last-child {
  border-right: 0;
}
.ad-sc-table col.ad-sc-c-code { width: 11%; }
.ad-sc-table col.ad-sc-c-pin { width: 5%; }
.ad-sc-table col.ad-sc-c-sec { width: 5%; }
.ad-sc-table col.ad-sc-c-product { width: 10%; }
.ad-sc-table col.ad-sc-c-client { width: 13%; }
.ad-sc-table col.ad-sc-c-order { width: 11%; }
.ad-sc-table col.ad-sc-c-pts { width: 4.5%; }
.ad-sc-table col.ad-sc-c-email { width: 11%; }
.ad-sc-table col.ad-sc-c-exp { width: 7.5%; }
.ad-sc-table col.ad-sc-c-sold { width: 11%; }
.ad-sc-table col.ad-sc-c-actions { width: 11%; }

.ad-sc-col-pin,
.ad-sc-col-sec,
.ad-sc-col-pts {
  text-align: center;
  white-space: nowrap;
}
.ad-sc-table th.ad-sc-col-pin,
.ad-sc-table th.ad-sc-col-sec,
.ad-sc-table th.ad-sc-col-pts {
  padding-left: 0.45rem;
  padding-right: 1.1rem; /* miejsce na ↕ sort, żeby label był bliżej środka */
}
.ad-sc-col-exp,
.ad-sc-col-sold,
.ad-sc-col-email {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.ad-sc-col-product {
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ad-sc-ellip {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.ad-sc-col-client .ad-code-link,
.ad-sc-col-order .ad-code-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.ad-sc-table-wrap .ad-sc-col-code {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: none;
}
.ad-sc-table-wrap thead th.ad-sc-col-code {
  z-index: 6;
  background: #f0f4fb;
  left: 0;
}
.ad-sc-table-wrap tbody tr:hover .ad-sc-col-code {
  background: #f8faff;
}
.ad-sc-code-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
}
.ad-sc-code-short {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-sc-reveal {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ad-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ad-ink);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.ad-sc-reveal .shop-icon { width: 13px; height: 13px; }
.ad-sc-reveal:hover {
  border-color: rgba(36, 72, 198, 0.35);
  color: var(--ad-blue);
}
.ad-sc-sec {
  font-size: 0.78rem;
  max-width: 100%;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.ad-sc-table-wrap .ad-sc-col-actions,
.ad-sc-table td.ad-sc-col-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #fff;
  white-space: nowrap;
  text-align: center;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
  border-left: 1px solid #e6ecf6;
  box-shadow: none;
}
.ad-sc-table-wrap thead th.ad-sc-col-actions {
  z-index: 6;
  background: #f0f4fb;
  right: 0;
}
.ad-sc-table-wrap tbody tr:hover .ad-sc-col-actions {
  background: #f8faff;
}
.ad-sc-details-btn {
  position: relative;
  z-index: 1;
  background: #fff !important;
  isolation: isolate;
  padding: 0.32rem 0.65rem !important;
  font-size: 0.76rem !important;
  white-space: nowrap;
}
.ad-sc-table td.ad-sc-col-actions::before,
.ad-sc-table th.ad-sc-col-actions::before {
  content: none;
}

@media (max-width: 1200px) {
  .ad-sc-table-wrap.is-sticky-head .ad-sc-table {
    min-width: 1120px;
  }
}

/* Zamówienia: pasek „Lista” nad tabelą; thead sticky w scrollu tabeli (bez nachodzenia na wiersze) */
.ad-orders-list-panel {
  padding-top: 0;
  overflow: visible;
}
.ad-orders-sticky-head {
  position: static;
  z-index: 1;
  margin: 0 -1.25rem 0;
  padding: 0.95rem 1.25rem 0.8rem;
  background: #fff;
  border-bottom: 1px solid var(--ad-line);
}
.ad-orders-table-wrap.is-sticky-head {
  max-height: min(70vh, 820px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 14px 14px;
}
.ad-orders-table-wrap.is-sticky-head .ad-orders-table {
  min-width: 1380px;
  width: 100%;
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 0;
}
.ad-orders-table-wrap.is-sticky-head thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f0f4fb;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  box-shadow: inset 0 -1px 0 var(--ad-line);
  white-space: nowrap;
}
.ad-orders-table-wrap .ad-orders-col-nr {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 0 var(--ad-line);
  white-space: nowrap;
}
.ad-orders-table-wrap thead th.ad-orders-col-nr {
  z-index: 6;
  background: #f0f4fb;
  left: 0;
}
.ad-orders-table-wrap tbody tr:hover .ad-orders-col-nr {
  background: #f8faff;
}
.ad-orders-table-wrap tbody tr.is-selected .ad-orders-col-nr {
  background: #eef3ff;
}
.ad-orders-table-wrap .ad-orders-col-money,
.ad-orders-table-wrap .ad-orders-col-date {
  white-space: nowrap;
}
.ad-orders-table-wrap .ad-od-pts {
  text-align: center;
  white-space: nowrap;
}
.ad-orders-table-wrap .ad-orders-col-status {
  min-width: 9.75rem;
  vertical-align: middle;
}
.ad-orders-table-wrap .ad-orders-col-pay-method {
  max-width: 8.5rem;
}
.ad-orders-table-wrap .ad-orders-col-client {
  min-width: 11rem;
  max-width: 16rem;
}
.ad-orders-table-wrap .ad-order-pay-select,
.ad-orders-table-wrap .ad-order-sent-select {
  min-width: 9.1rem;
  max-width: 10.5rem;
}
.ad-table tr:last-child td { border-bottom: 0; }
.ad-table tr:hover td { background: #f8faff; }
.ad-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  background: #f0f3fa;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}
.ad-table a {
  color: var(--ad-blue);
  font-weight: 700;
  text-decoration: none;
}
.ad-table a:hover { text-decoration: underline; }
.ad-table a.ad-btn,
.ad-table a.ad-btn:hover {
  text-decoration: none !important;
}
.ad-table a.ad-btn-primary {
  color: #fff !important;
  background: var(--ad-blue);
}
.ad-table a.ad-btn-primary:hover {
  color: #fff !important;
  background: var(--ad-blue-2);
}
.ad-table a.ad-btn-ghost {
  color: var(--ad-ink) !important;
}
.ad-table a.ad-btn-danger {
  color: #fff !important;
}
.ad-table .muted { color: var(--ad-muted); font-size: 0.8rem; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-paid { background: #e7f7ee; color: var(--ad-ok); }
.badge-pending { background: #fff7ed; color: var(--ad-warn); }
.badge-cancelled,
.badge-void { background: #fef3f2; color: var(--ad-danger); }
.badge-available { background: #e8eefc; color: var(--ad-blue); }
.badge-assigned { background: #f3e8ff; color: #7c3aed; }
.badge-sold { background: #e7f7ee; color: var(--ad-ok); }
.badge-soft { background: #eef1f8; color: var(--ad-soft); }

/* Forms */
.ad-form { display: flex; flex-direction: column; gap: 0.9rem; }
.ad-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ad-ink);
}
.ad-form .ad-check {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}
.ad-form input,
.ad-form select,
.ad-form textarea {
  height: 44px;
  border: 1.5px solid var(--ad-line);
  border-radius: 12px;
  padding: 0 0.85rem;
  font: inherit;
  font-weight: 600;
  color: var(--ad-ink);
  background: #fff;
}
.ad-form textarea { height: auto; padding: 0.75rem 0.85rem; resize: vertical; }
.ad-form input:focus,
.ad-form select:focus,
.ad-form textarea:focus {
  outline: none;
  border-color: var(--ad-blue);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.14);
}
.ad-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .ad-form-row-2 { grid-template-columns: 1fr 1fr; }
  .ad-form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
  .ad-form-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.ad-form-row-equal {
  align-items: stretch;
}
.ad-form-row-equal > label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  min-height: 100%;
}
.ad-form-row-equal > label > input,
.ad-form-row-equal > label > select {
  margin-top: auto;
  width: 100%;
}
.ad-form-section {
  margin: 0.35rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ad-line);
}
.ad-form-section h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

/* Filters */
.ad-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 1rem;
}
.ad-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ad-muted);
}
.ad-filters input,
.ad-filters select {
  height: 40px;
  border: 1.5px solid var(--ad-line);
  border-radius: 12px;
  padding: 0 0.75rem;
  font: inherit;
  font-weight: 600;
  background: #fff;
  min-width: 140px;
}
.ad-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.ad-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--ad-line);
  background: #fff;
  color: var(--ad-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}
.ad-chip.is-active {
  background: var(--ad-blue);
  border-color: var(--ad-blue);
  color: #fff;
}

/* Orders filter panel — channel / status / payment */
.ad-ord-filters {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  padding: 1rem 1.1rem;
}
.ad-ord-filter-row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.65rem 1rem;
  align-items: start;
}
.ad-ord-filter-row + .ad-ord-filter-row {
  padding-top: 0.85rem;
  border-top: 1px solid var(--ad-line);
}
.ad-ord-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.1rem;
  color: var(--ad-muted, #64748b);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-ord-filter-label .shop-icon {
  width: 15px;
  height: 15px;
  opacity: 0.7;
  flex-shrink: 0;
}
.ad-ord-filter-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ad-ord-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.75rem 0.3rem 0.85rem;
  border: 1px solid var(--ad-line);
  border-radius: 10px;
  background: #fff;
  color: var(--ad-ink, #0f172a);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ad-ord-pill strong {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}
.ad-ord-pill em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 1.5rem;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--ad-muted, #64748b);
  text-align: center;
}
.ad-ord-pill:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}
.ad-ord-pill.is-empty {
  opacity: 0.55;
}
.ad-ord-pill.is-active {
  border-color: var(--ad-blue);
  background: color-mix(in srgb, var(--ad-blue) 10%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ad-blue) 25%, transparent);
  color: var(--ad-blue);
}
.ad-ord-pill.is-active em {
  background: var(--ad-blue);
  color: #fff;
}
.ad-ord-pill.is-warn.is-active {
  border-color: #d97706;
  background: #fffbeb;
  color: #b45309;
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.2);
}
.ad-ord-pill.is-ok.is-active {
  border-color: #059669;
  background: #ecfdf5;
  color: #047857;
  box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.2);
}
.ad-ord-pill.is-void.is-active {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #475569;
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.2);
}
@media (max-width: 720px) {
  .ad-ord-filter-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .ad-ord-filter-opts {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }
  .ad-ord-filter-opts::-webkit-scrollbar { display: none; }
  .ad-ord-pill { flex: 0 0 auto; }
}

/* Stock matrix */
.ad-matrix {
  max-height: min(62vh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 14px 14px;
  border: 1px solid var(--ad-line);
  border-top: 1px solid var(--ad-line);
  background: #fff;
}
.ad-matrix table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
  font-size: 0.82rem;
}
.ad-matrix th,
.ad-matrix td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--ad-line);
  text-align: center;
  background: #fff;
}
.ad-matrix th:first-child,
.ad-matrix td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  min-width: 150px;
  padding-left: 0.9rem;
  font-weight: 700;
  box-shadow: 1px 0 0 var(--ad-line);
}
.ad-matrix tbody tr:hover td {
  background: #f8faff;
}
.ad-matrix tbody tr:hover td:first-child {
  background: #f8faff;
}
.ad-matrix thead th {
  background: #f0f4fb;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: inset 0 -1px 0 var(--ad-line);
}
.ad-matrix thead th:first-child {
  z-index: 4;
  left: 0;
  background: #f0f4fb;
  box-shadow: 1px 0 0 var(--ad-line), inset 0 -1px 0 var(--ad-line);
}
.ad-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
  padding: 0.35rem 0.4rem;
  border-radius: 10px;
  font-weight: 800;
  line-height: 1.15;
}
.ad-matrix td.is-empty { background: rgba(180, 35, 24, 0.08); }
.ad-matrix td.is-low { background: rgba(180, 83, 9, 0.1); }
.ad-matrix td.is-ok { background: rgba(10, 122, 74, 0.07); }
.ad-matrix td.is-api { background: rgba(10, 122, 74, 0.12); }
.ad-matrix td.is-api .ad-matrix-btn { color: var(--ad-ok); font-weight: 800; }
.ad-matrix-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: 54px;
  min-height: 44px;
  margin: 0;
  padding: 0.4rem 0.45rem;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-weight: 800;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.ad-matrix-btn small {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ad-matrix-btn:hover {
  border-color: rgba(36, 72, 198, 0.35);
  background: rgba(36, 72, 198, 0.08);
  transform: translateY(-1px);
}
.ad-matrix td.is-empty .ad-matrix-btn { color: var(--ad-danger); }
.ad-matrix td.is-low .ad-matrix-btn { color: var(--ad-warn); }
.ad-matrix td.is-ok .ad-matrix-btn { color: var(--ad-ok); }
.ad-matrix-product {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--ad-blue);
  cursor: pointer;
  text-align: left;
}
.ad-matrix-product:hover { text-decoration: underline; }
.ad-stock-inv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin: 0 1.1rem 0.85rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--ad-line);
  border-radius: 14px;
  background: linear-gradient(180deg, #f7f9fd, #fff);
}
.ad-stock-inv-partner {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ad-stock-inv-partner select {
  height: 42px;
  min-width: 14rem;
  max-width: 22rem;
  border: 1.5px solid var(--ad-line);
  border-radius: 12px;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ad-ink);
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
}
.ad-stock-inv-partner-hint {
  font-size: 0.78rem;
  font-weight: 600;
  align-self: center;
}
@media (max-width: 720px) {
  .ad-stock-inv-toolbar {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }
  .ad-stock-inv-partner,
  .ad-stock-inv-partner select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}
.ad-stock-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ad-soft);
}
.ad-stock-jump {
  position: sticky;
  top: 0.65rem;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--ad-line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ad-stock-jump a {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ad-muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.ad-stock-jump a:hover {
  color: var(--ad-ink);
  background: rgba(15, 23, 42, 0.05);
}
.ad-stock-jump a.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--ad-blue, #1d4ed8) 0%, var(--ad-blue-2, #1e3a8a) 100%);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--ad-blue, #1d4ed8) 22%, transparent);
}

/* Dostawcy */
.ad-sup-tabs.ad-stock-jump a {
  gap: 0.45rem;
}
.ad-sup-tabs .ad-sup-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.42rem;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  background: rgba(15, 23, 42, 0.1);
  color: var(--ad-ink);
}
.ad-sup-tabs a.is-active .ad-sup-count {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.ad-sup-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}
.ad-sup-filter-grid {
  grid-template-columns: 1fr !important;
}
@media (min-width: 900px) {
  .ad-sup-filter-grid {
    grid-template-columns: minmax(12rem, 1.5fr) repeat(4, minmax(0, 1fr)) !important;
  }
  .ad-sup-filter-grid .ad-stock-filter-search {
    grid-column: 1 / -1;
  }
  .ad-sup-filter-grid .ad-stock-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}
.ad-sup-table-wrap {
  padding: 0;
  overflow: auto;
}
.ad-sup-sort-link {
  color: inherit;
  text-decoration: none;
}
.ad-sup-sort-link:hover {
  color: var(--ad-blue);
}
.ad-sup-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(15, 23, 42, 0.06);
  color: var(--ad-ink);
}
.ad-sup-badge-amilon {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}
.ad-sup-badge-allegro {
  background: rgba(255, 90, 0, 0.12);
  color: #c2410c;
}
.ad-sup-badge-decathlon {
  background: rgba(0, 130, 195, 0.12);
  color: #0369a1;
}
.ad-sup-code {
  font-size: 0.82rem;
  word-break: break-all;
}
.ad-sup-sub,
.ad-sup-req {
  font-size: 0.75rem;
  margin-top: 0.15rem;
}
.ad-sup-req {
  display: inline-block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.ad-sup-channel {
  font-size: 0.86rem;
  font-weight: 650;
}
.ad-sup-empty {
  padding: 1.5rem 1.25rem !important;
  text-align: center;
}
.ad-sup-detail {
  display: grid;
  gap: 1.15rem;
}
.ad-sup-detail-block h3 {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ad-muted);
}
.ad-sup-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--ad-line);
}
@media (min-width: 720px) {
  .ad-sup-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.ad-sup-detail-grid > div {
  min-width: 0;
}
.ad-sup-detail-grid dt {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-muted);
}
.ad-sup-detail-grid dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ad-ink);
  word-break: break-word;
}
.ad-sup-detail-wide {
  grid-column: 1 / -1;
}
.ad-sup-detail-payload {
  display: block;
  max-height: 4.5rem;
  overflow: auto;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-all;
}

#ad-stock-overview,
#ad-stock-filters,
#ad-stock-products,
#ad-stock-inventory,
#ad-stock-actions,
#ad-stock-availability {
  scroll-margin-top: 4.25rem;
}
@media (max-width: 720px) {
  .ad-stock-jump {
    border-radius: 16px;
    top: 0.4rem;
    gap: 0.25rem;
  }
  .ad-stock-jump a {
    padding: 0.38rem 0.7rem;
    font-size: 0.74rem;
  }
}
.ad-stock-snap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 0 1.1rem 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--ad-line);
  border-radius: 14px;
  background: linear-gradient(180deg, #f7f9fd, #fff);
}
.ad-stock-snap-copy {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.ad-stock-snap-copy strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ad-ink);
}
.ad-stock-snap-copy span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ad-soft);
  line-height: 1.35;
}
.ad-stock-snap-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ad-stock-snap-field input,
.ad-stock-snap-field select {
  height: 42px;
  min-width: 9.5rem;
  border: 1.5px solid var(--ad-line);
  border-radius: 12px;
  padding: 0 0.75rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ad-ink);
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
}
.ad-stock-snap-field select {
  min-width: 12rem;
  max-width: 18rem;
}
.ad-stock-snap .ad-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 720px) {
  .ad-stock-snap {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }
  .ad-stock-snap-field,
  .ad-stock-snap-field input,
  .ad-stock-snap-field select,
  .ad-stock-snap .ad-btn {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}
.ad-stock-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ad-stock-dot {
  width: 10px;
  height: 10px;
  border-radius: 4px;
}
.ad-stock-dot.is-ok { background: rgba(10, 122, 74, 0.55); }
.ad-stock-dot.is-low { background: rgba(180, 83, 9, 0.65); }
.ad-stock-dot.is-empty { background: rgba(180, 35, 24, 0.65); }
.ad-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.ad-filter-bar input[type="search"] {
  flex: 1;
  min-width: 180px;
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--ad-line);
  padding: 0 0.9rem;
  font: inherit;
}
.ad-stock-filters {
  margin-bottom: 1rem;
}
.ad-stock-filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  padding: 0 1.1rem 1.1rem;
  align-items: end;
}
@media (min-width: 900px) {
  .ad-stock-filter-grid {
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)) auto;
  }
}
@media (min-width: 720px) and (max-width: 899px) {
  .ad-stock-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ad-stock-filter-search { grid-column: 1 / -1; }
  .ad-stock-filter-actions { grid-column: 1 / -1; }
}
.ad-stock-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ad-stock-filter-grid input,
.ad-stock-filter-grid select {
  height: 44px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1.5px solid var(--ad-line);
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ad-ink);
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
}
.ad-stock-filter-grid input:focus,
.ad-stock-filter-grid select:focus {
  outline: none;
  border-color: rgba(36, 72, 198, 0.45);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.12);
}
.ad-stock-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  min-height: 44px;
}
.ad-stock-filter-actions .ad-btn {
  height: 44px;
  box-sizing: border-box;
}
.ad-stock-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1.1rem 1rem;
}
.ad-sku-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: #eef3ff;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ad-blue);
}
.ad-code-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ad-blue);
  cursor: pointer;
  text-align: left;
}
.ad-code-link:hover code { text-decoration: underline; }
.ad-code-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef3ff 0%, #f7f9fc 100%);
  border: 1px solid rgba(36, 72, 198, 0.14);
}
.ad-code-hero code {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ad-ink);
  word-break: break-all;
}
a.ad-stat {
  transition: transform 0.12s, box-shadow 0.12s;
}
a.ad-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(3, 27, 78, 0.08);
}
.ad-cell small {
  font-size: 0.65rem;
  font-weight: 700;
  opacity: 0.75;
}
.ad-cell-ok { background: #e7f7ee; color: var(--ad-ok); }
.ad-cell-low { background: #fff7ed; color: var(--ad-warn); }
.ad-cell-empty { background: #fef3f2; color: var(--ad-danger); }

/* Login — high-contrast shell (isolated from shop.css) */
.ad-login-page {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--ad-font);
  color: var(--ad-ink);
  background: #eef2fb;
  -webkit-font-smoothing: antialiased;
}
.ad-auth {
  min-height: 100dvh;
  display: grid;
}
@media (min-width: 980px) {
  .ad-auth {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}

.ad-auth-stage {
  position: relative;
  overflow: hidden;
  color: #fff !important;
  background:
    radial-gradient(90% 70% at 12% 18%, rgba(120, 158, 255, 0.35), transparent 55%),
    radial-gradient(70% 60% at 88% 88%, rgba(9, 30, 90, 0.55), transparent 50%),
    linear-gradient(152deg, #021433 0%, #0c2a72 42%, var(--ad-blue) 100%);
  padding: 1.5rem 1.25rem 1.6rem;
  display: flex;
  flex-direction: column;
}
@media (min-width: 980px) {
  .ad-auth-stage {
    min-height: 100dvh;
    padding: 2rem 2.75rem;
  }
}
.ad-auth-stage,
.ad-auth-stage h1,
.ad-auth-stage h2,
.ad-auth-stage p,
.ad-auth-stage span,
.ad-auth-stage li,
.ad-auth-stage strong {
  color: #fff !important;
}
.ad-auth-stage .shop-icon,
.ad-auth-stage svg {
  color: #fff !important;
  stroke: currentColor;
}
.ad-auth-glow {
  position: absolute;
  inset: -20% -10% auto auto;
  width: min(70vw, 640px);
  height: min(70vw, 640px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 68%);
  pointer-events: none;
  animation: ad-auth-glow 9s ease-in-out infinite alternate;
}
.ad-auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
  pointer-events: none;
  opacity: 0.7;
}
@keyframes ad-auth-glow {
  from { transform: translate(0, 0) scale(1); opacity: 0.85; }
  to { transform: translate(-6%, 8%) scale(1.08); opacity: 1; }
}
.ad-auth-inner {
  position: relative;
  z-index: 1;
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  justify-content: center;
}
@media (min-width: 980px) {
  .ad-auth-inner { margin: 0; }
}

.ad-auth-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--ad-display);
  font-size: clamp(1.55rem, 3.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff !important;
}
.ad-auth-brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: contain;
  display: block;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.ad-auth-eyebrow {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72) !important;
}
.ad-auth-title {
  font-family: var(--ad-display);
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  line-height: 0.98;
  margin: 0;
  letter-spacing: -0.045em;
  max-width: 12ch;
  color: #fff !important;
}
.ad-auth-lead {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88) !important;
  max-width: 36ch;
}
.ad-auth-trust {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.ad-auth-trust li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.92) !important;
}
.ad-auth-trust .shop-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.95;
}
@media (max-width: 979px) {
  .ad-auth-trust { display: none; }
  .ad-auth-title { max-width: none; font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .ad-auth-lead { max-width: none; font-size: 0.95rem; }
  .ad-auth-stage { padding-bottom: 1.35rem; }
}

.ad-auth-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.35rem 1.15rem 2rem;
  background: #eef2fb;
  color: var(--ad-ink);
}
@media (min-width: 980px) {
  .ad-auth-main { padding: 2rem 2.5rem; }
}

.ad-auth-card {
  width: 100%;
  max-width: min(460px, 100%);
  margin: 0 auto;
  background: #fff !important;
  border-radius: 24px;
  border: 1px solid rgba(3, 27, 78, 0.08);
  box-shadow: 0 18px 48px rgba(3, 27, 78, 0.1);
  padding: 1.6rem 1.2rem 1.75rem;
  color: var(--ad-ink);
  animation: ad-auth-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (min-width: 640px) {
  .ad-auth-card { padding: 2rem 1.9rem 2.15rem; }
}
@keyframes ad-auth-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.ad-auth-card-top { margin-bottom: 1.15rem; }
.ad-auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(36, 72, 198, 0.1);
  color: var(--ad-blue) !important;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-auth-badge .shop-icon,
.ad-auth-badge svg {
  width: 15px;
  height: 15px;
  color: var(--ad-blue) !important;
}
.ad-auth-card-top h2 {
  font-family: var(--ad-display);
  font-size: clamp(1.7rem, 3.2vw, 2.1rem);
  margin: 0 0 0.3rem;
  color: var(--ad-ink) !important;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.ad-auth-card-top p {
  margin: 0;
  color: var(--ad-soft) !important;
  font-size: 0.94rem;
}

.ad-auth-card .ad-alert { margin-bottom: 1rem; }

.ad-auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}
.ad-auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}
.ad-auth-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ad-ink) !important;
}
.ad-auth-control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 52px;
  padding: 0 0.9rem;
  border: 1.5px solid rgba(3, 27, 78, 0.12);
  border-radius: 14px;
  background: #f5f7fc;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.ad-auth-control:focus-within {
  background: #fff;
  border-color: var(--ad-blue);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.14);
}
.ad-auth-control .shop-icon {
  width: 18px;
  height: 18px;
  color: var(--ad-blue) !important;
  flex-shrink: 0;
}
.ad-auth-control input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ad-ink) !important;
  outline: none;
  padding: 0;
}
.ad-auth-control input::placeholder { color: #9aa3b8; }
.ad-auth-eye {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: -0.3rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ad-muted);
  cursor: pointer;
}
.ad-auth-eye:hover {
  color: var(--ad-blue);
  background: rgba(36, 72, 198, 0.1);
}
.ad-auth-eye .shop-icon { width: 18px; height: 18px; color: inherit; opacity: 1; }
.ad-auth-submit {
  margin-top: 0.25rem;
  min-height: 52px;
  border-radius: 14px;
  font-size: 1rem;
  box-shadow: none;
}
.ad-auth-submit:hover {
  box-shadow: 0 10px 24px rgba(36, 72, 198, 0.25);
}

@media (prefers-reduced-motion: reduce) {
  .ad-auth-glow,
  .ad-auth-card { animation: none !important; }
}

/* Misc */
.ad-split {
  display: grid;
  gap: 1rem;
}
@media (min-width: 980px) {
  .ad-split-form { grid-template-columns: 1.15fr 0.85fr; align-items: start; }
}
.ad-meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.ad-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--ad-line);
}
.ad-meta-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.ad-meta-list span { color: var(--ad-muted); font-weight: 600; }
.ad-meta-list strong { color: var(--ad-ink); text-align: right; }
.ad-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ad-muted);
  font-weight: 600;
}
.ad-product-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.ad-product-row img {
  width: 64px;
  height: 64px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  border: 1px solid var(--ad-line, #e6ebf5);
  flex-shrink: 0;
}
.ad-product-open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.ad-product-open:hover strong { color: var(--ad-blue); text-decoration: underline; }
.ad-product-hero {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 0.85rem;
  border-radius: 16px;
  background: linear-gradient(145deg, #eef3ff 0%, #f8fafc 70%);
  border: 1px solid rgba(36, 72, 198, 0.12);
}
.ad-product-hero img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--ad-line);
}
.ad-product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.ad-feat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ad-feat-chip {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #eef1f8;
  color: var(--ad-soft);
}
.ad-feat-chip.is-on {
  background: #e7f7ee;
  color: var(--ad-ok);
}
.ad-product-preview-thumb {
  margin: -0.25rem 0 0.35rem;
}
.ad-product-preview-thumb img {
  max-width: 120px;
  max-height: 80px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--ad-line);
  background: #fff;
  padding: 0.35rem;
}
.ad-upload {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}
.ad-upload-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ad-soft);
}
.ad-upload-zone {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1.5px dashed rgba(36, 72, 198, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(120px 60px at 12% 20%, rgba(36, 72, 198, 0.08), transparent 70%),
    #f7f9fd;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.ad-upload-zone:hover,
.ad-upload-zone:focus-visible {
  border-color: rgba(36, 72, 198, 0.55);
  background: #eef3ff;
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.1);
  outline: none;
}
.ad-upload-zone.is-drag {
  border-color: var(--ad-blue);
  background: #e8eefc;
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.16);
}
.ad-upload-zone.has-file {
  border-style: solid;
  border-color: rgba(3, 27, 78, 0.1);
  background: #fff;
}
.ad-upload-preview,
.ad-upload-empty {
  display: grid;
  place-items: center;
  width: 112px;
  height: 64px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(3, 27, 78, 0.08);
  overflow: hidden;
}
.ad-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}
.ad-upload-empty {
  background: rgba(36, 72, 198, 0.06);
  border-style: dashed;
  color: var(--ad-blue);
}
.ad-upload-ico .shop-icon,
.ad-upload-empty .shop-icon {
  width: 22px;
  height: 22px;
}
.ad-upload-empty strong,
.ad-upload-meta strong {
  display: block;
  font-size: 0.92rem;
  color: var(--ad-ink);
  font-weight: 700;
}
.ad-upload-empty {
  grid-template-columns: 1fr;
  gap: 0.15rem;
  padding: 0.35rem;
}
.ad-upload-empty .ad-upload-ico {
  display: none;
}
.ad-upload-zone:not(.has-file) {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  min-height: 112px;
  padding: 1.15rem 1rem;
}
.ad-upload-zone:not(.has-file) .ad-upload-empty {
  width: auto;
  height: auto;
  border: 0;
  background: transparent;
  gap: 0.35rem;
}
.ad-upload-zone:not(.has-file) .ad-upload-empty .ad-upload-ico {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 0.15rem;
  border-radius: 12px;
  background: rgba(36, 72, 198, 0.1);
}
.ad-upload-empty em,
.ad-upload-meta em {
  display: block;
  font-style: normal;
  font-size: 0.78rem;
  color: var(--ad-soft);
  font-weight: 600;
  line-height: 1.35;
}
.ad-upload-meta {
  min-width: 0;
}
.ad-upload-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .ad-upload-zone.has-file {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .ad-upload-preview {
    width: 100%;
    height: 88px;
  }
}
.ad-switch {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0.65rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ad-line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  user-select: none;
}
.ad-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.ad-switch-ui {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 26px;
  margin-top: 0.1rem;
  border-radius: 999px;
  background: #c5cddc;
  transition: background 0.18s ease;
}
.ad-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(3, 27, 78, 0.2);
  transition: transform 0.18s ease;
}
.ad-switch input:checked + .ad-switch-ui {
  background: var(--ad-blue);
}
.ad-switch input:checked + .ad-switch-ui::after {
  transform: translateX(18px);
}
.ad-switch input:focus-visible + .ad-switch-ui {
  outline: 2px solid rgba(36, 72, 198, 0.45);
  outline-offset: 2px;
}
.ad-switch-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.ad-switch-copy strong {
  font-size: 0.92rem;
  color: var(--ad-ink);
}
.ad-switch-copy em {
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ad-soft);
  line-height: 1.35;
}
.ad-denom-toggles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.55rem;
  margin-top: 0.55rem;
}
.ad-denom-toggles .ad-switch {
  margin: 0;
}
.ad-denom-toggles .ad-switch:not(:has(input:checked)) {
  background: #f7f8fb;
  opacity: 0.92;
}
@media (max-width: 640px) {
  .ad-product-hero { grid-template-columns: 1fr; }
  .ad-product-hero img { width: 88px; height: 88px; }
}
.ad-order-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.ad-order-customer {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #eef3ff 0%, #f8fafc 70%);
  border: 1px solid rgba(36, 72, 198, 0.12);
}
@media (max-width: 720px) {
  .ad-order-top { grid-template-columns: 1fr; }
}
.ad-user-hero {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.ad-user-actions-card {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #eef3ff 0%, #f8fafc 70%);
  border: 1px solid rgba(36, 72, 198, 0.12);
}
@media (max-width: 720px) {
  .ad-user-hero { grid-template-columns: 1fr; }
}
.ad-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.25rem;
  border-radius: 12px;
  background: #f3f6ff;
}
.ad-tab {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--ad-soft);
  cursor: pointer;
}
.ad-tab.is-active {
  background: #fff;
  color: var(--ad-blue);
  box-shadow: 0 1px 4px rgba(3, 27, 78, 0.08);
}
.ad-rank {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ad-rank-standard { background: #eef1f8; color: var(--ad-soft); }
.ad-rank-silver { background: #e8eef5; color: #475569; }
.ad-rank-gold { background: #fff7ed; color: #b45309; }
.ad-rank-platinum { background: #eef2ff; color: #4338ca; }
.ad-rank-vip { background: #fef3f2; color: #b42318; }
.ad-settings-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ad-settings-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 1.5px solid var(--ad-line);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.ad-settings-row:hover {
  border-color: rgba(36, 72, 198, 0.35);
  background: #f7f9ff;
  transform: translateY(-1px);
}
.ad-settings-row > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eef3ff;
  color: var(--ad-blue);
}
.ad-settings-row .shop-icon { width: 18px; height: 18px; }
.ad-settings-row strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ad-ink);
}
.ad-settings-row small {
  display: block;
  margin-top: 0.15rem;
  color: var(--ad-muted);
  font-size: 0.78rem;
}
.ad-settings-row em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ad-blue);
}
.ad-settings {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.ad-settings .ad-quick { margin-bottom: 0; }
.ad-settings-stat-v {
  font-size: 1.25rem !important;
  word-break: normal;
}
.ad-settings-url-hint {
  display: inline-block;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.ad-settings-mono {
  font-size: 0.75rem !important;
  word-break: break-all;
  font-weight: 700 !important;
  line-height: 1.35;
}
.ad-settings-overview { margin: 0; }
.ad-settings-actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
@media (min-width: 720px) {
  .ad-settings .ad-grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .ad-stats.ad-stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ad-settings-actions .ad-btn {
    flex: 1 1 calc(50% - 0.4rem);
    justify-content: center;
    min-height: 40px;
  }
}
.ad-payload {
  margin: 0.55rem 0 0;
  padding: 0.9rem 1rem;
  max-height: min(42vh, 420px);
  overflow: auto;
  border-radius: 14px;
  background: #0b1220;
  color: #e8eefc;
  font-size: 0.75rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ad-table tr.is-selected td {
  background: rgba(36, 72, 198, 0.06);
}
.ad-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Pager */
.ad-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--ad-line);
}
.ad-pager-meta {
  font-size: 0.84rem;
  color: var(--ad-soft);
  font-weight: 600;
}
.ad-pager-sizes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--ad-muted);
  font-weight: 700;
}
.ad-pager-sizes .ad-chip {
  height: 34px;
  min-width: 44px;
  justify-content: center;
  padding: 0 0.75rem;
  font-weight: 800;
}
.ad-pager-sizes .ad-chip.is-active {
  background: var(--ad-blue);
  border-color: var(--ad-blue);
  color: #fff;
  box-shadow: 0 6px 14px rgba(36, 72, 198, 0.22);
}
.ad-pager-per-now {
  color: var(--ad-muted);
  font-weight: 700;
}
.ad-pager-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ad-table tr.is-selected td {
  background: rgba(36, 72, 198, 0.08);
}

.ad-pager-page {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ad-ink);
}

/* ——— Modals ——— */
body.ad-modal-open { overflow: hidden; }

.ad-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.ad-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.ad-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 27, 78, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ad-modal-sheet {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(90dvh, 920px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(3, 27, 78, 0.28);
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.ad-modal.is-open .ad-modal-sheet { transform: none; }
.ad-modal-sheet.is-lg { width: min(720px, 100%); }
.ad-modal-sheet.is-sm { width: min(420px, 100%); }
.ad-modal-sheet.is-xl { width: min(960px, 100%); }
.ad-modal-sheet.is-danger .ad-modal-head {
  background: linear-gradient(155deg, #4a1210 0%, #8b1e18 55%, #b42318 120%);
}

.ad-modal-head {
  padding: 1.25rem 1.35rem 1.1rem;
  background:
    radial-gradient(320px 140px at 100% 0%, rgba(61, 95, 217, 0.35), transparent 60%),
    linear-gradient(155deg, #031b4e 0%, #15358a 55%, var(--ad-blue) 120%);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.ad-modal-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--ad-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.ad-modal-head p {
  margin: 0;
  font-size: 0.86rem;
  opacity: 0.82;
  line-height: 1.4;
  max-width: 42ch;
}
.ad-modal-x {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.ad-modal-x:hover { background: rgba(255, 255, 255, 0.28); }
.ad-modal-x .shop-icon { width: 18px; height: 18px; }

.ad-modal-body {
  padding: 1.25rem 1.35rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.ad-modal-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.95rem 1.35rem 1.15rem;
  border-top: 1px solid var(--ad-line);
  background: #f7f9fd;
}
/* flex nadpisuje natywny [hidden] — alt tylko przy imporcie kodów */
.ad-modal-foot [data-ad-confirm-alt][hidden] {
  display: none !important;
}

.ad-modal-body .ad-form { gap: 0.85rem; }
.ad-modal-body .ad-form > label { margin: 0; }
.ad-modal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(36, 72, 198, 0.1);
  color: var(--ad-blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ad-modal-note {
  margin: 0.85rem 0 0;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: #eef3ff;
  color: var(--ad-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}
.ad-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: stretch;
}
.ad-quick-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  padding: 1rem 1.05rem;
  min-height: 108px;
  height: 100%;
  border-radius: 16px;
  border: 1px solid var(--ad-line);
  background: #fff;
  box-shadow: var(--ad-shadow);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.ad-quick-card:hover {
  border-color: rgba(36, 72, 198, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(3, 27, 78, 0.1);
}
.ad-quick-card .shop-icon {
  width: 22px;
  height: 22px;
  color: var(--ad-blue);
}
.ad-quick-card strong {
  font-size: 0.95rem;
  color: var(--ad-ink);
}
.ad-quick-card span {
  font-size: 0.8rem;
  color: var(--ad-muted);
  line-height: 1.35;
  margin-top: auto;
}

@media (max-width: 720px) {
  .ad-modal {
    align-items: flex-end;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .ad-modal-sheet,
  .ad-modal-sheet.is-lg,
  .ad-modal-sheet.is-sm,
  .ad-modal-sheet.is-xl {
    width: 100%;
    max-width: 100vw;
    max-height: min(94dvh, 94vh);
    border-radius: 20px 20px 0 0;
  }
  .ad-modal-sheet.is-xl {
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }
  .ad-modal-head {
    padding: 1rem 1.05rem 0.9rem;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .ad-modal-head h2 { font-size: 1.1rem; }
  .ad-modal-body { padding: 1rem 1.05rem; }
  .ad-modal-foot {
    padding: 0.85rem 1.05rem calc(0.95rem + env(safe-area-inset-bottom, 0));
    position: sticky;
    bottom: 0;
    z-index: 2;
  }
  .ad-modal-foot .ad-btn {
    flex: 1 1 auto;
    min-height: 44px;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  .ad-nav-toggle { display: grid; }
  .ad-sidebar-x {
    display: grid;
    margin-right: 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    border-color: transparent;
    color: #fff;
  }
  .ad-nav-overlay {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.ad-nav-open .ad-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  body.ad-nav-open { overflow: hidden; }

  .ad-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    height: 100dvh;
    z-index: 150;
    transform: translateX(-105%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 12px 0 40px rgba(3, 27, 78, 0.25);
  }
  body.ad-nav-open .ad-sidebar {
    transform: translateX(0);
  }
  .ad-nav a,
  .ad-side-foot a {
    min-height: 44px;
  }
  .ad-main {
    padding: 0.85rem 0.85rem calc(2.5rem + env(safe-area-inset-bottom, 0));
  }
  .ad-top {
    position: sticky;
    top: 0;
    z-index: 50;
    margin: -0.85rem -0.85rem 1rem;
    padding: 0.75rem 0.85rem;
    background: rgba(238, 241, 248, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ad-line);
  }
  .ad-top h1 { font-size: 1.28rem; }
  .ad-top-sub { font-size: 0.82rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ad-eyebrow { font-size: 0.66rem; }
  .ad-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .ad-stat .v { font-size: 1.35rem; }
  .ad-quick {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }
  .ad-quick-card { padding: 0.85rem 0.9rem; min-height: 88px; }
  .ad-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .ad-filters label,
  .ad-filters input,
  .ad-filters select {
    width: 100%;
    min-width: 0;
  }
  .ad-filters .ad-btn { width: 100%; min-height: 44px; justify-content: center; }
  .ad-panel { padding: 0.95rem; border-radius: 16px; }
  .ad-chips { gap: 0.35rem; }
  .ad-chip { min-height: 40px; }

  /* Card-style tables on phones */
  .ad-table-wrap { overflow: visible; border: 0; }
  .ad-table.ad-table-cards { min-width: 0; }
  .ad-table.ad-table-cards thead { display: none; }
  .ad-table.ad-table-cards tbody tr {
    display: block;
    margin-bottom: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--ad-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(3, 27, 78, 0.04);
  }
  .ad-table.ad-table-cards tbody tr.is-selected {
    border-color: rgba(36, 72, 198, 0.45);
    box-shadow: 0 0 0 2px rgba(36, 72, 198, 0.12);
  }
  .ad-table.ad-table-cards tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border: 0;
    text-align: right;
  }
  .ad-table.ad-table-cards tbody td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ad-muted);
    padding-top: 0.15rem;
  }
  .ad-table.ad-table-cards tbody td:first-child {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding-bottom: 0.65rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--ad-line);
  }
  .ad-table.ad-table-cards tbody td:first-child::before { display: none; }
  .ad-table.ad-table-cards tbody td:last-child {
    padding-top: 0.65rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--ad-line);
    justify-content: flex-end;
  }
  .ad-table.ad-table-cards tbody td:last-child::before { display: none; }
  .ad-btn-sm { min-height: 40px; }

  .ad-pager {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .ad-pager-nav { justify-content: space-between; }
  .ad-pager-nav .ad-btn { flex: 1; min-height: 44px; justify-content: center; }

  .ad-matrix { margin: 0 -0.25rem; }
  .ad-user-actions-card .ad-btn { min-height: 44px; justify-content: center; }
  .ad-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ad-tabs::-webkit-scrollbar { display: none; }
  .ad-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 40px;
  }
  .ad-crm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-settings-row { grid-template-columns: 40px 1fr; }
  .ad-settings-row > :last-child { grid-column: 2; justify-self: start; }
}

@media (max-width: 480px) {
  .ad-stats { grid-template-columns: 1fr 1fr; }
  .ad-quick { grid-template-columns: 1fr; }
  .ad-top-actions { width: 100%; max-width: none; justify-content: stretch; }
  .ad-top-actions .ad-btn { flex: 1; justify-content: center; min-height: 44px; }
  .ad-top-section-nav {
    width: 100%;
    border-radius: 14px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .ad-top-section-link { flex: 0 0 auto; min-height: 40px; }
}


/* CRM clients */
.ad-crm-never {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.72rem;
  font-weight: 800;
}
.ad-crm-table td { vertical-align: top; }

/* Users list: sticky pasek tytułu + thead przy scrollu strony */
.ad-users-list-panel {
  --ad-users-sticky-h: 3.35rem;
  padding-top: 0;
  overflow: visible;
}
.ad-users-sticky-head {
  position: sticky;
  top: 0;
  z-index: 7;
  margin: 0 -1.25rem 0;
  padding: 0.95rem 1.25rem 0.8rem;
  background: #fff;
  border-bottom: 1px solid var(--ad-line);
  box-shadow: 0 6px 16px rgba(3, 27, 78, 0.05);
}
.ad-users-table-wrap.is-sticky-head {
  max-height: none;
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  border-radius: 0 0 16px 16px;
}
.ad-users-table-wrap.is-sticky-head .ad-users-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.ad-users-table th,
.ad-users-table td {
  padding: 0.7rem 0.55rem;
  overflow: hidden;
}
.ad-users-table th:nth-child(2),
.ad-users-table td:nth-child(2),
.ad-users-table th:nth-child(3),
.ad-users-table td:nth-child(3),
.ad-users-table th:nth-child(4),
.ad-users-table td:nth-child(4) {
  width: 7.5%;
}
.ad-users-table th:nth-child(5),
.ad-users-table td:nth-child(5) {
  width: 12%;
}
.ad-users-table th:nth-child(6),
.ad-users-table td:nth-child(6) {
  width: 14%;
}
.ad-users-table th:nth-child(7),
.ad-users-table td:nth-child(7) {
  width: 11%;
  overflow: visible;
}
.ad-users-table-wrap.is-sticky-head thead th {
  position: sticky;
  top: var(--ad-users-sticky-h);
  z-index: 5;
  background: #f0f4fb;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  box-shadow: inset 0 -1px 0 var(--ad-line);
}
.ad-users-table-wrap .ad-users-col-client {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 24%;
  min-width: 0;
  background: #fff;
  box-shadow: 1px 0 0 var(--ad-line);
}
.ad-users-table-wrap thead th.ad-users-col-client {
  z-index: 6;
  background: #f0f4fb;
  left: 0;
}
.ad-users-table-wrap tbody tr:hover .ad-users-col-client {
  background: #f8faff;
}
.ad-users-table-wrap tbody tr.is-selected .ad-users-col-client {
  background: #eef3ff;
}
.ad-users-col-actions {
  white-space: nowrap;
  width: 9.5rem;
  overflow: visible;
  text-align: right;
}
.ad-users-col-actions .ad-btn {
  padding: 0 0.4rem;
  gap: 0.2rem;
}

.ad-crm-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.ad-crm-kpi {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #f7f9ff;
  border: 1px solid rgba(36, 72, 198, 0.08);
}
.ad-crm-kpi span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}
.ad-crm-kpi strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ad-ink);
}
.ad-crm-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}
.ad-crm-section-title {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  font-weight: 800;
}
.ad-crm-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.25rem 0.15rem;
}
.ad-crm-tl-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.65rem;
  position: relative;
  padding: 0.55rem 0 0.55rem 0.15rem;
}
.ad-crm-tl-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 1.35rem;
  bottom: 0;
  width: 2px;
  background: #e2e8f5;
}
.ad-crm-tl-dot {
  width: 10px;
  height: 10px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--ad-blue);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.15);
}
.ad-crm-tl-login .ad-crm-tl-dot { background: #0a7a4a; box-shadow: 0 0 0 3px rgba(10,122,74,0.15); }
.ad-crm-tl-points_adjust .ad-crm-tl-dot { background: #b45309; box-shadow: 0 0 0 3px rgba(180,83,9,0.15); }
.ad-crm-tl-deactivate .ad-crm-tl-dot { background: #b42318; box-shadow: 0 0 0 3px rgba(180,35,24,0.15); }
.ad-crm-tl-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}
.ad-crm-tl-body { font-size: 0.86rem; }
@media (max-width: 900px) {
  .ad-crm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-crm-split { grid-template-columns: 1fr; }
}

/* ——— Modern CRM user modal ——— */
.ad-crm-sheet {
  width: min(1080px, 100%);
  max-height: min(94dvh, 980px);
  display: flex;
  flex-direction: column;
}
.ad-crm-sheet .ad-crm-head {
  align-items: flex-start;
  gap: 1rem;
  flex-shrink: 0;
}
.ad-crm-sheet .ad-crm-head p {
  max-width: none;
}
.ad-crm-head-id {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  min-width: 0;
  flex: 1;
}
.ad-crm-head-text {
  min-width: 0;
  flex: 1;
}
.ad-crm-avatar {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  font-family: var(--ad-display);
  font-size: 1.15rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ad-crm-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}
.ad-crm-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.25rem 0 0 !important;
  opacity: 0.92;
  font-size: 0.84rem !important;
  line-height: 1.35 !important;
}
.ad-crm-mail {
  color: #c5d0ff;
  text-decoration: none;
  font-weight: 600;
  word-break: break-all;
}
.ad-crm-mail:hover { text-decoration: underline; color: #fff; }
.ad-crm-icon-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.ad-crm-icon-btn.is-copied { background: rgba(10,122,74,0.55); }
.ad-crm-icon-btn .shop-icon { width: 14px; height: 14px; }
.ad-crm-badges {
  margin-top: 0;
}
.ad-crm-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.7rem;
  margin-top: 0.7rem;
}
.ad-crm-badges .badge,
.ad-crm-badges .ad-rank {
  background: rgba(255,255,255,0.16);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
  font-weight: 700;
}
.ad-status-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 8.5rem;
  padding: 0.28rem 0.55rem 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #eef7f1;
  box-shadow: inset 0 0 0 1px rgba(16, 122, 74, 0.12);
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.ad-status-select.is-inactive {
  background: #f4f5f8;
  box-shadow: inset 0 0 0 1px rgba(90, 100, 120, 0.16);
}
.ad-status-select.is-saving {
  opacity: 0.65;
  pointer-events: none;
}
.ad-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
  flex: 0 0 auto;
}
.ad-status-select.is-inactive .ad-status-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}
.ad-status-select select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23475569' d='M1.2 1.3 6 6.1l4.8-4.8 1.2 1.2L6 8.5.0 2.5z'/%3E%3C/svg%3E")
    no-repeat right 0.05rem center / 0.7rem;
  padding: 0.1rem 1.1rem 0.1rem 0;
  margin: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  color: #166534;
  line-height: 1.2;
  cursor: pointer;
  min-width: 6.5rem;
}
.ad-status-select.is-inactive select {
  color: #475569;
}
.ad-status-select select:focus {
  outline: none;
}
.ad-status-select-crm {
  background: rgba(255,255,255,0.16);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
}
.ad-status-select-crm select {
  color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M1.2 1.3 6 6.1l4.8-4.8 1.2 1.2L6 8.5.0 2.5z'/%3E%3C/svg%3E");
}
.ad-status-select-crm.is-inactive {
  background: rgba(15, 23, 42, 0.28);
}
.ad-status-select-crm .ad-status-dot {
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}
.ad-status-select-crm.is-inactive .ad-status-dot {
  background: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.18);
}
.ad-status-select-lg {
  width: 100%;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #f4f8ff;
  box-shadow: inset 0 0 0 1px #d5e0f5;
}
.ad-status-select-lg.is-active {
  background: #eef7f1;
  box-shadow: inset 0 0 0 1px rgba(16, 122, 74, 0.16);
}
.ad-status-select-lg.is-inactive {
  background: #f7f8fb;
}
.ad-status-select-lg select {
  width: 100%;
  min-width: 0;
  font-size: 0.95rem;
  color: #12204a;
  background-position: right 0.2rem center;
}
.ad-crm-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.ad-crm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--ad-soft);
  font-weight: 600;
}
.ad-crm-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(36,72,198,0.15);
  border-top-color: var(--ad-blue);
  animation: ad-crm-spin 0.7s linear infinite;
}
@keyframes ad-crm-spin { to { transform: rotate(360deg); } }

.ad-crm-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.ad-crm-chrome {
  flex-shrink: 0;
  padding: 1rem 1.35rem 0;
  background:
    linear-gradient(180deg, #f8faff 0%, #fff 72%);
  border-bottom: 1px solid #e6ecf5;
}
.ad-crm-panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.35rem 1.25rem;
  background: #fbfcfe;
}
.ad-crm-panels > [data-uv-panel] {
  animation: ad-crm-panel-in 0.22s ease;
}
@keyframes ad-crm-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.ad-crm-summary {
  display: grid;
  grid-template-columns: minmax(10rem, 0.85fr) minmax(0, 2.15fr);
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}
.ad-crm-summary .ad-crm-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0;
}
.ad-crm-summary .ad-crm-kpi {
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e6ecf5;
  box-shadow: 0 1px 0 rgba(3, 27, 78, 0.03);
  min-width: 0;
}
.ad-crm-summary .ad-crm-kpi > span {
  display: block;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a8499;
  margin-bottom: 0.22rem;
}
.ad-crm-summary .ad-crm-kpi > strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  color: #1a2456;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
}
.ad-crm-summary .ad-crm-kpi > strong > span {
  display: inline;
  font: inherit;
  color: inherit;
  text-transform: none;
  letter-spacing: inherit;
  margin: 0;
}
.ad-crm-balance {
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #e8efff 0%, #f7f9fc 88%);
  border: 1px solid rgba(36, 72, 198, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.ad-crm-metric-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a8499;
  margin-bottom: 0.28rem;
}
.ad-crm-balance-val {
  display: block;
  margin: 0.2rem 0 0.15rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #1a2456;
  line-height: 1.1;
}
.ad-crm-balance em {
  font-style: normal;
  font-size: 0.84rem;
  font-weight: 600;
  color: #6b7793;
}
.ad-crm-summary .ad-crm-kpi > strong.is-up { color: #0a7a4a; }
.ad-crm-summary .ad-crm-kpi > strong.is-down { color: #b42318; }
.ad-crm-summary .ad-crm-kpi > em {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  color: #8a95ab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
}
.ad-crm-sep {
  display: inline !important;
  margin: 0 0.2rem !important;
  color: #9aa3b5 !important;
  font-weight: 700 !important;
  text-transform: none !important;
}
.ad-crm-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 0.75rem;
  padding: 0;
  border: 1px solid #e6ecf5;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.ad-crm-facts > div {
  padding: 0.7rem 0.85rem;
  min-width: 0;
  border-right: 1px solid #eef2f8;
}
.ad-crm-facts > div:last-child { border-right: 0; }
.ad-crm-facts dt {
  margin: 0 0 0.25rem;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a8499;
}
.ad-crm-facts dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1a2456;
  line-height: 1.35;
  word-break: break-word;
}
.ad-crm-notes-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-crm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e4eaf3;
}
.ad-crm-tool-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.ad-crm-tool-group + .ad-crm-tool-group {
  padding-left: 0.55rem;
  border-left: 1px solid #d8e0ef;
}
.ad-crm-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.3rem 0.65rem;
  border-radius: 9px;
  border: 1px solid #dce3f0;
  background: #fff;
  color: var(--ad-ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
}
.ad-crm-tool:hover {
  border-color: rgba(36,72,198,0.4);
  background: #eef3fc;
  color: var(--ad-blue);
}
.ad-crm-tool.is-primary {
  background: var(--ad-blue);
  border-color: var(--ad-blue);
  color: #fff;
}
.ad-crm-tool.is-primary:hover { background: var(--ad-blue-2); color: #fff; }
.ad-crm-tool.is-danger {
  color: var(--ad-danger);
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff8f7;
}
.ad-crm-tool.is-danger:hover {
  background: #fef3f2;
  border-color: rgba(180, 35, 24, 0.45);
  color: #912018;
}
.ad-crm-tool .shop-icon { width: 15px; height: 15px; flex-shrink: 0; }

.ad-crm-meta-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.95rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8eef7;
}
.ad-crm-meta-row > div {
  min-width: 0;
  padding-right: 0.35rem;
}
.ad-crm-meta-row > div:not(:last-child) {
  border-right: 1px solid #eef2f8;
}
.ad-crm-meta-row span {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ad-muted);
  margin-bottom: 0.25rem;
}
.ad-crm-meta-row strong {
  font-size: 0.86rem;
  color: var(--ad-ink);
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.ad-crm-tabs {
  margin: 0;
  padding-bottom: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  border-bottom: 0;
  gap: 0.15rem;
}
.ad-crm-tabs .ad-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
}
.ad-crm-tabs .shop-icon { width: 15px; height: 15px; }
.ad-crm-tab-n {
  display: inline-flex;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(36,72,198,0.1);
  color: var(--ad-blue);
  font-size: 0.7rem;
  font-weight: 800;
}
.ad-tab.is-active .ad-crm-tab-n {
  background: rgba(36,72,198,0.14);
}

.ad-crm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.ad-crm-panel-tools {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}
.ad-crm-panel-tools input[type="search"] {
  height: 42px;
  border: 1.5px solid var(--ad-line);
  border-radius: 12px;
  padding: 0 0.9rem;
  font: inherit;
  font-weight: 600;
  width: 100%;
  background: #fff;
}

.ad-crm-order-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow: auto;
}
.ad-crm-order-cards.is-full {
  max-height: none;
  overflow: visible;
}
.ad-crm-order-card {
  display: block;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1.5px solid var(--ad-line);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ad-crm-order-card:hover {
  border-color: rgba(36,72,198,0.35);
  box-shadow: 0 6px 18px rgba(3,27,78,0.06);
}
.ad-crm-oc-top,
.ad-crm-oc-mid,
.ad-crm-oc-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ad-crm-oc-mid { margin: 0.4rem 0 0.35rem; }
.ad-crm-oc-pts { color: #0a7a4a; font-weight: 700; font-size: 0.8rem; }

.ad-crm-feed {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: none;
  overflow: visible;
}
.ad-crm-feed-item {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--ad-line);
  background: #fff;
}
.ad-crm-feed-amt {
  font-weight: 800;
  font-size: 0.95rem;
}
.ad-crm-feed-item.is-up .ad-crm-feed-amt { color: #0a7a4a; }
.ad-crm-feed-item.is-down .ad-crm-feed-amt { color: #b42318; }
.ad-crm-feed-body strong { display: block; font-size: 0.88rem; }
.ad-crm-feed-body .muted { font-size: 0.75rem; }
.ad-crm-feed-bal { font-size: 0.75rem; color: var(--ad-muted); font-weight: 700; white-space: nowrap; }

.ad-crm-code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.55rem;
  max-height: none;
  overflow: visible;
}
.ad-crm-code-card {
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  border: 1.5px solid var(--ad-line);
  background: #fff;
}
.ad-crm-cc-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.ad-crm-cc-code code {
  font-size: 0.9rem;
  font-weight: 800;
}
.ad-crm-cc-bot {
  display: flex;
  justify-content: space-between;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.ad-crm-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--ad-muted);
  font-weight: 600;
  border: 1px dashed var(--ad-line);
  border-radius: 14px;
  background: #fff;
}
.ad-crm-timeline.is-full {
  max-height: none;
  overflow: visible;
  padding: 0.35rem 0.25rem;
  background: #fff;
  border: 1px solid #e6ecf5;
  border-radius: 14px;
}
.ad-crm-foot {
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
}
.ad-crm-notes-form {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid #e6ecf5;
  background: #fff;
}

.ad-crm-balance-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 1rem 1.05rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #eef3ff, #f8fafc);
  border: 1px solid rgba(36,72,198,0.12);
  margin-bottom: 0.15rem;
}
.ad-crm-balance-card span { font-size: 0.75rem; font-weight: 800; color: var(--ad-muted); text-transform: uppercase; width: 100%; }
.ad-crm-balance-card strong { font-size: 1.45rem; font-family: var(--ad-display); }
.ad-crm-balance-card em { font-style: normal; color: var(--ad-soft); font-weight: 600; }
.ad-crm-pts-adjust {
  margin: 0 0 1rem;
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid #e4eaf3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(3, 27, 78, 0.03);
}
.ad-crm-pts-adjust-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}
.ad-crm-pts-adjust-head strong {
  display: block;
  color: #1a2456;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.ad-crm-pts-adjust-head .muted {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  line-height: 1.35;
  max-width: 36rem;
}
.ad-crm-pts-balance {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.45rem;
  font-size: 0.8rem;
  color: #6b7a99;
  padding: 0.45rem 0.7rem;
  border-radius: 12px;
  background: #f6f8fc;
}
.ad-crm-pts-balance strong {
  font-size: 1rem;
  color: #1a2456;
}
.ad-crm-pts-balance strong.is-up { color: #0a7a4a; }
.ad-crm-pts-balance strong.is-down { color: #b42318; }
.ad-crm-pts-balance strong.is-neg { color: #b42318; }
.ad-crm-pts-arrow { opacity: 0.45; }
.ad-crm-pts-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
}
.ad-crm-pts-quick .ad-btn {
  min-width: 3.4rem;
  justify-content: center;
}
.ad-crm-pts-fields {
  display: grid;
  grid-template-columns: minmax(9.5rem, 12rem) minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: end;
}
.ad-crm-pts-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 750;
  color: #5a6478;
  letter-spacing: 0.01em;
}
.ad-crm-pts-fields input {
  width: 100%;
  margin: 0;
  height: 42px;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(3, 27, 78, 0.14);
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  color: #1a2456;
  background: #fff;
}
.ad-crm-pts-fields input:focus {
  outline: none;
  border-color: var(--ad-blue, #2448c6);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ad-blue, #2448c6) 16%, transparent);
}
.ad-crm-pts-fields .ad-btn {
  height: 42px;
  padding: 0 1.1rem;
  white-space: nowrap;
  align-self: end;
}
@media (max-width: 820px) {
  .ad-crm-pts-fields {
    grid-template-columns: 1fr 1fr;
  }
  .ad-crm-pts-fields .ad-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}
@media (max-width: 560px) {
  .ad-crm-pts-fields {
    grid-template-columns: 1fr;
  }
}
.ad-crm-delta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}
.ad-crm-action-sheet {
  width: min(480px, 100%);
}
.ad-crm-action-sheet.is-sm {
  width: min(400px, 100%);
}
.ad-crm-action-sheet .ad-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: #fbfcfe;
}
.ad-crm-action-sheet .ad-modal-body > label {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid #e6ecf5;
  background: #fff;
}
.ad-crm-action-sheet .ad-modal-body > p {
  margin: 0;
  line-height: 1.5;
}
.ad-crm-action-sheet .ad-modal-note {
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #eef3ff;
  border: 1px solid rgba(36, 72, 198, 0.12);
  color: #3a4a78;
  font-size: 0.84rem;
}
.ad-crm-rank-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}
.ad-crm-rank-opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1.5px solid var(--ad-line);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ad-crm-rank-opt input { accent-color: var(--ad-blue); }
.ad-crm-rank-opt.is-selected,
.ad-crm-rank-opt:has(input:checked) {
  border-color: rgba(36,72,198,0.45);
  background: #f5f8ff;
}
.ad-crm-toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1.5px solid var(--ad-line);
  background: #f7f9ff;
  cursor: pointer;
}
.ad-crm-toggle-card input { margin-top: 0.2rem; accent-color: var(--ad-blue); width: 18px; height: 18px; }
.ad-crm-toggle-card strong { display: block; margin-bottom: 0.2rem; }
.ad-crm-toggle-card span { color: var(--ad-soft); font-size: 0.88rem; }

@media (max-width: 900px) {
  .ad-crm-summary {
    grid-template-columns: 1fr;
  }
  .ad-crm-summary .ad-crm-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ad-crm-facts {
    grid-template-columns: 1fr 1fr;
  }
  .ad-crm-facts > div {
    border-right: 0;
    border-bottom: 1px solid #eef2f8;
  }
  .ad-crm-facts > div:nth-last-child(-n+2) { border-bottom: 0; }
  .ad-crm-tool-group + .ad-crm-tool-group {
    padding-left: 0;
    border-left: 0;
  }
  .ad-crm-feed-item { grid-template-columns: 72px 1fr; }
  .ad-crm-feed-bal { grid-column: 2; }
  .ad-crm-chrome,
  .ad-crm-panels {
    padding-left: 1.05rem;
    padding-right: 1.05rem;
  }
}
@media (max-width: 560px) {
  .ad-crm-summary .ad-crm-kpis,
  .ad-crm-facts {
    grid-template-columns: 1fr;
  }
  .ad-crm-facts > div { border-bottom: 1px solid #eef2f8; }
  .ad-crm-facts > div:last-child { border-bottom: 0; }
  .ad-crm-tool span { display: none; }
  .ad-crm-tool { min-width: 44px; justify-content: center; padding: 0.55rem; }
  .ad-crm-head-id { align-items: flex-start; }
  .ad-users-table-wrap {
    max-height: min(58vh, 520px);
  }
}

/* ========== FINAL MOBILE POLISH (admin A–Z) ========== */
.ad-stock-mobile { display: none; }

html { -webkit-text-size-adjust: 100%; }
body.ad-body {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

@media (max-width: 900px) {
  .ad-top {
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0));
  }
  .ad-sidebar {
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Touch targets */
  .ad-chip,
  .ad-btn-sm,
  .ad-tab,
  .ad-pager-sizes .ad-chip {
    min-height: 44px;
  }
  .ad-crm-icon-btn {
    width: 44px;
    height: 44px;
  }

  /* Horizontal chip scroller (status / segments / presets) */
  .ad-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding: 0.15rem 0.25rem 0.35rem;
  }
  .ad-chips::-webkit-scrollbar { display: none; }
  .ad-chip { flex: 0 0 auto; white-space: nowrap; }

  /* Empty card rows */
  .ad-table.ad-table-cards tbody tr.is-empty-row,
  .ad-table.ad-table-cards tbody tr:has(td[colspan]) {
    padding: 1rem;
    text-align: center;
  }
  .ad-table.ad-table-cards tbody tr.is-empty-row td,
  .ad-table.ad-table-cards tbody tr:has(td[colspan]) td {
    display: block;
    border: 0 !important;
    margin: 0 !important;
    padding: 0.5rem 0 !important;
    text-align: center;
    justify-content: center;
  }
  .ad-table.ad-table-cards tbody tr.is-empty-row td::before,
  .ad-table.ad-table-cards tbody tr:has(td[colspan]) td::before {
    display: none !important;
  }

  /* Action cells in cards */
  .ad-table.ad-table-cards tbody td {
    white-space: normal;
  }
  .ad-table.ad-table-cards tbody td:last-child {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .ad-table.ad-table-cards tbody td:last-child .ad-btn {
    min-height: 40px;
  }

  /* Modal foot: don't equal-stretch 3+ buttons awkwardly */
  .ad-modal-foot {
    gap: 0.45rem;
  }
  .ad-modal-foot .ad-btn {
    flex: 1 1 calc(50% - 0.35rem);
    max-width: 100%;
  }
  .ad-modal-foot .ad-btn-primary {
    flex: 1 1 100%;
    order: 3;
  }
  .ad-modal-foot > span[style*="flex"] {
    display: none !important;
  }

  /* Reports filters: force 1–2 cols on phone */
  .ad-form-row-4 {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Stock: phone cards instead of wide matrix */
  .ad-matrix { display: none; }
  .ad-stock-mobile {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.85rem;
  }
  .ad-stock-card {
    border: 1.5px solid var(--ad-line);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
  }
  .ad-stock-card-head {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 52px;
    padding: 0.85rem 1rem;
    border: 0;
    background: #f5f7fc;
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    color: var(--ad-ink);
  }
  .ad-stock-card-head span {
    font-size: 0.82rem;
    color: var(--ad-blue);
    font-weight: 800;
  }
  .ad-stock-card-amts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.4rem;
    padding: 0.75rem;
  }
  .ad-stock-amt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    min-height: 64px;
    padding: 0.55rem 0.6rem;
    border-radius: 12px;
    border: 1.5px solid var(--ad-line);
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .ad-stock-amt em {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--ad-muted);
    text-transform: uppercase;
  }
  .ad-stock-amt strong {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ad-ink);
  }
  .ad-stock-amt span {
    font-size: 0.68rem;
    font-weight: 700;
  }
  .ad-stock-amt.is-ok { border-color: rgba(10,122,74,0.25); background: #f3fbf7; }
  .ad-stock-amt.is-ok span { color: #0a7a4a; }
  .ad-stock-amt.is-low { border-color: rgba(180,83,9,0.3); background: #fff8f0; }
  .ad-stock-amt.is-low span { color: #b45309; }
  .ad-stock-amt.is-empty { border-color: rgba(180,35,24,0.25); background: #fff5f4; }
  .ad-stock-amt.is-empty span { color: #b42318; }

  /* Settings URL wrap */
  .ad-stat .h,
  .ad-stat .v {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Top subtitle clamp */
  .ad-top-sub {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Payments / dense toolbars */
  .ad-filters .ad-actions,
  .ad-filters {
    width: 100%;
  }
  .ad-filters .ad-btn,
  .ad-filters a.ad-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .ad-form-row-2,
  .ad-form-row-3,
  .ad-form-row-4 {
    grid-template-columns: 1fr !important;
  }
  .ad-crm-head {
    flex-wrap: nowrap;
  }
}

@media (max-width: 480px) {
  .ad-stats { gap: 0.45rem; }
  .ad-stat { padding: 0.85rem 0.8rem; }
  .ad-stat .v { font-size: 1.2rem; }
  .ad-panel-head {
    flex-wrap: wrap;
  }
  .ad-stock-card-amts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Desktop: keep matrix, hide mobile stock cards */
@media (min-width: 901px) {
  .ad-stock-mobile { display: none !important; }
  .ad-matrix { display: block; }
}

/* ===== Reports page ===== */
.ad-reports { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.ad-reports-period {
  background: #fff;
  border: 1px solid var(--ad-line);
  border-radius: var(--ad-radius);
  box-shadow: var(--ad-shadow);
  padding: 1rem 1.15rem 1.05rem;
}
.ad-reports-period-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.ad-reports-period-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ad-ink);
}
.ad-reports-period-head p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
  color: var(--ad-muted);
  font-weight: 600;
}
.ad-reports-chips { margin: 0; }
.ad-reports-filters {
  padding: 1.15rem 1.2rem 1.35rem;
}
.ad-reports-filters .ad-panel-head {
  padding: 0;
  margin-bottom: 1rem;
}
.ad-rf-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.ad-rf-block {
  margin: 0;
  padding: 1.05rem 1.1rem 1.15rem;
  border: 1px solid #e0e7f2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(3, 27, 78, 0.03);
}
.ad-rf-block.is-primary {
  background: linear-gradient(180deg, #fbfcff 0%, #fff 55%);
  border-color: #d5def0;
}
.ad-rf-details {
  padding: 0;
  overflow: hidden;
}
.ad-rf-details > summary.ad-rf-head {
  list-style: none;
  cursor: pointer;
  padding: 1.05rem 1.1rem;
  margin: 0;
  border-bottom: 0;
  user-select: none;
}
.ad-rf-details > summary.ad-rf-head::-webkit-details-marker { display: none; }
.ad-rf-details[open] > summary.ad-rf-head {
  border-bottom: 1px solid #eef2f8;
  background: #fafbfd;
}
.ad-rf-details-body {
  padding: 0.85rem 1.1rem 1.15rem;
}
.ad-rf-chev,
.ad-reports-fold-chev {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 9px;
  background: #eef3fc;
  color: var(--ad-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.ad-rf-chev::before,
.ad-reports-fold-chev::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
}
.ad-rf-details[open] > summary .ad-rf-chev,
.ad-rf-more[open] > summary .ad-rf-chev,
.ad-reports-fold[open] > summary .ad-reports-fold-chev {
  transform: rotate(180deg);
  background: var(--ad-blue);
  color: #fff;
}
.ad-rf-count.is-muted {
  background: #f1f4f9;
  color: #6b7793;
}
.ad-rf-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #eef2f8;
}
.ad-rf-details > summary.ad-rf-head {
  margin-bottom: 0;
  padding-bottom: 1.05rem;
}
.ad-rf-details > summary.ad-rf-head .ad-rf-count {
  margin-left: 0;
}
.ad-rf-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #031b4e;
  letter-spacing: -0.01em;
}
.ad-rf-head p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #6b7793;
  font-weight: 500;
}
.ad-rf-ico {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef3fc;
  color: var(--ad-blue);
}
.ad-rf-ico .shop-icon {
  width: 17px;
  height: 17px;
}
.ad-rf-count {
  margin-left: auto;
  align-self: center;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-blue);
  background: #eef3fc;
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  white-space: nowrap;
}
.ad-rf-group + .ad-rf-group {
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px dashed #e4eaf3;
}
.ad-rf-divider {
  height: 1px;
  margin: 1rem 0 0.85rem;
  background: #eef2f8;
}
.ad-rf-sub {
  margin: 1rem 0 0.45rem !important;
  font-size: 0.92rem !important;
}
.ad-rf-hint {
  margin: -0.25rem 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #5a6478;
}
.ad-rf-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a8499;
  margin: 0 0 0.45rem;
}
.ad-rf-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
.ad-rf-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ad-rf-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ad-rf-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ad-rf-span-2 { grid-column: span 2; }
.ad-rf-block label,
.ad-rf-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #5a6478;
}
.ad-rf-block input,
.ad-rf-block select,
.ad-rf-grid input,
.ad-rf-grid select {
  height: 42px;
  border-radius: 11px;
  border: 1.5px solid #d8e0ef;
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ad-ink);
  background: #fbfcfe;
  width: 100%;
  min-width: 0;
}
.ad-rf-block input:focus,
.ad-rf-block select:focus {
  outline: none;
  border-color: rgba(36, 72, 198, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.12);
}
.ad-rf-chips-scroll {
  max-height: 9.5rem;
  overflow: auto;
  padding: 0.15rem 0.1rem 0.25rem;
  margin: 0 -0.1rem;
  scrollbar-width: thin;
}
.ad-rf-chips,
.ad-rf-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ad-rf-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.ad-rf-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.ad-rf-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 2.05rem;
  padding: 0.3rem 0.8rem;
  border-radius: 10px;
  border: 1.5px solid #e0e7f2;
  background: #f8fafc;
  color: #1a2456;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.ad-rf-chip:hover span { border-color: rgba(36, 72, 198, 0.45); background: #fff; }
.ad-rf-chip.is-on span {
  background: var(--ad-blue);
  border-color: var(--ad-blue);
  color: #fff;
  box-shadow: 0 6px 14px rgba(36, 72, 198, 0.22);
}
.ad-rf-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 0.95rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid #e0e7f2;
  background: #f8fafc;
  cursor: pointer;
}
.ad-rf-toggle input { margin-top: 0.2rem; width: auto; height: auto; accent-color: var(--ad-blue); }
.ad-rf-toggle strong { display: block; color: #1a2456; font-size: 0.9rem; }
.ad-rf-toggle em {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-size: 0.8rem;
  color: #5a6478;
  font-weight: 500;
  line-height: 1.4;
}
.ad-rf-toggle.is-on {
  border-color: rgba(36, 72, 198, 0.35);
  background: #eef3fc;
}
.ad-rf-more {
  margin: 0;
  border: 1px dashed #c9d4ea;
  border-radius: 16px;
  padding: 0;
  background: #f7f9fc;
  overflow: hidden;
}
.ad-rf-more > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 800;
  color: var(--ad-blue);
  padding: 0.9rem 1.05rem;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.ad-rf-more > summary::-webkit-details-marker { display: none; }
.ad-rf-more > summary .ad-rf-ico {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9px;
}
.ad-rf-more > summary .ad-rf-chev {
  margin-left: auto;
}
.ad-rf-more[open] > summary {
  border-bottom: 1px solid #e4eaf3;
  background: #fff;
}
.ad-rf-more-body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ad-reports-fold {
  padding: 0;
  overflow: hidden;
}
.ad-reports-fold > summary {
  list-style: none;
  cursor: pointer;
}
.ad-reports-fold > summary::-webkit-details-marker { display: none; }
.ad-reports-fold-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  user-select: none;
}
.ad-reports-fold-sum h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--ad-ink);
}
.ad-reports-fold-sum .muted {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
}
.ad-reports-fold-body {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid #eef2f8;
  padding-top: 1rem;
}
.ad-reports-exports.ad-reports-fold {
  margin-top: 0;
}
.ad-reports-export-more {
  margin-top: 1rem;
  border: 1px dashed #c9d4ea;
  border-radius: 14px;
  background: #f7f9fc;
  overflow: hidden;
}
.ad-reports-export-more > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 800;
  color: var(--ad-blue);
  font-size: 0.9rem;
}
.ad-reports-export-more > summary::-webkit-details-marker { display: none; }
.ad-reports-export-more > summary::before { content: '▸ '; }
.ad-reports-export-more[open] > summary::before { content: '▾ '; }
.ad-reports-export-more[open] > summary {
  border-bottom: 1px solid #e4eaf3;
  background: #fff;
}
.ad-reports-export-more .ad-reports-export-grid {
  padding: 0 1rem 1rem;
}
.ad-reports-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.05rem;
  padding-top: 1rem;
  border-top: 1px solid #eef2f8;
}
.ad-reports-filter-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-left: auto;
}
.ad-reports-filters .ad-reports-note {
  margin: 0;
  max-width: 28rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #6b7793;
}
.ad-reports-filters .ad-reports-note a {
  color: var(--ad-blue);
  font-weight: 700;
}
@media (max-width: 980px) {
  .ad-rf-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-rf-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .ad-rf-grid-4,
  .ad-rf-grid-3,
  .ad-rf-grid-2 { grid-template-columns: 1fr; }
  .ad-rf-span-2 { grid-column: auto; }
  .ad-reports-filter-actions { flex-direction: column; align-items: stretch; }
  .ad-reports-filter-btns { margin-left: 0; width: 100%; }
  .ad-reports-filter-btns .ad-btn { flex: 1; justify-content: center; }
}
.ad-reports-filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .ad-reports-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 980px) {
  .ad-reports-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .ad-reports-filter-search { grid-column: span 2; }
}
.ad-reports-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ad-reports-filter-grid input,
.ad-reports-filter-grid select {
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--ad-line);
  padding: 0 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ad-ink);
  background: #fff;
  text-transform: none;
  letter-spacing: 0;
  width: 100%;
  min-width: 0;
}
.ad-reports-filter-grid input:focus,
.ad-reports-filter-grid select:focus {
  outline: none;
  border-color: rgba(36, 72, 198, 0.45);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.12);
}
.ad-reports-note {
  margin: 1rem 0 0;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: #eef3ff;
  color: var(--ad-soft);
  font-size: 0.84rem;
  line-height: 1.45;
  font-weight: 600;
}
.ad-reports-note a { color: var(--ad-blue); font-weight: 800; }
.ad-reports-export-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .ad-reports-export-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .ad-reports-export-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ad-reports-export-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 0.75rem;
  align-items: start;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--ad-line);
  background: #fff;
  box-shadow: var(--ad-shadow);
  text-decoration: none;
  color: inherit;
}
.ad-reports-export-card.is-link {
  transition: border-color 0.15s, transform 0.15s;
}
.ad-reports-export-card.is-link:hover {
  border-color: rgba(36, 72, 198, 0.35);
  transform: translateY(-1px);
}
.ad-reports-export-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eef3ff;
  color: var(--ad-blue);
  display: grid;
  place-items: center;
}
.ad-reports-export-icon .shop-icon { width: 18px; height: 18px; }
.ad-reports-export-card strong {
  display: block;
  font-size: 0.92rem;
  color: var(--ad-ink);
}
.ad-reports-export-card span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--ad-muted);
  line-height: 1.35;
  font-weight: 600;
}
.ad-reports-export-btns {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ad-reports-charts { margin: 0; }
.ad-reports-chart-full { margin: 0; }
.ad-chart-wrap-lg { height: 280px; }
.ad-reports-tables { margin: 0; }
.ad-reports-scroll {
  max-height: min(52vh, 440px);
  overflow: auto;
}
.ad-reports-sub {
  font-size: 0.72rem;
  margin-top: 0.15rem;
}
.ad-val-ok { color: var(--ad-ok); }
.ad-val-bad { color: var(--ad-danger); }
@media (min-width: 720px) {
  .ad-reports .ad-grid-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .ad-reports-period-head { flex-wrap: wrap; }
  .ad-reports-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }
  .ad-reports-chips::-webkit-scrollbar { display: none; }
  .ad-reports-chips .ad-chip { flex: 0 0 auto; min-height: 40px; }
  .ad-reports-filter-actions { width: 100%; }
  .ad-reports-filter-btns .ad-btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
  }
  .ad-chart-wrap-lg { height: 240px; }
  .ad-reports-export-btns .ad-btn { flex: 1; justify-content: center; }
}
@media (max-width: 480px) {
  .ad-reports .ad-stats-6 { grid-template-columns: 1fr 1fr; }
  .ad-reports .ad-stat .v { font-size: 1.15rem; }
}

/* Advanced report filters */
.ad-reports-section {
  border: 1px solid var(--ad-line);
  border-radius: 14px;
  padding: 0.65rem 0.9rem 0.85rem;
  margin: 0.75rem 0;
  background: #f8fafc;
}
.ad-reports-section > summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ad-ink, #0b1f44);
  list-style: none;
  padding: 0.25rem 0;
}
.ad-reports-section > summary::-webkit-details-marker { display: none; }
.ad-reports-section > summary::before {
  content: '▸ ';
  color: var(--ad-blue);
}
.ad-reports-section[open] > summary::before { content: '▾ '; }
.ad-reports-section .ad-reports-filter-grid { margin-top: 0.75rem; }
.ad-reports-filter-grid select[multiple] {
  min-height: 8rem;
  padding: 0.45rem;
}
.ad-reports-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.45rem 0.85rem;
  align-items: center;
  padding: 0.35rem 0;
}
.ad-reports-checks label,
.ad-reports-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0;
}
.ad-reports-check { grid-column: 1 / -1; }

/* Baza eKodów: graficzne stany po kartach */
.ad-gc-hero { margin-bottom: 1rem; }
.ad-gc-stats .ad-stat { text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.ad-gc-stats .ad-stat:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(3, 27, 78, 0.1); }
.ad-gc-stats .ad-stat.is-selected {
  outline: 2px solid var(--ad-blue);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px rgba(36, 72, 198, 0.12);
}
.ad-gc-mini-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(3, 27, 78, 0.08);
  margin: 0.45rem 0 0.35rem;
  overflow: hidden;
}
.ad-gc-mini-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a7a4a, #34b27b);
  min-width: 0;
}
.ad-gc-mini-bar.is-sold span { background: linear-gradient(90deg, var(--ad-blue), #6b8cff); }
.ad-gc-mini-bar.is-assigned span { background: linear-gradient(90deg, #7c5cbf, #a78bfa); }
.ad-gc-mini-bar.is-void span { background: linear-gradient(90deg, #b45309, #f0a35a); }

.ad-gc-stack-panel {
  margin-top: 0.85rem;
  background: var(--ad-panel);
  border: 1px solid var(--ad-line);
  border-radius: var(--ad-radius);
  padding: 0.9rem 1.1rem 1rem;
  box-shadow: var(--ad-shadow);
}
.ad-gc-stack-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
  flex-wrap: wrap;
}
.ad-gc-stack {
  display: flex;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(3, 27, 78, 0.06);
  gap: 2px;
}
.ad-gc-stack-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-decoration: none;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: filter .15s ease, opacity .15s ease;
  padding: 0 0.35rem;
}
.ad-gc-stack-seg span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-gc-stack-seg:hover { filter: brightness(1.08); }
.ad-gc-stack-seg.is-active { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.85); }
.ad-gc-stack-seg.is-ok { background: #0a7a4a; }
.ad-gc-stack-seg.is-sold { background: var(--ad-blue); }
.ad-gc-stack-seg.is-assigned { background: #7c5cbf; }
.ad-gc-stack-seg.is-void { background: #b45309; }
.ad-gc-stack-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ad-soft);
}
.ad-gc-stack-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.ad-gc-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.ad-gc-dot.is-ok { background: #0a7a4a; }
.ad-gc-dot.is-sold { background: var(--ad-blue); }
.ad-gc-dot.is-assigned { background: #7c5cbf; }
.ad-gc-dot.is-void { background: #b45309; }

.ad-gc-products-panel .ad-panel-head {
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
}
.ad-gc-panel-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}
.ad-gc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
  padding: 0 1.1rem 1.15rem;
  align-items: stretch;
}
.ad-gc-card {
  background: #fff;
  border: 1px solid var(--ad-line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.ad-gc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(3, 27, 78, 0.1);
}
.ad-gc-card.is-active {
  border-color: var(--ad-blue);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.15);
}
.ad-gc-card.is-empty { border-color: rgba(180, 35, 24, 0.28); }
.ad-gc-card.is-low { border-color: rgba(180, 83, 9, 0.35); }
.ad-gc-card-visual {
  position: relative;
  display: block;
  aspect-ratio: 2 / 1;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(36, 72, 198, 0.12), transparent 55%),
    linear-gradient(160deg, #e8eefc, #f7f9fd);
  overflow: hidden;
  flex-shrink: 0;
}
.ad-gc-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ad-gc-card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ad-display);
  font-size: 2.4rem;
  color: var(--ad-blue);
  font-weight: 800;
}
.ad-gc-card-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: var(--ad-ok);
  border: 1px solid rgba(10, 122, 74, 0.25);
  max-width: calc(100% - 1.2rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-gc-card-badge.is-low { color: var(--ad-warn); border-color: rgba(180, 83, 9, 0.3); }
.ad-gc-card-badge.is-empty { color: var(--ad-danger); border-color: rgba(180, 35, 24, 0.3); }

/* Source badges — high contrast on product/stock cards */
.ad-src-badge,
.ad-gc-card-badge.is-source {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  right: auto;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  max-width: calc(100% - 1.2rem);
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.ad-src-badge.is-local,
.ad-gc-card-badge.is-source.is-local {
  background: linear-gradient(135deg, #0f9d58 0%, #0a7a4a 100%);
}
.ad-src-badge.is-api,
.ad-gc-card-badge.is-source.is-api {
  background: linear-gradient(135deg, #3b6ef5 0%, var(--ad-blue) 100%);
}
.ad-src-badge.is-partner,
.ad-gc-card-badge.is-source.is-partner {
  background: linear-gradient(135deg, #e0982a 0%, #b46e14 100%);
}
.ad-src-badge.is-own,
.ad-gc-card-badge.is-source.is-own {
  background: linear-gradient(135deg, #9b4dca 0%, #7828a0 100%);
}
.ad-src-badge.is-muted,
.ad-gc-card-badge.is-source.is-muted {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}
.ad-src-badge.is-inline {
  position: static;
  box-shadow: none;
  max-width: none;
  vertical-align: middle;
}
.ad-prod-card .ad-viz-card-visual { position: relative; }
.ad-prod-card .ad-gc-card-badge.is-empty {
  left: auto;
  right: 0.55rem;
}
.ad-gc-card-body {
  padding: 0.8rem 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
}
.ad-gc-card-title { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.ad-gc-card-title strong {
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-gc-card-title .muted {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-gc-card .ad-gc-amts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 2.7rem;
  margin-top: auto;
}
.ad-gc-card .ad-gc-amt {
  min-height: 2.7rem;
  padding: 0.3rem 0.2rem;
}
.ad-gc-card .ad-gc-amt strong { font-size: 0.76rem; }
.ad-gc-card .ad-gc-amt span { font-size: 0.64rem; }
.ad-gc-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(3, 27, 78, 0.08);
  gap: 1px;
  text-decoration: none;
  flex-shrink: 0;
}
.ad-gc-bar span { min-width: 3px; }
.ad-gc-bar .is-ok { background: #0a7a4a; }
.ad-gc-bar .is-sold { background: var(--ad-blue); }
.ad-gc-bar .is-assigned { background: #7c5cbf; }
.ad-gc-bar .is-void { background: #b45309; }
.ad-gc-card-nums {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3rem;
  min-width: 0;
}
.ad-gc-card-nums a,
.ad-gc-card-nums > span {
  text-decoration: none;
  color: inherit;
  text-align: center;
  padding: 0.4rem 0.2rem;
  border-radius: 10px;
  background: rgba(3, 27, 78, 0.035);
  transition: background .15s ease;
  min-width: 0;
  overflow: hidden;
}
.ad-gc-card-nums a:hover { background: rgba(36, 72, 198, 0.1); }
.ad-gc-card-nums em {
  display: block;
  font-style: normal;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-gc-card-nums span span,
.ad-gc-card-nums a span {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 0.12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-gc-amts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.4rem, 1fr));
  gap: 0.35rem;
  margin-top: 0;
  align-content: start;
}
.ad-gc-amt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 2.55rem;
  padding: 0.35rem 0.3rem;
  text-decoration: none;
  color: #1a2456;
  border: 1px solid #e2e8f3;
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  text-align: center;
  min-width: 0;
}
button.ad-gc-amt {
  font: inherit;
  cursor: pointer;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}
.ad-gc-amt:hover {
  border-color: rgba(36, 72, 198, 0.4);
  background: #f5f8ff;
  box-shadow: 0 4px 12px rgba(36, 72, 198, 0.08);
}
.ad-gc-amt.is-active {
  border-color: var(--ad-blue);
  background: #eef3ff;
  box-shadow: 0 0 0 2px rgba(36, 72, 198, 0.14);
}
.ad-gc-amt strong,
.ad-gc-amt .ad-amt-val {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #1a2456;
}
.ad-gc-amt span,
.ad-gc-amt .ad-amt-qty {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b7793;
  line-height: 1.1;
}
.ad-gc-amt.is-api {
  background: #f3fbf7;
  border-color: rgba(10, 122, 74, 0.28);
}
.ad-gc-amt.is-api span,
.ad-gc-amt.is-api .ad-amt-qty {
  color: #0a7a4a;
  font-weight: 800;
}
.ad-gc-amt.is-ok:not(.is-api) span,
.ad-gc-amt.is-ok:not(.is-api) .ad-amt-qty {
  color: #0a7a4a;
  font-weight: 800;
}
.ad-gc-card-badge.is-api,
.ad-gc-card-badge.is-ok {
  background: rgba(10, 122, 74, 0.12);
  color: #0a7a4a;
}
.ad-viz-card.is-api-ok {
  border-color: rgba(10, 122, 74, 0.28);
}
.ad-gc-amt.is-low {
  background: #fffaf4;
  border-color: rgba(180, 83, 9, 0.28);
}
.ad-gc-amt.is-low span,
.ad-gc-amt.is-low .ad-amt-qty {
  color: #b45309;
  font-weight: 800;
}
.ad-gc-amt.is-empty {
  background: #fcf6f5;
  border-color: rgba(180, 35, 24, 0.18);
}
.ad-gc-amt.is-empty strong,
.ad-gc-amt.is-empty .ad-amt-val {
  color: #8a6a68;
}
.ad-gc-amt.is-empty span,
.ad-gc-amt.is-empty .ad-amt-qty {
  color: #b42318;
  font-weight: 800;
}
.ad-gc-amt.is-more {
  background: #eef2f8;
  border-style: dashed;
  color: #5a6478;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
}
.ad-gc-amt.is-more:hover {
  border-color: rgba(36, 72, 198, 0.4);
  background: #f5f8ff;
  color: var(--ad-blue);
}
.ad-gc-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
}
.ad-gc-active-filters .ad-sku-chip {
  text-decoration: none;
  cursor: pointer;
}
.ad-gc-active-filters .ad-sku-chip:hover {
  background: #e8eefc;
  border-color: rgba(36, 72, 198, 0.35);
}
.ad-gc-row-active td { background: rgba(36, 72, 198, 0.06); }

@media (max-width: 720px) {
  .ad-gc-grid { grid-template-columns: 1fr; padding: 0 0.85rem 1rem; }
  .ad-gc-stack-seg span { font-size: 0.62rem; }
  .ad-gc-panel-tools { width: 100%; margin-left: 0; justify-content: flex-start; }
  .ad-gc-card-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Aliases — wspólny kit wizualny dla wszystkich zakładek */
.ad-viz-hero { margin-bottom: 1rem; }
.ad-viz-stats a.ad-stat,
.ad-gc-stats a.ad-stat { text-decoration: none; color: inherit; }
.ad-viz-mini-bar { /* same as .ad-gc-mini-bar */ }
.ad-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(255, 120, 80, 0.95);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}
.ad-nav-link { display: flex; align-items: center; gap: 0.55rem; }
.ad-nav-link .ad-nav-badge { margin-left: auto; }

/* Produkt / zamówienie / promo — karty katalogowe */
.ad-viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  padding: 0 1.1rem 1.15rem;
  align-items: stretch;
}
.ad-viz-card {
  background: #fff;
  border: 1px solid var(--ad-line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
/* Author display:flex overrides UA [hidden] — force hide for live filters */
.ad-viz-card[hidden],
[data-ad-stock-pcard][hidden],
[data-ad-prod-card][hidden],
.ad-stock-card[hidden],
tr[data-ad-stock-row][hidden],
tr[data-ad-stock-mrow][hidden],
tr[data-ad-prod-row][hidden] {
  display: none !important;
}
.ad-viz-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(3, 27, 78, 0.1);
}
.ad-viz-card.is-active {
  border-color: var(--ad-blue);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.15);
}
.ad-viz-card.is-warn { border-color: rgba(180, 83, 9, 0.35); }
.ad-viz-card.is-danger { border-color: rgba(180, 35, 24, 0.28); }
.ad-viz-card-visual {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #eef2f8;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  box-shadow: none;
  outline: none;
  flex-shrink: 0;
}
.ad-viz-card-visual:focus-visible {
  outline: 2px solid var(--ad-blue);
  outline-offset: -2px;
}
.ad-viz-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  background: transparent;
  border: 0;
  vertical-align: top;
}
.ad-viz-card-body {
  padding: 0.85rem 0.9rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}
.ad-viz-card-body strong { font-size: 0.98rem; letter-spacing: -0.01em; }
.ad-viz-card .ad-gc-amts {
  flex: 0 0 auto;
  align-content: flex-start;
  min-height: 0;
  max-height: none;
  overflow: visible;
  margin-top: 0;
}
.ad-viz-card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: auto;
  flex-wrap: wrap;
  padding-top: 0.15rem;
}
.ad-viz-card-actions .ad-btn {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 36px;
  opacity: 1;
  visibility: visible;
}
.ad-stock-product-grid .ad-viz-card-actions .ad-btn-primary {
  order: -1;
  flex: 1 1 100%;
}

/* Stock: zawsze 1 rząd × 4 równe kafle nominałów */
.ad-stock-product-grid .ad-gc-amts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 2.7rem;
}
.ad-stock-product-grid .ad-gc-amt {
  min-height: 2.7rem;
  padding: 0.3rem 0.2rem;
}
.ad-stock-product-grid .ad-gc-amt strong {
  font-size: 0.76rem;
}
.ad-stock-product-grid .ad-gc-amt span {
  font-size: 0.64rem;
}
/* Magazyn: te same loga co w Produktach (contain, kwadrat, białe tło) */
.ad-stock-product-grid .ad-viz-card-visual {
  aspect-ratio: 1 / 1;
  background: #fff;
  border-bottom: 1px solid #eef2f8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
}
.ad-stock-product-grid .ad-viz-card-visual img {
  width: 100%;
  height: 100%;
  max-width: 220px;
  max-height: 220px;
  object-fit: contain;
  object-position: center;
  padding: 0;
  background: transparent;
  image-rendering: auto;
}
.ad-prod-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.ad-prod-card {
  height: 100%;
}
.ad-prod-card .ad-viz-card-visual {
  aspect-ratio: 1 / 1;
  background: #fff;
  border-bottom: 1px solid #eef2f8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
}
.ad-prod-card .ad-viz-card-visual img {
  width: 100%;
  height: 100%;
  max-width: 220px;
  max-height: 220px;
  object-fit: contain;
  object-position: center;
  padding: 0;
  background: transparent;
  image-rendering: auto;
}
.ad-prod-card .ad-viz-card-body {
  gap: 0.55rem;
  flex: 1 1 auto;
}
.ad-prod-card .ad-gc-card-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-prod-card .ad-gc-card-title .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
}
.ad-prod-active-switch {
  margin: 0.1rem 0 0.15rem;
}
.ad-prod-fulfill-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  margin: 0.15rem 0 0.25rem;
}
.ad-prod-fulfill-switches.is-compact {
  margin-top: 0.35rem;
}
.ad-prod-fulfill-switch {
  margin: 0;
  padding: 0.2rem 0.45rem 0.2rem 0.25rem;
  border: 1px solid #e6ebf5;
  border-radius: 999px;
  background: #f8fafc;
  gap: 0.35rem;
}
.ad-prod-fulfill-switch .ad-switch-copy strong {
  font-size: 0.74rem;
}
.ad-prod-fulfill-switch.is-off,
.ad-prod-fulfill-switch:not(:has(input:checked)) {
  opacity: 0.55;
  background: #f1f5f9;
}
.ad-prod-denom-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  max-height: 9.5rem;
  overflow: auto;
  padding: 0.15rem 0 0.25rem;
  margin-top: auto;
}
.ad-prod-denom-switches.is-compact {
  max-height: 7rem;
}
.ad-prod-denom-switch {
  margin: 0;
  padding: 0.2rem 0.4rem 0.2rem 0.25rem;
  border: 1px solid #e6ebf5;
  border-radius: 999px;
  background: #f8fafc;
  gap: 0.35rem;
}
.ad-prod-denom-switch .ad-switch-copy strong {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.ad-prod-denom-switch.is-off,
.ad-prod-denom-switch:not(:has(input:checked)) {
  opacity: 0.55;
  background: #f1f5f9;
}
.ad-prod-card .ad-gc-amts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 2.7rem;
  margin-top: auto;
}
.ad-prod-card .ad-gc-amt {
  min-height: 2.7rem;
  padding: 0.3rem 0.2rem;
}
.ad-prod-card .ad-gc-amt strong { font-size: 0.76rem; }
.ad-prod-card .ad-gc-amt span { font-size: 0.64rem; }
.ad-prod-card .ad-viz-card-actions {
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px solid #eef2f8;
}
.ad-viz-amt-more {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #eef2f8;
  color: #5a6478;
  font-size: 0.75rem;
  font-weight: 800;
}
.ad-viz-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(3, 27, 78, 0.08);
  overflow: hidden;
}
.ad-viz-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ad-blue), #6b8cff);
}
.ad-viz-progress.is-ok > span { background: linear-gradient(90deg, #0a7a4a, #34b27b); }
.ad-viz-progress.is-warn > span { background: linear-gradient(90deg, #b45309, #f0a35a); }
.ad-viz-progress.is-danger > span { background: linear-gradient(90deg, #b42318, #f07167); }
.ad-viz-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ad-soft);
}
.ad-viz-meta-stack {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.12rem;
  line-height: 1.35;
}
.ad-viz-meta-stack strong {
  font-size: inherit;
  color: var(--ad-ink);
}
.ad-viz-meta-stack .muted {
  font-size: 0.74rem;
  font-weight: 600;
}
.ad-viz-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--ad-line);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
}
.ad-viz-pill:hover { border-color: rgba(36, 72, 198, 0.35); background: #eef3ff; }
.ad-viz-pill.is-active { border-color: var(--ad-blue); background: #eef3ff; }

/* Dashboard / reports hero polish */
.ad-viz-hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}
.ad-viz-hero-title h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.ad-viz-hero-title p {
  margin: 0.15rem 0 0;
  color: var(--ad-soft);
  font-size: 0.85rem;
}

/* Partnerzy API — nowocześniejszy podgląd */
.ad-partner-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 900px) {
  .ad-partner-hero { grid-template-columns: 1fr; }
}
.ad-partner-hero .ad-stat .v .badge {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
}
.ad-partner-kit pre {
  margin: 0.75rem 0 0;
  line-height: 1.45;
}

/* Nowe zamówienie ręczne */
.ad-oc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}
.ad-oc-side {
  position: sticky;
  top: 1rem;
}
.ad-oc-search {
  margin: 0;
  padding: 0.85rem 1.1rem 0;
}
.ad-oc-form {
  padding: 0.5rem 1.1rem 1.25rem;
}
.ad-oc-lines {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}
.ad-oc-line {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--ad-line);
  background: linear-gradient(165deg, #fff 0%, #f7f9fc 100%);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.ad-oc-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ad-oc-line-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ad-muted);
}
.ad-oc-sum-lines {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0.65rem 0 0;
  border-top: 1px dashed var(--ad-line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ad-oc-sum-lines li {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ad-ink);
  line-height: 1.35;
}
.ad-oc-section {
  margin: 0 0 1.15rem;
  padding: 1rem 1.05rem;
  border: 1px solid #e4eaf3;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff 0%, #f7f9fc 100%);
}
.ad-oc-section h3 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: #1a2456;
}
.ad-oc-section h3 .muted {
  font-weight: 600;
  font-size: 0.82rem;
}
.ad-oc-hint {
  margin: 0 0 0.75rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #5a6478;
}
.ad-oc-guest {
  display: none;
  margin: 0.75rem 0;
  padding: 0.85rem;
  border-radius: 12px;
  background: #eef3fc;
  border: 1px dashed rgba(36, 72, 198, 0.35);
}
.ad-oc-guest.is-open { display: block; }
.ad-oc-guest .ad-oc-save-customer {
  margin-top: 0.85rem;
  background: #fff;
}
.ad-oc-check-inline {
  display: flex !important;
  align-items: center;
  margin-top: 1.55rem;
}
.ad-oc-shipping-same {
  display: flex !important;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #e4eaf3;
  background: #f7f9fc;
  font-weight: 600;
  color: #1a2456;
  cursor: pointer;
}
.ad-oc-shipping-same input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.ad-oc-shipping-fields {
  margin-top: 0.35rem;
  padding: 0.85rem 0.95rem 0.2rem;
  border-radius: 14px;
  border: 1px dashed rgba(36, 72, 198, 0.28);
  background: #fafbff;
}
.ad-oc-pdf-brand,
.ad-oc-brand {
  margin-top: 1rem;
  margin-bottom: 0.35rem;
  border-radius: 18px;
  border: 1px solid #c9d7f5;
  background: linear-gradient(165deg, #f7faff 0%, #eef4ff 48%, #f8fbff 100%);
  box-shadow: 0 10px 28px rgba(36, 72, 198, 0.07);
  overflow: hidden;
}
.ad-oc-brand a {
  color: var(--ad-blue);
  font-weight: 700;
}
.ad-oc-brand-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.1rem 0.95rem;
  border-bottom: 1px solid rgba(36, 72, 198, 0.1);
}
.ad-oc-brand-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: rgba(36, 72, 198, 0.1);
  color: #2448c6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ad-oc-brand-title {
  margin: 0.45rem 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: #12204a;
  letter-spacing: -0.02em;
}
.ad-oc-brand-lead {
  margin: 0;
  max-width: 42rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #5a6478;
}
.ad-oc-brand-switch {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  min-width: 15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid #d5e0f5;
  background: #fff;
  cursor: pointer;
}
.ad-oc-brand-switch input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #2448c6;
}
.ad-oc-brand-switch strong {
  display: block;
  font-size: 0.88rem;
  color: #12204a;
}
.ad-oc-brand-switch em {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-size: 0.78rem;
  color: #7a8499;
  line-height: 1.35;
}
.ad-oc-brand-body {
  padding: 1rem 1.1rem 1.15rem;
}
.ad-oc-brand-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(220px, 0.85fr);
  gap: 1.1rem;
  align-items: start;
}
.ad-oc-brand-controls {
  display: grid;
  gap: 0.85rem;
}
.ad-oc-brand-field {
  display: grid;
  gap: 0.35rem;
}
.ad-oc-brand-field > span {
  font-size: 0.8rem;
  font-weight: 700;
  color: #33415f;
}
.ad-oc-brand-field input[type="text"] {
  width: 100%;
}
.ad-oc-drop {
  position: relative;
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1.5px dashed #b7c8ea;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ad-oc-drop:hover,
.ad-oc-drop.is-drag {
  border-color: #2448c6;
  background: #fff;
  box-shadow: 0 8px 20px rgba(36, 72, 198, 0.08);
}
.ad-oc-drop.is-sm {
  padding: 0.8rem 0.9rem;
}
.ad-oc-drop.is-filled {
  border-style: solid;
  border-color: #8eabe8;
  background: #fff;
}
.ad-oc-drop-inner {
  display: grid;
  gap: 0.18rem;
  pointer-events: none;
}
.ad-oc-drop-inner strong {
  font-size: 0.9rem;
  color: #12204a;
}
.ad-oc-drop-inner span {
  font-size: 0.78rem;
  color: #7a8499;
}
.ad-oc-drop-inner em {
  margin-top: 0.25rem;
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2448c6;
}
.ad-oc-brand-tips {
  display: grid;
  gap: 0.4rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(36, 72, 198, 0.05);
  border: 1px solid rgba(36, 72, 198, 0.1);
  font-size: 0.8rem;
  color: #4b5872;
  line-height: 1.4;
}
.ad-oc-brand-preview-wrap {
  position: sticky;
  top: 0.75rem;
}
.ad-oc-brand-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.ad-oc-brand-preview-head strong {
  font-size: 0.82rem;
  color: #12204a;
}
.ad-oc-brand-preview-head span {
  font-size: 0.75rem;
  font-weight: 700;
  color: #2448c6;
}
.ad-oc-brand-stage {
  padding: 0.85rem;
  border-radius: 16px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,0.75), transparent 40%),
    linear-gradient(160deg, #dbe6fb 0%, #c7d6f4 100%);
  border: 1px solid #c2d1ee;
}
.ad-oc-a4 {
  position: relative;
  width: min(100%, 280px);
  margin: 0 auto;
  aspect-ratio: 210 / 297;
  border-radius: 10px;
  overflow: hidden;
  background: #eef3fb;
  box-shadow: 0 16px 40px rgba(18, 32, 74, 0.22);
}
.ad-oc-brand-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.15rem 0 0.35rem;
}
.ad-oc-brand-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #c9d6ef;
  background: #f4f7ff;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a2456;
  cursor: pointer;
  user-select: none;
}
.ad-oc-brand-toggle input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: #2448c6;
}
.ad-oc-brand-toggle:has(input:not(:checked)) {
  background: #f3f4f7;
  border-color: #d5d9e2;
  color: #647087;
}
.ad-oc-a4-bg {
  position: absolute;
  inset: 0;
  background-image: var(--oc-bg);
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
  background-color: #fff;
  z-index: 0;
}
.ad-oc-a4-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  display: block;
  pointer-events: none;
  background: #fff;
}
.ad-oc-a4-bg-img.is-broken {
  display: none;
}
.ad-oc-a4-bg.is-custom {
  filter: none;
  background-size: contain;
}
.ad-oc-a4-logo {
  position: absolute;
  z-index: 6;
  background: center / contain no-repeat;
  min-height: 4%;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12));
  pointer-events: none;
  touch-action: none;
}
.ad-oc-a4-logo.is-draggable {
  pointer-events: auto;
  cursor: grab;
  outline: 1px dashed transparent;
  border-radius: 4px;
}
.ad-oc-a4-logo.is-draggable:hover,
.ad-oc-a4-logo.is-dragging {
  outline-color: rgba(36, 72, 198, 0.55);
  background-color: rgba(255, 255, 255, 0.08);
}
.ad-oc-a4-logo.is-dragging {
  cursor: grabbing;
  z-index: 8;
}
.ad-oc-a4-logo-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #2448c6;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(3, 27, 78, 0.35);
  cursor: nwse-resize;
  pointer-events: auto;
}
.ad-oc-logo-tools {
  margin: 0.15rem 0 0.55rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(36, 72, 198, 0.14);
  background: #f5f8ff;
}
.ad-oc-logo-size-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.ad-oc-logo-size-row input[type="range"] {
  flex: 1;
  accent-color: #2448c6;
}
.ad-oc-logo-size-row strong {
  min-width: 3.6rem;
  font-size: 0.82rem;
  color: #1a2456;
}
.ad-oc-logo-hint {
  margin: 0.45rem 0 0;
  font-size: 0.76rem;
  color: #647087;
  line-height: 1.35;
}
.ad-oc-a4-name,
.ad-oc-a4-amount,
.ad-oc-a4-code {
  position: absolute;
  z-index: 3;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.ad-oc-a4-name {
  font-size: 11px;
  color: #1a2456;
  text-align: right;
}
.ad-oc-a4-amount {
  letter-spacing: -0.02em;
}
.ad-oc-a4-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}
.ad-oc-a4-barcode {
  position: absolute;
  z-index: 2;
  border-radius: 4px;
  background:
    repeating-linear-gradient(
      90deg,
      #1a2456 0 2px,
      transparent 2px 4px,
      #1a2456 4px 5px,
      transparent 5px 8px,
      #1a2456 8px 11px,
      transparent 11px 13px
    );
  opacity: 0.88;
}
.ad-oc-brand-preview-note {
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.74rem;
  color: #7a8499;
  line-height: 1.4;
}
@media (max-width: 980px) {
  .ad-oc-brand-top {
    grid-template-columns: 1fr;
  }
  .ad-oc-brand-switch {
    min-width: 0;
  }
  .ad-oc-brand-grid {
    grid-template-columns: 1fr;
  }
  .ad-oc-brand-preview-wrap {
    position: static;
  }
}
.ad-oc-pdf-brand-fields {
  margin-top: 0.35rem;
}
.ad-oc-readonly {
  font-weight: 800 !important;
  background: #f0f3f9 !important;
}
.ad-oc-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ad-ink);
  margin-bottom: 0.4rem;
}
.ad-oc-product-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0.65rem 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e4eaf3;
}
.ad-oc-product-meta[hidden] {
  display: none !important;
}
.ad-oc-product-meta img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
  background: #eef2f8;
}
.ad-oc-product-meta strong { display: block; }
.ad-oc-amts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  min-height: 2.4rem;
}
.ad-oc-amt {
  appearance: none;
  border: 1.5px solid #dce3f0;
  background: #fff;
  border-radius: 14px;
  padding: 0.55rem 0.85rem 0.5rem;
  font: inherit;
  color: #1a2456;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 5.5rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
  box-shadow: 0 1px 0 rgba(3, 27, 78, 0.04);
}
.ad-oc-amt:hover {
  border-color: rgba(36, 72, 198, 0.45);
  transform: translateY(-1px);
}
.ad-oc-amt-val {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.ad-oc-amt-stock {
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b7793;
  letter-spacing: 0.02em;
}
.ad-oc-amt.is-active {
  background: linear-gradient(160deg, var(--ad-blue) 0%, #3a5fd4 100%);
  border-color: var(--ad-blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(36, 72, 198, 0.22);
}
.ad-oc-amt.is-active .ad-oc-amt-stock { color: rgba(255, 255, 255, 0.82); }
.ad-oc-amt.is-empty {
  background: #fff7f6;
  border-color: #f0c9c4;
  opacity: 0.85;
}
.ad-oc-amt.is-empty .ad-oc-amt-stock { color: #b42318; }
.ad-oc-amt.is-low {
  background: #fffaf3;
  border-color: #f0d7b0;
}
.ad-oc-amt.is-low .ad-oc-amt-stock { color: #b45309; }
.ad-oc-amt.is-ok {
  background: #f3fbf6;
  border-color: #c6e8d4;
}
.ad-oc-amt.is-ok .ad-oc-amt-stock { color: #0a7a4a; }
.ad-oc-amt.is-active.is-ok,
.ad-oc-amt.is-active.is-low,
.ad-oc-amt.is-active.is-empty {
  background: linear-gradient(160deg, var(--ad-blue) 0%, #3a5fd4 100%);
  border-color: var(--ad-blue);
}
.ad-oc-mail-edit {
  margin-top: 0.85rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid #e4eaf3;
  background: #f8faff;
}
.ad-oc-mail-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.ad-oc-mail-edit-head strong {
  font-size: 0.9rem;
  color: #1a2456;
}
.ad-oc-mail-edit input[type="color"] {
  height: 42px;
  padding: 0.25rem;
  max-width: 5.5rem;
}
.ad-oc-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.ad-oc-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #e4eaf3;
  background: #fff;
  cursor: pointer;
}
.ad-oc-toggle:has(input:checked) {
  border-color: #1e4fd6;
  background: #f4f7ff;
  box-shadow: 0 0 0 1px rgba(30, 79, 214, 0.12);
}
.ad-oc-toggle[hidden] { display: none !important; }
.ad-oc-toggle input { margin-top: 0.2rem; }
.ad-oc-toggle strong { display: block; color: #1a2456; font-size: 0.9rem; }
.ad-oc-toggle em {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.8rem;
  color: #5a6478;
  line-height: 1.4;
  font-weight: 500;
}
.ad-oc-submit {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.25rem;
}
.ad-oc-summary {
  padding: 0 1.1rem 1.15rem;
}
.ad-oc-sum-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #eef2f8;
  font-size: 0.88rem;
  color: #5a6478;
}
.ad-oc-sum-row strong {
  color: #1a2456;
  text-align: right;
  font-weight: 800;
}
.ad-oc-sum-row.is-grand {
  margin-top: 0.35rem;
  padding-top: 0.7rem;
  border-bottom: 0;
  font-size: 1rem;
}
.ad-oc-sum-row.is-grand strong {
  color: var(--ad-blue);
  font-size: 1.15rem;
}

/* Order-create — email template */
.ad-oc-mail-brand {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--ad-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8faff 0%, #fff 42%);
}
.ad-oc-mail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.ad-oc-mail-type-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 10px;
  background: #e8eefb;
  gap: 0.15rem;
}
.ad-oc-mail-type {
  border: 0;
  background: transparent;
  color: var(--ad-soft);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
}
.ad-oc-mail-type.is-active {
  background: #fff;
  color: var(--ad-blue);
  box-shadow: 0 1px 3px rgba(15, 27, 61, 0.08);
}
.ad-oc-align-fields {
  align-items: end;
}
.ad-oc-align-fields > label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}
.ad-oc-field-label {
  display: block;
  min-height: 1.35em;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: #1a2456;
  font-size: 0.88rem;
}
.ad-oc-field-label .muted {
  font-weight: 500;
  white-space: nowrap;
}
.ad-oc-mail-modes-solo {
  grid-template-columns: 1fr !important;
}
.ad-oc-mail-brand[hidden],
.ad-oc-mail-type-toggle[hidden] {
  display: none !important;
}
.ad-oc-mail-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.ad-oc-mail-mode {
  display: block;
  cursor: pointer;
  margin: 0;
}
.ad-oc-mail-mode.is-solo {
  cursor: default;
  grid-column: 1 / -1;
}
.ad-oc-mail-mode > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ad-oc-mail-mode-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 100%;
  padding: 0.9rem;
  border: 1.5px solid #d8e0ef;
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ad-oc-mail-mode:hover .ad-oc-mail-mode-card {
  border-color: #94a8d8;
}
.ad-oc-mail-mode:has(input:checked) .ad-oc-mail-mode-card {
  border-color: var(--ad-blue);
  background: #f4f7ff;
  box-shadow: inset 0 0 0 1px rgba(36, 72, 198, 0.18);
}
.ad-oc-mail-mode.is-solo {
  cursor: default;
}
.ad-oc-mail-mode-card.is-selected {
  border-color: var(--ad-blue);
  background: #f4f7ff;
  box-shadow: inset 0 0 0 1px rgba(36, 72, 198, 0.18);
}
.ad-oc-mail-logo-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e6ebf5;
}
.ad-oc-mail-logo-slot.is-benefiteo {
  background: linear-gradient(180deg, #ffffff 0%, #f3f6ff 100%);
}
.ad-oc-mail-logo-slot.is-partner {
  background: #f8fafc;
}
.ad-oc-mail-logo-slot img {
  display: block;
  max-width: 150px;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.ad-oc-mail-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #e8eefb;
  color: var(--ad-blue);
}
.ad-oc-mail-logo-fallback .shop-icon {
  width: 20px;
  height: 20px;
}
.ad-oc-mail-mode-copy strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ad-ink);
}
.ad-oc-mail-mode-copy em {
  display: block;
  font-style: normal;
  color: var(--ad-soft);
  font-size: 0.8rem;
  line-height: 1.45;
  margin-top: 0.25rem;
}
.ad-oc-mail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.65rem;
}
.ad-oc-mail-tags span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: #eef2fb;
  color: #4a5d86;
}
.ad-oc-mail-mode:has(input:checked) .ad-oc-mail-tags span {
  background: rgba(36, 72, 198, 0.12);
  color: var(--ad-blue);
}
.ad-oc-mail-branded {
  margin-top: 0.85rem;
  padding: 0.9rem;
  border-radius: 12px;
  border: 1px dashed #c9d4ea;
  background: #fff;
}
.ad-oc-mail-branded-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.ad-oc-mail-branded-head strong {
  font-size: 0.88rem;
  color: var(--ad-ink);
}
.ad-oc-color-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.ad-oc-color-wrap input[type="color"] {
  width: 46px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ad-line);
  border-radius: 8px;
  background: #fff;
}
.ad-oc-mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
  margin-top: 0.9rem;
}
.ad-oc-preview-chrome {
  margin-top: 0.9rem;
  border: 1px solid #d8e0ef;
  border-radius: 14px;
  overflow: hidden;
  background: #0c1a33;
  box-shadow: 0 10px 28px rgba(12, 26, 51, 0.12);
}
.ad-oc-preview-chrome-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  color: #fff;
  font-size: 0.75rem;
}
.ad-oc-preview-chrome-bar strong {
  font-weight: 700;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-oc-preview-chrome-bar em {
  font-style: normal;
  opacity: 0.75;
  white-space: nowrap;
}
.ad-oc-preview-dots {
  display: inline-flex;
  gap: 0.28rem;
}
.ad-oc-preview-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5f57;
  display: block;
}
.ad-oc-preview-dots i:nth-child(2) { background: #febc2e; }
.ad-oc-preview-dots i:nth-child(3) { background: #28c840; }
.ad-oc-preview-box {
  background: #e8edf5;
}
.ad-oc-preview-box iframe {
  width: 100%;
  height: 520px;
  border: 0;
  background: #e8edf5;
  display: block;
}
@media (max-width: 980px) {
  .ad-oc-layout { grid-template-columns: 1fr; }
  .ad-oc-side { position: static; order: -1; }
  .ad-oc-mail-modes { grid-template-columns: 1fr; }
  .ad-oc-preview-box iframe { height: 420px; }
}

/* Settings — status tiles */
.ad-set-hero {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.ad-set-tile {
  appearance: none;
  border: 1px solid #e4eaf3;
  border-radius: 18px;
  background: linear-gradient(165deg, #fff 0%, #f4f7fc 100%);
  padding: 1.05rem 1.1rem 1.15rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 9.5rem;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  font: inherit;
  color: inherit;
}
.ad-set-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(3, 27, 78, 0.1);
  border-color: rgba(36, 72, 198, 0.35);
}
.ad-set-tile.is-ok { border-color: rgba(10, 122, 74, 0.28); }
.ad-set-tile.is-warn { border-color: rgba(180, 83, 9, 0.3); background: linear-gradient(165deg, #fff 0%, #fff8f0 100%); }
.ad-set-tile.is-off { opacity: 0.92; }
.ad-set-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.ad-set-tile-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef3fc;
  color: var(--ad-blue);
}
.ad-set-tile-icon .shop-icon { width: 18px; height: 18px; }
.ad-set-tile strong {
  font-size: 1.05rem;
  color: #1a2456;
  letter-spacing: -0.01em;
}
.ad-set-tile em {
  font-style: normal;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #5a6478;
  font-weight: 600;
}
.ad-set-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #eef2f8;
  color: #5a6478;
}
.ad-set-badge.is-ok { background: #e8f7ee; color: #0a7a4a; }
.ad-set-badge.is-warn { background: #fff1e0; color: #b45309; }
.ad-set-badge.is-off { background: #eef2f8; color: #7a8499; }
.ad-set-health {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.15rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  border: 1px solid #e4eaf3;
  background: #f7f9fc;
}
.ad-set-health.is-ok {
  background: #eefaf3;
  border-color: rgba(10, 122, 74, 0.22);
}
.ad-set-health.is-warn {
  background: #fff8f0;
  border-color: rgba(180, 83, 9, 0.25);
}
.ad-set-health strong { display: block; color: #1a2456; margin-bottom: 0.2rem; }
.ad-set-health p { margin: 0; font-size: 0.86rem; color: #5a6478; line-height: 1.4; }
.ad-set-row-go {
  font-style: normal !important;
  font-weight: 800 !important;
  color: var(--ad-blue) !important;
}
.ad-settings-list a.ad-settings-row { text-decoration: none; color: inherit; }

.ad-form-section-title {
  margin: 1.1rem 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a8499;
}
.ad-form-section-title:first-child { margin-top: 0; }

.ad-company-preview {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid #e4eaf3;
  background: linear-gradient(165deg, #f7f9fc 0%, #eef3fc 100%);
  margin-bottom: 0.25rem;
}
.ad-company-preview.is-ok {
  border-color: rgba(10, 122, 74, 0.28);
  background: linear-gradient(165deg, #f3fbf6 0%, #e8f7ee 100%);
}
.ad-company-preview.is-warn {
  border-color: rgba(180, 83, 9, 0.28);
  background: linear-gradient(165deg, #fffaf3 0%, #fff1e0 100%);
}
.ad-company-preview-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a8499;
  margin-bottom: 0.45rem;
}
.ad-company-preview strong {
  display: block;
  font-size: 1.05rem;
  color: #1a2456;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}
.ad-company-preview p {
  margin: 0.12rem 0;
  color: #5a6478;
  font-size: 0.9rem;
  line-height: 1.4;
}
.ad-company-preview-miss {
  margin-top: 0.55rem !important;
  color: #b45309 !important;
  font-weight: 700;
  font-size: 0.84rem !important;
}
.ad-modal-body .ad-company-preview { margin-bottom: 1rem; }

@media (max-width: 1100px) {
  .ad-set-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ad-set-hero { grid-template-columns: 1fr; }
  .ad-set-health { flex-direction: column; align-items: stretch; }
}

/* Reports polish — Plusik-style type tabs + export cards */
.ad-reports-period {
  margin: 0 0 0.85rem;
  padding: 1.05rem 1.15rem 1.15rem;
  border-radius: 18px;
  border: 1px solid #e4eaf3;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(36, 72, 198, 0.1), transparent 55%),
    linear-gradient(180deg, #fff 0%, #f4f7fc 100%);
}
.ad-reports-period-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.ad-reports-period-head h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #1a2456;
}

.ad-rep-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ad-rep-preset {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
.ad-rep-preset:hover {
  border-color: #93a8e8;
  color: #1a2456;
  background: #f5f7ff;
  text-decoration: none;
}
.ad-rep-preset.is-active {
  border-color: #3d5fd9;
  background: #3d5fd9;
  color: #fff;
  box-shadow: 0 8px 18px rgba(61, 95, 217, 0.22);
}

.ad-rep-type-section {
  margin: 0 0 1rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 22px;
  border: 1px solid #e4eaf3;
  background: #fff;
  box-shadow: 0 12px 32px rgba(3, 27, 78, 0.05);
}
.ad-rep-type-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.ad-rep-type-eyebrow {
  margin: 0 0 0.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3d5fd9;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-rep-type-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  color: #031b4e;
}
.ad-rep-type-lead {
  margin: 0.4rem 0 0;
  max-width: 46rem;
  color: #5a6b8c;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.55;
}
.ad-rep-type-lead strong { color: #031b4e; }
.ad-rep-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #1a2456;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.ad-rep-count-pill .shop-icon { width: 14px; height: 14px; }

.ad-rep-type-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}
.ad-rep-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 7.5rem;
  padding: 0.95rem 0.95rem 0.85rem;
  border-radius: 18px;
  border: 1px solid #e8ecf5;
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
}
.ad-rep-type-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(3, 27, 78, 0.08);
  text-decoration: none;
  color: inherit;
  border-color: #c5d0f0;
}
.ad-rep-type-card.is-active {
  border-color: #93a8e8;
  background: linear-gradient(135deg, #eef2ff 0%, #fff 58%);
  box-shadow: 0 12px 28px rgba(61, 95, 217, 0.12);
}
.ad-rep-type-icon {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ad-rep-type-icon .shop-icon { width: 15px; height: 15px; }
.ad-rep-type-icon--indigo { background: #eef2ff; color: #3d5fd9; }
.ad-rep-type-icon--emerald { background: #ecfdf5; color: #059669; }
.ad-rep-type-icon--violet { background: #f5f3ff; color: #6d28d9; }
.ad-rep-type-icon--amber { background: #fffbeb; color: #d97706; }
.ad-rep-type-icon--rose { background: #fff1f2; color: #e11d48; }
.ad-rep-type-icon--sky { background: #e0f2fe; color: #0284c7; }
.ad-rep-type-sub {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.ad-rep-type-label {
  font-size: 0.92rem;
  font-weight: 900;
  color: #031b4e;
  line-height: 1.2;
  padding-right: 1.4rem;
}
.ad-rep-type-desc {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}
.ad-rep-type-check {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #fff;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.ad-rep-type-check .shop-icon { width: 11px; height: 11px; }
.ad-rep-type-card.is-active .ad-rep-type-check {
  opacity: 1;
  background: #3d5fd9;
}

.ad-rep-export-panel {
  padding: 1.15rem 1.2rem 1.25rem;
  margin: 0 0 1rem;
}
.ad-rep-export-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.ad-rep-export-head h2 {
  margin: 0.35rem 0 0;
  font-size: 1.1rem;
  color: #031b4e;
}
.ad-rep-export-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3d5fd9;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-rep-export-eyebrow .shop-icon { width: 12px; height: 12px; }
.ad-rep-export-lead {
  margin: 0.45rem 0 0;
  max-width: 42rem;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.55;
}
.ad-rep-export-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}
.ad-rep-export-group-label {
  margin: 0 0 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #3d5fd9;
}
.ad-rep-export-group-label .shop-icon { width: 13px; height: 13px; }
.ad-rep-export-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.ad-rep-export-type {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid #e8ecf5;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s, background .15s;
  min-width: 0;
}
.ad-rep-export-type:hover {
  border-color: #3d5fd9;
  box-shadow: 0 10px 24px rgba(61, 95, 217, 0.12);
  transform: translateY(-1px);
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #f5f7ff, #fff);
}
.ad-rep-export-type-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ad-rep-export-type-icon .shop-icon { width: 15px; height: 15px; }
.ad-rep-export-type-body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1;
}
.ad-rep-export-type-body small {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #3d5fd9;
}
.ad-rep-export-type-body strong {
  font-size: 0.86rem;
  color: #031b4e;
  line-height: 1.25;
}
.ad-rep-export-type-body span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.35;
}
.ad-rep-export-type-action {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3d5fd9;
  font-size: 0.7rem;
  font-weight: 800;
}
.ad-rep-export-more {
  margin-top: 0.85rem;
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.75rem;
}
.ad-rep-export-more > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 800;
  color: #3d5fd9;
  user-select: none;
}
.ad-rep-export-more > summary::-webkit-details-marker { display: none; }
.ad-rep-export-more > summary::before { content: '▸ '; }
.ad-rep-export-more[open] > summary::before { content: '▾ '; }
.ad-rep-export-more[open] .ad-rep-export-types { margin-top: 0.75rem; }

.ad-reports-views {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e4eaf3;
}
.ad-reports-views-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #5a6478;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ad-reports-exports {
  margin: 1rem 0;
  padding-bottom: 1rem;
}
.ad-reports-exports .ad-reports-export-grid {
  padding: 0 1.1rem 0.25rem;
}
.ad-reports-export-card {
  background: linear-gradient(180deg, #fff 0%, #f7f9fc 100%);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ad-reports-export-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(3, 27, 78, 0.08);
}

@media (max-width: 1200px) {
  .ad-rep-type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ad-rep-export-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .ad-rep-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-rep-export-types { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ad-rep-type-grid { grid-template-columns: 1fr; }
  .ad-rep-type-head { flex-direction: column; }
}

/* Order detail */
.ad-od-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.ad-od-top-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}
.ad-od-title { min-width: 0; }
.ad-od-number-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
}
.ad-od-number {
  margin: 0;
  font-family: var(--ad-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ad-ink);
  line-height: 1.15;
}
.ad-od-sub {
  margin: 0.35rem 0 0;
  color: var(--ad-soft);
  font-size: 0.88rem;
  font-weight: 600;
}
.ad-od-nav {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ad-od-hero { margin-bottom: 0.85rem; }
.ad-od-hero.is-warn {
  border-radius: 18px;
}
.ad-od-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
}
.ad-od-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.9fr);
  gap: 1rem;
  align-items: start;
}
.ad-od-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ad-od-side .ad-panel { margin: 0; }
.ad-od-customer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 1.1rem 0.85rem;
}
.ad-od-avatar {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--ad-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ad-blue);
  background: linear-gradient(145deg, #e8eeff 0%, #f4f7fc 100%);
  border: 1px solid rgba(36, 72, 198, 0.16);
  flex-shrink: 0;
}
.ad-od-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.35rem 1.1rem 1.1rem;
}
.ad-od-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--ad-line);
  background: linear-gradient(165deg, #fff 0%, #f7f9fc 100%);
}
.ad-od-item.no-code {
  border-color: rgba(180, 83, 9, 0.22);
  background: linear-gradient(165deg, #fff 0%, #fff8f0 100%);
}
.ad-od-item-media {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2f8;
  display: grid;
  place-items: center;
}
.ad-od-item-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.ad-od-item-ph {
  color: #7a8499;
  display: grid;
  place-items: center;
}
.ad-od-item-ph .shop-icon { width: 1.4rem; height: 1.4rem; }
.ad-od-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}
.ad-od-item-head strong {
  font-size: 1rem;
  color: var(--ad-ink);
}
.ad-od-item-amount {
  font-family: var(--ad-display);
  font-weight: 800;
  color: var(--ad-ink);
  white-space: nowrap;
}
.ad-od-item-meta {
  margin-top: 0.15rem;
  font-size: 0.8rem;
}
.ad-od-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.7rem;
}
.ad-od-code {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  background: rgba(3, 27, 78, 0.03);
  border: 1px solid rgba(3, 27, 78, 0.06);
}
.ad-od-code .k {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ad-soft);
  flex-shrink: 0;
}
.ad-od-code code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ad-ink);
}
.ad-od-missing {
  font-size: 0.82rem;
  font-weight: 700;
  color: #b45309;
}
.ad-od-note {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.25rem 1.1rem 1.1rem;
}
.ad-od-note textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--ad-line);
  padding: 0.7rem 0.8rem;
  font: inherit;
  resize: vertical;
  min-height: 5.5rem;
  background: #fff;
}
.ad-od-note textarea:focus {
  outline: 2px solid rgba(36, 72, 198, 0.25);
  border-color: rgba(36, 72, 198, 0.35);
}
.ad-od-timeline {
  list-style: none;
  margin: 0;
  padding: 0.15rem 1.1rem 1.1rem;
}
.ad-od-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0 0 0.95rem;
}
.ad-od-timeline li:last-child { padding-bottom: 0; }
.ad-od-timeline li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: rgba(3, 27, 78, 0.08);
}
.ad-od-tl-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 0.2rem;
  background: #c5cde0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(3, 27, 78, 0.12);
  z-index: 1;
}
.ad-od-timeline li.is-ok .ad-od-tl-dot { background: #0a7a4a; }
.ad-od-timeline li.is-void .ad-od-tl-dot { background: #b42318; }
.ad-od-tl-body strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ad-ink);
}
.ad-od-tl-body .muted {
  font-size: 0.78rem;
  margin-top: 0.12rem;
}
.ad-od-tl-body time {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
}
[data-ad-copy].is-copied {
  color: #0a7a4a !important;
  border-color: rgba(10, 122, 74, 0.35) !important;
}
.ad-maint [data-ad-copy].is-copied {
  color: #86efac !important;
  border-color: transparent !important;
}
@media (max-width: 960px) {
  .ad-od-layout { grid-template-columns: 1fr; }
  .ad-od-codes { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ad-od-top { flex-direction: column; }
  .ad-od-top-main { flex-direction: column; }
  .ad-od-item { grid-template-columns: 52px minmax(0, 1fr); }
  .ad-od-item-media { width: 52px; height: 52px; }
}


/* Import CSV modal (even grid) */
.ad-import-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#ad-modal-confirm {
  z-index: 420;
}
#ad-modal-import.is-open {
  z-index: 300;
}
.ad-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: #f6f8fc;
  border: 1px solid var(--ad-line);
}
.ad-import-toolbar-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 180px;
}
.ad-import-toolbar-copy strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--ad-ink);
  line-height: 1.25;
}
.ad-import-toolbar-copy span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ad-soft);
  line-height: 1.35;
  word-break: break-word;
}
.ad-import-toolbar .ad-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.ad-import-sku-box {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #f4f7ff 0%, #eef3fc 100%);
  border: 1px solid rgba(36, 72, 198, 0.18);
}
.ad-import-sku-box-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ad-soft);
  margin-bottom: 0.35rem;
}
.ad-import-sku-box-main {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ad-ink);
  line-height: 1.45;
}
.ad-import-sku-box-main code,
.ad-import-sku-code,
.ad-import-sku-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.84em;
  font-weight: 700;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  background: #fff;
  border: 1px solid rgba(36, 72, 198, 0.2);
  color: #1a3a9e;
}
.ad-import-sku-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.ad-import-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
@media (min-width: 640px) {
  .ad-import-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}
.ad-import-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}
.ad-import-field-full { margin-bottom: 0.85rem; }
.ad-import-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ad-ink);
  line-height: 1.2;
  min-height: 1.2em;
}
.ad-import-hint {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ad-soft);
  line-height: 1.3;
  min-height: 1.3em;
  margin-bottom: 0.1rem;
}
.ad-import-field input,
.ad-import-field select,
.ad-import-field textarea {
  height: 44px;
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--ad-line);
  border-radius: 12px;
  padding: 0 0.85rem;
  font: inherit;
  font-weight: 600;
  color: var(--ad-ink);
  background: #fff;
}
.ad-import-field textarea {
  height: auto;
  min-height: 7.5rem;
  padding: 0.75rem 0.85rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
}
.ad-import-field input[type="file"] {
  padding: 0.55rem 0.65rem;
  height: auto;
  min-height: 44px;
  line-height: 1.3;
}
.ad-import-file-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.ad-import-file-row input[type="file"] {
  flex: 1;
  min-width: 0;
}
.ad-import-file-row .ad-btn {
  flex-shrink: 0;
  height: 44px;
}
.ad-stock-import-delete {
  display: inline;
  margin: 0;
}
#ad-stock-imports .ad-table td strong {
  font-weight: 800;
}
.ad-import-field input:focus,
.ad-import-field select:focus,
.ad-import-field textarea:focus {
  outline: none;
  border-color: var(--ad-blue);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.14);
}
#ad-modal-import .ad-modal-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}
#ad-modal-import .ad-modal-note { margin-top: 0.15rem; }

/* Gift-cards empty / warehouse notice */
.ad-gc-empty {
  padding: 1.25rem 1.1rem;
  text-align: left;
}
.ad-gc-empty strong {
  display: block;
  font-size: 0.98rem;
  color: var(--ad-ink);
  margin-bottom: 0.35rem;
}
.ad-gc-empty p {
  margin: 0 0 0.85rem;
  color: var(--ad-soft);
  font-size: 0.88rem;
  line-height: 1.45;
  font-weight: 600;
  max-width: 52rem;
}
.ad-gc-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* Orders detail modal */
.ad-od-pts { white-space: nowrap; font-weight: 700; font-size: 0.84rem; }
.ad-od-pts-spend { color: #b45309; }
.ad-od-pts-earn { color: #0a7a4a; }

.ad-odm-status { margin-bottom: 0.85rem; display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.ad-order-pay-select.is-paid {
  background: #eef7f1;
  box-shadow: inset 0 0 0 1px rgba(16, 122, 74, 0.12);
}
.ad-order-pay-select.is-paid select { color: #166534; }
.ad-order-pay-select.is-paid .ad-status-dot {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
}
.ad-order-pay-select.is-unpaid {
  background: #fff7ed;
  box-shadow: inset 0 0 0 1px rgba(194, 65, 12, 0.14);
}
.ad-order-pay-select.is-unpaid select { color: #c2410c; }
.ad-order-pay-select.is-unpaid .ad-status-dot {
  background: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.16);
}
.ad-order-pay-select.is-cancelled {
  background: #f4f5f8;
  box-shadow: inset 0 0 0 1px rgba(90, 100, 120, 0.16);
}
.ad-order-pay-select.is-cancelled select { color: #475569; }
.ad-order-pay-select.is-cancelled .ad-status-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}
.ad-order-sent-select.is-sent {
  background: #eef2ff;
  box-shadow: inset 0 0 0 1px rgba(67, 56, 202, 0.14);
}
.ad-order-sent-select.is-sent select { color: #3730a3; }
.ad-order-sent-select.is-sent .ad-status-dot {
  background: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}
.ad-order-sent-select.is-unsent {
  background: #f4f5f8;
  box-shadow: inset 0 0 0 1px rgba(90, 100, 120, 0.16);
}
.ad-order-sent-select.is-unsent select { color: #64748b; }
.ad-order-sent-select.is-unsent .ad-status-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}
.ad-orders-col-status { min-width: 9.5rem; }
.ad-order-pay-select,
.ad-order-sent-select { min-width: 9.25rem; }
.ad-odm-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.ad-odm-kpi {
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--ad-line);
  background: linear-gradient(165deg, #fff 0%, #f7f9fc 100%);
  min-width: 0;
}
.ad-odm-kpi.is-muted {
  opacity: 0.72;
  background: #f8fafc;
}
.ad-odm-kpi .k {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ad-soft);
  margin-bottom: 0.25rem;
}
.ad-odm-kpi strong {
  display: block;
  font-family: var(--ad-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ad-ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.ad-odm-kpi .is-spend { color: #b45309; }
.ad-odm-kpi .is-earn { color: #0a7a4a; }
.ad-odm-kpi .is-none { color: var(--ad-muted); font-weight: 700; }

.ad-odm-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.ad-odm-panel {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--ad-line);
  background: #fff;
}
.ad-odm-customer {
  background: linear-gradient(145deg, #eef3ff 0%, #f8fafc 70%);
  border-color: rgba(36, 72, 198, 0.12);
}
.ad-odm-panel-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ad-soft);
  margin-bottom: 0.75rem;
}
.ad-odm-panel-title .shop-icon {
  width: 16px;
  height: 16px;
  color: var(--ad-blue);
}
.ad-odm-meta { margin: 0; }
.ad-odm-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}
.ad-odm-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--ad-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ad-blue);
  background: #fff;
  border: 1px solid rgba(36, 72, 198, 0.16);
  flex-shrink: 0;
}
.ad-odm-user-text strong {
  display: block;
  font-size: 0.98rem;
  color: var(--ad-ink);
}
.ad-odm-lines-panel { padding-bottom: 0.65rem; }
.ad-odm-lines {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(48vh, 440px);
  overflow: auto;
  padding-right: 0.15rem;
}
.ad-odm-line {
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--ad-line);
  background: linear-gradient(165deg, #fff 0%, #f7f9fc 100%);
}
.ad-odm-line.has-code {
  border-color: rgba(10, 122, 74, 0.22);
  background: linear-gradient(165deg, #fff 0%, #f3fbf7 100%);
}
.ad-odm-line-main {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.35rem;
}
.ad-odm-line-main strong { color: var(--ad-ink); font-size: 0.95rem; }
.ad-odm-line-amt {
  font-family: var(--ad-display);
  font-weight: 800;
  white-space: nowrap;
  color: var(--ad-ink);
}
.ad-odm-line-meta {
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
}
.ad-odm-line-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.ad-odm-code {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border-radius: 10px;
  background: rgba(3, 27, 78, 0.03);
  border: 1px solid rgba(3, 27, 78, 0.06);
}
.ad-odm-code-wide {
  grid-column: 1 / -1;
}
.ad-odm-code .k {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ad-soft);
  flex-shrink: 0;
}
.ad-odm-code code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 700;
}
.ad-odm-code code.ad-odm-code-val {
  white-space: normal;
  word-break: break-all;
  text-overflow: clip;
  overflow: visible;
  line-height: 1.35;
}
.ad-odm-payload {
  white-space: normal !important;
  word-break: break-all;
  font-size: 0.74rem !important;
  line-height: 1.35;
}
.ad-odm-foot { flex-wrap: wrap; }
.ad-odm-foot-spacer { flex: 1 1 0.5rem; min-width: 0.5rem; }

@media (max-width: 820px) {
  .ad-odm-kpis { grid-template-columns: 1fr 1fr; }
  .ad-odm-grid { grid-template-columns: 1fr; }
  .ad-odm-line-codes { grid-template-columns: 1fr; }
}

/* ——— Szablony (templates.php) ——— */
.ad-tpl {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1280px;
}
.ad-tpl-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding: 1.35rem 1.45rem 1.4rem;
  border-radius: 22px;
  border: 1px solid rgba(36, 72, 198, 0.12);
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(79, 124, 255, 0.18), transparent 60%),
    linear-gradient(145deg, #0f1b3d 0%, #1a3478 48%, var(--ad-blue) 120%);
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 35, 90, 0.18);
}
.ad-tpl-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}
.ad-tpl-hero h1 {
  margin: 0 0 0.4rem;
  font-family: var(--ad-display);
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.ad-tpl-hero-copy p:last-child {
  margin: 0;
  max-width: 48ch;
  font-size: 0.92rem;
  line-height: 1.5;
  opacity: 0.86;
}
.ad-tpl-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.ad-tpl-hero-actions .ad-btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.ad-tpl-hero-actions .ad-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.ad-tpl-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
.ad-tpl-nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid #e4eaf3;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s, background 0.15s;
  min-height: 76px;
}
.ad-tpl-nav-item:hover {
  border-color: rgba(36, 72, 198, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(3, 27, 78, 0.06);
}
.ad-tpl-nav-ico {
  flex: 0 0 auto;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eef3ff;
  color: var(--ad-blue);
}
.ad-tpl-nav-ico .shop-icon {
  width: 1.2rem;
  height: 1.2rem;
}
.ad-tpl-nav-item.is-confirm .ad-tpl-nav-ico {
  background: #ecfdf5;
  color: #047857;
}
.ad-tpl-nav-item.is-delivery .ad-tpl-nav-ico {
  background: #eef3ff;
  color: var(--ad-blue);
}
.ad-tpl-nav-item.is-pdf .ad-tpl-nav-ico {
  background: #fff7ed;
  color: #c2410c;
}
.ad-tpl-nav-item.is-partners .ad-tpl-nav-ico {
  background: #f5f3ff;
  color: #6d28d9;
}
.ad-tpl-nav-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.ad-tpl-nav-item.is-active {
  border-color: transparent;
  background: linear-gradient(160deg, var(--ad-blue) 0%, #3a5fd4 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(36, 72, 198, 0.25);
}
.ad-tpl-nav-item.is-active .ad-tpl-nav-ico {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.ad-tpl-nav-item strong {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.ad-tpl-nav-item .ad-tpl-nav-copy > span {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.7;
}
.ad-tpl-nav-item.is-active .ad-tpl-nav-copy > span { opacity: 0.9; }

.ad-tpl-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 1rem;
  align-items: start;
}
.ad-tpl-editor {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.ad-tpl-partner-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
}
.ad-tpl-card {
  padding: 1.15rem 1.2rem 1.2rem;
  border-radius: 18px;
  border: 1px solid #e4eaf3;
  background: linear-gradient(180deg, #fff 0%, #f8faff 100%);
  box-shadow: 0 1px 0 rgba(3, 27, 78, 0.03);
}
.ad-tpl-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}
.ad-tpl-card-head h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #1a2456;
  letter-spacing: -0.02em;
}
.ad-tpl-lead {
  margin: -0.35rem 0 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #6b7793;
}
.ad-tpl-switches {
  display: grid;
  gap: 0.55rem;
}
.ad-tpl-switches .ad-switch {
  margin: 0;
  background: #fff;
  border-color: #e4eaf3;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ad-tpl-switches .ad-switch:has(input:checked) {
  border-color: rgba(36, 72, 198, 0.35);
  box-shadow: 0 0 0 1px rgba(36, 72, 198, 0.08);
  background: #f4f7ff;
}

.ad-tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 0.9rem;
}
.ad-tpl-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  min-width: 0;
}
.ad-tpl-field > span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a8499;
}
.ad-tpl-field input,
.ad-tpl-field select,
.ad-tpl-field textarea {
  width: 100%;
  margin: 0;
  min-height: 44px;
  border: 1.5px solid #dce3f0;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-weight: 600;
  color: #1a2456;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ad-tpl-field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}
.ad-tpl-field input:focus,
.ad-tpl-field select:focus,
.ad-tpl-field textarea:focus {
  outline: none;
  border-color: rgba(36, 72, 198, 0.55);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.12);
}
.ad-tpl-span-2 { grid-column: 1 / -1; }
.ad-tpl-color {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1.5px solid #dce3f0;
  border-radius: 12px;
  background: #fff;
}
.ad-tpl-color input[type="color"] {
  width: 40px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.ad-tpl-color em,
.ad-tpl-swatch em {
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 700;
  color: #5a6478;
  font-variant-numeric: tabular-nums;
}
.ad-tpl-colors {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
.ad-tpl-swatch {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid #e4eaf3;
  background: #fff;
  cursor: pointer;
}
.ad-tpl-swatch span {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a8499;
}
.ad-tpl-swatch input[type="color"] {
  width: 100%;
  height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}
.ad-tpl-pick { margin: 0; }
.ad-tpl-asset { margin: 0; font-size: 0.84rem; }
.ad-tpl-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  border-radius: 16px;
  border: 1px dashed #d5dde9;
  color: #7a8499;
  font-weight: 600;
  background: #f8faff;
}
.ad-tpl-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  padding: 0.35rem 0.15rem 0.5rem;
}
.ad-tpl-foot .muted { font-size: 0.82rem; }
.ad-tpl-delete-form { display: none; }

.ad-tpl-preview {
  position: sticky;
  top: 1rem;
  min-width: 0;
}
.ad-tpl-preview-chrome {
  border-radius: 20px;
  border: 1px solid #dce3f0;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 35, 90, 0.08);
}
.ad-tpl-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.95rem;
  background: #0f1b3d;
  color: #fff;
}
.ad-tpl-preview-dots {
  display: inline-flex;
  gap: 5px;
}
.ad-tpl-preview-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}
.ad-tpl-preview-dots i:first-child { background: #ff5f57; }
.ad-tpl-preview-dots i:nth-child(2) { background: #febc2e; }
.ad-tpl-preview-dots i:nth-child(3) { background: #28c840; }
.ad-tpl-preview-bar strong {
  font-size: 0.82rem;
  font-weight: 800;
}
.ad-tpl-preview-bar em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.7;
}
.ad-tpl-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid #eef2f8;
  background: #f7f9fd;
  font-size: 0.78rem;
  color: #6b7793;
  font-weight: 600;
}
.ad-tpl-preview-meta span:last-child {
  color: #1a2456;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-tpl-preview-frame {
  height: min(72vh, 760px);
  background: #e8eef8;
}
.ad-tpl-preview-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #e8eef8;
}

.ad-tpl-pdf-stage {
  min-height: min(68vh, 720px);
  padding: 1.5rem 1.15rem 1.75rem;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.08), transparent 40%),
    var(--pdf-bg, #0c0c10);
}
.ad-tpl-pdf-stage.is-modern {
  background:
    radial-gradient(circle at 80% 0%, rgba(36, 72, 198, 0.12), transparent 45%),
    var(--pdf-bg, #eef3fb);
}
.ad-tpl-pdf-stage.is-empty {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  text-align: center;
}
.ad-tpl-pdf-card {
  width: min(100%, 340px);
  padding: 1.25rem 1.2rem 1.1rem;
  border-radius: 18px;
  background: var(--pdf-card, #16161c);
  color: var(--pdf-text, #f4f6fa);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}
.ad-tpl-pdf-card.is-modern {
  color: var(--pdf-text, #1a2456);
  border: 1px solid #e4eaf3;
  box-shadow: 0 18px 40px rgba(26, 36, 86, 0.12);
}
.ad-tpl-pdf-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ad-tpl-pdf-brand {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pdf-accent, var(--ad-blue));
}
.ad-tpl-pdf-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--pdf-muted, #9aa3b5);
}
.ad-tpl-pdf-card.is-modern .ad-tpl-pdf-badge {
  background: #eef3fc;
  color: var(--pdf-muted, #5a6478);
}
.ad-tpl-pdf-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.85rem;
  border-radius: 14px;
  background: var(--pdf-accent, var(--ad-blue));
  color: #fff;
}
.ad-tpl-pdf-hero h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.3;
  color: #fff;
}
.ad-tpl-pdf-hero strong {
  font-size: 1.25rem;
  white-space: nowrap;
}
.ad-tpl-pdf-card h3 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--pdf-text, #f4f6fa);
}
.ad-tpl-pdf-card > p {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--pdf-muted, #9aa3b5);
}
.ad-tpl-pdf-code {
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}
.ad-tpl-pdf-code.is-zone {
  background: var(--pdf-code, #1a2456);
  color: #fff;
  padding: 1rem 0.9rem 1.05rem;
}
.ad-tpl-pdf-code.is-zone span {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.55rem;
}
.ad-tpl-pdf-bars {
  height: 28px;
  margin: 0 auto 0.65rem;
  max-width: 180px;
  background: repeating-linear-gradient(
    90deg,
    currentColor 0 2px,
    transparent 2px 5px
  );
  opacity: 0.55;
}
.ad-tpl-pdf-code.is-zone .ad-tpl-pdf-bars {
  background: repeating-linear-gradient(
    90deg,
    #fff 0 2px,
    transparent 2px 5px
  );
  opacity: 0.85;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  height: 36px;
}
.ad-tpl-pdf-code code {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.ad-tpl-pdf-code strong {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.8;
}
.ad-tpl-pdf-howto {
  font-size: 0.72rem !important;
  line-height: 1.4 !important;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-tpl-pdf-card footer {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  color: var(--pdf-muted, #9aa3b5);
}
.ad-tpl-pdf-card.is-modern footer {
  border-top-color: #e4eaf3;
}

@media (max-width: 1100px) {
  .ad-tpl-workspace {
    grid-template-columns: 1fr;
  }
  .ad-tpl-preview {
    position: static;
  }
  .ad-tpl-preview-frame {
    height: min(58vh, 560px);
  }
  .ad-tpl-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .ad-tpl-grid,
  .ad-tpl-colors {
    grid-template-columns: 1fr;
  }
  .ad-tpl-nav {
    grid-template-columns: 1fr;
  }
  .ad-tpl-hero {
    border-radius: 18px;
    padding: 1.1rem 1.05rem;
  }
}

/* Partner PDF A4 layout editor */
.ad-tpl-code-insight {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: #f0f4fb;
  border: 1px solid #e4eaf3;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #5a6478;
}
.ad-tpl-code-insight code {
  font-size: 0.8rem;
  background: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.ad-tpl-layout-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.85rem;
}
.ad-tpl-box-fields {
  margin: 0;
  padding: 0.85rem 0.95rem 1rem;
  border: 1px solid #e4eaf3;
  border-radius: 14px;
  background: #fafbff;
}
.ad-tpl-box-fields legend {
  padding: 0 0.25rem;
  font-weight: 700;
  color: #1a2456;
}
.ad-tpl-xy {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.55rem;
}
.ad-tpl-xy label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #7a8499;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ad-tpl-xy input,
.ad-tpl-xy select {
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: #1a2456;
}
@media (max-width: 720px) {
  .ad-tpl-xy { grid-template-columns: 1fr 1fr; }
}
.ad-tpl-a4-stage {
  padding: 1.1rem 1rem 1.25rem;
  background: #e8eef8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}
.ad-tpl-a4-page {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 210 / 297;
  background: var(--a4-bg, #eef3fb) center / 100% 100% no-repeat;
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(26, 36, 86, 0.18);
  border: 1px solid #d7deea;
  overflow: hidden;
  touch-action: none;
}
.ad-tpl-a4-box {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px dashed rgba(36, 72, 198, 0.85);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0.2rem;
  min-height: 1.6rem;
  user-select: none;
  touch-action: none;
  z-index: 2;
}
/* display:flex nadpisuje natywny [hidden] — bez tego odznaczone pola zostają widoczne */
.ad-tpl-a4-box[hidden],
.ad-tpl-a4-box.is-off {
  display: none !important;
}
.ad-tpl-a4-box.is-dragging {
  cursor: grabbing;
  border-style: solid;
  box-shadow: 0 8px 20px rgba(36, 72, 198, 0.25);
  z-index: 20;
}
.ad-tpl-a4-box > span {
  position: absolute;
  top: -0.85rem;
  left: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-blue);
  background: #fff;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}
.ad-tpl-a4-box.is-barcode img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.ad-tpl-a4-bars {
  height: 70%;
  margin: 0 4%;
  background: repeating-linear-gradient(90deg, #1a2456 0 2px, transparent 2px 5px);
  opacity: 0.75;
}
.ad-tpl-a4-box.is-code code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.25rem;
  word-break: break-all;
}
.ad-tpl-a4-box.is-amount strong {
  text-align: center;
  color: var(--ad-blue);
  font-size: 1.05rem;
}
.ad-tpl-a4-box.is-expiry em,
.ad-tpl-a4-box.is-pin code {
  display: block;
  font-style: normal;
  font-weight: 700;
  padding: 0.1rem 0.25rem;
  font-size: 0.78rem;
  color: #111;
}
.ad-tpl-a4-box.is-pin code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
}
.ad-tpl-a4-box.is-terms {
  align-items: flex-start;
  justify-content: flex-start;
  background: rgba(255, 255, 255, 0.88);
}
.ad-tpl-a4-stage.is-clean .ad-tpl-a4-box {
  border-color: transparent;
  background: transparent;
  cursor: default;
  box-shadow: none;
}
.ad-tpl-a4-stage.is-clean .ad-tpl-a4-box > span,
.ad-tpl-a4-stage.is-clean .ad-tpl-a4-resize {
  display: none !important;
}
.ad-tpl-preview-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem 0;
  font-size: 0.82rem;
}
.ad-tpl-fields-picker {
  margin: 1rem 0 0.75rem;
  padding: 0.85rem 1rem;
  background: #f4f7fc;
  border: 1px solid #d7deea;
  border-radius: 10px;
}
.ad-tpl-fields-picker > strong {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  color: #1a2456;
}
.ad-tpl-fields-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.1rem;
}
.ad-tpl-box-fields[hidden] {
  display: none !important;
}
.ad-tpl-a4-terms {
  font-size: 0.58rem;
  line-height: 1.35;
  color: #5a6478;
  overflow: hidden;
  width: 100%;
  max-height: 100%;
  white-space: pre-wrap;
}
.ad-tpl-a4-resize {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--ad-blue);
  cursor: nwse-resize;
  box-shadow: 0 0 0 2px #fff;
}
.ad-tpl-a4-hint {
  margin: 0;
  font-size: 0.78rem;
  text-align: center;
}

/* Nowoczesny podgląd PDF (jak u klienta) */
.ad-tpl-a4-stage.is-modern-pdf {
  background:
    radial-gradient(circle at 80% 0%, rgba(36, 72, 198, 0.1), transparent 45%),
    #eef3fb;
}
.ad-tpl-modern-page {
  --m-accent: #2448c6;
  width: min(100%, 340px);
  aspect-ratio: 210 / 297;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(26, 36, 86, 0.16);
  border: 1px solid #d7deea;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #0f1218;
}
.ad-tpl-modern-bar {
  height: 3px;
  background: var(--m-accent);
  flex: 0 0 auto;
}
.ad-tpl-modern-wash {
  padding: 0.45rem 0.7rem 0.65rem;
  background: color-mix(in srgb, var(--m-accent) 8%, #fff);
  text-align: center;
}
.ad-tpl-modern-meta-top {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.52rem;
  font-weight: 600;
  color: #667085;
  margin-bottom: 0.35rem;
}
.ad-tpl-modern-logo {
  display: block;
  max-width: 58%;
  max-height: 2.4rem;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0.15rem auto 0.35rem;
}
.ad-tpl-modern-logo.is-placeholder {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  background: var(--m-accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  margin-left: auto;
  margin-right: auto;
}
.ad-tpl-modern-brand {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  color: #0f1218;
}
.ad-tpl-modern-pill {
  display: inline-block;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: var(--m-accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}
.ad-tpl-modern-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.55rem 0.65rem 0.15rem;
}
.ad-tpl-modern-card {
  background: #fff;
  border: 1px solid #e8eef8;
  border-radius: 8px;
  padding: 0.35rem 0.3rem 0.4rem;
  text-align: center;
  box-shadow: inset 0 2px 0 var(--m-accent);
}
.ad-tpl-modern-card em {
  display: block;
  font-style: normal;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #667085;
  margin-bottom: 0.15rem;
}
.ad-tpl-modern-card strong {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f1218;
}
.ad-tpl-modern-code {
  margin: 0.45rem 0.55rem 0.35rem;
  padding: 0.55rem 0.5rem 0.5rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--m-accent) 10%, #fff);
  text-align: center;
  position: relative;
}
.ad-tpl-modern-code::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 10px;
  background: #fff;
  z-index: 0;
}
.ad-tpl-modern-code > * {
  position: relative;
  z-index: 1;
}
.ad-tpl-modern-code-lab {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--m-accent);
  color: #fff;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.ad-tpl-modern-barcode {
  display: block;
  width: 82%;
  max-height: 2.4rem;
  margin: 0 auto 0.35rem;
  object-fit: contain;
}
.ad-tpl-modern-barcode.is-qr {
  width: 32%;
  max-height: 4.2rem;
}
.ad-tpl-modern-bars {
  height: 1.6rem;
  width: 78%;
  margin: 0 auto 0.35rem;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, #1a2456 0 2px, transparent 2px 5px);
  opacity: 0.7;
}
.ad-tpl-modern-code code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  word-break: break-all;
  margin-bottom: 0.25rem;
  color: #0f1218;
}
.ad-tpl-modern-code p {
  margin: 0;
  font-size: 0.55rem;
  color: #667085;
  line-height: 1.35;
}
.ad-tpl-modern-terms {
  margin: 0.2rem 0.55rem 0.35rem;
  padding: 0.4rem 0.45rem 0.4rem 0.55rem;
  border-radius: 8px;
  background: #f8f9fb;
  border-left: 3px solid var(--m-accent);
  flex: 1 1 auto;
  min-height: 0;
}
.ad-tpl-modern-terms p {
  margin: 0;
  font-size: 0.52rem;
  line-height: 1.35;
  color: #3a4150;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-tpl-modern-foot {
  margin-top: auto;
  padding: 0.35rem 0.65rem 0.45rem;
  font-size: 0.5rem;
  color: #667085;
  border-top: 1px solid #eef1f6;
  text-align: center;
}

.ad-tpl-gfx-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ad-tpl-gfx-list li {
  font-size: 0.8rem;
  color: #5a6478;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: #f0f4fb;
}
.ad-tpl-gfx-list code { font-size: 0.75rem; }

/* Support center */
.supp-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  margin: 0 0 1.15rem;
  color: #fff;
}
.supp-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 90% at 8% 0%, rgba(120, 160, 255, 0.35), transparent 55%),
    linear-gradient(145deg, #06122f 0%, #12308a 48%, var(--ad-blue) 100%);
}
.supp-hero-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.55rem 1.6rem 1.45rem;
  align-items: flex-end;
}
.supp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c5d2ff;
}
.supp-eyebrow .shop-icon { width: 14px; height: 14px; }
.supp-hero h1 {
  margin: 0 0 0.4rem;
  font-family: var(--ad-display);
  font-size: clamp(1.65rem, 2.5vw, 2.15rem);
  letter-spacing: -0.03em;
}
.supp-hero-copy p:last-child {
  margin: 0;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  line-height: 1.5;
}
.supp-hero-side {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.supp-hero-chip {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 4.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.supp-hero-chip span {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}
.supp-hero-chip strong {
  font-family: var(--ad-display);
  font-size: 1.2rem;
  color: #fff;
}
.supp-hero .ad-btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.supp-hero .ad-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.supp-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}
@media (max-width: 900px) {
  .supp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.supp-metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(3, 27, 78, 0.08);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--ad-shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.supp-metric:hover { border-color: rgba(36, 72, 198, 0.35); transform: translateY(-1px); }
.supp-metric strong {
  font-family: var(--ad-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.supp-metric span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ad-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.supp-metric.is-on {
  border-color: var(--ad-blue);
  box-shadow: 0 0 0 2px rgba(36, 72, 198, 0.15);
}
.supp-metric.tone-amber strong { color: #b45309; }
.supp-metric.tone-sky strong { color: #0369a1; }
.supp-metric.tone-ok strong { color: #0a7a4a; }

.supp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin: 0 0 1rem;
  padding: 1rem;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(3, 27, 78, 0.08);
}
.supp-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ad-soft);
}
.supp-filters select,
.supp-filters input {
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(3, 27, 78, 0.12);
  padding: 0 0.7rem;
  font: inherit;
  font-weight: 600;
  min-width: 140px;
}
.supp-filters .supp-q { flex: 1; min-width: 180px; }
.supp-filters .supp-q input { width: 100%; }

.supp-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  min-height: 62vh;
}
@media (max-width: 1080px) {
  .supp-layout { grid-template-columns: 1fr; }
}

.supp-list,
.supp-detail {
  background: #fff;
  border: 1px solid rgba(3, 27, 78, 0.08);
  border-radius: 20px;
  box-shadow: var(--ad-shadow);
  overflow: hidden;
}
.supp-list {
  max-height: 82vh;
  overflow: auto;
  position: sticky;
  top: 1rem;
}
.supp-list > header {
  display: flex;
  justify-content: space-between;
  padding: 0.9rem 1.05rem;
  border-bottom: 1px solid rgba(3, 27, 78, 0.06);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.supp-list > header span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ad-muted);
}

.supp-item {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(3, 27, 78, 0.05);
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.supp-item:hover { background: #f7f9fd; }
.supp-item.is-on {
  background: #eef2ff;
  border-left-color: var(--ad-blue);
}
.supp-item.is-waiting { background: linear-gradient(90deg, #fff8f0 0%, #fff 40%); }
.supp-item.is-on.is-waiting { background: #eef2ff; }

.supp-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: #5a6478;
  color: #fff !important;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
}
.supp-avatar.is-lg {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 14px;
  font-size: 0.85rem;
}
.supp-avatar.is-staff {
  background: var(--ad-blue);
}

.supp-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
  gap: 0.5rem;
}
.supp-item-top em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ad-muted);
}
.supp-pill {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--ad-blue);
  white-space: nowrap;
}
.supp-item.status-open .supp-pill,
.supp-pill.status-open { background: #fff7ed; color: #b45309; }
.supp-item.status-in_progress .supp-pill,
.supp-pill.status-in_progress { background: #e0f2fe; color: #0369a1; }
.supp-item.status-resolved .supp-pill,
.supp-pill.status-resolved { background: #ecfdf5; color: #0a7a4a; }
.supp-item.status-closed .supp-pill,
.supp-pill.status-closed { background: #f1f5f9; color: #64748b; }

.supp-item strong {
  display: block;
  font-size: 0.9rem;
  margin: 0 0 0.15rem;
  line-height: 1.3;
}
.supp-item-from {
  display: block;
  font-size: 0.74rem;
  color: var(--ad-muted);
  margin-bottom: 0.3rem;
}
.supp-item-preview {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #5a6478;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.supp-item-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}
.supp-item-who {
  font-size: 0.7rem;
  font-weight: 700;
  color: #7a8499;
}
.supp-item-who.is-staff { color: var(--ad-blue); }
.supp-item-who.is-client { color: #b45309; }
.supp-item-foot time {
  font-size: 0.68rem;
  color: var(--ad-muted);
  white-space: nowrap;
}
.supp-wait-badge {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #b45309;
  background: #fff7ed;
  border: 1px solid rgba(180, 83, 9, 0.2);
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
}

.supp-empty,
.supp-empty-detail {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ad-muted);
  font-weight: 600;
}
.supp-empty-detail {
  padding: 4.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}
.supp-empty-detail .shop-icon {
  width: 32px;
  height: 32px;
  opacity: 0.45;
  margin-bottom: 0.35rem;
}
.supp-empty-detail strong {
  color: #1a2456;
  font-size: 1.05rem;
}
.supp-empty-detail p {
  margin: 0;
  max-width: 32ch;
  font-weight: 600;
  line-height: 1.45;
}
.supp-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(3, 27, 78, 0.06);
}

.supp-detail {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 72vh;
}
.supp-detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.3rem;
  border-bottom: 1px solid rgba(3, 27, 78, 0.07);
  background: linear-gradient(180deg, #fbfcff 0%, #fff 100%);
}
.supp-detail-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ad-muted);
}
.supp-detail-head h2 {
  margin: 0 0 0.85rem;
  font-family: var(--ad-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #1a2456;
}
.supp-from-card {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.supp-from-card strong {
  display: block;
  color: #1a2456;
  font-size: 0.95rem;
}
.supp-from-card a {
  display: block;
  color: var(--ad-blue);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}
.supp-from-card em {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-size: 0.78rem;
  color: var(--ad-muted);
}
.supp-status-form {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
}
.supp-status-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ad-soft);
}
.supp-status-form select {
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(3, 27, 78, 0.12);
  padding: 0 0.6rem;
  font: inherit;
  font-weight: 600;
}

.supp-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  flex: 1;
  min-height: 0;
}
@media (max-width: 1180px) {
  .supp-detail-grid { grid-template-columns: 1fr; }
}

.supp-thread-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(3, 27, 78, 0.06);
}
@media (max-width: 1180px) {
  .supp-thread-wrap { border-right: 0; }
}

.supp-thread {
  flex: 1;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(36, 72, 198, 0.05), transparent 55%),
    #f4f7fc;
  max-height: 48vh;
  overflow: auto;
  scroll-behavior: smooth;
}

.supp-day-sep {
  display: flex;
  justify-content: center;
  margin: 0.25rem 0;
}
.supp-day-sep span {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a8499;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(3, 27, 78, 0.08);
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
}

.supp-bubble {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  gap: 0.65rem;
  max-width: 92%;
  align-items: flex-start;
}
.supp-bubble.is-admin {
  align-self: flex-end;
  grid-template-columns: minmax(0, 1fr) 2.35rem;
}
.supp-bubble.is-admin .supp-avatar { order: 2; }
.supp-bubble.is-user { align-self: flex-start; }

.supp-bubble-card {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(3, 27, 78, 0.07);
  box-shadow: 0 6px 18px rgba(3, 27, 78, 0.04);
}
.supp-bubble.is-admin .supp-bubble-card {
  background: linear-gradient(160deg, #0d1f4d 0%, #183688 100%);
  color: #fff;
  border-color: transparent;
}
.supp-bubble header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  align-items: flex-start;
}
.supp-bubble-who {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}
.supp-bubble-who strong {
  font-size: 0.84rem;
  line-height: 1.2;
}
.supp-bubble-who em {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.7;
}
.supp-bubble time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  font-size: 0.68rem;
  opacity: 0.78;
  white-space: nowrap;
  flex-shrink: 0;
}
.supp-time-abs { font-weight: 700; }
.supp-time-rel { opacity: 0.85; }
.supp-bubble-body {
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.supp-receipt {
  margin-top: 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.72;
  letter-spacing: 0.01em;
}
.supp-receipt.is-read { color: #1d4ed8; opacity: 0.95; }
.supp-receipt.is-delivered { color: #0f766e; }
.supp-receipt.is-sent,
.supp-receipt.is-unread { color: #64748b; }
.supp-bubble.is-admin .supp-receipt { text-align: right; }
.supp-presence {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(3, 27, 78, 0.08);
}
.supp-presence-dot {
  width: 0.65rem;
  height: 0.65rem;
  margin-top: 0.35rem;
  border-radius: 999px;
  background: #94a3b8;
  flex-shrink: 0;
}
.supp-presence.is-online .supp-presence-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}
.supp-presence strong {
  display: block;
  font-size: 0.86rem;
  line-height: 1.25;
}
.supp-presence span {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.35;
  margin-top: 0.15rem;
}

.supp-reply,
.supp-note {
  padding: 1rem 1.2rem 1.15rem;
  border-top: 1px solid rgba(3, 27, 78, 0.07);
  background: #fff;
}
.supp-reply-head {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin: 0 0 0.75rem;
}
.supp-reply-head strong {
  display: block;
  font-size: 0.88rem;
  color: #1a2456;
}
.supp-reply-head > div > span {
  display: block;
  font-size: 0.75rem;
  color: var(--ad-muted);
  font-weight: 600;
}
.supp-reply label,
.supp-note label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ad-soft);
  margin: 0 0 0.65rem;
}
.supp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.supp-reply textarea,
.supp-note textarea {
  border-radius: 12px;
  border: 1px solid rgba(3, 27, 78, 0.12);
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-weight: 600;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}
.supp-reply textarea:focus,
.supp-note textarea:focus {
  outline: none;
  border-color: rgba(36, 72, 198, 0.55);
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.12);
}
.supp-reply-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-end;
}
.supp-reply-foot select {
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(3, 27, 78, 0.12);
  padding: 0 0.65rem;
  font: inherit;
  font-weight: 600;
}

.supp-meta {
  padding: 1.1rem 1.1rem 1.25rem;
  background: #fbfcfe;
  border-left: 1px solid rgba(3, 27, 78, 0.05);
}
@media (max-width: 1180px) {
  .supp-meta {
    border-left: 0;
    border-top: 1px solid rgba(3, 27, 78, 0.07);
  }
}
.supp-meta h3 {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8499;
}
.supp-meta-list {
  margin: 0 0 1.1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.supp-meta-list > div {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(3, 27, 78, 0.06);
}
.supp-meta-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.supp-meta-list dt {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8a95ab;
}
.supp-meta-list dd {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.supp-meta-list dd strong {
  font-size: 0.9rem;
  color: #1a2456;
  line-height: 1.3;
}
.supp-meta-list dd strong.is-warn { color: #b45309; }
.supp-meta-list dd strong.is-ok { color: #0a7a4a; }
.supp-meta-list dd span {
  font-size: 0.75rem;
  color: var(--ad-muted);
  font-weight: 600;
  line-height: 1.35;
}
.supp-meta .supp-note {
  padding: 0;
  border: 0;
  background: transparent;
}

/* Partner monthly credit line */
.ad-credit-meter {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: #f8fafc;
}
.ad-credit-meter.is-warn {
  border-color: #fdba74;
  background: #fff7ed;
}
.ad-credit-meter.is-full {
  border-color: #fca5a5;
  background: #fef2f2;
}
.ad-credit-meter-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: space-between;
  align-items: baseline;
}
.ad-credit-meter-top strong {
  font-size: 1.05rem;
  color: #0f172a;
}
.ad-credit-meter-top span {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 650;
}
.ad-credit-meter-track {
  margin-top: 0.65rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.ad-credit-meter-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2448c6, #3d5fd9);
}
.ad-credit-meter.is-warn .ad-credit-meter-track i {
  background: linear-gradient(90deg, #ea580c, #f59e0b);
}
.ad-credit-meter.is-full .ad-credit-meter-track i {
  background: linear-gradient(90deg, #b91c1c, #ef4444);
}
.ad-shop-row.is-credit-warn {
  border-color: #fdba74;
  box-shadow: inset 3px 0 0 #ea580c;
}

/* Admin: eKody Benefiteo */
.ad-bf-stats {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 1.15rem;
}
@media (min-width: 900px) {
  .ad-bf-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.ad-bf-filters {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
@media (min-width: 800px) {
  .ad-bf-filters {
    grid-template-columns: 1.4fr repeat(3, minmax(110px, 0.7fr)) auto;
    align-items: end;
  }
}
.ad-bf-filters label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 750;
  color: var(--ad-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ad-bf-filters input,
.ad-bf-filters select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--ad-ink, #0f172a);
  background: #fff;
}
.ad-bf-card-row td { vertical-align: top; }
.ad-bf-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 750;
  font-size: 0.88rem;
}
.ad-bf-usage {
  min-width: 140px;
}
.ad-bf-usage-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ad-muted, #64748b);
  margin-bottom: 0.3rem;
}
.ad-bf-usage-top b { color: var(--ad-ink, #0f172a); }
.ad-bf-usage-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.ad-bf-usage-track > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2448c6, #60a5fa);
}
.ad-bf-usage.is-full .ad-bf-usage-track > i {
  background: linear-gradient(90deg, #b45309, #f59e0b);
}
.ad-bf-usage.is-done .ad-bf-usage-track > i {
  background: linear-gradient(90deg, #9f1239, #fb7185);
}
.ad-bf-owner {
  display: grid;
  gap: 0.15rem;
}
.ad-bf-owner a { font-weight: 750; }
.ad-bf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.ad-bf-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.ad-bf-inline-form input[type="number"],
.ad-bf-inline-form input[type="email"],
.ad-bf-inline-form input[type="text"] {
  width: 110px;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 0.85rem;
  font-weight: 650;
}
.ad-bf-inline-form input[type="email"] { width: 170px; }
.ad-bf-detail {
  margin-top: 0.55rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.ad-bf-detail summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}
.ad-bf-detail ul {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.ad-bf-detail li {
  padding: 0.35rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.78rem;
  color: var(--ad-muted, #64748b);
}
.ad-bf-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
}
@media (max-width: 760px) {
  .ad-bf-table-desktop { display: none; }
  .ad-bf-mobile { display: grid; gap: 0.75rem; }
  .ad-bf-mobile-card {
    padding: 1rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  }
  .ad-bf-mobile-card h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    word-break: break-all;
  }
}
@media (min-width: 761px) {
  .ad-bf-mobile { display: none; }
}

.ad-bf-inline-form select {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-size: 0.85rem;
  font-weight: 650;
  background: #fff;
}

.ad-crm-code-card.is-archived { opacity: 0.88; }
.ad-crm-cc-usage { margin: 0.55rem 0 0.35rem; }
.ad-crm-cc-usage-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ad-muted, #64748b);
  margin-bottom: 0.28rem;
}
.ad-crm-cc-usage-top b { color: var(--ad-ink, #0f172a); }
.ad-crm-cc-usage-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.ad-crm-cc-usage-track > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2448c6, #60a5fa);
}

/* —— Profil klienta (user.php) —— */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ad-user-page {
  max-width: 1180px;
  margin: 0 auto 2.5rem;
}
.ad-user-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.ad-user-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.ad-user-page > .ad-user-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: center;
  margin: 0 0 1.15rem;
  padding: 1.2rem 1.3rem;
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(36, 72, 198, 0.14), transparent 55%),
    radial-gradient(80% 70% at 100% 0%, rgba(96, 165, 250, 0.12), transparent 50%),
    linear-gradient(145deg, #f5f8ff 0%, #fff 52%, #f8fafc 100%);
  border: 1px solid rgba(36, 72, 198, 0.14);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}
.ad-user-avatar {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 850;
  color: #fff;
  background: linear-gradient(145deg, #2448c6, #1d4ed8 55%, #3b82f6);
  box-shadow: 0 10px 22px rgba(36, 72, 198, 0.32);
}
.ad-user-hero-main h1 {
  margin: 0.15rem 0 0.35rem;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
}
.ad-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ad-eyebrow .shop-icon {
  width: 14px;
  height: 14px;
}
.ad-user-mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.92rem;
}
.ad-user-mail a { font-weight: 700; }
.ad-user-mail a,
.ad-user-hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ad-user-mail .shop-icon,
.ad-user-hero-meta .shop-icon,
.ad-pill .shop-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.ad-user-kpis {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}
.ad-user-kpi {
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}
.ad-user-kpi span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-muted, #64748b);
  margin-bottom: 0.28rem;
}
.ad-user-kpi span .shop-icon {
  width: 14px;
  height: 14px;
  color: #2448c6;
}
.ad-user-kpi.is-accent span .shop-icon {
  color: #1d4ed8;
}
.ad-user-kpi strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.ad-user-kpi em {
  font-style: normal;
  font-weight: 650;
  color: var(--ad-muted, #64748b);
  font-size: 0.82em;
}
.ad-user-kpi.is-accent {
  background: linear-gradient(145deg, #eef3ff, #f8fafc);
  border-color: rgba(36, 72, 198, 0.18);
}
.ad-user-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.2rem;
  padding: 0.4rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #e7eefc 0%, #eef2ff 100%);
  border: 1px solid rgba(36, 72, 198, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
.ad-user-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.45rem 0.85rem 0.45rem 0.65rem;
  border-radius: 13px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 750;
  color: #5b6b8c;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ad-user-tab-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #64748b;
  flex-shrink: 0;
}
.ad-user-tab-ico .shop-icon {
  width: 16px;
  height: 16px;
}
.ad-user-tab-label {
  line-height: 1.15;
}
.ad-user-tab:hover {
  color: #1e293b;
  background: rgba(255, 255, 255, 0.62);
}
.ad-user-tab:hover .ad-user-tab-ico {
  color: #2448c6;
  background: #fff;
}
.ad-user-tab.is-on {
  background: #fff;
  color: #1d4ed8;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
}
.ad-user-tab.is-on .ad-user-tab-ico {
  background: linear-gradient(145deg, #eef3ff, #dbe7ff);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(36, 72, 198, 0.12);
}
.ad-user-tab-n,
.ad-user-tab b {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.4rem;
  margin-left: 0.1rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  background: rgba(15, 23, 42, 0.08);
  color: inherit;
}
.ad-user-tab.is-on .ad-user-tab-n,
.ad-user-tab.is-on b {
  background: rgba(36, 72, 198, 0.14);
  color: #1d4ed8;
}
.ad-user-section-head h2,
.ad-user-codes-intro h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.ad-user-section-head h2 .shop-icon,
.ad-user-codes-intro h2 .shop-icon {
  width: 18px;
  height: 18px;
  color: #2448c6;
}
@media (max-width: 720px) {
  .ad-user-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ad-user-tabs::-webkit-scrollbar { display: none; }
  .ad-user-tab {
    flex: 0 0 auto;
  }
  .ad-user-tab-label {
    max-width: 9.5rem;
    white-space: nowrap;
  }
}
.ad-user-section {
  padding: 1.1rem 1.2rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}
.ad-user-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}
.ad-user-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  margin: 0;
}
.ad-user-facts > div {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.ad-user-facts dt {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-muted, #64748b);
  margin: 0 0 0.2rem;
}
.ad-user-facts dd {
  margin: 0;
  font-weight: 750;
}
.ad-user-hist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.ad-user-hist li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.88rem;
}
.ad-user-hist .is-up { color: #15803d; }
.ad-user-hist .is-down { color: #b91c1c; }
.ad-user-hist em {
  font-style: normal;
  color: var(--ad-muted, #64748b);
  font-size: 0.78rem;
  white-space: nowrap;
}

.ad-user-codes-shell {
  margin: 0;
  padding: 1rem 1.05rem 1.15rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}
.ad-user-codes-intro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.95rem;
}
.ad-user-codes-intro h2 {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
}
.ad-user-codes-intro .muted {
  margin: 0;
  font-size: 0.88rem;
}
.ad-user-codes-sum {
  display: grid;
  gap: 0.15rem;
  text-align: right;
  font-size: 0.84rem;
  color: var(--ad-muted, #64748b);
  font-weight: 650;
}
.ad-user-codes-sum b {
  color: var(--ad-ink, #0f172a);
  font-weight: 850;
}
.ad-user-codes-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  padding: 0.28rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.05);
  margin-bottom: 0.9rem;
}
.ad-user-codes-seg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 750;
  color: var(--ad-muted, #64748b);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.ad-user-codes-seg-btn b {
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.ad-user-codes-seg-btn.is-on {
  background: #fff;
  color: var(--ad-ink, #0f172a);
  box-shadow: 0 4px 14px rgba(6, 18, 47, 0.08);
}
.ad-user-codes-controls {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.ad-user-codes-q {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f7f9fd;
}
.ad-user-codes-q:focus-within {
  border-color: rgba(36, 72, 198, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(36, 72, 198, 0.1);
}
.ad-user-codes-q .ad-icon,
.ad-user-codes-q svg {
  width: 18px;
  height: 18px;
  color: var(--ad-muted, #64748b);
  flex-shrink: 0;
}
.ad-user-codes-q input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  color: var(--ad-ink, #0f172a);
}
.ad-user-codes-fields {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr 1fr;
}
@media (min-width: 860px) {
  .ad-user-codes-fields {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.ad-user-codes-fields label {
  display: grid;
  gap: 0.28rem;
  margin: 0;
}
.ad-user-codes-fields label > span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-muted, #64748b);
}
.ad-user-codes-fields select {
  width: 100%;
  box-sizing: border-box;
  min-height: 42px;
  padding: 0.45rem 1.8rem 0.45rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ad-ink, #0f172a);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235a6b8c' d='M1.4 1.2 6 5.8l4.6-4.6 1.2 1.2L6 8.2.2 2.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
}
.ad-user-codes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.ad-user-codes-count {
  margin-left: auto;
  font-size: 0.84rem;
  font-weight: 750;
  color: var(--ad-muted, #64748b);
  font-variant-numeric: tabular-nums;
}
.ad-user-codes-shell.is-loading {
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.ad-user-codes-results.is-loading {
  opacity: 0.55;
  pointer-events: none;
}
.ad-user-empty {
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px dashed rgba(15, 23, 42, 0.12);
}
.ad-user-empty p {
  margin: 0 0 0.75rem;
  font-weight: 650;
  color: var(--ad-muted, #64748b);
}
.ad-user-card-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .ad-user-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ad-user-card {
  display: grid;
  gap: 0.85rem;
  padding: 1.05rem 1.1rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.09);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}
.ad-user-card.is-archive {
  opacity: 0.92;
  background: #f8fafc;
}
.ad-user-card-head {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0.75rem;
  align-items: center;
}
.ad-user-card-head img {
  width: 72px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.ad-user-card-ph {
  width: 72px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: var(--ad-blue, #2448c6);
}
.ad-user-card-head strong {
  display: block;
  font-size: 0.98rem;
}
.ad-user-card-head .muted {
  display: block;
  font-size: 0.8rem;
  margin: 0.1rem 0 0.25rem;
}
.ad-user-card-code {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
}
.ad-user-card-code code {
  font-size: 0.92rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: #fff;
}
.ad-user-card-code code.is-copied,
.ad-user-card-code [data-copy].is-copied {
  opacity: 0.55;
}
.ad-user-card-code .muted {
  color: #94a3b8;
  font-size: 0.8rem;
}
.ad-user-card-code .muted code {
  color: #cbd5e1;
  font-size: 0.85rem;
}

/* Panel kodu + barcode / QR (profil klienta) */
.ad-ekod-panel {
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
}
@media (min-width: 560px) {
  .ad-ekod-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}
.ad-ekod-panel-title {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--ad-ink, #0f172a);
}
.ad-ekod-fields {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ad-ekod-fields > div { margin: 0; }
.ad-ekod-fields dt {
  margin: 0 0 0.1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ad-muted, #64748b);
}
.ad-ekod-fields dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ad-ink, #0f172a);
  word-break: break-all;
}
.ad-ekod-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ad-ekod-copy code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 700;
  word-break: break-all;
}
.ad-ekod-copy .shop-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  opacity: 0.5;
}
.ad-ekod-copy:hover .shop-icon,
.ad-ekod-copy.is-copied .shop-icon { opacity: 1; }
.ad-ekod-copy.is-copied { color: #15803d; }
.ad-ekod-barcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  justify-self: center;
}
.ad-ekod-barcode img {
  display: block;
  height: auto;
  max-width: 100%;
  background: #fff;
}
.ad-ekod-barcode.is-bars img {
  width: min(100%, 200px);
  max-height: 68px;
  object-fit: contain;
}
.ad-ekod-barcode.is-qr img {
  width: 112px;
  height: 112px;
  object-fit: contain;
}
.ad-ekod-barcode span {
  max-width: 200px;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ad-muted, #64748b);
  text-align: center;
  word-break: break-all;
  line-height: 1.25;
}
.ad-user-card-head strong {
  display: block;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.ad-pill.is-used {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}
.ad-user-card-usage-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ad-muted, #64748b);
  margin-bottom: 0.28rem;
}
.ad-user-card-usage-top b { color: var(--ad-ink, #0f172a); }
.ad-user-card-usage-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.ad-user-card-usage-track > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2448c6, #60a5fa);
}
.ad-user-card-usage.is-full .ad-user-card-usage-track > i {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}
.ad-user-card-usage.is-done .ad-user-card-usage-track > i {
  background: linear-gradient(90deg, #64748b, #94a3b8);
}
.ad-user-card-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
}
.ad-user-card-adjust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}
.ad-user-card-adjust select,
.ad-user-card-adjust input {
  min-height: 36px;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  background: #fff;
}
.ad-user-card-adjust select { max-width: 7.5rem; }
.ad-user-card-adjust input[name="amount"] { width: 4.5rem; }
.ad-user-card-adjust input[name="reason"] { flex: 1; min-width: 7rem; }
.ad-user-card-ledger {
  border-top: 1px solid rgba(15, 23, 42, 0.07);
  padding-top: 0.35rem;
}
.ad-user-card-ledger summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ad-muted, #64748b);
}
.ad-user-card-ledger ul {
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}
.ad-user-card-ledger li {
  padding: 0.3rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.78rem;
  color: var(--ad-muted, #64748b);
}
.ad-user-codes-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin: 1.1rem 0 0.2rem;
}
@media (max-width: 900px) {
  .ad-user-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-user-facts { grid-template-columns: 1fr; }
  .ad-user-hist li { grid-template-columns: 1fr; gap: 0.2rem; }
  .ad-user-codes-sum { text-align: left; width: 100%; }
}
@media (max-width: 640px) {
  .ad-user-page > .ad-user-hero {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .ad-user-kpis { grid-template-columns: 1fr 1fr; }
  .ad-user-codes-shell { padding: 0.85rem; border-radius: 16px; }
  .ad-user-codes-count { width: 100%; margin: 0.15rem 0 0; text-align: center; }
  .ad-user-card-head { grid-template-columns: 56px 1fr; }
  .ad-user-card-head img,
  .ad-user-card-ph { width: 56px; height: 34px; }
}

/* CRM profile: overview / orders / points / activity / notes */
.ad-user-hero-meta {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}
.ad-user-hero-sep { opacity: 0.45; margin: 0 0.15rem; }
.ad-user-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.ad-user-section-head h2,
.ad-user-section-head h3 {
  margin: 0 0 0.2rem;
}
.ad-user-section-head .muted {
  margin: 0;
  font-size: 0.86rem;
}
.ad-user-section-count {
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--ad-muted, #64748b);
}
.ad-user-live-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.9rem;
}
.ad-user-live-q {
  flex: 1 1 220px;
}
.ad-user-live-q input {
  width: 100%;
  min-height: 2.4rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 0.55rem 0.85rem;
  font: inherit;
  background: #fff;
}
.ad-user-live-empty {
  margin: 0.75rem 0 0;
  text-align: center;
}
.ad-user-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.ad-user-kpi .is-up,
.ad-user-order-grid .is-up { color: #15803d; }
.ad-user-kpi .is-down,
.ad-user-order-grid .is-down { color: #b91c1c; }
.ad-user-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.1rem 0;
}
.ad-user-quick-stat {
  display: block;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(160deg, #fff, #f8fafc);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ad-user-quick-stat:hover {
  border-color: rgba(36, 72, 198, 0.28);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}
.ad-user-quick-stat span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-muted, #64748b);
}
.ad-user-quick-stat strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.15rem;
}
.ad-user-quick-stat em {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-size: 0.78rem;
  color: var(--ad-muted, #64748b);
}
.ad-user-overview-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin: 1.15rem 0;
}
.ad-user-order-list {
  display: grid;
  gap: 1rem;
}
.ad-user-order-card {
  padding: 1.05rem 1.15rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  background:
    linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}
.ad-user-order-card.is-paid {
  border-color: rgba(22, 163, 74, 0.18);
}
.ad-user-order-card.is-pending {
  border-color: rgba(217, 119, 6, 0.22);
}
.ad-user-order-card.is-cancelled {
  border-color: rgba(148, 163, 184, 0.35);
  opacity: 0.92;
}
.ad-user-order-card.is-compact {
  padding: 0.85rem 0.95rem;
}
.ad-user-order-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.ad-user-order-card-id {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  min-width: 0;
}
.ad-user-order-ico {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eef3ff;
  color: #2448c6;
  flex-shrink: 0;
}
.ad-user-order-ico .shop-icon {
  width: 18px;
  height: 18px;
}
.ad-user-order-id-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.ad-user-order-num {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.ad-user-order-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
}
.ad-user-order-meta .shop-icon {
  width: 13px;
  height: 13px;
}
.ad-user-order-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.ad-user-order-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.ad-user-order-grid.is-compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ad-user-order-grid > div {
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: #f4f7fb;
  border: 1px solid rgba(15, 23, 42, 0.04);
}
.ad-user-order-grid span {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ad-muted, #64748b);
}
.ad-user-order-grid strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.95rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.ad-user-order-lines {
  display: grid;
  gap: 0.45rem;
}
.ad-user-order-line {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.ad-user-order-line img {
  width: 48px;
  height: 30px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
}
.ad-user-order-line-ph {
  width: 48px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #eef3ff;
  color: #2448c6;
}
.ad-user-order-line-ph .shop-icon {
  width: 16px;
  height: 16px;
}
.ad-user-order-line-main {
  min-width: 0;
}
.ad-user-order-line-main strong {
  display: block;
  font-size: 0.92rem;
}
.ad-user-order-line-main .muted {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.78rem;
}
.ad-user-order-line-sum {
  text-align: right;
  white-space: nowrap;
}
.ad-user-order-line-sum strong {
  display: block;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.ad-user-order-line-sum .muted {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.74rem;
}
.ad-user-order-codes-wrap {
  margin-top: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  padding: 0.35rem 0.75rem 0.55rem;
}
.ad-user-order-codes-wrap summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  list-style: none;
  min-height: 40px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #334155;
}
.ad-user-order-codes-wrap summary::-webkit-details-marker { display: none; }
.ad-user-order-codes-wrap summary .shop-icon {
  width: 16px;
  height: 16px;
  color: #2448c6;
}
.ad-user-order-codes-wrap summary b {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #eef3ff;
  color: #1d4ed8;
  font-size: 0.75rem;
}
.ad-user-order-codes {
  list-style: none;
  margin: 0.25rem 0 0.35rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 280px;
  overflow: auto;
}
.ad-user-order-codes li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.82rem;
}
.ad-user-order-codes code {
  cursor: pointer;
  font-weight: 750;
}
.ad-user-order-codes code.is-copied {
  background: #e7f7ee;
}
.ad-user-order-codes li strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.ad-user-order-codes-more {
  margin: 0.35rem 0 0.15rem;
  font-size: 0.78rem;
}
@media (max-width: 980px) {
  .ad-user-order-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .ad-user-order-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ad-user-order-line {
    grid-template-columns: 40px 1fr;
  }
  .ad-user-order-line-sum {
    grid-column: 2;
    text-align: left;
  }
}
.ad-user-card-preview {
  display: grid;
  gap: 0.5rem;
}
.ad-user-card-preview-item {
  display: grid;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  text-decoration: none;
  color: inherit;
}
.ad-user-card-preview-item:hover {
  border-color: rgba(36, 72, 198, 0.28);
}
.ad-user-card-preview-item code {
  font-size: 0.82rem;
}
.ad-user-card-preview-item span {
  font-size: 0.8rem;
  color: var(--ad-muted, #64748b);
}
.ad-user-overview-forms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.ad-user-inline-form {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}
.ad-user-inline-form-head {
  margin-bottom: 0.65rem;
}
.ad-user-inline-form-head strong {
  display: block;
  font-size: 0.95rem;
}
.ad-user-inline-form-head .muted {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
}
.ad-user-inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.ad-user-inline-fields label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ad-muted, #64748b);
  flex: 1 1 120px;
}
.ad-user-inline-fields input,
.ad-user-field input,
.ad-user-field textarea,
.ad-user-notes-form textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 0.55rem 0.75rem;
  font: inherit;
  background: #fff;
}
.ad-user-field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ad-muted, #64748b);
}
.ad-user-field span { font-weight: 750; }
.ad-user-recalc { margin: 0.65rem 0 0; }
.ad-user-inline-link {
  border: 0;
  background: none;
  padding: 0;
  margin-left: 0.35rem;
  color: #1d4ed8;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.ad-user-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.ad-user-timeline li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: #fff;
}
.ad-user-tl-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(36, 72, 198, 0.1);
  color: #1d4ed8;
  white-space: nowrap;
}
.ad-user-tl-body {
  display: grid;
  gap: 0.15rem;
  font-size: 0.88rem;
}
.ad-user-timeline em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--ad-muted, #64748b);
  white-space: nowrap;
}
.ad-user-profile-form {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.ad-user-profile-form h3 {
  margin: 0 0 0.75rem;
}
.ad-user-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 0.85rem;
}
.ad-user-field-wide { grid-column: 1 / -1; }
@media (max-width: 980px) {
  .ad-user-quick-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ad-user-overview-cols { grid-template-columns: 1fr; }
  .ad-user-overview-forms { grid-template-columns: 1fr; }
  .ad-user-order-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ad-user-kpi-row { grid-template-columns: 1fr; }
}
.ad-viz-card[data-ad-promo-orders] {
  cursor: pointer;
}
.ad-viz-card[data-ad-promo-orders]:hover {
  border-color: rgba(36, 72, 198, 0.28);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}
#ad-modal-promo-orders .ad-promo-orders-kicker {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.45rem;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#ad-modal-promo-orders .ad-modal-head h2 {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.04em;
}
#ad-modal-promo-orders .ad-modal-head p {
  max-width: none;
  opacity: 0.88;
}
#ad-modal-promo-orders .ad-promo-orders-body {
  background: #f4f7fb;
}
#ad-modal-promo-orders .ad-promo-uses-stats,
#ad-modal-promo-orders .ad-odm-kpis.ad-promo-uses-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}
#ad-modal-promo-orders .ad-promo-uses-list {
  display: grid;
  gap: 0.85rem;
}
#ad-modal-promo-orders .ad-promo-uses-empty {
  margin: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--ad-muted, #64748b);
  background: #fff;
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: 16px;
}
#ad-modal-promo-orders .ad-promo-uses-client {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.85rem;
  min-width: 0;
}
#ad-modal-promo-orders .ad-promo-uses-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #eef3ff;
  color: #2448c6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
}
#ad-modal-promo-orders .ad-promo-uses-client > div:last-child strong,
#ad-modal-promo-orders .ad-promo-uses-client > div:last-child span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#ad-modal-promo-orders .ad-promo-uses-client strong {
  font-size: 0.92rem;
}
#ad-modal-promo-orders .ad-promo-uses-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.15rem 0 0;
}
#ad-modal-promo-orders .ad-promo-uses-items .ad-chip {
  margin: 0;
  pointer-events: none;
}
@media (max-width: 640px) {
  .ad-user-order-grid,
  .ad-user-order-grid.is-compact { grid-template-columns: 1fr 1fr; }
  .ad-user-timeline li { grid-template-columns: 1fr; }
  .ad-user-profile-grid { grid-template-columns: 1fr; }
  #ad-modal-promo-orders .ad-promo-uses-stats,
  #ad-modal-promo-orders .ad-odm-kpis.ad-promo-uses-stats {
    grid-template-columns: 1fr;
  }
}
