/* ═══════════════════════════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════════════════════════ */
:root {
  /* Marca */
  --brand-gradient:  linear-gradient(135deg, #3a7bd5 0%, #6b3fa0 48%, #9333ea 100%);
  --brand-purple:    #9333ea;
  --brand-blue:      #3a7bd5;
  --brand-purple-dk: #6b21a8;
  --brand-purple-lt: rgba(147,51,234,.12);

  /* Sidebar escura */
  --sidebar-bg:      #1e2a3e;
  --sidebar-border:  rgba(255,255,255,.08);
  --sidebar-section: rgba(255,255,255,.05);
  --sidebar-text:    #d4dcea;
  --sidebar-muted:   #7e8fa8;
  --sidebar-line:    rgba(255,255,255,.09);
  --sidebar-hover:   rgba(147,51,234,.16);

  /* Workspace claro */
  --ws-bg:    #f0f2f8;
  --ws-panel: #ffffff;

  /* Semântico */
  --line:     #e2e8f0;
  --text:     #1a202c;
  --muted:    #718096;
  --danger:   #e53e3e;
  --success:  #1f9d74;

  /* Sombras */
  --shadow-float: 0 8px 40px rgba(0,0,0,.32), 0 0 0 1px rgba(147,51,234,.12);
  --shadow-btn:   0 4px 16px rgba(107,63,160,.40);

  /* Espaçamento base */
  --sp-xs: 6px;  --sp-sm: 10px; --sp-md: 16px;
  --sp-lg: 24px; --sp-xl: 32px;

  /* Raios */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px;
}

/* ═══════════════════════════════════════════════════════════════
   BASE
═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--ws-bg);
  color: var(--text);
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ═══════════════════════════════════════════════════════════════
   BOTÃO DA MARCA
═══════════════════════════════════════════════════════════════ */
.btn-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-md);
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .02em;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition:
    box-shadow 200ms cubic-bezier(.4,0,.2,1),
    transform  200ms cubic-bezier(.34,1.56,.64,1);
}
.btn-brand:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(107,63,160,.56);
  transform: translateY(-2px);
  color: #fff;
}
.btn-brand:active:not(:disabled) { transform: translateY(0); }
.btn-brand:disabled { opacity: .55; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════
   LOGIN
═══════════════════════════════════════════════════════════════ */
.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--sp-lg);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 85% 15%,  rgba(147,51,234,.16) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 10% 90%,  rgba(58,123,213,.10) 0%, transparent 60%),
    var(--ws-bg);
}

.login-card {
  width: min(100%, 460px);
  background: #fff;
  border: 1px solid rgba(147,51,234,.10);
  border-radius: var(--r-xl);
  box-shadow:
    0 24px 60px rgba(107,63,160,.16),
    0 4px 14px rgba(30,42,62,.05);
  padding: 38px 34px 30px;
  position: relative;
  overflow: hidden;
  animation: modalIn 320ms cubic-bezier(.22,.94,.36,1) both;
}

/* faixa roxa fina no topo do card — assinatura visual coerente com a sidebar do editor */
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--brand-gradient);
}

.login-logo-wrap { display: block; margin-bottom: var(--sp-md); }
.login-logo-wrap .brand-logo { height: 36px; }

.login-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-purple);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.login-title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1.15;
  color: var(--text);
}

.login-subtitle {
  margin: 0 0 var(--sp-lg);
  color: #6b7280;
  font-size: 13.5px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.45;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: var(--sp-lg);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f7f8fb;
}

.auth-switch-btn {
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: #556174;
  font-weight: 500;
  font-size: 13.5px;
  padding: 9px 10px;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.auth-switch-btn:hover:not(.is-active) {
  color: var(--brand-purple-dk);
}

.auth-switch-btn.is-active {
  background: #fff;
  color: var(--brand-purple-dk);
  font-weight: 600;
  box-shadow:
    0 1px 8px rgba(30,42,62,.10),
    0 0 0 1px rgba(147,51,234,.12);
}

.login-form .form-label {
  font-size: 13px;
  font-weight: 500;
  color: #455164;
  margin-bottom: 6px;
}

.login-form .form-control,
.login-form textarea.form-control {
  border-radius: var(--r-md);
  border: 1px solid #e1e5ec;
  padding: 10px 12px;
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-form .form-control:hover {
  border-color: #cdd2dc;
}

.login-form .form-control:focus,
.login-form textarea.form-control:focus {
  border-color: var(--brand-purple);
  box-shadow:
    0 0 0 4px rgba(147,51,234,.10),
    0 0 0 1px var(--brand-purple);
  outline: none;
}

/* botão principal com lift sutil + gradient no hover */
.login-form .btn-brand {
  margin-top: 4px;
  padding: 11px 18px;
  font-weight: 600;
  letter-spacing: .005em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 220ms ease;
}

.login-form .btn-brand:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--brand-gradient);
  box-shadow:
    0 8px 24px rgba(107,63,160,.32),
    0 2px 6px rgba(147,51,234,.20);
}

.login-form .btn-brand:active:not(:disabled) {
  transform: translateY(0);
}

.login-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}
.login-status.is-error { color: var(--danger); }
.login-status.is-success { color: var(--success); }

.login-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 2px 0 var(--sp-md);
  padding: 10px 12px;
  background: #f7f8fb;
  border: 1px solid #e1e5ec;
  border-radius: var(--r-md);
  color: #455164;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.login-check:hover {
  background: #f1f3f8;
  border-color: #cdd2dc;
}

.login-check .form-check-input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid #b0b7c2;
  border-radius: 4px;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.login-check .form-check-input:hover {
  border-color: var(--brand-purple);
}

.login-check .form-check-input:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 4px rgba(147,51,234,.14);
}

.login-check .form-check-input:checked {
  background-color: var(--brand-purple);
  border-color: var(--brand-purple);
}

.login-check .form-check-label {
  cursor: pointer;
  user-select: none;
}

.turnstile-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px 0 var(--sp-md);
  min-height: 72px;
}

.turnstile-wrap.is-invisible {
  height: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.optional-label {
  color: var(--muted);
  font-weight: 400;
}

.form-text-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.85;
}

/* Placeholder mais discreto em textareas longos (registerObservations etc) */
#registerObservations::placeholder {
  font-size: 12px;
  color: #9aa3b1;
  opacity: 0.75;
  font-style: italic;
}
#registerObservations::-webkit-input-placeholder {
  font-size: 12px;
  color: #9aa3b1;
  opacity: 0.75;
  font-style: italic;
}

.password-help {
  margin: 0 0 var(--sp-md);
  color: #455164;
  font-size: 14px;
}

.password-rule {
  margin: -4px 0 var(--sp-md);
  color: var(--muted);
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  height: 100vh;
  min-height: 700px;
}

/* ═══════════════════════════════════════════════════════════════
   TOPBAR CLARA NETPOINT
═══════════════════════════════════════════════════════════════ */
.topbar {
  position: relative;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #dfe5ef;
  box-shadow: 0 8px 24px rgba(30,42,62,.08);
}

.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--brand-gradient);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 0 var(--sp-xl);
  height: 60px;
}

.brand-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  height: 30px;
}

.brand-logo {
  display: block;
  height: 28px;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(30,42,62,.12));
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  color: #172033;
  white-space: nowrap;
}

/* ── Progress Steps ── */
.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
  padding: 0 var(--sp-lg);
}

.step {
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
}

.step-connector {
  width: 36px;
  height: 1px;
  background: #dbe1eb;
  margin: 0 2px;
  flex-shrink: 0;
  transition: background 400ms ease;
}

.step-connector.is-done { background: rgba(58,123,213,.50); }

.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #d9deea;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #8a96aa;
  transition: all 280ms cubic-bezier(.34,1.4,.64,1);
  flex-shrink: 0;
}

.step.is-done .step-dot {
  background: rgba(58,123,213,.10);
  border-color: rgba(58,123,213,.32);
  color: var(--brand-blue);
}

.step.is-active .step-dot {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(147,51,234,.10);
}

.step-label {
  font-size: 11px;
  font-weight: 600;
  color: #8a96aa;
  letter-spacing: .03em;
  white-space: nowrap;
  transition: color 280ms ease;
}

.step.is-done  .step-label { color: #59677c; }
.step.is-active .step-label { color: #172033; }

/* ── Topbar actions ── */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.version-badge {
  background: rgba(147,51,234,.08);
  border: 1px solid rgba(147,51,234,.18);
  color: var(--brand-purple);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 20px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #dfe4ee;
  border-radius: 20px;
  background: #f8f9fd;
  padding: 0 11px;
  color: #526076;
  font-size: 11.5px;
  font-weight: 500;
}

.status-chip.is-online  { background: #e7f7ef; border-color: rgba(31,157,116,.25); color: #08724f; }
.status-chip.is-offline { background: #ffe9e9; border-color: rgba(229,62,62,.30); color: #b42323; }

.btn-topbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 1px solid #d9deea;
  border-radius: var(--r-sm);
  background: #fff;
  padding: 0 12px;
  color: #344156;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}
.btn-topbar:hover {
  border-color: rgba(147,51,234,.30);
  background: rgba(147,51,234,.06);
  color: var(--brand-purple);
  box-shadow: 0 4px 12px rgba(147,51,234,.08);
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT: SIDEBAR DARK + WORKSPACE
═══════════════════════════════════════════════════════════════ */
.app-body {
  display: grid;
  grid-template-columns: 300px minmax(0,1fr);
  min-height: 0;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR ESCURA
═══════════════════════════════════════════════════════════════ */
.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar-bg);
  box-shadow: 2px 0 30px rgba(0,0,0,.25);
  position: relative;
  z-index: 5;
}

/* Linha decorativa roxa no topo da sidebar */
.sidebar::before {
  content: "";
  display: block;
  height: 2px;
  background: var(--brand-gradient);
  flex-shrink: 0;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(147,51,234,.3) transparent;
}

.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(147,51,234,.3);
  border-radius: 2px;
}

/* Seções da sidebar */
.panel-section {
  padding: 14px 0;
  border-top: 1px solid var(--sidebar-line);
}
.panel-section:first-child { border-top: none; padding-top: 4px; }

.section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--sidebar-line);
}

.muted { color: var(--sidebar-muted); font-size: 12px; margin: 4px 0 0; }
#imageMeta { color: var(--sidebar-muted); font-size: 12px; margin: 6px 0 0; }
#imageMeta.is-error { color: #fc8181; }

/* Upload card */
.file-control input[type="file"] { display: none; }

.upload-card {
  display: grid;
  gap: 3px;
  border: 1.5px dashed rgba(255,255,255,.12);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.04);
  padding: 13px 12px;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-card:hover {
  border-color: rgba(147,51,234,.55);
  background: rgba(147,51,234,.07);
}

.upload-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 600;
}

.upload-icon { font-size: 17px; color: var(--brand-purple); opacity: .85; }
.upload-meta { color: var(--sidebar-muted); font-size: 11px; }

/* ── Layer bar: tabs de camada ── */
.layer-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,.14);
  border-radius: var(--r-md);
  padding: 4px;
}

.layer-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 6px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.layer-tab i { font-size: 20px; transition: color 180ms ease; }

.layer-tab:hover:not(:disabled) {
  background: rgba(147,51,234,.14);
  color: rgba(255,255,255,.75);
}

.layer-tab.is-active {
  background: rgba(147,51,234,.28);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(147,51,234,.40);
}

.layer-tab.is-active i { color: #c084fc; }

.layer-tab:disabled { opacity: .32; cursor: not-allowed; }

.layer-tab-badge {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--sidebar-muted);
}
.layer-tab.is-active .layer-tab-badge { color: rgba(255,255,255,.55); }

/* ── Inspector: painel de edição inline ── */
.inspector-panel {
  margin-top: 10px;
  border: 1px solid rgba(147,51,234,.22);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.04);
  overflow: hidden;
}

.inspector-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  background: linear-gradient(110deg, rgba(147,51,234,.18) 0%, rgba(58,123,213,.10) 100%);
  border-bottom: 1px solid rgba(147,51,234,.14);
}

.inspector-header i { font-size: 16px; color: #c084fc; }

.inspector-title {
  flex: 1;
  color: #e2d9f3;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.inspector-body { padding: 13px; }

/* Grupos colapsáveis dentro do inspector */
.inspector-group {
  border-radius: var(--r-sm);
  background: rgba(0,0,0,.10);
  overflow: hidden;
  margin-bottom: 8px;
}

.inspector-group:last-child { margin-bottom: 0; }

.inspector-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  cursor: pointer;
  user-select: none;
  color: var(--sidebar-text);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 140ms ease;
}

.inspector-group-header:hover { background: rgba(255,255,255,.04); }

.inspector-group-header i.group-icon { font-size: 14px; color: #a78bfa; }

.inspector-group-chevron {
  margin-left: auto;
  font-size: 13px;
  color: var(--sidebar-muted);
  transition: transform 220ms ease;
}

.inspector-group.is-open .inspector-group-chevron { transform: rotate(180deg); }

.inspector-group-body {
  padding: 10px 11px 11px;
  border-top: 1px solid rgba(255,255,255,.05);
  display: none;
}

.inspector-group.is-open .inspector-group-body { display: block; }

/* Labels e inputs no inspector */
.inspector-label {
  display: block;
  margin-bottom: 5px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.inspector-input {
  width: 100%;
  min-height: 34px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  padding: 6px 9px;
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.inspector-input:focus {
  outline: none;
  border-color: rgba(147,51,234,.55);
  box-shadow: 0 0 0 3px rgba(147,51,234,.14);
}

.inspector-color {
  width: 100%;
  height: 34px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-sm);
  padding: 3px 5px;
  cursor: pointer;
}

.inspector-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.inspector-row:last-child { margin-bottom: 0; }

.inspector-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sidebar-text);
  font-size: 12.5px;
  margin-bottom: 7px;
}

.inspector-check input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--brand-purple);
  cursor: pointer;
}

.inspector-range-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.inspector-range {
  width: 100%;
  accent-color: var(--brand-purple);
}

/* Align buttons no inspector */
.inspector-align {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.align-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--r-sm);
  background: rgba(0,0,0,.20);
  color: var(--sidebar-muted);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.align-btn:hover:not(:disabled) {
  border-color: rgba(147,51,234,.45);
  background: rgba(147,51,234,.14);
  color: #c084fc;
}
.align-btn:disabled { opacity: .3; cursor: not-allowed; }

/* Style toggles (negrito / itálico) */
.style-toggle-group {
  display: flex;
  gap: 5px;
}

.style-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: var(--r-sm);
  background: rgba(0,0,0,.20);
  color: var(--sidebar-muted);
  cursor: pointer;
  font-size: 16px;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.style-toggle:hover:not(:disabled) {
  border-color: rgba(147,51,234,.45);
  background: rgba(147,51,234,.14);
  color: #c084fc;
}

.style-toggle[aria-pressed="true"] {
  border-color: rgba(147,51,234,.65);
  background: rgba(147,51,234,.28);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(147,51,234,.40);
}

.style-toggle:disabled {
  opacity: .35;
  cursor: not-allowed;
  position: relative;
}

.style-toggle:disabled::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px;
  top: 50%;
  height: 1px;
  background: var(--sidebar-muted);
  transform: rotate(-25deg);
  pointer-events: none;
}

/* ── Font picker ── */
.font-picker-wrap { position: relative; }

.font-picker-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 300;
  margin: 0; padding: 4px 0;
  list-style: none;
  border: 1px solid rgba(147,51,234,.28);
  border-radius: var(--r-md);
  background: #1e2640;
  box-shadow: 0 12px 32px rgba(0,0,0,.40);
  max-height: 210px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(147,51,234,.3) transparent;
}

.font-picker-group {
  padding: 7px 12px 3px;
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  pointer-events: none;
}

.font-picker-item {
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.3;
  color: #e8edf5;
  cursor: pointer;
  transition: background 80ms;
}
.font-picker-item:hover { background: rgba(147,51,234,.22); }
.font-picker-item.is-selected {
  background: rgba(147,51,234,.32);
  color: #f3e8ff;
}

.font-picker-empty {
  padding: 10px 13px;
  color: var(--sidebar-muted);
  font-size: 13px;
  pointer-events: none;
}

/* ── Painel de Música ── */
.music-panel-inner { padding-top: 4px; }

.media-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.media-item {
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-md);
  background: rgba(0,0,0,.18);
  padding: 8px 10px;
  color: var(--sidebar-muted);
  font-size: 12.5px;
  transition: border-color 160ms ease;
}

.media-item.is-ready  { border-color: rgba(31,157,116,.30); background: rgba(31,157,116,.07); color: #6ee7b7; }
.media-item.is-error  { border-color: rgba(229,62,62,.30);  background: rgba(229,62,62,.07);  color: #fca5a5; }

.media-item-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.media-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--sidebar-text);
}

.media-item-status { font-size: 11px; }

.media-remove-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.media-remove-btn:hover {
  border-color: rgba(229,62,62,.50);
  background: rgba(229,62,62,.12);
  color: #fca5a5;
}

.media-player-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.media-play-btn {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 1px solid rgba(147,51,234,.30);
  border-radius: 50%;
  background: rgba(147,51,234,.14);
  color: #c084fc;
  font-size: 15px;
  cursor: pointer;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms cubic-bezier(.34,1.56,.64,1);
}
.media-play-btn:hover {
  background: rgba(147,51,234,.28);
  box-shadow: 0 2px 10px rgba(147,51,234,.30);
  transform: scale(1.1);
}

.media-vol-slider {
  flex: 1; height: 3px;
  border: none; border-radius: 999px;
  background: rgba(255,255,255,.10);
  accent-color: var(--brand-purple);
  cursor: pointer; min-height: auto; padding: 0;
}

.media-vol-label {
  flex-shrink: 0;
  width: 34px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 500;
  text-align: right;
}

/* ── Export section (sticky na sidebar) ── */
.export-section {
  flex-shrink: 0;
  padding: 14px 14px 18px;
  border-top: 1px solid var(--sidebar-line);
  background: linear-gradient(180deg, rgba(21,28,44,0) 0%, var(--sidebar-bg) 18%);
}

.billing-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.billing-panel[hidden],
.billing-company[hidden] {
  display: none !important;
}

.billing-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-md);
  background: rgba(255,255,255,.045);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.billing-toggle:hover,
.billing-toggle:focus-within {
  border-color: rgba(147,51,234,.35);
  background: rgba(147,51,234,.08);
}

.billing-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.billing-toggle-icon {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(147,51,234,.26);
  border-radius: 50%;
  background: rgba(0,0,0,.18);
  color: #a78bfa;
  font-size: 15px;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.billing-toggle input:checked + .billing-toggle-icon {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(147,51,234,.16);
}

.billing-toggle-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.billing-toggle-copy strong {
  color: var(--sidebar-text);
  font-size: 12.5px;
  font-weight: 600;
}

.billing-toggle-copy small {
  color: var(--sidebar-muted);
  font-size: 10.8px;
  font-weight: 400;
  line-height: 1.25;
}

.billing-company {
  display: grid;
  gap: 5px;
}

.billing-company span {
  color: var(--sidebar-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.billing-company .inspector-input {
  min-height: 36px;
  background: rgba(0,0,0,.22);
}

/* ═══════════════════════════════════════════════════════════════
   WORKSPACE
═══════════════════════════════════════════════════════════════ */
.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr);
  min-width: 0;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(147,51,234,.05) 0%, transparent 60%),
    var(--ws-bg);
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.88);
  padding: 0 var(--sp-lg);
  backdrop-filter: blur(4px);
}

.toolbar-summary {
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-right { display: flex; align-items: center; }

#jobStatus {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 0 13px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}
#jobStatus.is-ok    { border-color: rgba(31,157,116,.28); background: #f0fdf4; color: #166534; }
#jobStatus.is-error { border-color: rgba(229,62,62,.30);  background: #fff5f5; color: var(--danger); }

/* Barra de progresso do render */
.progress-bar-wrap { height: 3px; background: var(--line); overflow: hidden; }
.progress-fill {
  height: 100%;
  background: var(--brand-gradient);
  transition: width 400ms ease;
  width: 0%;
}

/* Canvas área */
.canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: var(--sp-lg);
}

.canvas-wrap.is-empty  { cursor: pointer; }
.canvas-wrap.is-drag-over { background: rgba(147,51,234,.06); }

/* Quadro de filme */
canvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 145px);
  border-radius: var(--r-lg);
  background: #101820;
  cursor: grab;

  /* Borda estilo "quadro de filme" */
  border: 6px solid #1a2030;
  outline: 1px solid rgba(0,0,0,.35);
  box-shadow:
    0 0 0 1px #0d1117,
    inset 0 0 0 1px rgba(255,255,255,.04),
    0 20px 60px rgba(0,0,0,.35),
    0 4px 16px rgba(107,63,160,.20);

  transition: box-shadow 600ms ease, border-color 600ms ease;
}

.canvas-wrap.is-empty canvas {
  border-style: dashed;
  border-color: #2a3448;
  cursor: pointer;
  opacity: .85;
}

.canvas-wrap.is-drag-over canvas {
  border-color: var(--brand-purple);
  box-shadow:
    0 0 0 1px #0d1117,
    0 0 0 5px rgba(147,51,234,.20),
    0 20px 60px rgba(0,0,0,.35);
}

/* Glow dourado quando render concluído */
canvas.is-render-done {
  border-color: #2a1f0a;
  box-shadow:
    0 0 0 1px #0d1117,
    inset 0 0 0 1px rgba(255,200,50,.06),
    0 0 40px rgba(245,184,73,.22),
    0 0 80px rgba(245,184,73,.10),
    0 20px 60px rgba(0,0,0,.35);
}

canvas.is-dragging { cursor: grabbing; }

/* Estado vazio */
.empty-state {
  position: absolute;
  display: grid;
  gap: 5px;
  justify-items: center;
  min-width: 260px;
  border: 2px dashed rgba(255,255,255,.14);
  border-radius: var(--r-lg);
  background: rgba(13,17,23,.75);
  padding: 26px 22px;
  color: #d0daea;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.empty-state-icon { font-size: 38px; color: rgba(255,255,255,.25); margin-bottom: 4px; }
.empty-state strong { font-size: 15px; font-weight: 600; }
.empty-state span   { color: #8899bb; font-size: 12.5px; }

/* ═══════════════════════════════════════════════════════════════
   MODAL: DOWNLOAD
═══════════════════════════════════════════════════════════════ */
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(10,14,23,.60);
  padding: var(--sp-lg);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.editor-modal {
  position: relative;
  width: min(100%, 440px);
  border: 1px solid rgba(147,51,234,.18);
  border-top: 3px solid var(--brand-purple);
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: 0 32px 80px rgba(0,0,0,.30), 0 0 0 1px rgba(147,51,234,.08);
  padding: 32px;
  animation: modalIn 280ms cubic-bezier(.34,1.2,.64,1) both;
}

.modal-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--brand-purple);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.editor-modal h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

.editor-modal p {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 18px;
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 200ms ease;
}
.modal-close:hover { background: #fee2e2; color: var(--danger); transform: rotate(90deg); }

.modal-expiry {
  margin: -12px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

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

.btn-modal-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 160ms ease,
    box-shadow  160ms ease,
    transform   180ms cubic-bezier(.34,1.56,.64,1);
}

.btn-modal-download {
  border: 1px solid rgba(147,51,234,.22);
  background: linear-gradient(135deg, rgba(147,51,234,.08), rgba(58,123,213,.08));
  color: var(--brand-purple-dk);
}

.btn-modal-copy {
  border: 1px solid rgba(58,123,213,.22);
  background: linear-gradient(135deg, rgba(58,123,213,.08), rgba(147,51,234,.08));
  color: var(--brand-purple-dk);
}

.btn-modal-action:hover {
  background: linear-gradient(135deg, rgba(147,51,234,.16), rgba(58,123,213,.12));
  box-shadow: 0 4px 16px rgba(147,51,234,.22);
  transform: translateY(-2px);
  color: var(--brand-purple-dk);
}

.copy-feedback {
  margin: 10px 0 0;
  color: var(--success);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}
.copy-feedback.is-error { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════
   BOTÕES GERAIS (cancel, retry)
═══════════════════════════════════════════════════════════════ */
.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 38px;
  margin-top: 8px;
  border: 1px solid rgba(229,62,62,.30);
  border-radius: var(--r-md);
  background: rgba(229,62,62,.08);
  color: #fc8181;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.btn-cancel:hover { background: rgba(229,62,62,.16); color: #fca5a5; }

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid rgba(229,62,62,.30);
  border-radius: var(--r-sm);
  background: rgba(229,62,62,.08);
  color: #fc8181;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease;
}
.btn-retry:hover { background: rgba(229,62,62,.16); }

/* ═══════════════════════════════════════════════════════════════
   ADMIN TOOLS
═══════════════════════════════════════════════════════════════ */
.admin-shell {
  min-height: 100vh;
  background: #f4f6fb;
  color: var(--text);
}

.admin-topbar .brand-heading h1 { letter-spacing: 0; }

.admin-console {
  padding: 22px;
}

.admin-home-view,
.admin-product-view {
  min-width: 0;
}

.admin-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  padding: 0;
}

.admin-main,
.admin-detail-panel {
  min-width: 0;
  background: #fff;
  border: 1px solid #e4e8f0;
  border-radius: var(--r-md);
  box-shadow: 0 10px 26px rgba(30,42,62,.06);
}

.admin-main { padding: 18px; }

.admin-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-kicker {
  margin: 0 0 3px;
  color: var(--brand-purple);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.admin-page-head h2 {
  margin: 0;
  color: #172033;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
}

.admin-app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.admin-app-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 14px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid #e1e6f0;
  border-radius: var(--r-md);
  background: #fff;
  color: #172033;
  text-align: left;
  box-shadow: 0 10px 26px rgba(30,42,62,.06);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.admin-app-card:hover {
  border-color: rgba(147,51,234,.35);
  box-shadow: 0 14px 32px rgba(94,64,180,.12);
  transform: translateY(-1px);
}

.admin-app-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-sm);
  background: rgba(147,51,234,.09);
  color: var(--brand-purple);
  font-size: 25px;
}

.admin-app-card strong {
  display: block;
  margin-bottom: 4px;
  color: #172033;
  font-size: 16px;
  font-weight: 600;
}

.admin-app-card em {
  display: block;
  color: #68758a;
  font-size: 13px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.35;
}

.admin-app-card > .ph-bold {
  justify-self: end;
  color: #8b95a7;
  font-size: 18px;
}

.admin-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid #dfe4ee;
  border-radius: var(--r-sm);
  background: #fff;
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: calc(var(--r-sm) - 2px);
  background: transparent;
  color: #5e6b80;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.admin-tab.is-active {
  background: rgba(147,51,234,.10);
  color: var(--brand-purple);
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-panel-head h3 {
  margin: 0 0 4px;
  color: #172033;
  font-size: 17px;
  font-weight: 600;
}

.admin-panel-head p {
  margin: 0;
  color: #69758a;
  font-size: 13px;
}

.btn-admin-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #d9deea;
  border-radius: var(--r-sm);
  background: #fff;
  color: #344156;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn-admin-secondary:hover {
  border-color: rgba(147,51,234,.35);
  box-shadow: 0 5px 16px rgba(147,51,234,.10);
  transform: translateY(-1px);
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-metric {
  margin: 0;
  padding: 13px 14px;
  border: 1px solid #e5e9f2;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, #fff, #f8f9fd);
}

.admin-metric span {
  display: block;
  color: #68758a;
  font-size: 12px;
  font-weight: 500;
}

.admin-metric strong {
  display: block;
  margin-top: 4px;
  color: #172033;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
}

.admin-recent-pending {
  grid-column: 1 / -1;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid #e5e9f2;
  border-radius: var(--r-sm);
  background: #fff;
}

.admin-recent-pending-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #68758a;
  font-size: 12px;
  font-weight: 500;
}

.admin-recent-pending-title strong {
  color: #172033;
  font-size: 13px;
  font-weight: 600;
}

.admin-recent-pending-list {
  display: grid;
  gap: 7px;
}

.admin-pending-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #edf0f6;
  border-radius: var(--r-sm);
  background: #f9fafd;
  color: #263246;
  text-align: left;
  cursor: pointer;
}

.admin-pending-row:hover { background: rgba(147,51,234,.06); }

.admin-pending-row span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.admin-pending-row strong {
  color: #202b3d;
  font-size: 13px;
  font-weight: 600;
}

.admin-pending-row em,
.admin-pending-row small {
  color: #78859a;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: 180px minmax(220px, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.admin-field span,
.admin-action-reason span {
  display: block;
  margin-bottom: 5px;
  color: #667287;
  font-size: 12px;
  font-weight: 500;
}

.admin-field input,
.admin-field select,
.admin-action-reason textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #dfe4ee;
  border-radius: var(--r-sm);
  background: #fff;
  color: #172033;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 400;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.admin-field input:focus,
.admin-field select:focus,
.admin-action-reason textarea:focus {
  border-color: rgba(147,51,234,.45);
  box-shadow: 0 0 0 3px rgba(147,51,234,.10);
}

.admin-table-wrap {
  position: relative;
  overflow: auto;
  border: 1px solid #e5e9f2;
  border-radius: var(--r-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f6;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: #69758a;
  background: #f8f9fd;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-table td {
  color: #263246;
  font-size: 13px;
}

.admin-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.admin-table tbody tr:hover,
.admin-table tbody tr.is-selected {
  background: rgba(147,51,234,.07);
}

.admin-user-primary {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-user-primary strong {
  color: #172033;
  font-size: 13.5px;
  font-weight: 600;
}

.admin-user-primary span,
.admin-muted-text {
  color: #78859a;
  font-size: 12px;
  font-weight: 400;
}

.admin-type-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  min-height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.admin-user-primary .admin-type-pill { margin-top: 2px; }

.admin-type-pill.internal {
  color: #174ea6;
  background: #e8f0fe;
}

.admin-type-pill.external {
  color: #7a4b00;
  background: #fff1d7;
}

.admin-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.admin-pill.root {
  color: #fff;
  background: linear-gradient(135deg, #6b3fa0 0%, #9333ea 100%);
  box-shadow: 0 1px 6px rgba(147, 51, 234, 0.35);
}

.admin-pill.admin-pill-admin {
  color: #1e2a3e;
  background: #fde68a;
}

/* Linha root destacada na tabela */
tr.is-root td:first-child {
  border-left: 3px solid var(--brand-purple);
}

/* Aviso no detalhe quando é root */
.admin-detail-header.is-root {
  background: linear-gradient(135deg, rgba(147,51,234,0.08), rgba(58,123,213,0.06));
  border-radius: var(--r-lg);
  padding: 12px 14px;
  margin: -4px -4px 12px -4px;
}

.admin-root-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(147,51,234,0.10), rgba(58,123,213,0.08));
  border: 1px solid rgba(147, 51, 234, 0.20);
  border-radius: var(--r-md);
  color: #4c2789;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

.admin-root-warning i {
  color: var(--brand-purple);
  font-size: 18px;
}

/* Form de edição dentro do modal admin */
.admin-edit-form {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.admin-edit-form label {
  display: grid;
  gap: 4px;
}

.admin-edit-form span {
  font-size: 12px;
  font-weight: 500;
  color: #455164;
}

.admin-edit-form input {
  border: 1px solid #e1e5ec;
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.admin-edit-form input:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.10);
}

.admin-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.admin-status.pending { color: #855d00; background: #fff4cf; }
.admin-status.active { color: #08724f; background: #dff8ed; }
.admin-status.rejected { color: #a12626; background: #ffe3e3; }
.admin-status.suspended { color: #5c6170; background: #eceff5; }
.admin-status.queued { color: #5b4b0b; background: #fff5d6; }
.admin-status.processing { color: #174ea6; background: #e8f0fe; }
.admin-status.done { color: #08724f; background: #dff8ed; }
.admin-status.failed { color: #a12626; background: #ffe3e3; }
.admin-status.cancelled { color: #5c6170; background: #eceff5; }

.admin-jobs-table {
  min-width: 980px;
}

.admin-job-id,
.admin-job-progress {
  color: #7d889a;
  font-size: 11.5px;
  font-weight: 400;
}

.admin-job-progress {
  display: block;
  margin-top: 5px;
}

.admin-job-billing {
  display: inline-block;
  max-width: 230px;
  color: #3a4658;
  font-size: 12px;
  line-height: 1.35;
}

.admin-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #dfe4ee;
  border-radius: var(--r-sm);
  background: #fff;
  color: #344156;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.admin-icon-btn:hover {
  border-color: rgba(147,51,234,.35);
  background: rgba(147,51,234,.07);
  color: var(--brand-purple);
}

.admin-icon-btn.danger {
  color: #b42323;
}

.admin-icon-btn.danger:hover {
  border-color: rgba(229,62,62,.28);
  background: rgba(229,62,62,.08);
  color: #a12626;
}

.admin-icon-btn:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.admin-report-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 360px;
  padding: 42px 24px;
  border: 1px solid #e1e6f0;
  border-radius: var(--r-md);
  background: #fff;
  color: #68758a;
  text-align: center;
  box-shadow: 0 10px 26px rgba(30,42,62,.06);
}

.admin-report-placeholder i {
  color: var(--brand-purple);
  font-size: 44px;
}

.admin-report-placeholder strong {
  color: #172033;
  font-size: 18px;
  font-weight: 600;
}

.admin-report-placeholder span {
  max-width: 560px;
  font-size: 13px;
  line-height: 1.5;
}

.admin-empty {
  padding: 24px;
  color: #748096;
  font-size: 13px;
  text-align: center;
}

.admin-detail-panel {
  align-self: start;
  min-height: calc(100vh - 104px);
  padding: 18px;
  position: sticky;
  top: 80px;
}

.admin-detail-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: #7b879a;
  text-align: center;
}

.admin-detail-empty i {
  margin-bottom: 8px;
  color: var(--brand-purple);
  font-size: 38px;
}

.admin-detail-empty strong {
  color: #233047;
  font-weight: 600;
}

.admin-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-detail-header h3 {
  margin: 0 0 3px;
  color: #172033;
  font-size: 18px;
  font-weight: 600;
}

.admin-detail-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.admin-detail-section {
  padding: 13px 0;
  border-top: 1px solid #edf0f6;
}

.admin-detail-section h4 {
  margin: 0 0 9px;
  color: #526076;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.admin-detail-grid {
  display: grid;
  gap: 8px;
}

.admin-detail-item span {
  display: block;
  color: #7b879a;
  font-size: 11.5px;
  font-weight: 500;
}

.admin-detail-item strong {
  display: block;
  color: #202b3d;
  font-size: 13px;
  font-weight: 500;
  word-break: break-word;
}

.admin-job-item em {
  display: block;
  margin-top: 2px;
  color: #667287;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
}

.admin-action-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.admin-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 36px;
  border: 1px solid #dfe4ee;
  border-radius: var(--r-sm);
  background: #fff;
  color: #344156;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.admin-action-btn.primary {
  border-color: rgba(31,157,116,.30);
  background: rgba(31,157,116,.08);
  color: #08724f;
}

.admin-action-btn.warning {
  border-color: rgba(229,62,62,.26);
  background: rgba(229,62,62,.07);
  color: #b42323;
}

.admin-action-btn:hover { filter: brightness(.98); }

.admin-action-btn:disabled,
.btn-admin-secondary:disabled,
.btn-modal-action:disabled {
  cursor: progress;
  opacity: .72;
}

.admin-action-reason {
  display: block;
  margin: 12px 0 6px;
  text-align: left;
}

.admin-action-reason textarea {
  min-height: 110px;
  resize: vertical;
}

.admin-notes-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-inline-feedback {
  color: #08724f;
  font-size: 12px;
  font-weight: 500;
}

.admin-inline-feedback.is-error {
  color: #b42323;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .app-shell { height: auto; }

  .topbar-inner {
    height: auto; min-height: 60px;
    flex-wrap: wrap;
    padding: 12px 18px;
  }

  .progress-steps { display: none; }
  .app-body { grid-template-columns: 1fr; }
  .admin-body { grid-template-columns: 1fr; }
  .admin-detail-panel { position: static; min-height: 320px; }
  .admin-dashboard-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .admin-app-grid { grid-template-columns: 1fr; }

  .sidebar {
    box-shadow: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }

  canvas { max-height: 70vh; }
}

@media (max-width: 560px) {
  .modal-actions { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 16px; }
  .admin-console { padding: 12px; }
  .admin-body { padding: 0; }
  .admin-toolbar { grid-template-columns: 1fr; }
  .admin-dashboard-grid { grid-template-columns: 1fr; }
  .admin-app-card { grid-template-columns: 40px minmax(0, 1fr); }
  .admin-app-card > .ph-bold { display: none; }
}
