/* Product Data Lake Ipacarai — UI base */
:root,
html[data-theme="dark"] {
  color-scheme: dark;

  --warm-r: 255;
  --warm-g: 230;
  --warm-b: 215;
  --glass-r: 255;
  --glass-g: 255;
  --glass-b: 255;
  --brand-r: 233;
  --brand-g: 76;
  --brand-b: 61;
  --shadow-rgb: 0, 0, 0;
  --overlay-rgb: 14, 12, 11;
  --mask-rgb: 0, 0, 0;
  --grid-mask-top: 0.9;
  --grid-mask-mid: 0.5;
  --ambient-glow: rgba(233, 76, 61, 0.05);
  --carousel-stage: #ffffff;
  --carousel-fallback: #0a0908;
  --on-primary: #fff;
  --bg-brand: transparent;

  --bg-deep: #0e0c0b;
  --bg-base: #131110;
  --bg-surface: #1a1816;
  --bg-elevated: #221f1c;
  --bg-hover: #2a2622;

  --line: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.06);
  --line-strong: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.12);
  --grid-line: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.05);
  --grid-line-bold: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.08);

  --txt-primary: #f1ebe3;
  --txt-secondary: #a89f93;
  --txt-muted: #6e655c;
  --txt-faint: #4a423b;

  --red: #e94c3d;
  --red-soft: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.12);
  --red-glow: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.35);

  --neutral-icon: #a89f93;
  --neutral-bg: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.04);
  --neutral-border: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.1);

  --ok: #8a9a3f;
  --warn: #c89a3f;
  --ok-glow: rgba(138, 154, 63, 0.5);
  --warn-glow: rgba(200, 154, 63, 0.5);
  --ok-surface: #d6e0b8;
  --warn-surface: #e8d4a8;

  --status-ok-fg: #7dffb8;
  --status-warn-fg: #ffd28a;
  --status-danger-fg: #ffb0a8;
  --status-info-fg: #9ec0ff;
  --status-up-fg: #66e7a2;
  --status-down-fg: #ff8f8f;
  --status-error-fg: #ff9f9f;
  --status-sync-fg: #ffd47d;
  --status-sync-sub-fg: #ffe9b4;
  --status-sync-strong-fg: #fff1cc;
  --status-sync-detail-fg: #f6d58b;
  --status-thumb-pdf-fg: #ffb4aa;
  --status-thumb-video-fg: #e8cf8f;
  --status-sync-chip-bg: linear-gradient(180deg, rgba(245, 193, 82, 0.2), rgba(245, 193, 82, 0.07)), rgba(18, 16, 10, 0.56);
  --status-sync-chip-border: rgba(245, 193, 82, 0.4);

  /* aliases layout produto v2 */
  --border: var(--line);
  --text-muted: var(--txt-muted);
  --mono: 'IBM Plex Mono', monospace;
  --accent: var(--red);
}

html[data-theme="light"] {
  color-scheme: light;

  /* Cinza-azulado neutro para tints tom-sobre-tom limpos */
  --warm-r: 17;
  --warm-g: 24;
  --warm-b: 39;
  --glass-r: 255;
  --glass-g: 255;
  --glass-b: 255;
  --brand-r: 224;
  --brand-g: 54;
  --brand-b: 43;
  --shadow-rgb: 17, 24, 39;
  --overlay-rgb: 255, 255, 255;
  --mask-rgb: 17, 24, 39;
  --grid-mask-top: 0.18;
  --grid-mask-mid: 0.08;
  --ambient-glow: rgba(224, 54, 43, 0.06);
  --carousel-stage: #ffffff;
  --carousel-fallback: #f3f4f6;
  --on-primary: #fff;
  --bg-brand: #111827;

  /* Superfícies brancas / cinza-claras */
  --bg-deep: #eef0f3;
  --bg-base: #f6f7f9;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-hover: #eceef1;
  --bg-input: #ffffff;
  --bg-card: #ffffff;

  --line: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.08);
  --line-strong: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.14);
  --grid-line: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.045);
  --grid-line-bold: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.07);

  --txt-primary: #111827;
  --txt-secondary: #374151;
  --txt-muted: #6b7280;
  --txt-faint: #9ca3af;

  --red: #e0362b;
  --red-soft: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.10);
  --red-glow: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.28);

  --neutral-icon: #6b7280;
  --neutral-bg: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.05);
  --neutral-border: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.12);

  --bg-button: #ffffff;
  --btn-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.06), 0 1px 0 rgba(255, 255, 255, 0.9) inset;

  --ok: #166534;
  --warn: #92400e;
  --ok-glow: rgba(22, 101, 52, 0.35);
  --warn-glow: rgba(146, 64, 14, 0.35);
  --ok-surface: #dcfce7;
  --warn-surface: #fef3c7;

  --status-ok-fg: #166534;
  --status-warn-fg: #92400e;
  --status-danger-fg: var(--red);
  --status-info-fg: #1e40af;
  --status-up-fg: #166534;
  --status-down-fg: var(--red);
  --status-error-fg: var(--red);
  --status-sync-fg: #92400e;
  --status-sync-sub-fg: #b45309;
  --status-sync-strong-fg: var(--txt-primary);
  --status-sync-detail-fg: var(--txt-secondary);
  --status-thumb-pdf-fg: var(--red);
  --status-thumb-video-fg: #92400e;
  --status-sync-chip-bg: linear-gradient(180deg, rgba(180, 83, 9, 0.10), rgba(180, 83, 9, 0.04));
  --status-sync-chip-border: rgba(180, 83, 9, 0.25);

  --border: var(--line);
  --text-muted: var(--txt-muted);
  --mono: 'IBM Plex Mono', monospace;
  --accent: var(--red);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg-deep);
  color: var(--txt-primary);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-bold) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 140px 140px, 140px 140px;
  background-position: 0 0;
  -webkit-mask-image: linear-gradient(180deg, rgba(var(--mask-rgb), var(--grid-mask-top)) 0%, rgba(var(--mask-rgb), var(--grid-mask-mid)) 30%, rgba(var(--mask-rgb), 0.15) 60%, transparent 90%);
          mask-image: linear-gradient(180deg, rgba(var(--mask-rgb), var(--grid-mask-top)) 0%, rgba(var(--mask-rgb), var(--grid-mask-mid)) 30%, rgba(var(--mask-rgb), 0.15) 60%, transparent 90%);
  pointer-events: none;
  z-index: 1;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 80% 0%, var(--ambient-glow), transparent 60%);
  pointer-events: none;
  z-index: 2;
}

.mono { font-family: 'IBM Plex Mono', monospace; }
.display { font-family: 'Bricolage Grotesque', sans-serif; }
.serif-i { font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; }

/* Bridge: keep existing app containers working */
.app-body { position: relative; z-index: 10; min-height: 100vh; }
.app-main { padding: 36px; }
.app-footer { border-top: 1px solid var(--line); color: var(--txt-faint); padding: 18px 36px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.alert { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-surface); margin-bottom: 14px; }
.alert--ok { border-color: rgba(138, 154, 63, 0.25); color: var(--ok); }
.alert--error { border-color: rgba(233, 76, 61, 0.25); color: var(--red); background: var(--red-soft); }

.btn { cursor: pointer; }

/* ===== SISTEMA UNIFICADO DE BOTÕES ===== */

/* Base compartilhada por todas as variantes */
.btn--ghost,
.btn--primary,
.btn-secondary,
.btn-tech,
.btn-small,
.actionbar__btn,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  height: 36px;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, filter 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn--ghost svg,
.btn--primary svg,
.btn-secondary svg,
.btn-tech svg,
.actionbar__btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Focus ring comum */
.btn--ghost:focus-visible,
.btn--primary:focus-visible,
.btn-secondary:focus-visible,
.btn-tech:focus-visible,
.actionbar__btn:focus-visible,
.btn-danger:focus-visible {
  outline: 2px solid rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.55);
  outline-offset: 2px;
}

/* Disabled comum */
.btn--ghost:disabled,
.btn--primary:disabled,
.btn-secondary:disabled,
.btn-tech:disabled,
.actionbar__btn:disabled,
.btn-danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* Active shrink */
.btn--ghost:active,
.btn--primary:active,
.btn-secondary:active,
.btn-tech:active,
.actionbar__btn:active {
  transform: translateY(0) scale(0.98);
}

/* — Ghost / Secondary — */
.btn--ghost {
  background: var(--neutral-bg);
  border-color: var(--line);
  color: var(--txt-secondary);
}
.btn--ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--line-strong);
  color: var(--txt-primary);
}

/* — Primary (inline, não full-width) — */
.btn--primary {
  background: var(--red);
  color: var(--on-primary);
  border-color: var(--red);
}
.btn--primary:hover {
  box-shadow: 0 8px 20px -8px var(--red-glow);
  transform: translateY(-1px);
  filter: brightness(1.06);
}

/* — Secondary (compartilhado com .btn--ghost) — */
.btn-secondary {
  background: var(--neutral-bg);
  border-color: var(--line);
  color: var(--txt-secondary);
}
.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--line-strong);
  color: var(--txt-primary);
  box-shadow: 0 4px 12px -6px rgba(var(--shadow-rgb), 0.25);
  transform: translateY(-1px);
}

/* — Danger — */
.btn-danger {
  background: rgba(233, 76, 61, 0.12);
  border-color: rgba(233, 76, 61, 0.3);
  color: var(--red);
}
.btn-danger:hover {
  background: rgba(233, 76, 61, 0.20);
  border-color: rgba(233, 76, 61, 0.5);
  box-shadow: 0 4px 12px -6px rgba(233, 76, 61, 0.30);
  transform: translateY(-1px);
}

/* — Pequeno (modificador de tamanho) — */
.btn-small {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* — Tech (mono/uppercase, estilo terminal) — */
.btn-tech {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .14em;
  border-radius: 8px;
  border-color: var(--line);
  background: var(--neutral-bg);
  color: var(--txt-secondary);
  height: 36px;
}
.btn-tech:hover {
  border-color: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.35);
  color: var(--txt-primary);
  background: var(--bg-elevated);
  box-shadow: 0 6px 18px -10px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.30);
}

.form__input { width: 100%; background: var(--bg-surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; color: var(--txt-primary); outline: none; transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease; }
.form__input:hover:not(:focus) { border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.1); }
.form__input:focus { border-color: var(--line-strong); background: var(--bg-elevated); box-shadow: 0 0 0 3px var(--neutral-bg); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-surface); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 14px 22px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--txt-secondary); font-weight: 500; border-bottom: 1px solid var(--line); background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02); }
.table td { padding: 16px 22px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--txt-primary); transition: background 0.18s ease; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-elevated); }
.table__empty { text-align: center; color: var(--txt-muted); }

/* Auth bridge */
.auth-body { position: relative; z-index: 10; min-height: 100vh; display: grid; place-items: center; padding: 36px; }
.auth-wrap { width: 100%; max-width: 520px; }
.auth-card { background: var(--bg-surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }

/* ============= LOGIN (v3) ============= */
#login-screen {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.login-left {
  position: relative;
  padding: 56px 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-base);
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-bold) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-bold) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px, 160px 160px, 160px 160px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 35%, rgba(0,0,0,0.2) 65%, transparent 95%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.6) 35%, rgba(0,0,0,0.2) 65%, transparent 95%);
  pointer-events: none;
}

.login-left::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0.5;
}

.login-left > * { position: relative; z-index: 3; }

.brand-block { display: flex; align-items: center; gap: 22px; }
.brand-block img { height: clamp(56px, 9vw, 112px); width: auto; max-width: 100%; object-fit: contain; }
.brand-divider { width: 1px; height: clamp(44px, 6.5vw, 80px); background: var(--line-strong); }
.brand-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--txt-secondary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-tag .dot {
  width: 5px; height: 5px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--red-glow);
  animation: pulse 1.8s infinite;
}

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

.login-hero { max-width: 600px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-bottom: 32px;
}
.hero-eyebrow::before { content: ''; width: 32px; height: 1px; background: var(--txt-muted); }
.hero-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(48px, 5.4vw, 72px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  color: var(--txt-primary);
}
.hero-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--red);
  letter-spacing: -0.02em;
}
.hero-desc { font-size: 16px; color: var(--txt-secondary); line-height: 1.65; max-width: 480px; }

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.login-stat { padding-right: 24px; }
.login-stat:not(:last-child) { border-right: 1px solid var(--line); margin-right: 24px; }
.stat-num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--txt-primary);
  margin-bottom: 6px;
  letter-spacing: -0.025em;
  line-height: 1;
}
.stat-num em { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--txt-muted); font-weight: 400; margin-left: 2px; }
.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--txt-muted);
}

.login-right {
  position: relative;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-deep);
}
.auth-label {
  position: absolute;
  top: 36px;
  right: 56px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-label::after {
  content: '';
  width: 5px; height: 5px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--red-glow);
}

.login-card {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  border: 1px solid transparent;
  box-sizing: border-box;
}
.login-card-head { margin-bottom: 36px; }
.step-indicator {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--txt-muted);
}
.step-indicator .red { color: var(--red); }
.step-line { flex: 1; height: 1px; background: var(--line-strong); }
.login-card h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 12px;
}
.login-card h2 em { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--red); font-weight: 400; }
.login-card-head p { color: var(--txt-secondary); font-size: 14px; line-height: 1.6; }

/* Login — refinamentos modo claro */
html[data-theme="light"] .login-card {
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 16px;
  padding: 32px 32px 26px;
  box-sizing: border-box;
}

html[data-theme="light"] .login-card h2 {
  color: var(--txt-primary);
}

html[data-theme="light"] .login-card-head .step-indicator {
  color: var(--txt-muted);
}

.form-field { margin-bottom: 20px; }
.form-field label {
  display: flex;
  justify-content: space-between;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-bottom: 9px;
}
.form-field label .req { color: var(--txt-faint); }
.input-wrap { position: relative; }
.input-wrap input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px 14px 46px;
  color: var(--txt-primary);
  font-family: 'Manrope', sans-serif;
  font-size: 14.5px;
  transition: all 0.2s;
  outline: none;
}
.input-wrap input:hover:not(:focus) {
  border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.1);
}
.input-wrap input:focus {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px var(--neutral-bg);
}
.input-wrap input::placeholder { color: var(--txt-muted); }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--txt-muted); pointer-events: none; transition: color 0.2s; }
.input-wrap input:focus + .input-icon { color: var(--red); }

html[data-theme="light"] .login-card .input-wrap input {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.15);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.04);
}

html[data-theme="light"] .login-card .input-wrap input:hover:not(:focus) {
  border-color: rgba(17, 24, 39, 0.28);
}

html[data-theme="light"] .login-card .input-wrap input:focus {
  background: #ffffff;
  border-color: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.55);
  box-shadow: 0 0 0 3px var(--red-soft);
}

html[data-theme="light"] .login-card .input-wrap input::placeholder {
  color: #9ca3af;
}

html[data-theme="light"] .login-card .input-icon {
  color: #9ca3af;
}

.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; font-size: 13px; }
.checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--txt-secondary); }
.checkbox input { display: none; }
.checkbox .box { width: 17px; height: 17px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--bg-surface); display: grid; place-items: center; transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease; }
.checkbox:hover .box { border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.22); }
.checkbox input:checked + .box { background: var(--red); border-color: var(--red); }
.checkbox input:checked + .box::after { content: '✓'; color: var(--bg-deep); font-size: 11px; font-weight: 800; }
.forgot-link {
  color: var(--txt-secondary);
  text-decoration: none;
  transition: color 0.2s;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 14.5px;
}
.forgot-link:hover { color: var(--red); }

.btn-primary {
  width: 100%;
  height: auto;
  padding: 16px;
  background: var(--red);
  color: var(--on-primary);
  border: 1px solid var(--red);
  border-radius: 8px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%);
  transition: transform 0.7s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 32px -8px var(--red-glow); filter: brightness(1.05); }
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:focus-visible { outline: 2px solid rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.55); outline-offset: 2px; }
.btn-primary svg { transition: transform 0.25s; }
.btn-primary:hover svg { transform: translateX(4px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  background: var(--neutral-bg);
  color: var(--txt-secondary);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-secondary:hover {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
  color: var(--txt-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -6px rgba(var(--shadow-rgb), 0.25);
}
.btn-secondary:focus-visible {
  outline: 2px solid rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.55);
  outline-offset: 2px;
}

.login-footer {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--txt-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.system-status { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok-glow); }

/* ============= APP LAYOUT (v3) ============= */
#dashboard-screen { position: relative; z-index: 10; min-height: 100vh; }
#dashboard-screen.active { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
#dashboard-screen.active > .main { min-width: 0; }
.main > .content { min-width: 0; max-width: 100%; }

.sidebar {
  background: var(--bg-base);
  border-right: 1px solid var(--line);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
}
.sidebar-brand {
  display: block;
  position: relative;
  padding: 0 6px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.sidebar-brand img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: 110px;
  object-fit: contain;
}
.sidebar-brand-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--txt-muted);
  border: 1px solid var(--line-strong);
  padding: 3px 8px;
  border-radius: 3px;
  position: absolute;
  top: 2px;
  right: 0;
  text-transform: uppercase;
}
.nav-section { margin-bottom: 26px; }
.nav-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--txt-faint);
  padding: 0 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-label::before { content: ''; width: 14px; height: 1px; background: var(--txt-faint); }
.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border-radius: 6px;
  color: var(--txt-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.2s ease;
  cursor: pointer;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-surface);
  color: var(--txt-primary);
  transform: translateX(3px);
}
.nav-item.active { background: var(--bg-surface); color: var(--txt-primary); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  background: var(--red);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 10px var(--red-glow);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  background: var(--bg-elevated);
  padding: 2px 7px;
  border-radius: 3px;
  color: var(--txt-muted);
  border: 1px solid var(--line);
}
.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.sidebar-footer:hover {
  border-color: var(--line-strong);
  box-shadow: 0 12px 30px -20px rgba(var(--shadow-rgb), 0.5);
  transform: translateY(-1px);
}
.user-mini { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--txt-primary);
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: var(--txt-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--txt-muted); letter-spacing: 0.1em; margin-top: 2px; }
.logout-btn {
  background: transparent;
  border: none;
  color: var(--txt-muted);
  cursor: pointer;
  padding: 7px;
  border-radius: 5px;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.logout-btn:hover { color: var(--red); background: var(--red-soft); transform: scale(1.08); }

.main { background: transparent; min-height: 100vh; position: relative; }
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: rgba(var(--overlay-rgb), 0.85);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--txt-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.breadcrumb .current { color: var(--txt-primary); }
.breadcrumb .sep { color: var(--txt-faint); }
.topbar-search { margin-left: 16px; flex: 1; max-width: 480px; position: relative; }
.topbar-search input,
button.topbar-search {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px 9px 38px;
  color: var(--txt-primary);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
button.topbar-search { padding-left: 36px; }
.topbar-search input:hover:not(:focus),
button.topbar-search:hover { border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.18); }
.topbar-search input:focus { border-color: var(--line-strong); }
.topbar-search input::placeholder { color: var(--txt-muted); font-style: italic; }
.topbar-search .input-icon { left: 12px; }
.topbar-search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 6px;
  color: var(--txt-muted);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.live-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--txt-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.live-indicator:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -14px rgba(var(--shadow-rgb), 0.45);
}
.live-indicator .live-dot { width: 6px; height: 6px; background: var(--ok); border-radius: 50%; box-shadow: 0 0 8px var(--ok-glow); animation: pulse 1.8s infinite; }
.live-indicator .live-dot--warn { background: var(--warn); box-shadow: 0 0 8px var(--warn-glow); }

/* Dashboard — fila de jobs (estável / processando) */
.run-status {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-top: 0;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.run-status--stable {
  border-color: rgba(138, 154, 63, 0.38);
  background: linear-gradient(125deg, rgba(138, 154, 63, 0.14), rgba(138, 154, 63, 0.03));
  box-shadow: 0 0 28px -12px rgba(138, 154, 63, 0.4);
}
.run-status--busy {
  border-color: rgba(200, 154, 63, 0.42);
  background: linear-gradient(125deg, rgba(200, 154, 63, 0.14), rgba(200, 154, 63, 0.04));
  box-shadow: 0 0 28px -12px rgba(200, 154, 63, 0.35);
}
.run-status__dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.run-status__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(138, 154, 63, 0.55);
  animation: runStatusRipple 2.1s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  pointer-events: none;
}
.run-status--stable .run-status__dot {
  background: radial-gradient(circle at 32% 28%, #d4e29a, #7a8b38);
  box-shadow: 0 0 0 1px rgba(138, 154, 63, 0.45);
  animation: runStatusGlow 2.1s ease-in-out infinite;
}
.run-status--busy .run-status__dot {
  background: radial-gradient(circle at 32% 28%, #f0d49a, #a67c28);
  box-shadow: 0 0 0 1px rgba(200, 154, 63, 0.45);
  animation: runStatusGlowBusy 1.25s ease-in-out infinite;
}
.run-status--busy .run-status__dot::after {
  border-color: rgba(200, 154, 63, 0.55);
  animation-duration: 1.35s;
}
.run-status__label {
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.run-status--stable .run-status__label {
  color: var(--status-ok-fg);
}
.run-status--busy .run-status__label {
  color: var(--status-warn-fg);
}
@keyframes runStatusGlow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(138, 154, 63, 0.4), 0 0 10px rgba(138, 154, 63, 0.35);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(138, 154, 63, 0.65), 0 0 22px rgba(138, 154, 63, 0.55);
  }
}
@keyframes runStatusGlowBusy {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(200, 154, 63, 0.35), 0 0 10px rgba(200, 154, 63, 0.3);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(200, 154, 63, 0.6), 0 0 22px rgba(200, 154, 63, 0.45);
  }
}
@keyframes runStatusRipple {
  0% { transform: scale(1); opacity: 0.55; }
  70% { opacity: 0.12; }
  100% { transform: scale(2.85); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .run-status__dot,
  .run-status__dot::after {
    animation: none !important;
  }
  .run-status--stable .run-status__dot,
  .run-status--busy .run-status__dot {
    animation: none !important;
  }
}

.content { padding: 36px; position: relative; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  gap: 24px;
}
.page-header-info { flex: 1; }
.page-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--txt-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.page-eyebrow .ed { color: var(--txt-primary); }
.page-eyebrow .sep { width: 30px; height: 1px; background: var(--line-strong); }
.page-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 56px;
  font-weight: 500;
  letter-spacing: -0.035em;
  margin-bottom: 12px;
  line-height: 0.95;
}
.page-title em { font-family: 'Instrument Serif', serif; font-style: italic; color: var(--red); font-weight: 400; }
.page-subtitle { color: var(--txt-secondary); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.page-subtitle code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 3px;
  color: var(--txt-secondary);
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.panel:hover {
  border-color: var(--line-strong);
  box-shadow: 0 22px 50px -34px rgba(var(--shadow-rgb), 0.65);
  transform: translateY(-1px);
}
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-title { display: flex; align-items: baseline; gap: 12px; }
.panel-title h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 17px; font-weight: 500; letter-spacing: -0.02em; transition: color 0.2s ease; }
.panel:hover .panel-title h3 { color: var(--txt-primary); }
.panel-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--txt-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.panel:hover .panel-tag {
  border-color: var(--line-strong);
  transform: translateY(-0.5px);
}
.panel-body { padding: 22px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 14px 22px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--txt-muted); font-weight: 500; border-bottom: 1px solid var(--line); background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02); }
.data-table td { padding: 16px 22px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--txt-primary); transition: background 0.18s ease; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-elevated); }

/* ── Modais / dialogs — centralização global ── */
dialog {
  position: fixed;
  inset: 0;
  width: fit-content;
  height: fit-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: none;
  overflow: auto;
  overscroll-behavior: contain;
  transform: none;
  box-sizing: border-box;
  background: transparent;
  color: var(--txt-primary);
}
dialog:not([open]) {
  display: none;
}
.tm-overlay {
  position: fixed;
  inset: 0;
  z-index: 290;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.58);
  padding: 16px;
  overflow-y: auto;
}
.tm-overlay.is-open {
  display: flex;
}
.tm-overlay--2 { z-index: 295; }
.tm-overlay--3 { z-index: 298; }

.sync-confirm {
  border: none;
  padding: 0;
  border-radius: 12px;
  background: transparent;
}
.sync-confirm::backdrop {
  background: rgba(var(--shadow-rgb), 0.65);
}
.sync-confirm__form {
  width: auto;
  min-width: min(280px, calc(100vw - 32px));
  max-width: min(860px, calc(100vw - 32px));
  box-sizing: border-box;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
/* Tamanhos usados em telas com max-width inline no __form */
.sync-confirm__form.apres-modal__form { max-width: min(520px, calc(100vw - 32px)); }
dialog.sync-confirm.seller-history-dialog .sync-confirm__form,
dialog.sync-confirm.seller-customer-history-dialog .sync-confirm__form {
  width: min(1280px, calc(100vw - 32px));
  max-width: min(1280px, calc(100vw - 32px));
}
#orders-quick-customer-dialog .sync-confirm__form {
  width: min(980px, calc(100vw - 32px));
  max-width: min(980px, calc(100vw - 32px));
}
#orders-quick-seller-dialog .sync-confirm__form {
  width: min(1020px, calc(100vw - 32px));
  max-width: min(1020px, calc(100vw - 32px));
}
#orders-quick-order-dialog .sync-confirm__form {
  width: min(1040px, calc(100vw - 32px));
  max-width: min(1040px, calc(100vw - 32px));
}
.sync-confirm__title {
  padding: 18px 18px 12px;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.sync-confirm__body {
  padding: 0 18px 18px;
  color: var(--txt-secondary);
}
.sync-confirm__actions {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.job-actions{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.job-actions > a,
.job-actions > form{
  display:block;
}
.job-actions .btn-secondary{
  min-width: 140px;
  justify-content: center;
}

.btn-tech:hover{
  border-color: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.35);
  box-shadow: 0 6px 18px -10px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.30);
  color: var(--txt-primary);
  background: var(--bg-elevated);
}

.actionbar{
  display:inline-flex;
  gap:8px;
  align-items:center;
  justify-content:flex-end;
}
.actionbar__form{ display:inline; }
.actionbar__btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--neutral-bg);
  color: var(--txt-secondary);
  text-decoration:none;
  cursor:pointer;
  transition: all .18s ease;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
button.actionbar__btn {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  line-height: 1;
}
.actionbar__btn svg{ width:14px; height:14px; opacity:.85; flex-shrink:0; }
.actionbar__btn:hover{
  color: var(--txt-primary);
  border-color: var(--line-strong);
  background: var(--bg-elevated);
  box-shadow: 0 4px 12px -6px rgba(var(--shadow-rgb), 0.18);
  transform: translateY(-1px);
}
.actionbar__btn--primary{
  border-color: var(--red);
  background: var(--red);
  color: var(--on-primary);
}
.actionbar__btn--primary:hover{
  border-color: var(--red);
  box-shadow: 0 8px 20px -8px var(--red-glow);
  filter: brightness(1.06);
}
@media (max-width: 980px){
  .actionbar__btn span{ display:none; }
  .actionbar__btn{ padding: 0 12px; }
}

/* .btn-small já definido acima no sistema unificado — apenas ajuste de padding para compatibilidade */
.btn-small {
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
  height: 30px;
}

/* Upload dropzone (produto/show) */
.prod-upload-zone {
  position: relative;
  margin-bottom: 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--bg-base);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.25s;
  outline: none;
}
.prod-upload-zone:focus-visible {
  border-color: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.18);
}
.prod-upload-zone.is-dragover {
  border-color: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.65);
  background: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.06);
}
.prod-upload-zone.is-highlight {
  animation: prodUploadHighlight 1.4s ease-out;
}
.prod-upload-zone.is-pending {
  border-style: solid;
  border-color: var(--line-strong);
}
.prod-upload-zone.is-uploading {
  opacity: 0.72;
  pointer-events: none;
}
.prod-upload-zone__input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.prod-upload-zone__idle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 20px 20px;
  cursor: pointer;
}
.prod-upload-zone__glow {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(233, 76, 61, 0.2) 0%, transparent 68%);
  pointer-events: none;
  animation: carouselEmptyPulse 4s ease-in-out infinite;
}
.prod-upload-zone__visual {
  position: relative;
  z-index: 1;
  color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.62);
  margin-bottom: 4px;
}
.prod-upload-zone__icon {
  width: 84px;
  height: 84px;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 10px 24px rgba(var(--shadow-rgb), 0.45));
}
.prod-upload-zone__cam {
  transform-origin: 60px 64px;
  transform-box: fill-box;
}
@media (prefers-reduced-motion: no-preference) {
  .prod-upload-zone__cam {
    animation: carouselEmptyCamLive 2.9s ease-in-out infinite;
  }
}
.prod-upload-zone__title {
  position: relative;
  z-index: 1;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--txt-primary);
  margin: 6px 0 0;
}
.prod-upload-zone__hint {
  position: relative;
  z-index: 1;
  max-width: 360px;
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--txt-secondary);
}
.prod-upload-zone__pick {
  position: relative;
  z-index: 2;
  margin-top: 12px;
}
.prod-upload-zone__pending {
  padding: 16px 18px;
}
.prod-upload-zone__file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-surface);
  margin-bottom: 12px;
}
.prod-upload-zone__file-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.12);
  color: var(--txt-primary);
  font-size: 14px;
  flex-shrink: 0;
}
.prod-upload-zone__file-name {
  font-size: 13px;
  color: var(--txt-primary);
  word-break: break-all;
  line-height: 1.35;
}
.prod-upload-zone__principal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 14px;
  user-select: none;
}
.prod-upload-zone__principal input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.prod-upload-zone__principal .box {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  transition: border-color 0.15s, background 0.15s;
}
.prod-upload-zone__principal input:checked + .box {
  background: var(--red);
  border-color: var(--red);
}
.prod-upload-zone__principal input:checked + .box::after {
  content: '✓';
  color: var(--bg-deep);
  font-size: 11px;
  font-weight: 800;
}
.prod-upload-zone__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
@keyframes prodUploadHighlight {
  0% { box-shadow: 0 0 0 0 rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.45); }
  40% { box-shadow: 0 0 0 6px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.22); }
  100% { box-shadow: 0 0 0 0 rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0); }
}
@media (prefers-reduced-motion: reduce) {
  .prod-upload-zone__glow,
  .prod-upload-zone__cam,
  .prod-upload-zone.is-highlight {
    animation: none !important;
  }
}
html[data-theme="light"] .prod-upload-zone {
  background: var(--bg-surface);
}
html[data-theme="light"] .prod-upload-zone.is-dragover {
  background: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.04);
}

/* Attachments (produto/show) */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  gap: 14px;
  align-items: start;
  justify-content: start;
}

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

.attachment-card {
  border: 1px solid var(--line);
  background: var(--bg-surface);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.attachment-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--bg-elevated);
}
.attachment-card.is-principal {
  border-color: rgba(138, 154, 63, 0.35);
  box-shadow: 0 0 0 1px rgba(138, 154, 63, 0.10);
}

.attachment-thumb {
  display: block;
  position: relative;
  height: 92px;
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.03);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.02);
}

.attachment-file {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 55% 60% at 70% 25%, rgba(233, 76, 61, 0.08), transparent 60%),
    rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.03);
}
.attachment-file-ext {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--txt-secondary);
  border: 1px solid var(--line);
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.03);
  padding: 7px 10px;
  border-radius: 8px;
  text-transform: uppercase;
}

.attachment-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ok);
  background: rgba(138, 154, 63, 0.10);
  border: 1px solid rgba(138, 154, 63, 0.25);
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.attachment-meta {
  padding: 12px 14px 10px;
}
.attachment-name {
  font-weight: 650;
  font-size: 13px;
  color: var(--txt-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.attachment-sub {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.attachment-sub .dot { opacity: 0.6; }

.attachment-actions {
  padding: 0 14px 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.attachment-actions .btn-secondary.btn-small,
.attachment-actions form {
  flex: 1 1 100%;
}

.attachment-actions form button {
  width: 100% !important;
}

.attachment-btn-delete {
  border-color: rgba(233, 76, 61, 0.42) !important;
  color: var(--red) !important;
}
.attachment-btn-delete:hover {
  border-color: rgba(233, 76, 61, 0.6) !important;
  background: var(--red-soft) !important;
}

/* Produto (show) - hero / carrossel / chips */
.neon-border{
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.10);
  background:
    radial-gradient(ellipse 60% 55% at 10% 0%, rgba(233, 76, 61, 0.06), transparent 55%),
    radial-gradient(ellipse 70% 60% at 90% 20%, rgba(138, 154, 63, 0.05), transparent 55%),
    linear-gradient(180deg, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.04), rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02));
  box-shadow:
    0 0 0 1px rgba(233, 76, 61, 0.06),
    0 28px 70px -42px rgba(233, 76, 61, 0.35);
  border-radius: 16px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.neon-border:hover {
  border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.16);
  box-shadow:
    0 0 0 1px rgba(233, 76, 61, 0.1),
    0 32px 72px -40px rgba(233, 76, 61, 0.42);
  transform: translateY(-1px);
}

.product-hero{
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.08fr);
  gap: 20px;
  padding: 18px;
  margin-bottom: 18px;
  align-items: start;
}

.product-hero__main{
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.product-hero__header{
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.product-hero__header-row{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 10px;
}

.product-hero__code{
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-secondary);
  font-weight: 600;
}

.product-hero__fabricante{
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.product-hero__fabricante-k{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--txt-muted);
}

.product-hero__fabricante-v{
  font-size: 14px;
  color: var(--txt-primary);
  font-weight: 600;
}

.product-hero__tags .product-hero__chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.product-hero__description{
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.03);
}

.product-hero__prices.product-price-card--hero{
  border: 1px solid rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.22);
  border-radius: 14px;
  padding: 14px 16px;
  background:
    linear-gradient(135deg, rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.1) 0%, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.04) 55%, transparent 100%);
  box-shadow: 0 12px 32px -22px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.35);
}

.product-price-item--varejo .product-price-item__value{
  color: var(--red);
}

.product-price-item--atacado .product-price-item__value{
  color: var(--txt-primary);
}

.product-hero__quality{
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02);
}

.product-hero__quality-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.product-hero__quality-val{
  font-size: 13px;
  color: var(--txt-secondary);
}

.score-track{
  height: 10px;
  border-radius: 999px;
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.12);
  border: 1px solid var(--line);
  overflow: hidden;
}

.score-bar{
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ok) 0%, rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.85) 100%);
  box-shadow: 0 0 12px var(--ok-glow);
  transition: width 0.35s ease;
}

.product-hero__advanced{
  margin-top: 4px;
}

.product-hero__advanced > summary{
  border-left-color: var(--red);
}

.product-hero__meta-card{
  margin-bottom: 12px;
}

.product-hero__gallery{
  min-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  position: sticky;
  top: 80px;
}

.product-hero__gallery .carousel{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.product-hero__gallery .carousel-main{
  flex: 1 1 auto;
  min-height: 380px;
  height: auto;
}

.product-hero__upload{
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.product-gallery{
  display:flex;
  flex-direction:column;
  gap: 12px;
  height: 100%;
  width: 100%;
}

@media (max-width: 1100px){
  .product-hero{
    grid-template-columns: 1fr;
  }
  .product-hero__gallery{
    position: static;
    min-width: 0;
    order: -1;
  }
  .product-hero__main{
    min-width: 0;
  }
}

@media (max-width: 560px){
  .product-hero__gallery .carousel-main{
    min-height: 280px;
  }
}
.carousel{ border: 1px solid var(--line); border-radius: 14px; overflow:hidden; background: var(--carousel-stage); }
.carousel-main{ position: relative; height: 420px; background: var(--carousel-stage); }
.carousel--empty{
  border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.12);
  background:
    radial-gradient(ellipse 90% 70% at 50% 18%, rgba(233, 76, 61, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.06) 0%, rgba(12, 11, 10, 0.92) 42%, rgba(8, 7, 7, 0.98) 100%);
}
.carousel--empty .carousel-main{ background: transparent; }
@media (max-width: 560px){ .carousel-main{ height: 300px; } }
.carousel-track{
  position: relative;
  width: 100%;
  height: 100%;
}
.carousel-slide{
  display: none;
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--carousel-stage);
}
.carousel-slide.is-active{
  display: flex;
  z-index: 1;
}
.carousel-slide__media{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: saturate(1.05) contrast(1.02);
  transform: translateZ(0);
}
.carousel-slide__video{
  width: 100%;
  height: auto;
  max-height: 100%;
  background: var(--carousel-fallback);
}
.carousel-slide--pdf{
  background:
    radial-gradient(ellipse 72% 62% at 50% 108%, rgba(233, 76, 61, 0.07), transparent 52%),
    radial-gradient(ellipse 90% 56% at 12% 18%, rgba(200, 154, 63, 0.05), transparent 45%),
    linear-gradient(168deg, #f3ede6 0%, #e8dfd4 36%, #ded4c8 100%);
  padding: 20px 14px;
}
.carousel-slide-doc{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
}
.carousel-slide-doc__card{
  width: 100%;
  text-align: center;
  padding: 26px 22px 22px;
  border-radius: 18px;
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.12);
  background:
    linear-gradient(152deg, rgba(32, 28, 26, 0.98) 0%, rgba(14, 12, 11, 0.99) 52%, rgba(10, 9, 8, 1) 100%);
  box-shadow:
    0 0 0 1px rgba(var(--shadow-rgb), 0.35),
    0 28px 56px -24px rgba(var(--shadow-rgb), 0.55),
    inset 0 1px 0 rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.06);
}
.carousel-slide-doc__icon-wrap{
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: radial-gradient(circle at 38% 30%, rgba(233, 76, 61, 0.2), transparent 62%),
    rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.04);
  border: 1px solid rgba(233, 76, 61, 0.22);
}
.carousel-slide-doc__icon-svg{
  width: 56px;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(var(--shadow-rgb), 0.45));
}
.carousel-slide-doc__eyebrow{
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.38);
  margin-bottom: 8px;
}
.carousel-slide-doc__name{
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--txt-primary);
  line-height: 1.4;
  word-break: break-word;
  margin: 0 0 8px;
}
.carousel-slide-doc__hint{
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--txt-secondary);
  max-width: 28em;
  margin-left: auto;
  margin-right: auto;
}
.carousel-slide-doc__cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--on-primary);
  border: 1px solid rgba(233, 76, 61, 0.45);
  background: linear-gradient(180deg, rgba(233, 76, 61, 0.95), rgba(200, 58, 48, 0.92));
  box-shadow: 0 12px 32px -14px rgba(233, 76, 61, 0.55);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.carousel-slide-doc__cta:hover{
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 16px 36px -12px rgba(233, 76, 61, 0.6);
}
.carousel-slide-doc__cta svg{
  flex-shrink: 0;
  opacity: 0.95;
}
.carousel-empty{
  position: relative;
  height: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align: center;
  padding: 28px 24px;
  box-sizing: border-box;
  border: none;
  margin: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.72);
}
.carousel-empty__glow{
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(233, 76, 61, 0.22) 0%, transparent 68%);
  pointer-events: none;
  animation: carouselEmptyPulse 4s ease-in-out infinite;
}
.carousel-empty__visual{
  position: relative;
  z-index: 1;
  color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.62);
  margin-bottom: 8px;
}
.carousel-empty__icon{
  width: 112px;
  height: 112px;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 14px 32px rgba(var(--shadow-rgb), 0.5));
}
.carousel-empty__cam{
  transform-origin: 60px 64px;
  transform-box: fill-box;
}
@media (prefers-reduced-motion: no-preference){
  .carousel-empty__cam{
    animation: carouselEmptyCamLive 2.9s ease-in-out infinite;
  }
}
.carousel-empty__title{
  position: relative;
  z-index: 1;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--txt-primary);
  margin: 10px 0 0;
}
.carousel-empty__hint{
  position: relative;
  z-index: 1;
  max-width: 320px;
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--txt-secondary);
}
.carousel-empty__hint strong{
  color: var(--txt-primary);
  font-weight: 600;
}
.carousel-empty__cta{
  position: relative;
  z-index: 2;
  margin-top: 14px;
}
@keyframes carouselEmptyCamLive{
  0%, 100%{
    transform: rotate(-2.8deg) translateY(0) scale(1);
  }
  25%{
    transform: rotate(3deg) translateY(-5px) scale(1.05);
  }
  55%{
    transform: rotate(-1.2deg) translateY(3px) scale(0.97);
  }
  80%{
    transform: rotate(1.8deg) translateY(-2px) scale(1.02);
  }
}
@keyframes carouselEmptyPulse{
  0%, 100%{ opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50%{ opacity: 0.9; transform: translate(-50%, -50%) scale(1.06); }
}
@media (prefers-reduced-motion: reduce){
  .carousel-empty__glow,
  .carousel-empty__cam{
    animation: none !important;
  }
}
.carousel-nav{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.16);
  background: rgba(15, 13, 12, 0.55);
  color: var(--txt-primary);
  display:grid;
  place-items:center;
  cursor:pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s, background .15s;
  backdrop-filter: blur(8px);
}
.carousel-nav:hover{
  transform: translateY(-50%) scale(1.02);
  border-color: rgba(233, 76, 61, 0.35);
  box-shadow: 0 14px 34px -18px rgba(233, 76, 61, 0.55);
  background: rgba(15, 13, 12, 0.70);
}
.carousel-nav.prev{ left: 12px; }
.carousel-nav.next{ right: 12px; }

.thumb-strip{
  display: flex;
  gap: 8px;
  padding: 10px 10px 12px;
  border-top: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.1);
  background:
    linear-gradient(180deg, rgba(18, 16, 15, 0.45) 0%, rgba(12, 11, 10, 0.72) 100%);
  overflow-x: auto;
  flex-wrap: nowrap;
  align-items: stretch;
  scrollbar-color: rgba(233, 76, 61, 0.35) transparent;
}
.thumb-strip::-webkit-scrollbar{ height: 6px; }
.thumb-strip::-webkit-scrollbar-thumb{
  background: rgba(233, 76, 61, 0.35);
  border-radius: 999px;
}
.thumb{
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.14);
  background: rgba(10, 9, 8, 0.55);
  width: 82px;
  height: 60px;
  border-radius: 12px;
  padding: 3px;
  overflow: hidden;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 4px 14px -6px rgba(var(--shadow-rgb), 0.45);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 9px;
}
.thumb--placeholder{
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.thumb-chip{
  width: 100%;
  height: 100%;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background:
    linear-gradient(145deg, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.07) 0%, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02) 100%);
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.1);
}
.thumb-chip__icon{
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}
.thumb-chip__icon--pdf{
  background: color-mix(in srgb, var(--red) 18%, transparent);
  color: var(--status-thumb-pdf-fg);
  border: 1px solid color-mix(in srgb, var(--red) 38%, transparent);
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.04em;
}
.thumb-chip__icon--video{
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--status-thumb-video-fg);
  border: 1px solid color-mix(in srgb, var(--warn) 38%, transparent);
  font-size: 12px;
  padding-left: 2px;
}
.thumb-chip__lbl{
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.48);
}
.thumb:hover{
  transform: translateY(-2px);
  border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.24);
  box-shadow: 0 8px 22px -8px rgba(var(--shadow-rgb), 0.5);
}
.thumb.active{
  border-color: rgba(233, 76, 61, 0.65);
  box-shadow:
    0 0 0 1px rgba(233, 76, 61, 0.25),
    0 12px 28px -12px rgba(233, 76, 61, 0.55);
  background: rgba(233, 76, 61, 0.08);
}
.thumb.active .thumb-chip{
  border-color: rgba(233, 76, 61, 0.35);
  background: linear-gradient(145deg, rgba(233, 76, 61, 0.12) 0%, rgba(233, 76, 61, 0.04) 100%);
}

.product-description{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02);
  flex: 1 1 auto;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}
.product-description__grid{
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);
  gap:12px;
  align-items:stretch;
}
.product-description__copy{min-width:0;}
.product-price-card{
  border:1px solid rgba(255,230,215,.10);
  border-radius:12px;
  background:rgba(255,230,215,.03);
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.product-price-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.product-price-item{
  border:1px solid rgba(255,230,215,.10);
  border-radius:10px;
  background:rgba(255,230,215,.02);
  padding:8px 10px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.product-price-item__label{
  font-size:9px;
  letter-spacing:.11em;
  text-transform:uppercase;
  color:var(--txt-muted);
}
.product-price-item__value{
  font-size:18px;
  line-height:1.1;
  color:var(--txt-primary);
}
.desc-text{ margin-top: 6px; color: var(--txt-primary); font-size: 14px; }
.desc-hint{ margin-top: 10px; color: var(--txt-muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
@media (max-width:900px){
  .product-description__grid{grid-template-columns:1fr;}
}

.product-meta{ display:flex; flex-direction:column; gap: 12px; }
.info-card{
  border: 1px solid var(--line);
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02);
  border-radius: 14px;
  padding: 12px 14px;
}
.info-list{
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.info-item{
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.10);
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02);
  border-radius: 10px;
  padding: 8px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.info-item .k{
  color: var(--txt-muted);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: 'IBM Plex Mono', monospace;
}
.info-item .v{
  color: var(--txt-primary);
  text-align:right;
}
.info-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.06);
}
.info-row:last-child{ border-bottom:none; }
.info-row .k{ color: var(--txt-muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-family: 'IBM Plex Mono', monospace; }
.info-row .v{ color: var(--txt-primary); text-align:right; }

.chips{ display:flex; flex-wrap:wrap; gap: 10px; }
.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.12);
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.03);
  color: var(--txt-primary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: .10em;
  text-transform: uppercase;
  transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
}
.chip .dot{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.25);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.25);
}
.chip.is-empty{ opacity: .55; }
.chip-btn{ cursor:pointer; }
.chip-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(233, 76, 61, 0.28);
  box-shadow: 0 14px 34px -20px rgba(233, 76, 61, 0.40);
}
.chip-btn .x{
  margin-left: 4px;
  opacity: .7;
  font-size: 12px;
  line-height: 1;
}

.read-grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.read-field{ grid-column: span 6; }
@media (max-width: 760px){ .read-field{ grid-column: span 12; } }
.read-value{
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.10);
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--txt-primary);
}

.mini-list{
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.mini-item{
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.10);
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--txt-primary);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.advanced-info{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02);
  overflow: hidden;
}
.advanced-info > summary{
  list-style: none;
  cursor: pointer;
  padding: 14px 18px 14px 15px;
  border-left: 3px solid rgba(233, 76, 61, 0.5);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--txt-secondary);
  border-bottom: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.advanced-info > summary::-webkit-details-marker{ display:none; }
.advanced-info > summary::after{
  content: '+';
  float: right;
  opacity: .75;
}
.advanced-info[open] > summary{
  color: var(--txt-primary);
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.03);
  border-bottom-color: var(--line);
}
.advanced-info[open] > summary::after{ content: '−'; }
.advanced-info__content{
  padding: 16px 16px 8px;
  background: linear-gradient(180deg, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.028) 0%, transparent 140px);
}
.advanced-info__content > .panel{
  margin-bottom: 14px;
  border-radius: 14px;
  border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.1);
  overflow: hidden;
}
.advanced-info__content > .panel:last-child{
  margin-bottom: 4px;
}
.advanced-info__content .panel-head{
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.04) 0%, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.01) 100%);
}
.advanced-info__content .panel-title h3{
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

/* —— Informações avançadas: dados mestres / curadoria —— */
.adv-master-body{
  padding: 18px 20px 22px;
}
.adv-kpi-strip{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.adv-kpi-card{
  flex: 1 1 160px;
  min-width: 140px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.12);
  background: linear-gradient(158deg, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.06) 0%, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.015) 100%);
  box-shadow: 0 10px 28px -20px rgba(var(--shadow-rgb), 0.55);
}
.adv-kpi-card--grow{
  flex: 2 1 220px;
}
.adv-kpi-card__eyebrow{
  display: block;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-bottom: 6px;
}
.adv-kpi-card__label{
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--txt-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.adv-kpi-card__val{
  font-size: 15px;
  font-weight: 600;
  color: var(--txt-primary);
  word-break: break-word;
}
.adv-kpi-card__val--hash{
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--txt-secondary);
  word-break: break-all;
}
.adv-erp-strip{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid rgba(233, 76, 61, 0.28);
  background: linear-gradient(115deg, rgba(233, 76, 61, 0.12) 0%, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.05) 42%, rgba(200, 154, 63, 0.08) 100%);
  box-shadow: inset 0 1px 0 rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.06), 0 12px 32px -24px rgba(233, 76, 61, 0.35);
}
.adv-erp-strip__tag{
  display: block;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.52);
  margin-bottom: 4px;
}
.adv-erp-strip__title{
  display: block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 650;
  color: var(--txt-primary);
}
.adv-erp-strip__sub{
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--txt-secondary);
  max-width: 36rem;
}
.adv-erp-strip__form{ flex-shrink: 0; }
.adv-erp-strip__btn{ min-width: 168px; }

.adv-sector-label{
  display: block;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.42);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.09);
}

.adv-kv-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px 14px;
}
.adv-kv{
  grid-column: span 12;
}
@media (min-width: 920px){
  .adv-kv--half{ grid-column: span 6; }
  .adv-kv--third{ grid-column: span 4; }
  .adv-kv--full{ grid-column: span 12; }
}
.adv-kv__label{
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-muted);
}
.adv-kv__box{
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.11);
  background: rgba(8, 7, 6, 0.42);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--txt-primary);
  min-height: 2.75rem;
}

.adv-curation-body{
  padding: 18px 20px 22px;
}
.adv-read-grid{
  gap: 14px;
}
.adv-read-field .read-value{
  margin-top: 0;
  border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.12);
  background: rgba(8, 7, 6, 0.38);
  padding: 12px 14px;
}
.adv-read-field--full{
  grid-column: 1 / -1;
}

.adv-tags-body,
.adv-attachments-body,
.adv-snapshot-body{
  padding: 16px 20px 20px;
}
.adv-panel-intro{
  margin: 0 0 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.44);
}
.adv-chips-well{
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.1);
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.025);
}

.adv-empty-well{
  text-align: center;
  padding: 24px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.16);
  color: var(--txt-muted);
  font-size: 13px;
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02);
}

.adv-table-scroll{
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.09);
  background: rgba(var(--shadow-rgb), 0.12);
}
.adv-table-scroll .data-table{
  margin: 0;
  min-width: 640px;
}

.product-cell { display: flex; align-items: center; gap: 14px; }
.product-thumb { width: 36px; height: 36px; border-radius: 6px; background: var(--bg-elevated); display: grid; place-items: center; border: 1px solid var(--line); font-family: 'Bricolage Grotesque', sans-serif; font-size: 12px; font-weight: 600; color: var(--txt-secondary); }
.product-info-cell .name { font-weight: 500; color: var(--txt-primary); margin-bottom: 3px; font-size: 13.5px; }
.product-info-cell .sku { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--txt-muted); letter-spacing: 0.05em; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid;
}
.status-pill.success,
.status-pill--ok {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
  border-color: color-mix(in srgb, var(--ok) 28%, transparent);
}
.status-pill.warn,
.status-pill--warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border-color: color-mix(in srgb, var(--warn) 28%, transparent);
}
.status-pill.error,
.status-pill--danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 30%, transparent);
}
.status-pill--muted {
  background: var(--bg-hover);
  color: var(--txt-muted);
  border-color: var(--line-strong);
}
.status-pill.tag-empty {
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.04);
  color: var(--txt-muted);
  border-color: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.12);
}
.status-pill::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--txt-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover {
  background: var(--bg-surface);
  border-color: var(--line);
  color: var(--txt-primary);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -14px rgba(var(--shadow-rgb), 0.5);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt-muted);
}
.pagination a {
  color: var(--txt-secondary);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.pagination a:hover {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
  color: var(--txt-primary);
  transform: translateY(-1px);
}

.filters { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; align-items: end; }
.filters .filters__label { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--txt-muted); margin-bottom: 8px; }

@media (max-width: 1100px) {
  #login-screen { grid-template-columns: 1fr; }
  .login-left { display: none; }
  #dashboard-screen.active { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .page-title { font-size: 40px; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

::selection { background: var(--red); color: var(--on-primary); }

/* Qualidade → lista de produtos */
.quality-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 8px 0 14px;
}
.quality-section-title:first-child {
  margin-top: 0;
}

.quality-scope-menu {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--txt-muted);
  position: relative;
}
.quality-scope-menu summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.quality-scope-menu summary::-webkit-details-marker { display: none; }
.quality-scope-menu summary::after {
  content: ' ▸';
  opacity: 0.55;
  font-size: 10px;
}
.quality-scope-menu[open] summary::after {
  content: ' ▾';
}
.quality-scope-menu__body {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(var(--shadow-rgb), 0.35);
  z-index: 20;
}
.quality-scope-menu__body a {
  display: block;
  color: var(--txt-secondary);
  text-decoration: none;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.quality-scope-menu__body a:first-of-type { margin-top: 0; }
.quality-scope-menu__body a:hover { color: var(--red); }
.quality-scope-menu__hint {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--txt-muted);
  line-height: 1.45;
}

label.quality-scope-inline {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--txt-muted);
}
label.quality-scope-inline input {
  margin-top: 2px;
  accent-color: var(--red);
}
.quality-scope-inline-hint {
  margin: 6px 0 0 24px;
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--txt-muted);
  opacity: 0.85;
}

a.quality-indicator-card {
  display: block;
  grid-column: span 3;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
a.quality-indicator-card:hover {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -22px rgba(var(--shadow-rgb), 0.55);
}
a.quality-indicator-card:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  a.quality-indicator-card { grid-column: span 6; }
}
@media (max-width: 600px) {
  a.quality-indicator-card { grid-column: span 12; }
}

/* Qualidade — distribuição de status (faixa + cartões) */
.quality-status-dist {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.quality-status-dist__meta {
  margin: 0;
  font-size: 11px;
  color: var(--txt-muted);
  letter-spacing: 0.08em;
}
.quality-status-dist__bar {
  display: flex;
  width: 100%;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.2s ease;
}
.quality-status-dist__bar:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 28px -16px rgba(var(--shadow-rgb), 0.45);
}
.quality-status-dist__seg {
  min-width: max(4px, 0.4%);
  transition: filter 0.22s ease, transform 0.22s ease;
}
.quality-status-dist__bar:hover .quality-status-dist__seg {
  filter: brightness(1.1) saturate(1.06);
}
.quality-status-dist__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.quality-status-dist__card {
  position: relative;
  padding: 16px 18px 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.05), rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.015));
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.quality-status-dist__card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--status-accent, var(--ok));
  border-radius: 2px 0 0 2px;
}
.quality-status-dist__card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px -22px rgba(var(--shadow-rgb), 0.55);
}
.quality-status-dist__card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.quality-status-dist__card-label {
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--txt-primary);
  line-height: 1.25;
}
.quality-status-dist__card-code {
  flex-shrink: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-muted);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-surface);
}
.quality-status-dist__card-stat {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--txt-primary);
}
.quality-status-dist__card-pct {
  margin-top: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--txt-secondary);
}

/* Painel sync ao vivo (/sync) */
.sync-live-panel {
  margin: 16px 0 24px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(165deg, rgba(233, 76, 61, 0.06), rgba(var(--warm-r), var(--warm-g), var(--warm-b), 0.02));
  box-shadow: 0 16px 48px rgba(var(--shadow-rgb), 0.28);
}
.sync-live-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.sync-live-panel__title {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 15px;
}
.sync-live-panel__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--txt-secondary);
}
.sync-eta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  padding: 5px 11px 6px;
  border-radius: 12px;
  border: 1px solid var(--status-sync-chip-border);
  background: var(--status-sync-chip-bg);
  color: var(--status-sync-fg);
  vertical-align: middle;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.sync-eta-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-sync-fg);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-sync-fg) 45%, transparent);
  flex-shrink: 0;
}
.sync-eta-chip__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.15;
}
.sync-eta-chip__line1 {
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--status-sync-sub-fg);
}
.sync-eta-chip__line1 strong {
  color: var(--status-sync-strong-fg);
}
.sync-eta-chip__line2 {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--status-sync-detail-fg);
  opacity: 0.95;
}
.sync-eta-chip--on {
  animation: syncEtaGlow 1.4s ease-in-out infinite;
}
.sync-eta-chip--on .sync-eta-chip__dot {
  animation: syncEtaDotPulse 1.2s ease-in-out infinite;
}
.sync-live-panel__stats {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--txt-muted);
  line-height: 1.45;
  margin-bottom: 14px;
}
.sync-live-panel__log-wrap {
  margin-bottom: 14px;
}
.sync-live-panel__log-title {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-bottom: 8px;
}
.sync-live-panel__log {
  display: block;
  max-height: 340px;
  overflow: auto;
  padding: 12px 14px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-deep);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--txt-secondary);
}
.sync-live-panel__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
.sync-live-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--txt-muted);
  flex-shrink: 0;
  margin-top: 4px;
}
.sync-live-pulse--on {
  background: var(--warn);
  box-shadow: 0 0 0 0 rgba(200, 154, 63, 0.45);
  animation: syncPulse 1.4s ease-out infinite;
}
@keyframes syncPulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 154, 63, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(200, 154, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 154, 63, 0); }
}
@keyframes syncEtaGlow {
  0% {
    transform: translateY(0);
    box-shadow:
      0 0 0 0 rgba(255, 200, 92, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  60% {
    transform: translateY(-1px);
    box-shadow:
      0 0 0 8px rgba(255, 200, 92, 0),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
  100% {
    transform: translateY(0);
    box-shadow:
      0 0 0 0 rgba(255, 200, 92, 0),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}
@keyframes syncEtaDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 212, 125, 0.45); opacity: 0.9; }
  70% { box-shadow: 0 0 0 7px rgba(255, 212, 125, 0); opacity: 1; }
  100% { box-shadow: 0 0 0 0 rgba(255, 212, 125, 0); opacity: 0.9; }
}

/* Painel unificado premium */
.ud-dashboard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.ud-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 28px;
  padding: 22px 24px;
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(91, 140, 255, 0.18), transparent 55%),
    radial-gradient(90% 120% at 100% 0%, rgba(255, 143, 90, 0.12), transparent 50%),
    var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(var(--shadow-rgb), 0.28);
}

.ud-hero__main { flex: 1; min-width: 240px; }

.ud-hero__date {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--txt-muted);
  margin-bottom: 8px;
}

.ud-hero__title {
  margin: 0 0 6px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.1;
}

.ud-hero__tagline {
  margin: 0 0 12px;
  max-width: 52ch;
  color: var(--txt-secondary);
  font-size: 14px;
  line-height: 1.5;
}

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

.ud-hero__rule {
  font-size: 11px;
  color: var(--txt-muted);
}

.ud-status-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.ud-status-badge--ok {
  color: var(--status-ok-fg);
  background: color-mix(in srgb, var(--status-ok-fg) 14%, transparent);
  border-color: color-mix(in srgb, var(--status-ok-fg) 38%, transparent);
}

.ud-status-badge--warn {
  color: var(--status-warn-fg);
  background: color-mix(in srgb, var(--status-warn-fg) 16%, transparent);
  border-color: color-mix(in srgb, var(--status-warn-fg) 42%, transparent);
}

.ud-status-badge--danger {
  color: var(--status-danger-fg);
  background: color-mix(in srgb, var(--status-danger-fg) 14%, transparent);
  border-color: color-mix(in srgb, var(--status-danger-fg) 38%, transparent);
}

.ud-hero__period {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  min-width: 220px;
}

.ud-period-label {
  width: 100%;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--txt-muted);
  font-family: var(--mono-font);
}

.ud-period-control {
  position: relative;
  min-width: 200px;
}

.ud-period-select {
  width: 100%;
  appearance: none;
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 12px;
  background: rgba(var(--shadow-rgb), 0.15);
  color: var(--txt-primary);
  min-height: 42px;
  padding: 10px 36px 10px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ud-period-select:hover,
.ud-period-select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.2);
}

.ud-period-chevron {
  position: absolute;
  right: 12px;
  bottom: 12px;
  pointer-events: none;
  color: var(--txt-muted);
  font-size: 12px;
}

.ud-period-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ud-period-custom input[type="date"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--txt-primary);
  min-height: 38px;
  padding: 6px 10px;
  font-family: var(--mono-font);
  font-size: 12px;
}

.ud-period-sep { color: var(--txt-muted); font-size: 12px; }

.ud-period-apply { min-height: 42px; padding-inline: 18px; }

.ud-error {
  margin: 0;
  padding: 12px 14px;
  color: var(--status-error-fg);
  font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--status-error-fg) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--status-error-fg) 8%, transparent);
}

.ud-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ud-kpi-card {
  padding: 16px 18px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background:
    linear-gradient(145deg, rgba(91, 140, 255, 0.1), transparent 55%),
    var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(var(--shadow-rgb), 0.2);
}

.ud-kpi-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--txt-muted);
  font-family: var(--mono-font);
}

.ud-kpi-card__value {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.15;
  color: var(--txt-primary);
}

.ud-kpi-card small {
  color: var(--txt-muted);
  font-size: 12px;
}

.ud-chart-wrap { margin: 0; }

.ud-chart-canvas-host {
  position: relative;
  height: 210px;
  width: 100%;
}

.ud-chart-canvas-host .ud-sales-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ud-chart-tooltip {
  position: absolute;
  z-index: 5;
  transform: translateX(-50%);
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  box-shadow: 0 10px 24px rgba(var(--shadow-rgb), 0.35);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.ud-chart-tooltip strong {
  display: block;
  color: var(--txt-primary);
  margin-bottom: 2px;
}

.ud-chart-tooltip span {
  color: var(--accent);
  font-family: var(--mono-font);
}

.ud-chart-bar {
  transition: opacity 0.15s ease;
}

.ud-hero__refresh {
  font-size: 11px;
  color: var(--text-muted, var(--txt-muted));
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed var(--line);
}

.ud-two-col {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start;
}

.ud-two-col__left,
.ud-two-col__right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ud-ranking-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ud-ranking-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ud-ranking-item__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(91, 140, 255, 0.18);
  color: var(--accent);
  border: 1px solid rgba(91, 140, 255, 0.28);
}

.ud-ranking-item__body { flex: 1; min-width: 0; }

.ud-ranking-item__row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ud-ranking-item__row--with-trailing {
  grid-template-columns: auto 1fr auto;
}

.ud-ranking-item__trailing {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.ud-ranking-item__rank {
  font-size: 11px;
  color: var(--txt-muted);
  width: 1.2rem;
}

.ud-ranking-item__name {
  font-size: 13px;
  color: var(--txt-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ud-ranking-item__value {
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}

.ud-ranking-item__bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(var(--shadow-rgb), 0.25);
  overflow: hidden;
}

.ud-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.5), var(--accent));
  transition: width 0.6s ease;
}

.ud-bar-fill--alt {
  background: linear-gradient(90deg, rgba(255, 143, 90, 0.45), #ff9f6a);
}

.ud-trend {
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
  text-align: right;
}

.ud-trend--up { color: var(--status-up-fg); }
.ud-trend--down { color: var(--status-down-fg); }

.ud-alerts-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ud-alerts-panel__title {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--txt-muted);
  font-family: var(--mono-font);
}

.ud-alert-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ud-alert-card:hover {
  transform: translateX(3px);
}

.ud-alert-card__label {
  font-size: 13px;
  color: var(--txt-primary);
}

.ud-alert-card__value {
  font-size: 20px;
  color: inherit;
}

.ud-alert-card--warn {
  background: color-mix(in srgb, var(--status-warn-fg) 12%, transparent);
  border-color: color-mix(in srgb, var(--status-warn-fg) 30%, transparent);
  color: var(--status-warn-fg);
}

.ud-alert-card--info {
  background: color-mix(in srgb, var(--status-info-fg) 12%, transparent);
  border-color: color-mix(in srgb, var(--status-info-fg) 30%, transparent);
  color: var(--status-info-fg);
}

.ud-alert-card--danger {
  background: color-mix(in srgb, var(--status-danger-fg) 12%, transparent);
  border-color: color-mix(in srgb, var(--status-danger-fg) 30%, transparent);
  color: var(--status-danger-fg);
}

.ud-sync-live .panel-body { padding-top: 4px; }

.ud-sync-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ud-sync-metrics div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg-elevated);
}

.ud-sync-metrics span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--txt-muted);
  margin-bottom: 4px;
}

.ud-sync-metrics strong { font-size: 15px; }

.ud-sync-pulse[data-running="1"] {
  color: var(--status-ok-fg);
  animation: udSyncPulse 1.8s ease-in-out infinite;
}

@keyframes udSyncPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.ud-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ud-timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.ud-timeline-item:last-child { border-bottom: 0; }

.ud-timeline-item:hover {
  background: rgba(91, 140, 255, 0.06);
  border-radius: 8px;
  padding-inline: 6px;
  margin-inline: -6px;
}

.ud-timeline-item__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.2);
  margin-top: 2px;
  align-self: start;
}

.ud-timeline-item__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ud-timeline-item__title {
  font-size: 13px;
  color: var(--txt-primary);
}

.ud-timeline-item__sub {
  font-size: 11px;
  color: var(--txt-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ud-timeline-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  color: var(--txt-muted);
}

.ud-timeline-item__meta strong {
  color: var(--accent);
  font-size: 12px;
}

.ud-footer {
  padding: 18px 20px;
  border-radius: 14px;
}

.ud-footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.ud-footer__label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--txt-muted);
  font-family: var(--mono-font);
  margin-bottom: 6px;
}

.ud-footer__block strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.ud-footer__block small {
  color: var(--txt-muted);
  font-size: 12px;
  line-height: 1.4;
}

.ud-footer__block small a {
  color: var(--accent);
  text-decoration: none;
}

.ud-footer__block small a:hover { text-decoration: underline; }

.ud-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ud-footer__links a {
  font-size: 12px;
  color: var(--txt-secondary);
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ud-footer__links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.ud-empty {
  margin: 0;
  color: var(--txt-muted);
  font-size: 13px;
}

@media (max-width: 1200px) {
  .ud-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ud-two-col { grid-template-columns: 1fr; }
  .ud-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .ud-hero { padding: 16px; }
  .ud-hero__period { width: 100%; }
  .ud-period-control { min-width: 0; flex: 1; }
  .ud-kpi-strip { grid-template-columns: 1fr; }
  .ud-ranking-item__row { grid-template-columns: auto 1fr auto; }
  .ud-trend { display: none; }
  .ud-footer__grid { grid-template-columns: 1fr; }
  .ud-chart-canvas-host { height: 200px; }
}

/* Busca global (Cmd/Ctrl+K) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.search-modal.open {
  display: flex;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.search-dialog {
  position: relative;
  width: min(600px, 90vw);
  background: var(--bg-surface, var(--bg-base));
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(var(--shadow-rgb, 0, 0, 0), 0.45);
}

.search-dialog__input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--txt-primary);
  outline: none;
}

.search-dialog__input::placeholder {
  color: var(--text-muted, var(--txt-muted));
}

.search-dialog__hint {
  position: absolute;
  top: 18px;
  right: 16px;
  font-size: 10px;
  color: var(--text-muted, var(--txt-muted));
  pointer-events: none;
}

.search-results {
  max-height: 400px;
  overflow-y: auto;
}

.search-results__empty,
.search-results__loading {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text-muted, var(--txt-muted));
}

.search-results__group {
  padding: 8px 0 4px;
}

.search-results__group-title {
  padding: 6px 20px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted, var(--txt-muted));
  font-family: var(--mono-font);
}

.search-result-item {
  padding: 10px 20px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border: none;
  width: 100%;
  text-align: left;
  background: transparent;
}

.search-result-item:hover,
.search-result-item.is-active {
  background: var(--bg-hover);
}

.search-result-type {
  font-size: 10px;
  font-family: var(--mono-font);
  color: var(--text-muted, var(--txt-muted));
  min-width: 60px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.search-result-body {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: 14px;
  color: var(--txt-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-sub {
  font-size: 11px;
  color: var(--text-muted, var(--txt-muted));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============= TEMA CLARO / ESCURO ============= */
html {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-surface);
  color: var(--txt-secondary);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--bg-elevated);
  color: var(--txt-primary);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--neutral-bg);
  border-color: var(--line-strong);
}

.theme-toggle__track {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--neutral-bg);
  border: 1px solid var(--line);
  position: relative;
}

.theme-toggle__icon {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-toggle__icon--sun {
  opacity: 0;
  transform: scale(0.7) rotate(-20deg);
}

.theme-toggle__icon--moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .theme-toggle__icon--sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

html[data-theme="light"] .theme-toggle__icon--moon {
  opacity: 0;
  transform: scale(0.7) rotate(20deg);
}

.login-theme-wrap {
  position: absolute;
  top: 32px;
  left: 56px;
  z-index: 5;
}

html[data-theme="light"] body::before {
  opacity: 0.72;
}

html[data-theme="light"] body::after {
  opacity: 1;
}

/* —— Superfícies globais (modo claro) —— */
html[data-theme="light"] .main {
  background: var(--bg-base);
}

html[data-theme="light"] .content {
  position: relative;
  background:
    radial-gradient(ellipse 80% 45% at 90% 0%, rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.04), transparent 55%),
    linear-gradient(180deg, #f6f7f9 0%, #f1f3f6 100%);
  border-radius: 18px 0 0 0;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

/* Quadriculado tom-sobre-tom no conteúdo light */
html[data-theme="light"] .content::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background-image:
    linear-gradient(rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(17, 24, 39, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.06) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 140px 140px, 140px 140px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.18) 35%, transparent 70%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.18) 35%, transparent 70%);
  z-index: 0;
}

html[data-theme="light"] .page-header {
  border-bottom-color: var(--line-strong);
}

html[data-theme="light"] .page-subtitle code {
  background: var(--bg-input);
  border-color: var(--line-strong);
}

/* Logo pensado para fundo escuro — faixa de marca no modo claro */
html[data-theme="light"] .sidebar-brand {
  background: var(--bg-brand);
  border-radius: 12px;
  padding: 14px 12px 18px;
  margin: 0 0 20px;
  border-bottom: none;
  box-shadow:
    0 1px 0 rgba(var(--shadow-rgb), 0.06),
    0 12px 28px -16px rgba(var(--shadow-rgb), 0.2);
}

html[data-theme="light"] .sidebar-brand-tag {
  color: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] .brand-block {
  background: var(--bg-brand);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 12px 32px -18px rgba(var(--shadow-rgb), 0.25);
}

html[data-theme="light"] .brand-tag {
  color: rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .brand-tag .dot {
  background: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

html[data-theme="light"] .brand-divider {
  background: rgba(255, 255, 255, 0.14);
}

html[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(17, 24, 39, 0.10);
  box-shadow: 4px 0 16px -8px rgba(17, 24, 39, 0.08);
}

html[data-theme="light"] .topbar {
  background: rgba(246, 247, 249, 0.92);
  border-bottom: 1px solid rgba(17, 24, 39, 0.10);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 16px -8px rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html[data-theme="light"] .nav-item {
  color: var(--txt-secondary);
}

html[data-theme="light"] .nav-item:hover {
  background: rgba(17, 24, 39, 0.05);
  color: var(--txt-primary);
}

html[data-theme="light"] .nav-item.active {
  background: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.08);
  color: var(--txt-primary);
  box-shadow: inset 0 0 0 1px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.18);
}

html[data-theme="light"] .nav-item.active::before {
  background: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

html[data-theme="light"] .user-mini .avatar {
  background: var(--bg-hover);
  border: 1px solid var(--line-strong);
}

html[data-theme="light"] .panel {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 3px rgba(17, 24, 39, 0.06),
    0 8px 24px -12px rgba(17, 24, 39, 0.10);
}

html[data-theme="light"] .panel-head {
  background: #f9fafb;
  border-bottom-color: rgba(17, 24, 39, 0.08);
}

html[data-theme="light"] .panel-tag {
  background: var(--bg-input);
  border-color: var(--line-strong);
  color: var(--txt-secondary);
}

html[data-theme="light"] .table-wrap,
html[data-theme="light"] .data-table-wrap {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 3px rgba(17, 24, 39, 0.06),
    0 8px 24px -12px rgba(17, 24, 39, 0.10);
}

html[data-theme="light"] .table th,
html[data-theme="light"] .data-table th {
  background: #f9fafb;
  color: var(--txt-secondary);
  border-bottom-color: rgba(17, 24, 39, 0.08);
}

html[data-theme="light"] .table tbody tr:nth-child(even) td,
html[data-theme="light"] .data-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

html[data-theme="light"] .table tr:hover td,
html[data-theme="light"] .data-table tr:hover td {
  background: #f3f4f6;
}

html[data-theme="light"] .form__input,
html[data-theme="light"] .topbar-search input,
html[data-theme="light"] .login-card input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.15);
  box-shadow: inset 0 1px 2px rgba(17, 24, 39, 0.04);
}

html[data-theme="light"] .form__input:hover:not(:focus),
html[data-theme="light"] .topbar-search input:hover:not(:focus),
html[data-theme="light"] .login-card input:hover:not(:focus),
html[data-theme="light"] select:hover:not(:focus),
html[data-theme="light"] textarea:hover:not(:focus) {
  border-color: rgba(17, 24, 39, 0.25);
}

html[data-theme="light"] .form__input:focus,
html[data-theme="light"] .topbar-search input:focus {
  background: #ffffff;
  border-color: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.55);
  box-shadow: 0 0 0 3px var(--red-soft);
}

html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .btn--ghost {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.14);
  color: var(--txt-primary);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06), inset 0 1px 0 rgba(255,255,255,0.9);
}

html[data-theme="light"] .btn-secondary:hover,
html[data-theme="light"] .btn--ghost:hover {
  background: #f9fafb;
  border-color: rgba(17, 24, 39, 0.22);
  color: var(--txt-primary);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.10), inset 0 1px 0 rgba(255,255,255,0.9);
}

html[data-theme="light"] .btn-secondary:focus-visible,
html[data-theme="light"] .btn--ghost:focus-visible,
html[data-theme="light"] .btn-primary:focus-visible {
  outline: 2px solid rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.55);
  outline-offset: 2px;
}

html[data-theme="light"] .btn-small.btn-secondary,
html[data-theme="light"] .btn-small.btn--ghost {
  border-color: rgba(17, 24, 39, 0.14);
}

html[data-theme="light"] .live-indicator,
html[data-theme="light"] .theme-toggle,
html[data-theme="light"] .run-status {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.12);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

html[data-theme="light"] .topbar-search kbd {
  background: #f3f4f6;
  border-color: rgba(17, 24, 39, 0.12);
}

html[data-theme="light"] .alert {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.09);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.05);
}

html[data-theme="light"] .auth-card,
html[data-theme="light"] .login-card {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.09);
  box-shadow: 0 4px 16px -8px rgba(17, 24, 39, 0.12), 0 20px 40px -20px rgba(17, 24, 39, 0.10);
}

html[data-theme="light"] .adv-kpi-card {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.09);
}

html[data-theme="light"] .adv-erp-strip {
  background: linear-gradient(
    115deg,
    rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.07) 0%,
    #f9fafb 42%,
    rgba(245, 158, 11, 0.06) 100%
  );
  border-color: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.22);
}

html[data-theme="light"] .ud-kpi-card,
html[data-theme="light"] .attachment-card,
html[data-theme="light"] .product-thumb {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.09);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.06);
}

html[data-theme="light"] .sync-confirm__form {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.09);
}

html[data-theme="light"] .status-pill.neutral,
html[data-theme="light"] .status-pill,
html[data-theme="light"] .status-pill.tag-empty {
  border-color: var(--line-strong);
}

html[data-theme="light"] .status-pill.tag-empty {
  color: var(--txt-muted);
  background: color-mix(in srgb, var(--txt-muted) 8%, transparent);
}

html[data-theme="light"] .attachment-badge {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border-color: color-mix(in srgb, var(--ok) 32%, transparent);
}

html[data-theme="light"] .alert--ok {
  background: color-mix(in srgb, var(--ok) 10%, transparent);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
}

html[data-theme="light"] .alert--error {
  border-color: color-mix(in srgb, var(--red) 32%, transparent);
}

html[data-theme="light"] .ud-alert-card--warn .ud-alert-card__label,
html[data-theme="light"] .ud-alert-card--danger .ud-alert-card__label,
html[data-theme="light"] .ud-alert-card--info .ud-alert-card__label {
  color: var(--txt-primary);
}

html[data-theme="light"] .sync-eta-chip {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

html[data-theme="light"] .vendedores-list-total-pill--ok,
html[data-theme="light"] .clientes-purchase-pill--ok,
html[data-theme="light"] .cd-pill--on,
html[data-theme="light"] .cat-pill--com {
  border-color: color-mix(in srgb, var(--ok) 34%, transparent);
}

html[data-theme="light"] ::-webkit-scrollbar-track {
  background: #f3f4f6;
}

html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border: 2px solid #f3f4f6;
}

html[data-theme="light"] .login-left {
  background:
    linear-gradient(165deg, #f9fafb 0%, #edf2f7 100%);
}

/* Suaviza a grid no painel esquerdo no modo claro para evitar ruído visual excessivo */
html[data-theme="light"] .login-left::before {
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 55%, transparent 95%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 55%, transparent 95%);
}

html[data-theme="light"] .login-left::after {
  opacity: 0.4;
}

html[data-theme="light"] .login-right {
  background: linear-gradient(180deg, #f9fafb 0%, #eef2ff 100%);
}

html[data-theme="light"] .auth-label {
  color: rgba(17, 24, 39, 0.42);
}

html[data-theme="light"] .carousel-slide-doc__card {
  background: #ffffff;
}

html[data-theme="light"] .carousel-slide--pdf {
  background:
    radial-gradient(ellipse 72% 62% at 50% 108%, rgba(224, 54, 43, 0.06), transparent 52%),
    radial-gradient(ellipse 90% 56% at 12% 18%, rgba(245, 158, 11, 0.04), transparent 45%),
    linear-gradient(168deg, #fafbfc 0%, #f3f4f6 36%, #eef0f3 100%);
}

html[data-theme="light"] .tag-delete-btn,
html[data-theme="light"] #tag-delete-btn {
  color: var(--red) !important;
  border-color: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.35) !important;
}

/* Botões adicionais — overrides light */
html[data-theme="light"] .btn-tech {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.14);
  color: var(--txt-secondary);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}
html[data-theme="light"] .btn-tech:hover {
  background: #f9fafb;
  border-color: rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.35);
  color: var(--txt-primary);
  box-shadow: 0 4px 12px -6px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.20);
}

html[data-theme="light"] .actionbar__btn {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.14);
  color: var(--txt-secondary);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}
html[data-theme="light"] .actionbar__btn:hover {
  background: #f9fafb;
  border-color: rgba(17, 24, 39, 0.22);
  color: var(--txt-primary);
  box-shadow: 0 4px 12px -6px rgba(17, 24, 39, 0.12);
}
html[data-theme="light"] .actionbar__btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(var(--brand-r), var(--brand-g), var(--brand-b), 0.30);
}
html[data-theme="light"] .actionbar__btn--primary:hover {
  box-shadow: 0 8px 20px -8px var(--red-glow);
}

/* Páginas comerciais — estilos embutidos compatíveis com tema */
.commercial-theme-scope .preco-action-btn,
.commercial-theme-scope .pedidos-action-btn,
.commercial-theme-scope [class*="btn"][class*="action"] {
  border-color: var(--line);
  background: var(--neutral-bg);
}

html[data-theme="light"] .commercial-theme-scope .preco-action-btn,
html[data-theme="light"] .commercial-theme-scope .pedidos-action-btn,
html[data-theme="light"] .commercial-theme-scope [class*="btn"][class*="action"] {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.14);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

html[data-theme="light"] .commercial-theme-scope .preco-table tbody tr:hover,
html[data-theme="light"] .commercial-theme-scope .pedidos-table tbody tr:hover,
html[data-theme="light"] .commercial-theme-scope .clientes-table tbody tr:hover {
  background: rgba(17, 24, 39, 0.03);
}

/* Ranking bars & avatar — light mode */
html[data-theme="light"] .ud-ranking-item__bar {
  background: rgba(17, 24, 39, 0.08);
}

html[data-theme="light"] .ud-bar-fill {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.50), rgba(99, 102, 241, 0.80));
}

html[data-theme="light"] .ud-bar-fill--alt {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.50), rgba(249, 115, 22, 0.80));
}

html[data-theme="light"] .ud-ranking-item__avatar {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.18);
}

html[data-theme="light"] .ud-ranking-item__value {
  color: #4f46e5;
}

/* Chart tooltip — light mode */
html[data-theme="light"] .ud-chart-tooltip {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.10);
  box-shadow: 0 4px 16px -4px rgba(17, 24, 39, 0.14);
}

/* Sync metrics — light mode */
html[data-theme="light"] .ud-sync-metrics div {
  background: #f9fafb;
  border-color: rgba(17, 24, 39, 0.09);
}

/* Footer — light mode */
html[data-theme="light"] .ud-footer {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.09);
}

/* Topbar search button — light mode */
html[data-theme="light"] button.topbar-search {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.12);
}

html[data-theme="light"] button.topbar-search:hover {
  border-color: rgba(17, 24, 39, 0.22);
}

/* Avatar — light mode */
html[data-theme="light"] .avatar {
  background: #f3f4f6;
  border: 1px solid rgba(17, 24, 39, 0.12);
  color: var(--txt-secondary);
}

/* Search dialog — light mode */
html[data-theme="light"] .search-dialog {
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.12);
  box-shadow: 0 8px 32px -8px rgba(17, 24, 39, 0.18);
}

/* Comparação cards — light mode */
html[data-theme="light"] .ud-comparison-card {
  background: #f9fafb;
  border-color: rgba(17, 24, 39, 0.09);
}

/* Alert cards dashboard — light mode */
html[data-theme="light"] .ud-alert-card--warn {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.22);
}

html[data-theme="light"] .ud-alert-card--info {
  background: rgba(59, 130, 246, 0.07);
  border-color: rgba(59, 130, 246, 0.22);
}

html[data-theme="light"] .ud-alert-card--danger {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.22);
}

html[data-theme="light"] .ud-alert-card--warn .ud-alert-card__label,
html[data-theme="light"] .ud-alert-card--danger .ud-alert-card__label,
html[data-theme="light"] .ud-alert-card--info .ud-alert-card__label {
  color: var(--txt-primary);
}

@media (max-width: 980px) {
  .login-theme-wrap {
    left: 24px;
    top: 20px;
  }
  .theme-toggle__label {
    display: none;
  }
}

/* ============= Produto — layout v2 ============= */
.product-hero-v2 {
  display: grid;
  grid-template-columns: 1fr minmax(360px, 420px);
  gap: 24px;
  align-items: start;
}
.product-info-col { display: flex; flex-direction: column; gap: 16px; }
.product-gallery-col { position: sticky; top: 24px; }
.product-tags-inline { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.product-price-highlight {
  background: var(--bg-hover);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}
.price-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.price-label { font-size: 12px; font-family: var(--mono); color: var(--text-muted); }
.price-value { font-size: 20px; font-weight: 600; font-family: var(--mono); }
.score-bar-wrap { margin-top: 4px; }
.score-bar-track { height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.score-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .6s ease; }
details.info-dropdown summary {
  cursor: pointer; font-size: 13px; font-weight: 500;
  padding: 10px 0; border-top: 0.5px solid var(--border);
  list-style: none; display: flex; justify-content: space-between;
}
details.info-dropdown[open] summary::after { content: '−'; }
details.info-dropdown summary::after { content: '+'; }

@media (max-width: 768px) {
  .product-hero-v2 { grid-template-columns: 1fr; }
  .product-gallery-col { order: -1; position: static; }
}

/* ============================================================
   Loading overlay — IA Pensando
   ============================================================ */
.ud-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 7, 6, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.ud-loading-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

.ud-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  position: relative;
}

.ud-loading-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 180px;
  transform: translate(-50%, -60%);
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(200, 160, 32, 0.18) 0%,
    rgba(72, 120, 192, 0.12) 40%,
    transparent 70%
  );
  pointer-events: none;
  animation: ud-glow-pulse 2.4s ease-in-out infinite;
}

.ud-loading-globe-wrap {
  animation: ud-globe-breathe 2.4s ease-in-out infinite;
  transform-origin: center;
}

.ud-loading-logo {
  display: block;
  width: 200px;
  height: auto;
}

/* Lightbox global reutilizável (fotos de produto) */
.app-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 7, 6, 0.86);
  backdrop-filter: blur(6px);
  padding: 32px;
}
.app-lightbox[hidden] { display: none !important; }
.app-lightbox__img {
  max-width: min(92vw, 1100px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  background: var(--bg-base);
}
.app-lightbox__caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 12px;
  border-radius: 6px;
  max-width: 80vw;
  text-align: center;
}
.app-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
}
.app-lightbox__close:hover { background: rgba(0, 0, 0, 0.65); }
.app-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 56px;
  font-size: 28px;
  line-height: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
}
.app-lightbox__nav:hover { background: rgba(0, 0, 0, 0.65); }
.app-lightbox__nav--prev { left: 16px; }
.app-lightbox__nav--next { right: 16px; }
.app-lightbox__nav[hidden] { display: none !important; }
[data-lightbox-src] { cursor: zoom-in; }
.ud-ranking-item__name--link { color: inherit; text-decoration: none; cursor: pointer; }
.ud-ranking-item__name--link:hover { text-decoration: underline; }
.ud-ranking-item__value--btn { background: none; border: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.ud-ranking-item__value--btn:hover { text-decoration: underline; }
.ud-orders-modal {
  width: min(720px, calc(100vw - 32px));
  max-width: min(720px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--txt-primary);
  padding: 0;
}
.ud-orders-modal::backdrop { background: rgba(8, 7, 6, 0.6); backdrop-filter: blur(3px); }
.ud-orders-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ud-orders-modal__title { margin: 0; font-size: 15px; }
.ud-orders-modal__close { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--txt-primary); font-size: 18px; line-height: 1; cursor: pointer; }
.ud-orders-modal__body { padding: 12px 20px 20px; overflow-y: auto; max-height: calc(84vh - 58px); }
.ud-orders-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ud-orders-table th, .ud-orders-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.ud-orders-table th { font-size: 10px; text-transform: uppercase; color: var(--txt-muted); font-family: 'IBM Plex Mono', monospace; }
.ud-orders-table a { color: var(--accent); text-decoration: none; }
.ud-orders-table a:hover { text-decoration: underline; }
/* Cabeçalhos ordenáveis por clique (sortable.js) */
.data-table thead th, .vp-data-table thead th, .cu-data-table thead th { cursor: pointer; user-select: none; }
.data-table thead th.is-sorted-asc::after, .vp-data-table thead th.is-sorted-asc::after, .cu-data-table thead th.is-sorted-asc::after { content: ' \25B2'; font-size: 9px; opacity: .75; }
.data-table thead th.is-sorted-desc::after, .vp-data-table thead th.is-sorted-desc::after, .cu-data-table thead th.is-sorted-desc::after { content: ' \25BC'; font-size: 9px; opacity: .75; }

.ud-scan-line {
  animation: ud-scan-sweep 2s linear infinite;
}

.ud-loading-brand {
  font-family: 'Bricolage Grotesque', 'IBM Plex Mono', sans-serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.9);
  text-transform: lowercase;
}

.ud-loading-message {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

.ud-loading-label {
  color: rgba(255, 255, 255, 0.6);
}

.ud-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ud-loading-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c8a020;
  animation: ud-dot-bounce 1.5s ease-in-out infinite;
}
.ud-loading-dot:nth-child(2) { animation-delay: 0.18s; }
.ud-loading-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes ud-globe-breathe {
  0%, 100% {
    transform: scale(1);
    filter:
      drop-shadow(0 0 8px rgba(200, 160, 32, 0.2))
      drop-shadow(0 0 24px rgba(72, 120, 192, 0.12));
  }
  50% {
    transform: scale(1.055);
    filter:
      drop-shadow(0 0 18px rgba(200, 160, 32, 0.55))
      drop-shadow(0 0 52px rgba(72, 120, 192, 0.28));
  }
}

@keyframes ud-glow-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -60%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -60%) scale(1.15); }
}

@keyframes ud-scan-sweep {
  0%   { transform: translateY(-20px); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(175px); opacity: 0; }
}

@keyframes ud-dot-bounce {
  0%, 70%, 100% { transform: translateY(0);   opacity: 0.3; }
  35%           { transform: translateY(-7px); opacity: 1; }
}

