@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=DM+Sans:wght@300;400;500&family=Inter:wght@300;400;500;600&family=Manrope:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  /* Colors */
  --bg: #f6f3ef;
  --bg-subtle: #fff8f1;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);

  --text: #111827;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.16);

  --success: #0f766e;
  --success-light: rgba(13, 148, 136, 0.15);

  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --danger-light: rgba(239, 68, 68, 0.16);

  --accent: #2563eb;
  --accent-light: rgba(37, 99, 235, 0.16);

  --bg-gradient: radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.14), transparent 50%),
    radial-gradient(900px 500px at 90% -20%, rgba(37, 99, 235, 0.1), transparent 50%),
    linear-gradient(180deg, #f7f3ee 0%, #f2f0ec 100%);
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);

  /* Spacing */
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.06);
  --shadow: 0 10px 30px -20px rgba(15, 23, 42, 0.35);
  --shadow-md: 0 18px 40px -28px rgba(15, 23, 42, 0.45);
  --shadow-lg: 0 30px 70px -35px rgba(15, 23, 42, 0.55);

  /* Admin shell */
  --admin-app-bg: #f3f4f6;
  --admin-sidebar-bg: #ffffff;
  --admin-surface: #ffffff;
  --admin-surface-2: #f8fafc;
  --admin-border: rgba(15, 23, 42, 0.1);
  --admin-text: #111827;
  --admin-text-muted: rgba(17, 24, 39, 0.62);
  --admin-tab-text: rgba(17, 24, 39, 0.65);
  --admin-tab-hover-bg: rgba(15, 23, 42, 0.05);
  --admin-card-glass-top: rgba(15, 23, 42, 0.02);
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-subtle: #0f172a;
  --surface: #111827;
  --surface-strong: #0b1222;
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.3);

  --text: #e2e8f0;
  --text-secondary: #cbd5f5;
  --text-tertiary: #94a3b8;

  --primary: #60a5fa;
  --primary-hover: #2563eb;
  --primary-light: rgba(96, 165, 250, 0.22);

  --success: #34d399;
  --success-light: rgba(16, 185, 129, 0.2);

  --danger: #f87171;
  --danger-hover: #ef4444;
  --danger-light: rgba(248, 113, 113, 0.2);

  --accent: #60a5fa;
  --accent-light: rgba(96, 165, 250, 0.22);

  --bg-gradient: radial-gradient(900px 500px at 10% -10%, rgba(96, 165, 250, 0.2), transparent 55%),
    radial-gradient(700px 400px at 90% -20%, rgba(37, 99, 235, 0.16), transparent 55%),
    linear-gradient(180deg, #0b1120 0%, #0b1222 100%);
  --glass: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(148, 163, 184, 0.18);

  /* Admin shell */
  --admin-app-bg: #0f1117;
  --admin-sidebar-bg: #171922;
  --admin-surface: #171922;
  --admin-surface-2: #1e2130;
  --admin-border: rgba(255, 255, 255, 0.09);
  --admin-text: #e2e8f0;
  --admin-text-muted: rgba(226, 232, 240, 0.62);
  --admin-tab-text: rgba(226, 232, 240, 0.55);
  --admin-tab-hover-bg: rgba(255, 255, 255, 0.05);
  --admin-card-glass-top: rgba(255, 255, 255, 0.02);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-gradient);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.is-hidden {
  display: none !important;
}

.auth-gate {
  min-height: 100vh;
  background: #0c0c10;
  color: #f0eeff;
  font-family: "Inter", "Manrope", sans-serif;
  overflow: hidden;
  position: relative;
}

.auth-gate::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.auth-gate::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 85% 80%, rgba(45, 212, 160, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.auth-layout {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 500px;
}

.auth-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  position: relative;
}

.auth-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeUp 0.7s ease both;
}

.auth-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.35);
}

.auth-logo-icon svg {
  width: 20px;
  height: 20px;
}

.auth-brand {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.auth-brand span {
  color: #2563eb;
}

.auth-badge-admin {
  margin-left: 4px;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(37, 99, 235, 0.34);
  color: #2563eb;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
}

.auth-left-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 40px;
}

.auth-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  animation: fadeUp 0.7s 0.1s ease both;
}

.auth-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2dd4a0;
  box-shadow: 0 0 8px #2dd4a0;
}

.auth-eyebrow span {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #2dd4a0;
}

.auth-headline {
  margin: 0;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  animation: fadeUp 0.7s 0.15s ease both;
}

.auth-headline span {
  color: #2563eb;
}

.auth-tagline {
  margin-top: 24px;
  font-size: 14px;
  font-weight: 300;
  color: rgba(240, 238, 255, 0.44);
  line-height: 1.75;
  max-width: 390px;
  animation: fadeUp 0.7s 0.2s ease both;
}

.auth-stats {
  display: flex;
  gap: 40px;
  margin-top: 56px;
  animation: fadeUp 0.7s 0.3s ease both;
}

.auth-stats article {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-stats strong {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-stats small {
  font-size: 11px;
  color: rgba(240, 238, 255, 0.38);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-bottom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.7s 0.4s ease both;
}

.auth-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(45, 212, 160, 0.08);
  border: 1px solid rgba(45, 212, 160, 0.2);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #2dd4a0;
}

.auth-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2dd4a0;
  position: relative;
}

.auth-status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid #2dd4a0;
  animation: ping 2s ease-out infinite;
}

.auth-version {
  font-size: 11px;
  color: rgba(240, 238, 255, 0.38);
}

.auth-panel {
  background: #121726;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 52px;
  position: relative;
  overflow: hidden;
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #2563eb, #2dd4a0, transparent);
  pointer-events: none;
}

.auth-panel-top {
  margin-bottom: 36px;
  animation: fadeUp 0.7s 0.25s ease both;
}

.auth-panel-title {
  margin: 0 0 6px;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-panel-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 300;
  color: rgba(240, 238, 255, 0.4);
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 28px;
  animation: fadeUp 0.7s 0.3s ease both;
}

.auth-alert svg {
  width: 16px;
  height: 16px;
  color: #2563eb;
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-alert p {
  margin: 0;
  font-size: 12px;
  color: rgba(240, 238, 255, 0.55);
  line-height: 1.6;
}

.auth-alert strong {
  color: #2563eb;
  font-weight: 600;
}

.auth-form {
  display: grid;
}

.auth-form-group {
  margin-bottom: 18px;
  animation: fadeUp 0.7s 0.35s ease both;
}

.auth-form-group:nth-child(2) {
  animation-delay: 0.4s;
}

.auth-form label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(240, 238, 255, 0.38);
  margin-bottom: 8px;
}

.auth-form input {
  width: 100%;
  background: #0f172a !important;
  border: 1px solid rgba(148, 163, 184, 0.45) !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #f8fafc;
  opacity: 1;
  font-family: "Inter", "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 13px 16px;
  outline: none;
  border-radius: 8px;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.auth-form input::placeholder {
  color: rgba(226, 232, 240, 0.7);
}

.auth-form input:focus {
  border-color: rgba(59, 130, 246, 0.95) !important;
  background: #172554 !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.auth-form input:-webkit-autofill:active {
  -webkit-text-fill-color: #ffffff;
  caret-color: #ffffff;
  box-shadow: 0 0 0px 1000px #1a2236 inset;
  transition: background-color 9999s ease-out 0s;
}

.auth-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 28px;
  animation: fadeUp 0.7s 0.45s ease both;
}

.auth-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.auth-checkbox-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.auth-checkbox-wrap span {
  font-size: 12px;
  color: rgba(240, 238, 255, 0.45);
}

.auth-forgot {
  font-size: 12px;
  color: #2563eb;
  text-decoration: none;
}

.auth-forgot:hover {
  opacity: 0.7;
}

.auth-btn-login {
  width: 100%;
  height: 50px;
  background: #2563eb;
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-family: "Space Grotesk", "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.3s;
  animation: fadeUp 0.7s 0.5s ease both;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-btn-login::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.auth-btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.42);
}

.auth-btn-login:hover::before {
  opacity: 1;
}

.auth-btn-login:active {
  transform: translateY(0);
}

.auth-btn-login .login-btn-label {
  position: relative;
  z-index: 1;
}

.auth-btn-login .login-btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.auth-btn-login.is-loading {
  cursor: wait;
}

.auth-btn-login.is-loading .login-btn-spinner {
  opacity: 1;
  transform: scale(1);
  animation: spinLoader 0.75s linear infinite;
}

.auth-btn-login[disabled] {
  opacity: 0.85;
}

@keyframes spinLoader {
  to {
    transform: rotate(360deg);
  }
}

.auth-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 500;
  animation: fadeUp 0.7s 0.55s ease both;
}

.auth-twofa {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(45, 212, 160, 0.07);
  border: 1px solid rgba(45, 212, 160, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 20px;
  animation: fadeUp 0.7s 0.6s ease both;
}

.auth-twofa svg {
  width: 16px;
  height: 16px;
  color: #2dd4a0;
  flex-shrink: 0;
}

.auth-twofa span {
  font-size: 11px;
  color: rgba(45, 212, 160, 0.82);
  line-height: 1.5;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-left {
    display: none;
  }

  .auth-panel {
    padding: 40px 28px;
  }
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 120px;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 24px;
  color: var(--text-tertiary);
  font-size: 12px;
  letter-spacing: 0.02em;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 30;
}

.footer p {
  margin: 0;
  text-align: center;
}

.footer-copyright {
  text-align: center;
}

.footer-copyright a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.footer-copyright a:hover {
  text-decoration: underline;
}

/* ============ HERO ============ */
.hero {
  margin-bottom: 32px;
}

.hero-content {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
}

.hero-text {
  flex: 1;
  min-width: 280px;
}

.hero-user-card {
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: visible;
}

.hero-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-user-actions .account-trigger {
  flex: 1;
  min-width: 0;
}

.account-trigger {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  color: inherit;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.user-name {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-theme-toggle {
  flex-shrink: 0;
  min-height: 38px;
  padding: 8px 10px !important;
  border-color: var(--border) !important;
  background: var(--bg-subtle) !important;
}

.top-theme-toggle .theme-label {
  display: none;
}

.account-trigger-caret {
  font-size: 11px;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
}

.account-trigger[aria-expanded="true"] .account-trigger-caret {
  transform: rotate(180deg);
}

.hero-user-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 20px 50px -28px rgba(0, 0, 0, 0.55);
  z-index: 40;
  animation: accountDropIn 0.2s ease both;
}

.top-user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.top-user-avatar-lg {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.top-user-header-meta {
  min-width: 0;
}

.top-user-name-lg {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.top-user-email {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-user-role-wrap {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.top-user-separator {
  height: 1px;
  background: var(--border);
  margin: 8px 6px;
}

.top-user-action {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.top-user-action svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.top-user-action:hover {
  background: var(--bg-subtle);
}

.top-user-action.danger {
  color: var(--danger);
}

.top-user-action.danger:hover {
  background: var(--danger-light);
}

@keyframes accountDropIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.eyebrow {
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--primary);
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  font-family: "Space Grotesk", "Manrope", sans-serif;
}

.sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.shortcuts-hint {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.hint-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 700;
}

.hint-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: stretch;
}

.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: stretch;
}

.action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: 0 4px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.backup-restore-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.backup-restore-row select {
  min-width: 0;
}

.backup-info {
  margin: 0;
}

/* ============ LAYOUT ============ */
.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.layout.is-single-column {
  grid-template-columns: minmax(0, 1fr);
}

.editor-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.editor-kpi-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
}

.editor-kpi-label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
}

.editor-kpi-value {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.1;
}

.editor-kpi-link {
  justify-content: center;
}

.admin-tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
}

.admin-tab {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.admin-tab.is-active {
  background: var(--primary);
  color: #fff;
}

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: block;
}

@keyframes panelSlideInFromRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes panelSlideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.admin-panel.is-active.panel-slide-right {
  animation: panelSlideInFromRight 260ms ease;
}

.admin-panel.is-active.panel-slide-left {
  animation: panelSlideInFromLeft 260ms ease;
}

.analytics-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  margin-bottom: 24px;
}

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

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

.analytics-period {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.analytics-period-btn.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.analytics-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.analytics-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

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

.analytics-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--bg-subtle);
}

.analytics-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.analytics-value {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  margin-top: 6px;
}

.analytics-products {
  margin-top: 16px;
}

.analytics-products h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.analytics-measures-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.analytics-paging {
  position: fixed;
  left: calc(240px + 24px);
  right: 24px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  justify-content: space-between;
  margin: 0;
  border: 1px solid var(--border) !important;
  border-top: 1px solid var(--border) !important;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.analytics-paging strong {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 4px;
}

#analyticsMeasuresSection {
  padding-bottom: 96px;
}

.analytics-top-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 14px;
}

.analytics-funnel {
  margin-top: 16px;
}

.analytics-funnel h3,
.analytics-events h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.analytics-profiles {
  margin-top: 14px;
}

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.funnel-step {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--bg-subtle);
}

.funnel-step span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
}

.funnel-step strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.analytics-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.analytics-columns.is-single-focus {
  grid-template-columns: minmax(0, 1fr);
}

.analytics-columns.is-single-focus .analytics-products,
.analytics-columns.is-single-focus .analytics-events {
  margin-top: 0;
}

.analytics-charts {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.analytics-charts h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.analytics-top-chart {
  display: grid;
  gap: 10px;
}

.analytics-chart-row {
  display: grid;
  grid-template-columns: minmax(120px, 230px) 1fr auto;
  gap: 10px;
  align-items: center;
}

.analytics-chart-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-chart-track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.analytics-chart-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
}

.analytics-chart-value {
  font-size: 12px;
  font-weight: 700;
}

.analytics-chart-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Top produtos - card visual dedicado */
#adminRoot #analyticsTopChartSection {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

#adminRoot #analyticsTopChartSection > h3 {
  display: none;
}

#adminRoot .tp-chart-wrap {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.75rem;
  border: 0.5px solid rgba(0, 0, 0, 0.1);
}

#adminRoot .tp-chart-header {
  margin-bottom: 1.5rem;
}

#adminRoot .tp-chart-title {
  font-size: 16px;
  font-weight: 500;
  color: #1a1a18;
  margin-bottom: 4px;
}

#adminRoot .tp-chart-subtitle {
  font-size: 13px;
  color: #6b6b67;
}

#adminRoot .tp-summary-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

#adminRoot .tp-summary-card {
  flex: 1;
  background: #f1efe8;
  border-radius: 10px;
  padding: 12px 14px;
}

#adminRoot .tp-summary-label {
  font-size: 11px;
  color: #6b6b67;
  margin-bottom: 4px;
}

#adminRoot .tp-summary-value {
  font-size: 20px;
  font-weight: 500;
  color: #1a1a18;
}

#adminRoot .tp-divider {
  height: 0.5px;
  background: rgba(0, 0, 0, 0.1);
  margin: 18px 0;
}

#adminRoot .tp-chart-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

#adminRoot .tp-rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  flex-shrink: 0;
}

#adminRoot .tp-rank-1 { background: #fac775; color: #633806; }
#adminRoot .tp-rank-2 { background: #d3d1c7; color: #2c2c2a; }
#adminRoot .tp-rank-3 { background: #f5c4b3; color: #4a1b0c; }
#adminRoot .tp-rank-other { background: #f1efe8; color: #6b6b67; }

#adminRoot .tp-label-wrap {
  width: 200px;
  flex-shrink: 0;
}

#adminRoot .tp-label-name {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#adminRoot .tp-label-brand {
  font-size: 11px;
  color: #6b6b67;
  margin-top: 1px;
}

#adminRoot .tp-bar-area {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

#adminRoot .tp-bar-track {
  flex: 1;
  height: 28px;
  background: #f1efe8;
  border-radius: 6px;
  overflow: hidden;
}

#adminRoot .tp-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}

#adminRoot .tp-bar-fill-1 { background: #3266ad; }
#adminRoot .tp-bar-fill-2 { background: #3266ad; }
#adminRoot .tp-bar-fill-3 { background: #5a82bc; }
#adminRoot .tp-bar-fill-4 { background: #7a9dcc; }
#adminRoot .tp-bar-fill-5 { background: #9ab8db; }

#adminRoot .tp-bar-count {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a18;
  min-width: 28px;
  text-align: right;
}

#adminRoot .tp-footnote {
  font-size: 12px;
  color: #6b6b67;
  text-align: right;
  margin-top: 4px;
}

.analytics-pro-charts {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 12px;
}

.analytics-pro-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 14px;
}

.analytics-pro-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.analytics-pro-head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.analytics-pro-head p {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--text-secondary);
}

.analytics-pro-canvas {
  position: relative;
  height: 210px;
}

.analytics-pro-canvas.donut {
  height: 220px;
}

.analytics-donut-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.analytics-donut-center strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.analytics-donut-center small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-secondary);
}

.analytics-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  background: var(--surface);
}

.analytics-events-wrap {
  max-height: 412px;
  overflow-y: auto;
}

.analytics-columns.is-single-focus .analytics-events-wrap {
  max-height: 620px;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.analytics-table th,
.analytics-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
}

.analytics-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg-subtle);
}

.analytics-table tbody tr:last-child td {
  border-bottom: none;
}

.settings-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.settings-header h2 {
  margin: 0;
  font-size: 20px;
}

.settings-header p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.settings-subtabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.settings-subtab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.settings-subtab:hover {
  background: var(--bg-subtle);
}

.settings-subtab.is-active {
  background: var(--primary-light);
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--primary);
}

.settings-subpanel {
  display: none;
  margin-top: 14px;
}

.settings-subpanel.is-active {
  display: block;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.settings-grid.settings-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.settings-config-card {
  margin-top: 14px;
}

.settings-config-group {
  gap: 18px;
}

.settings-config-head p {
  margin: 6px 0 0;
}

.settings-config-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.settings-config-form {
  display: grid;
  gap: 14px;
}

.settings-config-topnav {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 12px;
  background: var(--admin-surface-2, var(--surface));
  overflow-x: auto;
}

.settings-config-topnav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--admin-text-muted, var(--text-secondary));
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.settings-config-topnav-btn.is-active {
  background: rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.38);
  color: #2563eb;
}

.settings-config-section-hidden {
  display: none !important;
}

.settings-pro-card {
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 14px;
  background: var(--admin-surface-2, var(--surface));
  overflow: hidden;
  box-shadow: 0 10px 28px -22px rgba(15, 23, 42, 0.35);
}

.settings-section-card {
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 14px;
  background: var(--admin-surface-2, var(--surface));
  overflow: hidden;
  box-shadow: 0 10px 28px -22px rgba(15, 23, 42, 0.35);
}

.settings-section-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--admin-border, var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-section-head-left {
  display: grid;
  gap: 2px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text, var(--text));
}

.settings-section-desc {
  font-size: 11.5px;
  color: var(--admin-text-muted, var(--text-secondary));
}

.settings-section-body {
  padding: 0;
}

.settings-sub-section {
  transition: opacity 180ms ease;
}

.settings-sub-section.is-collapsed {
  display: none;
}

.settings-sub-section.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.settings-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border, var(--border));
}

.settings-setting-row:last-child {
  border-bottom: 0;
}

.settings-setting-row-edge .settings-setting-control {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
}

.settings-setting-info {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.settings-setting-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text, var(--text));
}

.settings-setting-hint {
  font-size: 11.5px;
  color: var(--admin-text-muted, var(--text-secondary));
}

.settings-setting-control {
  width: min(520px, 100%);
  flex-shrink: 0;
}

.settings-row-input {
  width: 100%;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--admin-border, var(--border));
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text, var(--text));
  padding: 0 12px;
}

.settings-row-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.settings-row-textarea {
  min-height: 104px;
  height: auto;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.45;
  font-family: inherit;
}

.settings-media-pills {
  display: inline-flex;
  gap: 6px;
}

.settings-media-pill {
  border: 1px solid var(--admin-border, var(--border));
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text-muted, var(--text-secondary));
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.settings-media-pill.is-active {
  border-color: rgba(37, 99, 235, 0.52);
  background: rgba(37, 99, 235, 0.16);
  color: #2563eb;
}

.settings-hidden-select {
  display: none !important;
}

.settings-upload-zone {
  border: 1.5px dashed var(--admin-border, var(--border));
  border-radius: 10px;
  padding: 14px;
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 5px;
  text-align: center;
  cursor: pointer;
  background: var(--admin-surface, var(--surface));
}

.settings-upload-zone:hover {
  border-color: rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.07);
}

.settings-upload-zone input[type="file"] {
  display: none;
}

.settings-upload-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--admin-border, var(--border));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-text-muted, var(--text-secondary));
}

.settings-upload-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--admin-text, var(--text));
}

.settings-upload-hint {
  font-size: 11px;
  color: var(--admin-text-muted, var(--text-secondary));
}

.settings-section-body > .field-hint {
  margin: 0;
  padding: 0 18px 14px;
  font-size: 11.5px;
}

.settings-pro-card-head {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--admin-border, var(--border));
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.09), rgba(37, 99, 235, 0.02));
}

.settings-pro-card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--admin-text, var(--text));
}

.settings-pro-card-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--admin-text-muted, var(--text-secondary));
}

.settings-pro-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border, var(--border));
}

.settings-pro-row.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.settings-pro-row-switch-edge {
  grid-template-columns: minmax(0, 1fr) auto;
}

.settings-pro-row-switch-edge .settings-switch {
  justify-self: end;
  margin-left: auto;
}

.settings-pro-card > .settings-pro-row:last-child {
  border-bottom: 0;
}

.settings-pro-copy {
  display: grid;
  gap: 2px;
}

.settings-pro-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text, var(--text));
}

.settings-pro-hint {
  margin: 0;
  font-size: 11.5px;
  color: var(--admin-text-muted, var(--text-secondary));
}

.settings-pro-row-colors .settings-color-input-wrap {
  justify-self: end;
}

.settings-pro-row > input[type="text"],
.settings-pro-row > input[type="tel"],
.settings-pro-row > input[type="number"] {
  width: 100%;
  max-width: 560px;
  justify-self: stretch;
  min-width: 0;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--admin-border, var(--border));
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text, var(--text));
  padding: 0 12px;
}

.settings-pro-row > textarea {
  width: 100%;
  max-width: 560px;
  justify-self: stretch;
  min-width: 0;
}

.settings-pro-row.settings-pro-row-textarea {
  align-items: flex-start;
}

.settings-pro-row.settings-pro-row-tips {
  align-items: flex-start;
}

.settings-pro-row-inline {
  align-items: flex-start;
}

.settings-inline-pair {
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  justify-self: stretch;
}

.settings-inline-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--admin-text-muted, var(--text-secondary));
}

.settings-inline-field span {
  font-weight: 600;
}

.settings-tips-editor {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.settings-tips-list {
  display: grid;
  gap: 8px;
}

.settings-tip-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.settings-tip-input {
  width: 100%;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--admin-border, var(--border));
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text, var(--text));
  padding: 0 12px;
}

.settings-tip-input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

#previewExternalTableButton {
  width: min(320px, 100%);
}

.settings-external-preview-btn {
  width: min(320px, 100%);
  min-height: 40px;
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
}

.settings-pro-row-modal-preview {
  align-items: flex-start;
  grid-template-columns: 1fr;
  gap: 12px;
}

.settings-table-modal-preview {
  width: 100%;
  max-width: 900px;
}

.settings-table-modal-card {
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 38px -24px rgba(15, 23, 42, 0.45);
  overflow: hidden;
}

.settings-table-modal-bar {
  height: 4px;
  background: linear-gradient(90deg, #111827, #0f172a);
}

.settings-table-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 10px;
}

.settings-table-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-table-modal-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-table-modal-icon img {
  width: 18px;
  height: 18px;
}

.settings-table-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
}

.settings-table-modal-subtitle {
  margin: 1px 0 0;
  font-size: 11px;
  color: #64748b;
}

.settings-table-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 18px;
  line-height: 1;
}

.settings-table-modal-body {
  padding: 0 14px 14px;
  display: grid;
  gap: 10px;
}

.settings-table-modal-note {
  margin: 0;
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 9px 10px;
}

.settings-table-section-label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.settings-table-size-row {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  gap: 8px;
  align-items: center;
}

.settings-table-size-nav {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 16px;
}

.settings-table-size-track {
  display: flex;
  gap: 8px;
  overflow: hidden;
}

.settings-table-size-btn {
  min-width: 42px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
}

.settings-table-size-btn-active {
  background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
  border-color: #111827;
  color: #ffffff;
}

.settings-table-measure-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.settings-table-measure-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  color: #334155;
}

.settings-table-measure-row:last-child {
  border-bottom: 0;
}

.settings-table-measure-row strong {
  color: #0f172a;
}

.settings-table-full-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #ffffff;
}

.settings-table-full-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}

.settings-table-full-scroll {
  overflow-x: auto;
}

.settings-table-full {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  font-size: 11px;
}

.settings-table-full th,
.settings-table-full td {
  border: 1px solid #e2e8f0;
  padding: 6px 7px;
  text-align: center;
}

.settings-table-full th {
  background: #111827;
  color: #ffffff;
  font-weight: 700;
}

.settings-table-full .is-recommended td {
  background: #ecfdf3;
}

.settings-table-full .is-recommended td strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  min-height: 20px;
  border-radius: 6px;
  background: #111827;
  color: #ffffff;
}

.settings-table-modal-cta {
  width: 100%;
  min-height: 40px;
  border-radius: 9px;
  border: 1px solid #111827;
  background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
}

.settings-table-modal-preview .cosh-medidas-modal {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 760px;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.25);
  border: 1px solid #e5e7eb;
  animation: coshMedidasModalIn 0.35s cubic-bezier(0.34, 1.36, 0.64, 1);
  will-change: transform, opacity;
  background: #ffffff;
  overflow: hidden;
  --cosh-medidas-primary: #111827;
  --cosh-medidas-primary-strong: #0f172a;
  --cosh-medidas-on-primary: #ffffff;
  --cosh-medidas-primary-soft: #f3f4f6;
}

.settings-table-modal-preview .cosh-medidas-modal-bar {
  height: 3px;
  background: linear-gradient(90deg, #9ca3af 0%, #111827 50%, #9ca3af 100%);
}

.settings-table-modal-preview .cosh-medidas-modal-header {
  padding: 20px 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.settings-table-modal-preview .cosh-medidas-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.settings-table-modal-preview .cosh-medidas-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cosh-medidas-primary) 0%, var(--cosh-medidas-primary-strong) 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cosh-medidas-on-primary);
  flex-shrink: 0;
}

.settings-table-modal-preview .cosh-medidas-header-icon img {
  width: 20px;
  height: 20px;
  display: block;
}

.settings-table-modal-preview .cosh-medidas-title-wrap {
  min-width: 0;
}

.settings-table-modal-preview .cosh-medidas-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  color: #111827;
  letter-spacing: -0.2px;
}

.settings-table-modal-preview .cosh-medidas-modal-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: #6b7280;
}

.settings-table-modal-preview .cosh-medidas-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.settings-table-modal-preview .cosh-medidas-close-btn:hover {
  background: #f3f4f6;
  color: #111827;
  transform: rotate(90deg);
}

.settings-table-modal-preview .cosh-medidas-modal-body {
  padding: 20px 24px 24px;
  overflow-y: visible;
  flex: initial;
  min-height: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.settings-table-modal-preview .cosh-medidas-modal-note {
  margin: 0 0 14px 0;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.5;
}

.settings-table-modal-preview .cosh-medidas-section-label {
  margin: 0 0 10px 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: #6b7280;
}

.settings-table-modal-preview .cosh-medidas-size-selector {
  width: 100%;
  overflow: hidden;
}

.settings-table-modal-preview .cosh-medidas-size-carousel {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
}

.settings-table-modal-preview .cosh-medidas-size-nav {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--cosh-medidas-primary);
  background: #ffffff;
  color: var(--cosh-medidas-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.settings-table-modal-preview .cosh-medidas-size-nav:hover {
  background: var(--cosh-medidas-primary);
  color: var(--cosh-medidas-on-primary);
}

.settings-table-modal-preview .cosh-medidas-size-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.settings-table-modal-preview .cosh-medidas-size-track {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 32px) / 5);
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x mandatory;
}

.settings-table-modal-preview .cosh-medidas-size-track::-webkit-scrollbar {
  display: none;
}

.settings-table-modal-preview .cosh-medidas-size-btn {
  min-width: 0;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  scroll-snap-align: start;
}

.settings-table-modal-preview .cosh-medidas-size-btn:hover {
  border-color: var(--cosh-medidas-primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.settings-table-modal-preview .cosh-medidas-size-btn.active {
  border-color: var(--cosh-medidas-primary);
  background: linear-gradient(135deg, var(--cosh-medidas-primary) 0%, var(--cosh-medidas-primary-strong) 100%);
  color: var(--cosh-medidas-on-primary);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.settings-table-modal-preview .cosh-medidas-card {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.settings-table-modal-preview .cosh-medidas-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.settings-table-modal-preview .cosh-medidas-row:last-child {
  border-bottom: none;
}

.settings-table-modal-preview .cosh-medidas-row-name {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.settings-table-modal-preview .cosh-medidas-row-value {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  letter-spacing: -0.1px;
  text-wrap: nowrap;
}

.settings-table-modal-preview .cosh-modelo-medidas {
  margin-top: 14px;
  margin-bottom: 8px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 480px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  padding: 14px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.settings-table-modal-preview .cosh-medidas-table-toggle {
  margin-top: 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-table-modal-preview .cosh-medidas-view-btn {
  background: none;
  border: none;
  color: var(--cosh-medidas-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-table-modal-preview .cosh-medidas-view-btn svg {
  transition: transform 0.2s;
}

.settings-table-modal-preview .cosh-medidas-view-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.settings-table-modal-preview .cosh-medidas-full-table {
  display: none;
  margin-top: 8px;
}

.settings-table-modal-preview .cosh-medidas-full-table.open {
  display: block;
  animation: coshMedidasSlideDown 0.25s ease;
}

.settings-table-modal-preview .cosh-medidas-full-table.open .cosh-modelo-medidas {
  margin-left: auto;
  margin-right: auto;
}

.settings-table-modal-preview .cosh-medidas-full-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #111827;
}

.settings-table-modal-preview .cosh-pv-table-wrap {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  padding: 10px;
  margin-bottom: 12px;
  overflow-x: auto;
}

.settings-table-modal-preview .cosh-pv-table {
  width: 100%;
  margin-top: 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}

.settings-table-modal-preview .cosh-pv-table th,
.settings-table-modal-preview .cosh-pv-table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.settings-table-modal-preview .cosh-pv-table td {
  color: #374151;
  font-weight: 500;
}

.settings-table-modal-preview .cosh-pv-table th {
  background: var(--cosh-medidas-primary);
  color: var(--cosh-medidas-on-primary);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.settings-table-modal-preview .cosh-pv-table tbody tr:last-child td {
  border-bottom: none;
}

.settings-table-modal-preview .cosh-pv-table tr.cosh-recommended,
.settings-table-modal-preview .cosh-pv-table tr.is-recommended {
  background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 100%) !important;
}

.settings-table-modal-preview .cosh-pv-table tr.cosh-recommended td strong,
.settings-table-modal-preview .cosh-pv-table tr.is-recommended td strong {
  background: linear-gradient(135deg, var(--cosh-medidas-primary), var(--cosh-medidas-primary-strong));
  color: var(--cosh-medidas-on-primary);
  border-radius: 8px;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
}

.settings-table-modal-preview .cosh-modelo-medidas-title {
  margin: 0 auto 10px auto;
  color: var(--cosh-medidas-on-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  display: flex;
  width: fit-content;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cosh-medidas-primary) 0%, var(--cosh-medidas-primary-strong) 100%);
}

.settings-table-modal-preview .cosh-modelo-medidas-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.settings-table-modal-preview .cosh-modelo-medidas-table th,
.settings-table-modal-preview .cosh-modelo-medidas-table td {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
}

.settings-table-modal-preview .cosh-modelo-medidas-table th {
  background: #f9fafb;
  color: #4b5563;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.settings-table-modal-preview .cosh-modelo-medidas-table td {
  background: #ffffff;
  color: var(--cosh-medidas-primary);
  font-weight: 700;
  font-size: 13px;
}

.settings-table-modal-preview .cosh-modelo-medidas-table tr:last-child td {
  border-bottom: none;
}

.settings-table-modal-preview .cosh-medidas-cta-btn {
  width: 100%;
  margin-top: 16px;
  padding: 13px 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cosh-medidas-primary) 0%, var(--cosh-medidas-primary-strong) 100%);
  color: var(--cosh-medidas-on-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.settings-table-modal-preview .cosh-medidas-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

@keyframes coshMedidasModalIn {
  from { transform: translateY(24px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes coshMedidasSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .settings-table-modal-preview .cosh-medidas-modal {
    max-width: 100%;
  }
}

.settings-pro-row > input[type="text"]:focus,
.settings-pro-row > input[type="tel"]:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.settings-pro-hint code {
  font-family: "Monaco", "Courier New", monospace;
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 6px;
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text, var(--text));
}

.settings-color-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-color-input-wrap input[type="color"] {
  width: 44px;
  height: 36px;
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 9px;
  padding: 2px;
  background: var(--admin-surface, var(--surface));
  cursor: pointer;
}

.settings-color-input-wrap input[type="text"] {
  min-height: 36px;
  min-width: 116px;
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 9px;
  padding: 0 11px;
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text, var(--text));
  min-width: 0;
  font-family: "Monaco", "Courier New", monospace;
  letter-spacing: 0.02em;
  font-size: 12px;
}

.settings-color-input-wrap input[type="text"]:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.settings-phone-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: min(300px, 100%);
}

.settings-phone-input-wrap span {
  min-height: 38px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--admin-border, var(--border));
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text-muted, var(--text-secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.settings-phone-input-wrap input {
  width: 100%;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--admin-border, var(--border));
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text, var(--text));
  padding: 0 12px;
}

.settings-phone-input-wrap input:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.settings-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.settings-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--admin-border, var(--border));
  background: rgba(148, 163, 184, 0.2);
  transition: 180ms ease;
}

.settings-switch-thumb {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.28);
  transition: 180ms ease;
}

.settings-switch input:checked + .settings-switch-track {
  background: rgba(37, 99, 235, 0.24);
  border-color: rgba(37, 99, 235, 0.52);
}

.settings-switch input:checked ~ .settings-switch-thumb {
  transform: translateX(20px);
  background: #2563eb;
}

.settings-config-measure-controls {
  display: grid;
  gap: 0;
}

.settings-config-measure-controls.is-hidden {
  display: none;
}

.settings-config-measure-controls .settings-pro-row:last-of-type {
  border-bottom: 1px solid var(--admin-border, var(--border));
}

.settings-config-measure-controls select {
  min-height: 38px;
  min-width: 160px;
  border-radius: 9px;
  border: 1px solid var(--admin-border, var(--border));
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text, var(--text));
  padding: 0 36px 0 10px;
}

.settings-config-measure-controls select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.settings-upload-label {
  width: min(340px, 100%);
}

.settings-upload-label input[type="file"] {
  width: 100%;
  min-height: 38px;
  border: 1px dashed var(--admin-border, var(--border));
  border-radius: 9px;
  background: var(--admin-surface, var(--surface));
  color: var(--admin-text-muted, var(--text-secondary));
  font-size: 12px;
  padding: 7px 10px;
}

.settings-config-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 6px 0 0;
}

.settings-config-actions .field-hint {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
}

.settings-config-preview-wrap {
  position: static;
}

.settings-config-preview {
  border: 1px solid var(--admin-border, var(--border));
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.98));
  padding: 16px;
  box-shadow: 0 20px 42px -28px rgba(15, 23, 42, 0.45);
}

.settings-preview-eyebrow {
  margin: 0 0 3px;
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.settings-config-preview h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--text);
}

.settings-preview-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.settings-preview-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.settings-preview-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.settings-preview-main-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  background: #2563eb;
  color: #ffffff;
}

.settings-preview-inline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}

.settings-preview-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-subtle);
}

.settings-preview-measure {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.settings-preview-measure-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.settings-preview-media-empty {
  font-size: 12px;
  color: var(--text-secondary);
}

.settings-preview-media-image {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.settings-preview-media-video {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  background: #000;
}

.settings-pv-shell {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.08);
  padding: 14px;
  overflow: auto;
}

.pv-preview-host .cosh-pv-modal-content {
  background: #ffffff;
  border-radius: 12px;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  position: relative;
  margin: 0 auto;
  border: 0;
}

.pv-preview-host .cosh-pv-header {
  background: #ffffff;
  color: #111827;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 5;
}

.pv-preview-host .cosh-pv-flex-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.pv-preview-host .cosh-pv-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #111827;
}

.pv-preview-host .cosh-pv-sub {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

.pv-preview-host .cosh-saved-badge {
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.pv-preview-host .cosh-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pv-preview-host .cosh-spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  border-top-color: #111827;
  animation: spin360 0.8s linear infinite;
}

.pv-preview-host .cosh-loading-text {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

@keyframes spin360 {
  to { transform: rotate(360deg); }
}

.pv-preview-host .cosh-pv-body {
  padding: 20px 24px;
}

.pv-preview-host .cosh-pv-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.pv-preview-host .cosh-pv-input-group {
  margin-bottom: 16px;
}

.pv-preview-host .cosh-pv-input-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
}

.pv-preview-host .cosh-pv-input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d1d5db !important;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  background: #ffffff !important;
  color: #111827 !important;
  -webkit-appearance: none;
  appearance: none;
}

.pv-preview-host .cosh-pv-input-group input[readonly] {
  border: 1px solid #d1d5db !important;
  background: #ffffff !important;
  color: #111827 !important;
  opacity: 1;
}

.pv-preview-host .cosh-pv-input-group input:hover {
  border-color: #9ca3af !important;
}

.pv-preview-host .cosh-pv-input-group input:focus {
  outline: none;
  border-color: #111827 !important;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.05);
  background: #ffffff !important;
}

.pv-preview-host .cosh-pv-size-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pv-preview-host .cosh-pv-size-chip {
  padding: 10px 18px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
}

.pv-preview-host .cosh-pv-size-chip.cosh-selected {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.pv-preview-host .cosh-pv-btn-primary {
  width: 100%;
  padding: 14px;
  background: #111827;
  color: #ffffff;
  border: 1px solid #111827;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pv-preview-host .cosh-clear-data-btn {
  margin-top: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff1f2;
  color: #9f1239;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.pv-preview-host .cosh-pv-whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-weight: 600;
  margin-top: 12px;
  width: 100%;
  font-size: 14px;
}

.pv-preview-host .cosh-table-toggle-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.pv-preview-host .cosh-pv-close-btn {
  background: #f3f4f6;
  color: #6b7280;
  border: none;
  cursor: default;
  padding: 8px;
  border-radius: 6px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 22px;
}

.pv-preview-host .cosh-pv-result-card {
  background: #f0fdf4;
  border: 2px solid #86efac;
  border-radius: 8px;
  padding: 24px;
  margin-top: 0;
}

.pv-preview-host .cosh-size-carousel {
  position: relative;
  margin: 10px 0 18px;
}

.pv-preview-host .cosh-size-carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 0;
}

.pv-preview-host .cosh-size-carousel-track::-webkit-scrollbar {
  display: none;
}

.pv-preview-host .cosh-size-option {
  flex: 0 0 100%;
  width: 100%;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
}

.pv-preview-host .cosh-size-option.active {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  border-color: #10b981 !important;
  border-width: 3px !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.22) !important;
}

.pv-preview-host .cosh-size-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pv-preview-host .cosh-size-option-number {
  font-size: 36px;
  font-weight: 800;
  color: #047857;
}

.pv-preview-host .cosh-size-status-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pv-preview-host .cosh-size-status-badge.perfect {
  background: #10b981 !important;
  color: #ffffff !important;
}

.pv-preview-host .cosh-size-status-badge.tight {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.pv-preview-host .cosh-size-status-badge.loose {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pv-preview-host .cosh-size-status-badge.loose.recommended {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.pv-preview-host .cosh-size-option-description {
  font-size: 13px;
  line-height: 1.6;
  color: #065f46;
  margin: 0;
  font-weight: 500;
}

.pv-preview-host .cosh-selected-badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.pv-preview-host .cosh-fit-direction {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #f3f4f6;
  color: #374151;
}

.pv-preview-host .cosh-fit-direction.recommended {
  background: #d1fae5;
  color: #065f46;
}

.pv-preview-host .cosh-size-option-measures {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pv-preview-host .cosh-measure-item-mini {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
}

.pv-preview-host .cosh-measure-label-mini {
  font-size: 11px;
  color: #64748b;
}

.pv-preview-host .cosh-measure-value-mini {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.pv-preview-host .cosh-carousel-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.pv-preview-host .cosh-carousel-btn {
  background: #111827;
  color: #ffffff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.pv-preview-host .cosh-carousel-dots {
  display: flex;
  gap: 8px;
}

.pv-preview-host .cosh-carousel-dot {
  width: 24px;
  height: 8px;
  border-radius: 4px;
  background: #111827;
  display: inline-block;
}

.pv-preview-host .cosh-carousel-dot:not(.active) {
  opacity: 0.35;
}

.pv-preview-host .cosh-swipe-hint {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
}

.pv-preview-host .cosh-pv-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 12px;
  color: #111827;
}

#adminRoot #previewTableSection,
#adminRoot #previewTableSection .cosh-pv-section-title,
#adminRoot #previewTableSection .cosh-pv-section-title svg {
  color: #0f172a !important;
  opacity: 1 !important;
}

.pv-preview-host .cosh-how-to-measure-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  min-height: 38px;
}

.pv-preview-host .cosh-how-to-measure-btn small {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  font-weight: 700;
}

.pv-preview-host .cosh-altura-warning {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 8px 10px;
}

.pv-preview-host .cosh-altura-warning strong {
  display: block;
  margin-bottom: 4px;
}

.pv-preview-host .cosh-altura-link-btn {
  display: inline-flex;
  margin-top: 6px;
  color: #92400e;
  font-weight: 700;
  text-decoration: underline;
}

.pv-preview-host .cosh-infobox {
  position: relative;
  background: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 20px 24px;
  margin: 18px 0;
  display: flex;
  align-items: start;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.pv-preview-host .cosh-infobox.success {
  background: #ffffff;
}

.pv-preview-host .cosh-infobox::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #0ea5e9 0%, #0284c7 100%);
  border-radius: 16px 0 0 16px;
}

.pv-preview-host .cosh-infobox:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.pv-preview-host .cosh-infobox-icon {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
  position: relative;
}

.pv-preview-host .cosh-infobox.success .cosh-infobox-icon {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
}

.pv-preview-host .cosh-infobox-icon::after {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3) 0%, rgba(2, 132, 199, 0.3) 100%);
  border-radius: 14px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}

.pv-preview-host .cosh-infobox.success .cosh-infobox-icon::after {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(22, 163, 74, 0.3) 100%);
}

.pv-preview-host .cosh-infobox:hover .cosh-infobox-icon::after {
  opacity: 1;
}

.pv-preview-host .cosh-infobox-content {
  flex: 1;
  line-height: 1.6;
}

.pv-preview-host .cosh-infobox-title {
  font-weight: 700;
  color: #111827;
  font-size: 15px;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pv-preview-host .cosh-infobox.success .cosh-infobox-title {
  color: #166534;
}

.pv-preview-host .cosh-infobox.success::before {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.pv-preview-host .cosh-infobox.success .cosh-infobox-text {
  color: #15803d;
}

.pv-preview-host .cosh-infobox-text {
  font-size: 14px;
  color: #374151;
  margin: 0;
  line-height: 1.6;
}

#adminRoot .pv-preview-host .cosh-infobox-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.pv-preview-host .cosh-infobox-text {
  font-size: 14px;
  color: #374151;
}

.pv-preview-host .cosh-pv-back-btn {
  margin-top: 8px;
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  padding: 11px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.settings-pv-real-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(680px, 1fr));
  gap: 18px;
  align-items: start;
}

.settings-pv-stage {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.settings-pv-stage.settings-pv-stage-enter {
  animation: settingsPvStageIn 0.28s cubic-bezier(0.22, 0.9, 0.32, 1);
}

@keyframes settingsPvStageIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.settings-pv-stage-label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

.settings-pv-stage-label-inline {
  margin-bottom: 6px;
}

.settings-pv-stage-launcher {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.03);
}

.settings-launcher-preview-row {
  display: grid;
  gap: 6px;
}

.settings-launcher-preview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.settings-launcher-preview-btn img,
.settings-launcher-preview-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.settings-launcher-preview-btn img {
  filter: var(--launcher-icon-filter, brightness(0) saturate(100%));
}

.settings-external-preview-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.settings-external-preview-btn .cosh-tabela-icon-inline {
  width: 16px !important;
  height: 16px !important;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
  filter: var(--external-table-icon-filter, brightness(0) saturate(100%));
}

.settings-launcher-preview-btn > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.settings-launcher-preview-btn > span > span {
  display: inline-block;
  line-height: 1.1;
}

.settings-external-preview-btn > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
}

.settings-external-preview-btn > span > span {
  display: inline-block;
  line-height: 1.1;
}

.settings-pv-modal-content {
  width: 100%;
  min-height: 520px;
  max-height: 76vh;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 18px 48px -26px rgba(0, 0, 0, 0.35);
}

.settings-pv-modal-content-result {
  min-height: 0;
}

.settings-pv-header {
  padding: 18px 18px 12px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.settings-pv-title {
  margin: 0 0 5px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  color: #111827;
}

.settings-pv-sub {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.settings-pv-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 22px;
  line-height: 1;
  cursor: default;
}

.settings-pv-body {
  padding: 16px 18px 20px;
  display: grid;
  gap: 14px;
}

.settings-pv-tip-row {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.settings-pv-tip-copy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.settings-pv-tip-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #0ea5e9;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.settings-pv-tip-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #0c4a6e;
}

.settings-pv-howto-card {
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.settings-pv-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-pv-input-group {
  display: grid;
  gap: 6px;
}

.settings-pv-input-group label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.settings-pv-input-group input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
}

.settings-pv-size-group {
  display: grid;
  gap: 8px;
}

.settings-pv-size-group label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.settings-pv-size-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-pv-size-chip {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #111827;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
}

.settings-pv-size-chip.is-active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.settings-pv-btn-primary {
  width: 100%;
  border: 1px solid #111827;
  background: #111827;
  color: #ffffff;
  border-radius: 8px;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
}

.settings-pv-whatsapp {
  width: 100%;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  border-radius: 8px;
  min-height: 46px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
}

.settings-pv-result-card {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  display: grid;
  gap: 4px;
}

.settings-pv-result-size {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  color: #166534;
  line-height: 1;
}

.settings-pv-result-fit {
  margin: 0;
  font-size: 13px;
  color: #166534;
}

.settings-pv-table-head {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.settings-pv-table-toggle {
  width: 100%;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
}

.auth-session-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--bg-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.auth-session-card p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.user-access-card {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--bg-subtle);
}

.user-access-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-access-header h3 {
  margin: 0;
  font-size: 16px;
}

.user-access-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.user-access-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 12px;
}

.user-access-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-access-error {
  margin: 0;
  min-height: 18px;
  font-size: 12px;
  color: var(--danger);
}

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

.user-access-list {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.user-access-list .analytics-table {
  min-width: 0;
}

.user-access-list .analytics-table th:nth-child(1),
.user-access-list .analytics-table td:nth-child(1) {
  width: 20%;
}

.user-access-list .analytics-table th:nth-child(2),
.user-access-list .analytics-table td:nth-child(2) {
  width: 34%;
}

.user-access-list .analytics-table th:nth-child(3),
.user-access-list .analytics-table td:nth-child(3) {
  width: 12%;
}

.user-access-list .analytics-table th:nth-child(4),
.user-access-list .analytics-table td:nth-child(4) {
  width: 12%;
}

.user-access-list .analytics-table th:nth-child(5),
.user-access-list .analytics-table td:nth-child(5) {
  width: 22%;
  text-align: right;
}

.user-access-list .user-actions-inline {
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
}

.user-access-list .analytics-table td:nth-child(2) {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .user-access-list .user-actions-inline {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.user-modal {
  width: min(520px, calc(100% - 32px));
}

.user-modal form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-modal .confirm-actions {
  justify-content: flex-end;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* Lista de produtos: remove o "card" antigo (fundo duplo arredondado) */
#adminRoot #editorSidebarSection.sidebar {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  position: static;
  top: auto;
  max-height: none;
}

.sidebar-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  flex-wrap: nowrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.sku-meta {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.sidebar-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.sku-count {
  font-size: 12px;
  color: var(--text-tertiary);
}

.sync-status {
  font-size: 11px;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sync-status.online {
  color: var(--success);
}

.dirty-status {
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 4px;
}

.sku-meta > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dirty-status.is-dirty {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  transition: opacity 0.2s ease;
}


.search-box input {
  width: 100%;
  padding: 10px 12px 10px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg-subtle);
  transition: all 0.2s;
}

#search {
  padding-left: 42px !important;
}

.filter-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-box label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-box select {
  width: 100%;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.products-admin {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}

.products-grid-wrap {
  position: relative;
}

.products-grid-wrap.is-list-loading .products-grid tbody {
  filter: blur(1.8px);
  pointer-events: none;
  user-select: none;
}

.products-grid-wrap.is-list-loading::before {
  content: none;
}

.products-grid-wrap.is-list-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  margin-left: -15px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--primary) 40%, var(--border) 60%);
  border-top-color: var(--primary);
  animation: productsListSpin 0.8s linear infinite;
  z-index: 16;
}

@keyframes productsListSpin {
  to {
    transform: rotate(360deg);
  }
}

.products-header-filter,
.customers-header-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: color-mix(in srgb, var(--surface) 72%, var(--bg-subtle) 28%);
}

.products-filter-main,
.customers-filter-main {
  flex: 1 1 220px;
  min-width: 0;
}

.customers-search-wrap {
  position: relative;
}

.customers-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.products-filter-side,
.customers-filter-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 260px;
  flex-wrap: wrap;
}

.fi {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.fi-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.customers-search-wrap .fi-sm {
  width: 100%;
  height: 38px;
  padding-left: 34px;
}

.fi-select {
  min-width: 168px;
}

.fi:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.customers-filter-side .btn {
  height: 38px;
  border-radius: 11px;
  padding: 0 14px;
  font-weight: 700;
}

.x-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.products-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.products-actions.x-toolbar-row {
  padding-left: 10px;
}

.products-actions.x-toolbar-row .products-toolbar-btn.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 9px;
}

.products-toolbar-btn .order-include-main-icon {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.products-toolbar-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.products-grid-wrap {
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: auto;
  background: var(--surface);
  min-height: 0;
  max-height: calc(100vh - 320px);
}

.products-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.products-grid thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, var(--bg-subtle) 8%);
  position: sticky;
  top: 0;
  z-index: 8;
}

.products-grid tbody td {
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

.products-grid thead th:not(:last-child),
.products-grid tbody td:not(:last-child) {
  border-right: 1px solid var(--border);
}

.products-grid thead th:first-child,
.products-grid tbody td:first-child {
  width: 40px;
  text-align: center;
  white-space: nowrap;
  padding-left: 6px;
  padding-right: 6px;
}

.products-grid thead th:nth-child(2),
.products-grid tbody td:nth-child(2) {
  width: 1%;
  white-space: nowrap;
  padding-left: 6px;
  padding-right: 8px;
}

.products-select-cell {
  text-align: center;
}

.products-id-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.products-row-check {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
}

.devop-check-all {
  appearance: auto;
  border-radius: 2px;
}

.products-grid tbody tr:last-child td {
  border-bottom: none;
}

.products-row {
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.products-row:hover {
  background: var(--primary-light);
}

.products-row.is-active {
  background: color-mix(in srgb, var(--primary-light) 72%, transparent);
}

.t-id {
  font-weight: 700;
  color: var(--text);
}

.t-bold {
  display: block;
  font-weight: 700;
  color: var(--text);
  line-height: 1.05;
  font-size: 13px;
}

.product-row-meta {
  display: block;
  margin-top: 0;
  font-size: 9px;
  color: var(--text-secondary);
  line-height: 1.05;
}

.products-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  gap: 5px;
}

.products-type-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
}

.products-type-badge.is-active {
  color: #065f46;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.14);
}

.products-type-badge.is-inactive {
  color: #991b1b;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] .products-type-badge.is-active {
  color: #9df5d1;
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .products-type-badge.is-inactive {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.18);
}

.products-type-badge.type-calca-jeans {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.35);
  background: rgba(20, 184, 166, 0.15);
}

.products-type-badge.type-shorts {
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, 0.35);
  background: rgba(59, 130, 246, 0.15);
}

.products-type-badge.type-bermuda {
  color: #7c2d12;
  border-color: rgba(124, 45, 18, 0.35);
  background: rgba(251, 146, 60, 0.16);
}

[data-theme="dark"] .products-type-badge.type-calca-jeans {
  color: #99f6e4;
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.2);
}

[data-theme="dark"] .products-type-badge.type-shorts {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .products-type-badge.type-bermuda {
  color: #fed7aa;
  border-color: rgba(251, 146, 60, 0.45);
  background: rgba(251, 146, 60, 0.2);
}

.products-actions-inline {
  display: flex;
  align-items: center;
  gap: 5px;
}

.product-preview-hover-card {
  position: fixed;
  z-index: 140;
  min-width: 170px;
  max-width: 210px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d7deea;
  background: #ffffff;
  box-shadow: 0 16px 34px -22px rgba(15, 23, 42, 0.55);
  pointer-events: none;
}

.product-preview-hover-card.is-hidden {
  display: none;
}

.product-preview-hover-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 700;
}

.product-preview-hover-sku {
  margin-top: 2px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.product-preview-hover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: #475569;
  border-top: 1px solid #eef2f7;
  padding-top: 6px;
  margin-top: 6px;
}

.product-preview-hover-row strong {
  font-size: 12px;
  color: #0f172a;
}

[data-theme="dark"] .product-preview-hover-card {
  border-color: #2e3a4f;
  background: #121b2a;
  box-shadow: 0 18px 34px -18px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .product-preview-hover-title {
  color: #9caec9;
}

[data-theme="dark"] .product-preview-hover-sku,
[data-theme="dark"] .product-preview-hover-row strong {
  color: #eef4ff;
}

[data-theme="dark"] .product-preview-hover-row {
  color: #b8c6de;
  border-top-color: #273247;
}

.product-action-btn.btn-sm {
  min-width: 58px;
  height: 22px;
  padding: 0 10px;
  font-size: 10px;
}

.product-action-icon-btn.btn-sm {
  min-width: 26px;
  width: 26px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid #d6d9dd;
  background: #f4f5f7;
  color: #4b5563;
  box-shadow: none;
}

.product-action-icon-btn svg {
  width: 13px;
  height: 13px;
}

.product-action-icon-btn.btn-sm:hover:not(:disabled) {
  background: #eceff3;
  border-color: #c8ced6;
  color: #374151;
}

.product-action-icon-btn.devop-delete.btn-sm {
  border-color: #f3c3c3;
  background: #fde8e8;
  color: #ef4444;
}

.product-action-icon-btn.devop-delete.btn-sm:hover:not(:disabled) {
  border-color: #f1a9a9;
  background: #fcd9d9;
  color: #dc2626;
}

.products-empty-cell {
  padding: 20px 12px !important;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

.products-paging {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: static;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  margin-top: 0;
}

.orders-paging-left,
.orders-paging-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.xpg-btn {
  height: 30px;
  min-width: 30px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: all 0.15s ease;
}

.xpg-btn svg {
  display: block;
  margin: 0 auto;
}

.xpg-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.xpg-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.xpg-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
}

.xpg-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.xpg-page-input {
  width: 60px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
}

.xpg-per-page {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
}

.xpg-page-input:focus,
.xpg-per-page:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 660px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  margin-right: -4px;
}

.product-list::-webkit-scrollbar {
  width: 6px;
}

.product-list::-webkit-scrollbar-track {
  background: transparent;
}

.product-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.product-list button {
  text-align: left;
  border: 1px solid var(--border);
  padding: 12px 14px 12px 34px;
  border-radius: var(--radius);
  background: var(--surface-strong);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
  transition: all 0.15s ease;
  font-family: "Manrope", sans-serif;
  position: relative;
}

.product-item-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.product-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-item-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.product-item-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-item-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.product-item-edit {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px dashed var(--primary);
  background: transparent;
  color: var(--primary);
}

.product-item-meta {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-list button::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
  transform: translateY(-50%);
}

.product-list button.sku-active::before {
  background: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.product-list button.sku-inactive::before {
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.product-list button:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(2px);
}

.product-list button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-weight: 600;
}

.product-list button.active .product-item-type {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.product-list button.active .product-item-edit {
  border-color: rgba(255, 255, 255, 0.75);
  color: #ffffff;
}

.product-list button.active .product-item-meta {
  color: rgba(255, 255, 255, 0.82);
}

.product-list button.active::before {
  background: white;
}

.product-list .status {
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}

.card-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  font-family: "Space Grotesk", "Manrope", sans-serif;
}

.status-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============ FORM ============ */
form {
  display: flex;
  flex-direction: column;
}

.form-section {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-field label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.field-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

input:not([type="file"]),
select,
textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  font-family: "Manrope", sans-serif;
  transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%236b7280' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============ SECTION HEADER ============ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.section-header h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.section-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============ MEASURE IMPORT ============ */
.measure-import {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}

.measure-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.measure-panel {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.measure-header h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.measure-header p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.measure-upload input {
  display: none;
}

.measure-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.code-preview {
  margin: 0;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
  font-family: "Monaco", "Courier New", monospace;
  min-height: 80px;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text);
}

/* ============ PASTE SECTION ============ */
.paste-section {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.paste-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.paste-toggle::-webkit-details-marker {
  display: none;
}

.paste-toggle svg {
  color: var(--accent);
  flex-shrink: 0;
}

.paste-toggle span {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.paste-toggle small {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

.paste-toggle:hover {
  background: rgba(245, 158, 11, 0.1);
}

.paste-content {
  padding: 16px;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.paste-content textarea {
  font-family: "Monaco", "Courier New", monospace;
  font-size: 12px;
  background: var(--surface);
  min-height: 140px;
}

/* ============ TABLE ============ */
.table-container {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  max-height: 1200px;
  transition: max-height 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.table-container.table-collapsed {
  max-height: 220px;
  overflow: hidden;
}

.table-container.table-collapsed .measures-table tbody tr:not(:first-child) {
  display: none;
}

.table-container.table-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--surface));
  pointer-events: none;
}

[data-theme="dark"] .table-container.table-collapsed::after {
  background: linear-gradient(to bottom, rgba(17, 24, 39, 0), var(--surface));
}

.sizes-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-toggle .chevron {
  transition: transform 0.2s ease;
}

.btn-toggle.is-expanded .chevron {
  transform: rotate(180deg);
}

.measures-table {
  width: 100%;
  border-collapse: collapse;
}

.measures-table th {
  background: var(--bg-subtle);
  padding: 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

.measures-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.measures-table tbody tr:last-child td {
  border-bottom: none;
}

.measures-table tbody tr:hover {
  background: var(--bg-subtle);
}

.measures-table input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
}

.measures-table input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.measures-table .row-actions {
  text-align: center;
  vertical-align: middle;
}

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

.measures-table .move-up,
.measures-table .move-down {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.measures-table .move-up:hover,
.measures-table .move-down:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.measures-table .remove {
  border: none;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}

.measures-table .remove:hover {
  background: var(--danger-light);
  color: var(--danger-hover);
}

.table-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
}

.table-empty svg {
  opacity: 0.3;
  margin-bottom: 12px;
}

.table-empty p {
  margin: 0 0 4px;
  font-weight: 500;
  color: var(--text-secondary);
}

.table-empty small {
  font-size: 13px;
}

#sizesBody:empty + .table-empty {
  display: flex;
}

#sizesBody:not(:empty) ~ .table-empty {
  display: none;
}

/* ============ BUTTONS ============ */
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  font-family: "Manrope", sans-serif;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn svg {
  flex-shrink: 0;
}

.shortcut {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 6px;
  line-height: 1.1;
  background: var(--surface);
  color: var(--text-secondary);
}

#newProduct {
  margin-left: 0;
  flex-shrink: 0;
  align-self: start;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-large {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-danger {
  color: white;
  background: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-subtle);
  border-color: var(--border);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ============ FORM ACTIONS ============ */
.form-actions {
  padding: 24px;
  background: var(--bg-subtle);
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ============ THEME TOGGLE ============ */
#toggleTheme {
  position: relative;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-strong);
  border-color: var(--border);
}

#toggleTheme .icon-sun,
#toggleTheme .icon-moon {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

[data-theme="dark"] #toggleTheme .icon-sun {
  opacity: 0.4;
  transform: scale(0.9);
}

[data-theme="dark"] #toggleTheme .icon-moon {
  opacity: 1;
  transform: scale(1.05);
}

[data-theme="light"] #toggleTheme .icon-sun,
:root:not([data-theme="dark"]) #toggleTheme .icon-sun {
  opacity: 1;
  transform: scale(1.05);
}

[data-theme="light"] #toggleTheme .icon-moon,
:root:not([data-theme="dark"]) #toggleTheme .icon-moon {
  opacity: 0.4;
  transform: scale(0.9);
}

.theme-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============ EMOJI SVG ============ */
.emoji {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-block;
}

/* ============ CONFIRM BOX ============ */
.confirm-box {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 280px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.confirm-box p {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.confirm-box .confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-box.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.profile-modal {
  max-width: 460px;
}

.about-modal {
  max-width: 560px;
  border-color: var(--border-strong);
}

.about-modal-body {
  display: grid;
  gap: 14px;
}

.about-modal-body p {
  margin: 0;
  color: var(--text-secondary);
  text-align: left;
}

.about-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
}

.about-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: #111827;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.about-icon svg {
  width: 18px;
  height: 18px;
}

.about-title-wrap {
  min-width: 0;
}

.about-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.about-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.about-version-pill {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
}

.about-status-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.about-status-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
}

.about-status-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.about-status-value {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.about-status-value.is-online {
  color: var(--success);
}

.about-notes {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}

.about-note-muted {
  font-size: 12px;
  color: var(--text-tertiary);
}

.avatar-crop-modal {
  max-width: 460px;
}

.avatar-crop-body {
  display: grid;
  gap: 10px;
}

.avatar-crop-viewport {
  position: relative;
  width: min(72vw, 320px);
  height: min(72vw, 320px);
  max-width: 320px;
  max-height: 320px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #0b0f18;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.avatar-crop-viewport.is-dragging {
  cursor: grabbing;
}

.avatar-crop-image {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
}

.avatar-crop-mask {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.35);
}

.avatar-crop-mask::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78%;
  height: 78%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
}

.avatar-crop-zoom-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.profile-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-photo-preview {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  background: var(--bg-subtle);
}

.profile-photo-btn {
  margin-top: 2px;
}

.profile-modal input[readonly] {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* ============ CONFIRM OVERLAY ============ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 90;
}

.confirm-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ============ APP CONFIRM MODAL ============ */
.app-confirm-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 120;
  padding: 18px;
}

.app-confirm-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.app-confirm-modal {
  width: min(760px, 100%);
  border: 1px solid #cad5e5;
  border-radius: 12px;
  background: #f4f7fb;
  box-shadow: 0 28px 80px -40px rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

.app-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #d3dceb;
  background: #eef3fa;
}

.app-confirm-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.app-confirm-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #bfd0ea;
  background: #e8f0fd;
  color: #335b96;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2a37;
  line-height: 1.2;
}

.app-confirm-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
}

.app-confirm-close {
  width: 30px;
  height: 30px;
  border: 1px solid #c7d3e6;
  border-radius: 8px;
  background: #f2f6fc;
  color: #556b8f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.app-confirm-close:hover {
  background: #e9f0fa;
  color: #3e5e8f;
}

.app-confirm-body {
  padding: 18px 16px 12px;
}

.app-confirm-message {
  margin: 0;
  font-size: 14px;
  color: #334155;
}

.app-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #d3dceb;
  background: #f6f9fe;
}

.app-confirm-btn {
  height: 34px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.app-confirm-btn-ghost {
  background: #ffffff;
  border-color: #cfd8e4;
  color: #334155;
}

.app-confirm-btn-ghost:hover {
  background: #f8fafc;
}

.app-confirm-btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.app-confirm-btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* ============ PRODUCT CRUD MODAL ============ */
.product-crud-overlay {
  position: fixed;
  inset: 0;
  z-index: 122;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.product-crud-modal {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid #c7d5ea;
  border-radius: 10px;
  background: #eef3f9;
  box-shadow: 0 35px 80px -45px rgba(15, 23, 42, 0.5);
}

.product-crud-header {
  min-height: 52px;
  border-bottom: 1px solid #c9d8ec;
  background: #eaf1fa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
}

.product-crud-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-crud-header-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  color: #355b8f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-crud-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1f2a37;
}

.product-crud-close {
  width: 30px;
  height: 30px;
  border: 1px solid #c6d4e7;
  border-radius: 8px;
  background: #f2f6fc;
  color: #556b8f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-crud-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px 8px;
}

.product-crud-tabs button {
  height: 32px;
  padding: 0 14px;
  border: 1px solid #b7c9df;
  border-radius: 6px;
  background: #edf3fa;
  color: #3e5c84;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.product-crud-tabs button.is-active {
  background: #ffffff;
  border-color: #8eb1d8;
  color: #1e3a5f;
}

.product-crud-form {
  padding: 0 12px 10px;
}

.product-crud-section {
  border: 1px solid #c9d8ec;
  background: #f4f8fc;
  padding: 12px;
}

.product-crud-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 12px;
  align-items: center;
}

.product-crud-grid label {
  display: contents;
}

.product-crud-grid label > span {
  font-size: 13px;
  color: #4b5f7e;
  text-align: right;
}

.product-crud-grid input,
.product-crud-grid select,
.product-crud-textarea-wrap textarea {
  width: 100%;
  border: 1px solid #a8bfdc;
  border-radius: 4px;
  background: #ffffff;
  color: #1f2a37;
  font-size: 13px;
  padding: 8px 10px;
}

.product-crud-textarea-wrap {
  display: block;
}

.product-crud-textarea-wrap > span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #4b5f7e;
}

.product-crud-textarea-wrap textarea {
  min-height: 220px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.product-crud-footer {
  border-top: 1px solid #c9d8ec;
  padding: 10px 0 0;
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============ PRODUCT PREVIEW MODAL ============ */
.product-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 123;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-preview-modal {
  width: 100%;
  max-width: 1000px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.product-preview-header {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-preview-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-preview-head-icon {
  width: 40px;
  height: 40px;
  background: #f0f9ff;
  border-radius: 6px;
  color: #0284c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-preview-head-texts h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.product-preview-head-texts p {
  margin: 2px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

.product-preview-header h3 {
  margin: 0;
  font-size: 16px;
}

.product-preview-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #9ca3af;
  padding: 0;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-preview-body {
  padding: 16px;
  overflow: auto;
}

.product-preview-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.product-preview-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.product-preview-section-header {
  padding: 14px 16px;
  border-bottom: 2px solid;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafafa;
}

.product-preview-section-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.product-preview-section-name {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.product-preview-section-content {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-preview-data-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-preview-data-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.3px;
}

.product-preview-data-value {
  font-size: 12px;
  font-weight: 500;
  color: #111827;
}

.product-preview-section-blue .product-preview-section-header {
  border-bottom-color: #2563eb;
  background: #f0f9ff;
}

.product-preview-section-blue .product-preview-section-dot {
  background: #2563eb;
}

.product-preview-section-blue .product-preview-section-name {
  color: #1d4ed8;
}

.product-preview-section-purple .product-preview-section-header {
  border-bottom-color: #7e22ce;
  background: #faf5ff;
}

.product-preview-section-purple .product-preview-section-dot {
  background: #7e22ce;
}

.product-preview-section-purple .product-preview-section-name {
  color: #7e22ce;
}

.product-preview-section-teal .product-preview-section-header {
  border-bottom-color: #0f766e;
  background: #ecfeff;
}

.product-preview-section-teal .product-preview-section-dot {
  background: #0f766e;
}

.product-preview-section-teal .product-preview-section-name {
  color: #0f766e;
}

.product-preview-section-green .product-preview-section-header {
  border-bottom-color: #16a34a;
  background: #f0fdf4;
}

.product-preview-section-green .product-preview-section-dot {
  background: #16a34a;
}

.product-preview-section-green .product-preview-section-name {
  color: #15803d;
}

.product-preview-table-section {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.product-preview-table-header {
  padding: 14px 16px;
  border-bottom: 2px solid #2563eb;
  background: #f0f9ff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-preview-table-header .product-preview-section-dot {
  background: #2563eb;
}

.product-preview-table-header .product-preview-section-name {
  color: #1d4ed8;
}

.product-preview-table-info {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.product-preview-table-wrap {
  overflow-x: auto;
}

.product-preview-table-wrap .measures-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.product-preview-table-wrap .measures-table thead {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.product-preview-table-wrap .measures-table th {
  padding: 6px 8px;
  text-align: left;
  color: #6b7280;
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-right: 1px solid #e5e7eb;
}

.product-preview-table-wrap .measures-table th:last-child {
  border-right: none;
}

.product-preview-table-wrap .measures-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.15s ease;
}

.product-preview-table-wrap .measures-table tbody tr:hover {
  background: #f9fafb;
}

.product-preview-table-wrap .measures-table tbody tr:last-child {
  border-bottom: none;
}

.product-preview-table-wrap .measures-table td {
  padding: 6px 8px;
  color: #4b5563;
  border-right: 1px solid #e5e7eb;
}

.product-preview-table-wrap .measures-table td:last-child {
  border-right: none;
}

.product-preview-footer {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
  display: flex;
  justify-content: flex-end;
}

.product-preview-footer-btn {
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #6b7280;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-preview-footer-btn:hover {
  background: #f9fafb;
  color: #111827;
}

.product-preview-close:hover {
  background: #f3f4f6;
  color: #4b5563;
}

@media (max-width: 600px) {
  .product-preview-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .product-preview-header {
    padding: 16px;
  }

  .product-preview-body {
    padding: 16px;
  }

  .product-preview-sections-grid {
    grid-template-columns: 1fr;
  }

  .product-preview-table-wrap .measures-table {
    font-size: 12px;
  }

  .product-preview-table-wrap .measures-table th,
  .product-preview-table-wrap .measures-table td {
    padding: 10px;
  }
}

/* ============ TOAST ============ */
.app-infobox {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(360px, calc(100vw - 26px));
  min-height: 66px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #d7deea;
  box-shadow: 0 20px 45px -30px rgba(15, 23, 42, 0.45);
  color: #1f2937;
  display: grid;
  grid-template-columns: 30px 1fr 20px;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 130;
  pointer-events: none;
}

.app-infobox.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.app-infobox.leaving {
  opacity: 0;
  transform: translateY(8px);
}

.app-infobox-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #e8f7ee;
  border: 1px solid #b8e5cb;
  color: #16a34a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-infobox-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.app-infobox-content {
  min-width: 0;
}

.app-infobox-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  color: #0f172a;
}

.app-infobox-message {
  margin-top: 1px;
  font-size: 12px;
  color: #475569;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-infobox-close {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.app-infobox-close:hover {
  background: #f1f5f9;
  color: #334155;
}

.app-infobox-close svg {
  width: 12px;
  height: 12px;
  stroke-width: 2;
}

.app-infobox.app-infobox-error .app-infobox-icon {
  background: #fdecec;
  border-color: #f4c4c4;
  color: #dc2626;
}

.app-infobox.app-infobox-warn .app-infobox-icon {
  background: #fff4e5;
  border-color: #f7ddaf;
  color: #d97706;
}

/* ============ UTILITY ============ */
input[type="file"]:not(#settingsMeasureMediaUpload) {
  display: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .editor-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-config-layout {
    grid-template-columns: 1fr;
  }

  .settings-config-preview-wrap {
    position: static;
  }

  .user-access-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .funnel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-columns {
    grid-template-columns: 1fr;
  }

  .analytics-pro-charts {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .hero-content {
    flex-direction: column;
  }

  .action-group {
    width: 100%;
  }

  .btn-group {
    width: 100%;
  }

  .btn-group .btn {
    flex: 1;
  }

  .shortcuts-hint {
    gap: 6px 10px;
  }
}

@media (max-width: 768px) {
  .editor-kpis {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .admin-tab {
    flex: 1;
    text-align: center;
  }

  .analytics-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-chart-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #adminRoot .tp-summary-row {
    flex-direction: column;
  }

  #adminRoot .tp-label-wrap {
    width: 140px;
  }

  .about-status-row {
    grid-template-columns: 1fr;
  }

  .funnel-grid {
    grid-template-columns: 1fr;
  }

  .page {
    padding: 20px 16px 60px;
  }

  h1 {
    font-size: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-container {
    overflow-x: auto;
  }

  .measures-table {
    min-width: 600px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }
}

/* ============ ADMIN V2 LOOK ============ */
#adminRoot.page {
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--admin-app-bg);
  color: var(--admin-text);
  overflow: hidden;
}

#adminRoot .shell-sidebar {
  border-right: 1px solid var(--admin-border);
  background: var(--admin-sidebar-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  position: sticky;
  top: 0;
  align-self: start;
  z-index: 20;
  overflow: visible;
}

#adminRoot .shell-brand {
  padding: 22px 18px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

#adminRoot .shell-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #2563eb;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#adminRoot .shell-brand-icon svg {
  width: 17px;
  height: 17px;
}

#adminRoot .shell-brand-name {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--admin-text);
}

#adminRoot .shell-brand-sub {
  margin: 2px 0 0;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--admin-text-muted);
  text-transform: uppercase;
}

#adminRoot .admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

#adminRoot .admin-tab {
  border-radius: 10px;
  padding: 11px 12px;
  text-align: left;
  background: transparent;
  color: var(--admin-tab-text);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

#adminRoot .admin-tab:hover {
  background: var(--admin-tab-hover-bg);
  color: var(--admin-text);
}

#adminRoot .admin-tab.is-active {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.35);
  color: #2563eb;
}

#adminRoot .tab-menu-wrap {
  position: relative;
}

#adminRoot .tab-menu-wrap .admin-tab {
  width: 100%;
}

#adminRoot .tab-popup-menu {
  position: absolute;
  top: 50%;
  left: calc(100% + 12px);
  transform: translateY(-50%) scale(0.98);
  min-width: 270px;
  padding: 10px;
  border: 1px solid var(--admin-border);
  border-radius: 0;
  background: var(--admin-surface);
  box-shadow: 0 24px 55px -28px rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  z-index: 35;
  transition: opacity 170ms ease, transform 170ms ease;
}

#adminRoot .tab-popup-menu::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-left: 1px solid var(--admin-border);
  border-bottom: 1px solid var(--admin-border);
  background: var(--admin-surface);
  transform: translateY(-50%) rotate(45deg);
}

#adminRoot .tab-popup-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

#adminRoot .tab-popup-head {
  margin: 2px 4px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--admin-text-muted);
}

#adminRoot .tab-popup-item {
  width: 100%;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--admin-text-muted);
  border-radius: 0;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

#adminRoot .tab-popup-item:hover {
  background: var(--admin-tab-hover-bg);
  border-left-color: rgba(37, 99, 235, 0.34);
  color: var(--admin-text);
  transform: none;
}

#adminRoot .tab-popup-item.is-active {
  background: transparent;
  border-left-color: #2563eb;
  color: #2563eb;
  box-shadow: none;
}

#adminRoot .tab-popup-icon {
  width: 30px;
  height: 30px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
}

#adminRoot .tab-popup-icon svg {
  width: 15px;
  height: 15px;
}

#adminRoot .tab-popup-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

#adminRoot .tab-popup-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--admin-text);
}

#adminRoot .tab-popup-item.is-active .tab-popup-title {
  color: #2563eb;
}

#adminRoot .tab-popup-desc {
  font-size: 11px;
  font-weight: 600;
  color: var(--admin-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#adminRoot .tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#adminRoot .tab-label {
  flex: 1;
}

#adminRoot .tab-caret {
  order: 3;
  margin-left: auto;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: 0.8;
  transition: transform 140ms ease, opacity 140ms ease;
}

#adminRoot .tab-caret svg {
  width: 14px;
  height: 14px;
}

#adminRoot .admin-tab[aria-expanded="true"] .tab-caret {
  transform: rotate(90deg);
  opacity: 1;
}

#adminRoot .nav-badge {
  order: 2;
  margin-left: auto;
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
}

#adminRoot .shell-main {
  min-width: 0;
  min-height: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 72px;
}

/* Lista de produtos: remove os respiros superior/inferior da área principal */
#adminRoot .shell-main.is-products-list-mode {
  padding: 0;
}

.mobile-menu-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.mobile-menu-toggle svg {
  width: 15px;
  height: 15px;
}

.mobile-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.5);
  backdrop-filter: blur(2px);
  z-index: 45;
}

#adminRoot .hero {
  margin-bottom: 18px;
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  background: var(--admin-surface);
  padding: 16px 18px;
}

#adminRoot .hero-content {
  position: relative;
  display: block;
  min-height: 78px;
  gap: 0;
}

#adminRoot .hero-text {
  min-width: 0;
  width: 100%;
  padding-right: 170px;
}

#adminRoot .eyebrow {
  color: #2563eb;
  margin-bottom: 4px;
}

#adminRoot h1 {
  color: var(--admin-text);
  font-size: 24px;
  margin-bottom: 4px;
}

#adminRoot .sub {
  color: var(--admin-text-muted);
}

#adminRoot .hero-user-card {
  position: absolute;
  top: 0;
  right: 0;
  width: auto;
  min-width: 138px;
  max-width: 162px;
  padding: 7px;
  background: var(--admin-surface-2);
  border-color: var(--admin-border);
}

#adminRoot .account-trigger-caret {
  color: var(--admin-text-muted);
}

#adminRoot .account-trigger {
  border-color: var(--admin-border);
  background: var(--admin-surface-2);
  padding: 5px 7px;
  gap: 6px;
  min-height: 30px;
}

#adminRoot .hero-user-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

#adminRoot .user-avatar {
  width: 26px;
  height: 26px;
}

#adminRoot .user-name {
  font-size: 12px;
  line-height: 1.2;
  max-width: 8ch;
}

#adminRoot .top-theme-toggle {
  min-height: 30px;
  height: 30px;
  width: 30px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 0;
  line-height: 1;
  flex: 0 0 30px;
}

#adminRoot .top-theme-toggle .icon-sun,
#adminRoot .top-theme-toggle .icon-moon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 15px;
  height: 15px;
}

#adminRoot .top-theme-toggle .theme-label {
  display: none !important;
}

#adminRoot .hero-user-panel {
  background: var(--admin-surface);
  border-color: var(--admin-border);
}

#adminRoot .top-user-name-lg {
  color: var(--admin-text);
}

#adminRoot .top-user-email,
#adminRoot .top-user-role-wrap {
  color: var(--admin-text-muted);
}

#adminRoot .top-user-separator {
  background: var(--admin-border);
}

#adminRoot .top-user-action {
  color: var(--admin-text);
}

#adminRoot .top-user-action:hover {
  background: var(--admin-tab-hover-bg);
}

#adminRoot .top-user-action.danger {
  color: #fca5a5;
}

#adminRoot .top-user-action.danger:hover {
  background: rgba(239, 68, 68, 0.16);
}

#adminRoot .editor-kpis,
#adminRoot .analytics-section,
#adminRoot .analytics-charts,
#adminRoot .analytics-pro-card,
#adminRoot .settings-section,
#adminRoot .card,
#adminRoot .sidebar,
#adminRoot .editor-kpi-card,
#adminRoot .action-card,
#adminRoot .analytics-card,
#adminRoot .funnel-step {
  background: var(--admin-surface);
  border-color: var(--admin-border);
}

#adminRoot .analytics-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

#adminRoot .analytics-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, var(--admin-card-glass-top), rgba(255, 255, 255, 0));
}

#adminRoot .analytics-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: rgba(37, 99, 235, 0.45);
}

#adminRoot .analytics-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--admin-text-muted);
}

#adminRoot .analytics-value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  color: var(--admin-text);
}

#adminRoot .status-text,
#adminRoot .section-hint,
#adminRoot .analytics-subtitle,
#adminRoot .settings-header p,
#adminRoot .field-hint,
#adminRoot .editor-kpi-label {
  color: var(--admin-text-muted);
}

#adminRoot .product-list button,
#adminRoot input:not([type="file"]),
#adminRoot select,
#adminRoot textarea {
  background: var(--admin-surface-2);
  border-color: var(--admin-border);
  color: var(--admin-text);
}

#adminRoot .footer {
  background: var(--admin-surface);
  left: 240px;
  right: 0;
}

#adminRoot .analytics-chart-track {
  background: var(--admin-surface-2);
}

#adminRoot .analytics-chart-label {
  color: var(--admin-text-muted);
}

#adminRoot .analytics-chart-value {
  color: var(--admin-text);
}

#adminRoot .analytics-pro-head p,
#adminRoot .analytics-donut-center small {
  color: var(--admin-text-muted);
}

#adminRoot .settings-config-block {
  background: var(--admin-surface-2);
  border-color: var(--admin-border);
  box-shadow: none;
}

#adminRoot .settings-config-preview {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.09), var(--admin-surface));
  border-color: var(--admin-border);
}

#adminRoot .about-header,
#adminRoot .about-status-card,
#adminRoot .about-notes {
  background: var(--admin-surface);
  border-color: var(--admin-border);
}

#adminRoot .about-subtitle,
#adminRoot .about-note-muted {
  color: var(--admin-text-muted);
}

#adminRoot .about-status-label {
  color: var(--admin-text-muted);
}

#adminRoot .about-status-value {
  color: var(--admin-text);
}

@media (max-width: 1100px) {
  #adminRoot.page {
    grid-template-columns: 1fr;
  }

  #adminRoot .shell-sidebar {
    min-height: 100vh;
    border-right: 1px solid var(--admin-border);
    border-bottom: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    max-width: 320px;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  }

  #adminRoot.sidebar-open .shell-sidebar {
    transform: translateX(0);
  }

  #adminRoot .mobile-menu-toggle {
    display: inline-flex;
  }

  #adminRoot .admin-tabs {
    flex-direction: column;
    overflow-x: hidden;
    margin: 12px;
  }

  #adminRoot .tab-menu-wrap {
    width: 100%;
    border-radius: 0;
    overflow: visible;
  }

  #adminRoot .admin-tab {
    white-space: normal;
    border-radius: 10px;
    padding: 10px 11px;
  }

  #adminRoot .admin-tab[aria-expanded="true"] {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.34);
    color: #2563eb;
  }

  #adminRoot .admin-tab .tab-caret {
    width: 16px;
    height: 16px;
  }

  #adminRoot .tab-popup-menu {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    z-index: auto !important;
    min-width: 0 !important;
    display: none !important;
    margin: 2px 0 6px !important;
    padding: 2px 0 2px 34px !important;
    border: 0 !important;
    border-left: 1px solid var(--admin-border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible !important;
    pointer-events: auto !important;
    transition: none !important;
  }

  #adminRoot .tab-popup-menu::before {
    display: none;
  }

  #adminRoot .tab-popup-menu.is-open {
    display: block !important;
  }

  #adminRoot .tab-popup-item {
    border: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 7px;
    padding: 6px 8px;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
  }

  #adminRoot .tab-popup-head {
    display: none;
  }

  #adminRoot .tab-popup-icon {
    display: none;
  }

  #adminRoot .tab-popup-copy {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #adminRoot .tab-popup-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--admin-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  #adminRoot .tab-popup-title::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--admin-text-muted);
    flex-shrink: 0;
    opacity: 0.9;
  }

  #adminRoot .tab-popup-item.is-active .tab-popup-title {
    color: #2563eb;
  }

  #adminRoot .tab-popup-item.is-active .tab-popup-title::before {
    background: #2563eb;
  }

  #adminRoot .tab-popup-desc {
    display: none;
  }

  #adminRoot .tab-popup-item:hover {
    transform: none;
    background: var(--admin-tab-hover-bg);
    border-color: transparent;
  }

  #adminRoot .shell-main {
    padding: 14px 14px 0;
  }

  .analytics-paging {
    left: 14px;
    right: 14px;
  }

  #adminRoot .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #adminRoot .analytics-grid {
    grid-template-columns: 1fr;
  }

  #adminRoot .footer {
    left: 0;
    right: 0;
  }
}

/* =====================================
   Settings Redesign (UI-only override)
   ===================================== */
#adminRoot #settingsConfigPanel,
#adminRoot #settingsUsersPanel,
#adminRoot #settingsBackupsPanel {
  --cfg-bg: #080810;
  --cfg-bg-2: #0e0e1a;
  --cfg-bg-3: #131320;
  --cfg-bg-4: #181826;
  --cfg-bg-5: #252538;
  --cfg-border: rgba(255, 255, 255, 0.07);
  --cfg-border-hi: rgba(255, 255, 255, 0.15);
  --cfg-text: #eeeef8;
  --cfg-text-2: #9b9bb7;
  --cfg-text-3: #5b5b78;
  --cfg-accent: #2563eb;
  --cfg-accent-dim: rgba(37, 99, 235, 0.12);
  --cfg-accent-br: rgba(37, 99, 235, 0.3);
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--cfg-text);
}

#adminRoot .settings-section {
  background: linear-gradient(180deg, var(--cfg-bg) 0%, #0b0b14 100%);
  border: 1px solid var(--cfg-border);
  border-radius: 14px;
  box-shadow: 0 20px 42px -28px rgba(0, 0, 0, 0.65);
}

#adminRoot .settings-header {
  border-bottom: 1px solid var(--cfg-border);
  background: var(--cfg-bg-2);
}

#adminRoot .settings-header .action-label {
  color: var(--cfg-text);
  letter-spacing: -0.01em;
}

#adminRoot .settings-header .field-hint {
  color: var(--cfg-text-2);
}

#adminRoot .settings-subtabs {
  border-radius: 10px;
  background: var(--cfg-bg-3);
  border: 1px solid var(--cfg-border);
  padding: 3px;
  gap: 3px;
}

#adminRoot .settings-subtab {
  border-radius: 8px;
  color: var(--cfg-text-2);
  font-weight: 600;
}

#adminRoot .settings-subtab.is-active {
  color: var(--cfg-accent);
  background: var(--cfg-accent-dim);
  border-color: var(--cfg-accent-br);
}

#adminRoot .settings-config-card,
#adminRoot .settings-config-preview,
#adminRoot .settings-pro-card,
#adminRoot .settings-section-card,
#adminRoot #settingsUsersPanel .action-card,
#adminRoot #settingsBackupsPanel .action-card {
  background: var(--cfg-bg-2);
  border: 1px solid var(--cfg-border);
  border-radius: 14px;
  box-shadow: none;
}

#adminRoot .settings-config-topnav {
  background: linear-gradient(180deg, #0b0e18 0%, #0a0d16 100%);
  border: 1px solid var(--cfg-border-hi);
  border-radius: 10px;
  padding: 3px;
}

#adminRoot .settings-config-topnav-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--cfg-text-2);
  font-weight: 600;
  border-radius: 8px;
  transition: color 180ms ease, border-color 180ms ease;
}

#adminRoot .settings-config-topnav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22) 0%, rgba(37, 99, 235, 0.1) 100%);
  transform: translateX(-110%);
  transition: transform 220ms cubic-bezier(0.22, 0.9, 0.32, 1);
  pointer-events: none;
}

#adminRoot .settings-config-topnav-btn:hover:not(.is-active) {
  color: var(--cfg-text);
  border-color: var(--cfg-border-hi);
}

#adminRoot .settings-config-topnav-btn:hover:not(.is-active)::before {
  transform: translateX(0);
}

#adminRoot .settings-config-topnav-btn.is-active {
  color: var(--cfg-text);
  background: var(--cfg-bg-5);
  border-color: var(--cfg-border-hi);
}

#adminRoot .settings-config-topnav-btn.is-active::before {
  transform: translateX(110%);
}

#adminRoot .settings-pro-card-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  border-bottom-color: var(--cfg-border);
}

#adminRoot .settings-pro-card-head h3,
#adminRoot .settings-section-title,
#adminRoot #settingsUsersPanel .sc-title,
#adminRoot #settingsBackupsPanel .sc-title {
  color: var(--cfg-accent);
  font-weight: 700;
}

#adminRoot .settings-pro-label,
#adminRoot .settings-setting-label {
  color: var(--cfg-text);
  font-weight: 600;
}

#adminRoot .settings-pro-card-head p,
#adminRoot .settings-section-desc,
#adminRoot .settings-pro-hint,
#adminRoot .settings-setting-hint,
#adminRoot .settings-config-actions .field-hint {
  color: var(--cfg-text-2);
}

#adminRoot .settings-pro-row,
#adminRoot .settings-setting-row {
  border-bottom-color: var(--cfg-border);
}

#adminRoot .settings-pv-stage-launcher {
  background: var(--cfg-bg-3);
  border-color: var(--cfg-border-hi);
}

#adminRoot .settings-sub-section {
  background: rgba(0, 0, 0, 0.16);
}

#adminRoot .settings-color-input-wrap input[type="text"],
#adminRoot .settings-pro-row > input[type="text"],
#adminRoot .settings-pro-row > input[type="tel"],
#adminRoot .settings-pro-row > input[type="number"],
#adminRoot .settings-tip-input,
#adminRoot .settings-row-input,
#adminRoot .settings-phone-input-wrap input,
#adminRoot #backupNameInput,
#adminRoot #backupSelect {
  background: var(--cfg-bg-3);
  border-color: var(--cfg-border-hi);
  color: var(--cfg-text);
  font-family: "DM Sans", system-ui, sans-serif;
}

#adminRoot .settings-color-input-wrap input[type="text"] {
  font-family: "DM Mono", ui-monospace, monospace;
}

#adminRoot .settings-phone-input-wrap span {
  background: var(--cfg-bg-4);
  border-color: var(--cfg-border-hi);
  color: var(--cfg-text-2);
}

#adminRoot .settings-color-input-wrap input[type="color"] {
  background: var(--cfg-bg-3);
  border-color: var(--cfg-border-hi);
}

#adminRoot .settings-upload-zone {
  background: var(--cfg-bg-3);
  border-color: var(--cfg-border-hi);
}

#adminRoot .settings-upload-zone:hover {
  border-color: var(--cfg-accent-br);
  background: var(--cfg-accent-dim);
}

#adminRoot .settings-upload-icon {
  background: var(--cfg-bg-4);
  border-color: var(--cfg-border);
  color: var(--cfg-text-2);
}

#adminRoot .settings-switch-track {
  background: var(--cfg-bg-4);
  border-color: var(--cfg-border-hi);
}

#adminRoot .settings-switch-thumb {
  background: #7d7d98;
}

#adminRoot .settings-switch input:checked + .settings-switch-track {
  background: var(--cfg-accent-dim);
  border-color: var(--cfg-accent-br);
}

#adminRoot .settings-switch input:checked ~ .settings-switch-thumb {
  background: var(--cfg-accent);
}

#adminRoot .settings-config-preview {
  background: linear-gradient(180deg, #10101b 0%, #0d0d17 100%);
  border-color: var(--cfg-border);
  padding: 10px;
}

#adminRoot .settings-preview-eyebrow {
  color: var(--cfg-text-3);
}

#adminRoot .settings-config-preview h4 {
  color: var(--cfg-text);
}

#adminRoot #settingsUsersPanel .analytics-table,
#adminRoot #settingsBackupsPanel .analytics-table,
#adminRoot #settingsUsersPanel table,
#adminRoot #settingsBackupsPanel table {
  background: transparent;
}

#adminRoot #settingsUsersPanel th,
#adminRoot #settingsBackupsPanel th {
  color: var(--cfg-text-3);
  border-bottom-color: var(--cfg-border);
}

#adminRoot #settingsUsersPanel td,
#adminRoot #settingsBackupsPanel td {
  color: var(--cfg-text-2);
  border-bottom-color: var(--cfg-border);
}

#adminRoot #settingsUsersPanel .role-chip {
  background: var(--cfg-bg-4);
  border-color: var(--cfg-border-hi);
  color: var(--cfg-text-2);
}

#adminRoot #settingsUsersPanel .sc {
  background: var(--cfg-bg-2);
  border: 1px solid var(--cfg-border);
  border-radius: 14px;
  overflow: hidden;
}

#adminRoot #settingsUsersPanel .users-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--cfg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#adminRoot #settingsUsersPanel .sc-head-info {
  display: grid;
  gap: 2px;
}

#adminRoot #settingsUsersPanel .sc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cfg-accent);
}

#adminRoot #settingsUsersPanel .sc-desc {
  font-size: 11.5px;
  color: var(--cfg-text-2);
}

#adminRoot #settingsUsersPanel .err-banner {
  margin: 12px 18px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid rgba(240, 101, 101, 0.25);
  background: rgba(240, 101, 101, 0.12);
  color: #ffb3b3;
  font-size: 12px;
  display: none;
  align-items: center;
  gap: 8px;
}

#adminRoot #settingsUsersPanel .users-table {
  width: 100%;
  border-collapse: collapse;
}

#adminRoot #settingsUsersPanel .users-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cfg-text-3);
  padding: 10px 18px;
  border-bottom: 1px solid var(--cfg-border);
}

#adminRoot #settingsUsersPanel .users-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--cfg-border);
  color: var(--cfg-text-2);
  font-size: 13px;
}

#adminRoot #settingsUsersPanel .users-table tr:last-child td {
  border-bottom: 0;
}

#adminRoot #settingsUsersPanel .ucell {
  display: flex;
  align-items: center;
  gap: 10px;
}

#adminRoot #settingsUsersPanel .uav {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--cfg-accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

#adminRoot #settingsUsersPanel .uav.dim {
  background: var(--cfg-bg-4);
  color: var(--cfg-text-2);
}

#adminRoot #settingsUsersPanel .uname {
  font-size: 13px;
  font-weight: 600;
  color: var(--cfg-text);
}

#adminRoot #settingsUsersPanel .uemail {
  font-size: 11.5px;
  color: var(--cfg-text-2);
}

#adminRoot #settingsUsersPanel .status-on,
#adminRoot #settingsUsersPanel .status-off {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

#adminRoot #settingsUsersPanel .status-on {
  color: #53d39b;
}

#adminRoot #settingsUsersPanel .status-off {
  color: var(--cfg-text-3);
}

#adminRoot #settingsUsersPanel .status-on::before,
#adminRoot #settingsUsersPanel .status-off::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

#adminRoot #settingsUsersPanel .status-on::before {
  background: #53d39b;
}

#adminRoot #settingsUsersPanel .status-off::before {
  background: var(--cfg-text-3);
}

#adminRoot #settingsUsersPanel .user-actions-inline {
  display: inline-flex;
  gap: 8px;
}

#adminRoot #settingsBackupsPanel .sc {
  background: var(--cfg-bg-2);
  border: 1px solid var(--cfg-border);
  border-radius: 14px;
  overflow: hidden;
}

#adminRoot #settingsBackupsPanel .sc-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--cfg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#adminRoot #settingsBackupsPanel .sc-head-info {
  display: grid;
  gap: 2px;
}

#adminRoot #settingsBackupsPanel .sc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cfg-accent);
}

#adminRoot #settingsBackupsPanel .sc-desc {
  font-size: 11.5px;
  color: var(--cfg-text-2);
}

#adminRoot #settingsBackupsPanel .bk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 16px 18px;
}

#adminRoot #settingsBackupsPanel .bk-card {
  background: var(--cfg-bg-3);
  border: 1px solid var(--cfg-border);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

#adminRoot #settingsBackupsPanel .bk-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cfg-text-3);
}

#adminRoot #settingsBackupsPanel .bk-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--cfg-text);
}

#adminRoot #settingsBackupsPanel .bk-desc {
  font-size: 11.5px;
  color: var(--cfg-text-2);
}

#adminRoot #settingsBackupsPanel .bk-row {
  display: flex;
  gap: 8px;
}

#adminRoot #settingsBackupsPanel .inp,
#adminRoot #settingsBackupsPanel .sel {
  width: 100%;
  min-height: 38px;
  border-radius: 9px;
  border: 1px solid var(--cfg-border-hi);
  background: var(--cfg-bg-3);
  color: var(--cfg-text);
  padding: 0 12px;
}

#adminRoot #settingsBackupsPanel .sel {
  padding-right: 34px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%239b9bb7' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

#adminRoot #settingsBackupsPanel .sr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--cfg-border);
}

#adminRoot #settingsBackupsPanel .sr:last-child {
  border-bottom: 0;
}

#adminRoot #settingsBackupsPanel .si {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

#adminRoot #settingsBackupsPanel .sl {
  font-size: 13px;
  font-weight: 700;
  color: var(--cfg-text);
}

#adminRoot #settingsBackupsPanel .sh {
  font-size: 11.5px;
  color: var(--cfg-text-2);
}

#adminRoot #settingsBackupsPanel .sc-ctrl {
  flex-shrink: 0;
}

#adminRoot .settings-model-dropdown {
  border-top: 1px solid var(--cfg-border);
}

#adminRoot .settings-model-dropdown.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

#adminRoot .settings-model-dropdown-toggle {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--cfg-border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--cfg-text);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

#adminRoot .settings-model-dropdown-toggle svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
  transition: transform 160ms ease;
}

#adminRoot .settings-model-dropdown-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

#adminRoot .settings-model-dropdown-content.is-collapsed {
  display: none;
}

#adminRoot #settingsBackupsPanel .action-card .field-hint,
#adminRoot #settingsBackupsPanel .action-card .action-label {
  color: var(--cfg-text-2);
}

#adminRoot #settingsConfigPanel .btn-primary {
  background: var(--cfg-accent);
  color: #ffffff;
  border-color: var(--cfg-accent);
}

/* Preview 1:1 com provador-external.js (resultado da analise) */
#adminRoot .pv-preview-host .cosh-size-carousel {
  position: relative;
  margin: 20px 0;
}

#adminRoot .pv-preview-host .cosh-size-carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 0;
  scroll-snap-type: x mandatory;
}

#adminRoot .pv-preview-host .cosh-size-carousel-track::-webkit-scrollbar {
  display: none;
}

#adminRoot .pv-preview-host .cosh-size-option {
  flex: 0 0 100%;
  width: 100%;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
  scroll-snap-align: center;
}

#adminRoot .pv-preview-host .cosh-size-option:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#adminRoot .pv-preview-host .cosh-size-option.active {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  border-color: #10b981 !important;
  border-width: 3px !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.22) !important;
}

#adminRoot .pv-preview-host .cosh-size-option.recommended {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  border-color: #10b981 !important;
  border-width: 2px !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18) !important;
}

#adminRoot .pv-preview-host .cosh-size-option.recommended.loose,
#adminRoot .pv-preview-host .cosh-size-option.recommended.tight {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
  border-color: #10b981 !important;
}

#adminRoot .pv-preview-host .cosh-size-option.loose {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  border-color: #f59e0b !important;
}

#adminRoot .pv-preview-host .cosh-size-option.tight {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
  border-color: #ef4444 !important;
}

#adminRoot .pv-preview-host .cosh-size-option-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

#adminRoot .pv-preview-host .cosh-selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #111827;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

#adminRoot .pv-preview-host .cosh-size-option-number {
  font-size: 36px;
  font-weight: 800;
  color: #111827;
}

#adminRoot .pv-preview-host .cosh-size-option.active .cosh-size-option-number {
  color: #047857 !important;
}

#adminRoot .pv-preview-host .cosh-size-option.loose .cosh-size-option-number {
  color: #92400e;
}

#adminRoot .pv-preview-host .cosh-size-option.tight .cosh-size-option-number {
  color: #991b1b;
}

#adminRoot .pv-preview-host .cosh-size-status-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#adminRoot .pv-preview-host .cosh-size-status-badge.perfect,
#adminRoot .pv-preview-host .cosh-size-status-badge.recommended {
  background: #10b981 !important;
  color: #ffffff !important;
}

#adminRoot .pv-preview-host .cosh-size-status-badge.loose {
  background: #d97706 !important;
  color: #ffffff !important;
}

#adminRoot .pv-preview-host .cosh-size-status-badge.tight {
  background: #dc2626 !important;
  color: #ffffff !important;
}

#adminRoot .pv-preview-host .cosh-fit-direction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: #f3f4f6;
  color: #374151;
  margin-top: 8px;
  margin-bottom: 8px;
}

#adminRoot .pv-preview-host .cosh-fit-direction.recommended {
  background: #dcfce7;
  color: #166534;
}

#adminRoot .pv-preview-host .cosh-size-option-description {
  font-size: 13px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 12px;
  font-weight: 400;
}

#adminRoot .pv-preview-host .cosh-size-option.active .cosh-size-option-description {
  color: #065f46 !important;
  font-weight: 500 !important;
}

#adminRoot .pv-preview-host .cosh-size-option.loose .cosh-size-option-description {
  color: #78350f;
}

#adminRoot .pv-preview-host .cosh-size-option.tight .cosh-size-option-description {
  color: #7f1d1d;
}

#adminRoot .pv-preview-host .cosh-size-option-measures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
}

#adminRoot .pv-preview-host .cosh-size-option.active .cosh-size-option-measures {
  border-top-color: #a7f3d0 !important;
}

#adminRoot .pv-preview-host .cosh-size-option.loose .cosh-size-option-measures {
  border-top-color: #fcd34d;
}

#adminRoot .pv-preview-host .cosh-size-option.tight .cosh-size-option-measures {
  border-top-color: #fca5a5;
}

#adminRoot .pv-preview-host .cosh-measure-item-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: transparent;
  border: 0;
  padding: 0;
}

#adminRoot #settingsConfigPanel .btn:not(.btn-primary),
#adminRoot #settingsUsersPanel .btn:not(.btn-primary),
#adminRoot #settingsBackupsPanel .btn:not(.btn-primary) {
  background: var(--cfg-bg-3);
  border-color: var(--cfg-border-hi);
  color: var(--cfg-text);
}

#adminRoot #settingsConfigPanel .btn:hover,
#adminRoot #settingsUsersPanel .btn:hover,
#adminRoot #settingsBackupsPanel .btn:hover {
  border-color: var(--cfg-accent-br);
}

/* Preview placement: desktop right column + proper in-section modal preview */
#adminRoot .settings-config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(760px, 920px);
  gap: 20px;
  align-items: start;
}

/* Scrollbar styling global do admin */
#adminRoot * {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.62) rgba(15, 23, 42, 0.12);
}

#adminRoot *::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

#adminRoot *::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
}

#adminRoot *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.78) 0%, rgba(100, 116, 139, 0.86) 100%);
  border: 2px solid rgba(15, 23, 42, 0.22);
  background-clip: padding-box;
  border-radius: 999px;
  min-height: 36px;
}

#adminRoot *::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.95) 0%, rgba(71, 85, 105, 0.98) 100%);
}

#adminRoot *::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.95) 0%, rgba(51, 65, 85, 1) 100%);
}

#adminRoot *::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

#adminRoot *::-webkit-scrollbar-button:single-button,
#adminRoot *::-webkit-scrollbar-button:double-button,
#adminRoot *::-webkit-scrollbar-button:start,
#adminRoot *::-webkit-scrollbar-button:end,
#adminRoot *::-webkit-scrollbar-button:vertical:start:decrement,
#adminRoot *::-webkit-scrollbar-button:vertical:end:increment,
#adminRoot *::-webkit-scrollbar-button:horizontal:start:decrement,
#adminRoot *::-webkit-scrollbar-button:horizontal:end:increment {
  display: none;
  width: 0;
  height: 0;
}

#adminRoot *::-webkit-scrollbar-corner {
  background: transparent;
}

/* Na previa da tabela de medidas, ocultar a barra horizontal do carrossel de tamanhos */
#adminRoot .settings-table-modal-preview .cosh-medidas-size-track {
  scrollbar-width: none !important;
  -ms-overflow-style: none;
}

#adminRoot .settings-table-modal-preview .cosh-medidas-size-track::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

#adminRoot #settingsConfigPanel .settings-config-card {
  margin-right: -28px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

#adminRoot #settingsConfigPanel .settings-config-layout {
  grid-template-columns: minmax(0, 1fr) minmax(820px, 1fr);
  gap: 12px;
}

#adminRoot .settings-config-form {
  min-width: 0;
}

#adminRoot .settings-config-preview-wrap {
  position: sticky;
  top: 16px;
  align-self: start;
}

#adminRoot .settings-config-preview {
  max-height: calc(100vh - 132px);
  overflow: auto;
}

#adminRoot .settings-pv-shell {
  overflow: hidden;
  background: linear-gradient(180deg, #0c0f1a 0%, #0a0d16 100%);
  border: 1px solid var(--cfg-border-hi);
  padding: 8px;
  border-radius: 12px;
}

#adminRoot .settings-pv-real-layout {
  grid-template-columns: 1fr;
  gap: 14px;
}

#adminRoot .settings-pv-stage {
  max-width: none;
}

#adminRoot .pv-preview-host .cosh-pv-modal-content {
  max-width: 100%;
}

#adminRoot .settings-table-modal-preview .cosh-medidas-modal {
  max-width: 100%;
}

#adminRoot .settings-pro-row-modal-preview {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

#adminRoot .settings-pro-row-modal-preview .settings-pro-copy {
  margin-bottom: 0;
}

#adminRoot .settings-table-modal-preview {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

@media (max-width: 1100px) {
  #adminRoot .settings-config-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #adminRoot #settingsConfigPanel .settings-config-card {
    margin-right: 0;
    border-top-right-radius: 14px;
    border-bottom-right-radius: 14px;
  }

  #adminRoot .settings-config-preview-wrap {
    position: static;
    top: auto;
  }

  #adminRoot .settings-pro-row-modal-preview {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  #adminRoot .settings-config-preview {
    max-height: none;
    overflow: visible;
  }

  #adminRoot .settings-pv-shell {
    overflow: visible;
  }

  #adminRoot #settingsBackupsPanel .bk-grid {
    grid-template-columns: 1fr;
  }

  #adminRoot #settingsBackupsPanel .sr {
    flex-direction: column;
    align-items: stretch;
  }

  #adminRoot #settingsBackupsPanel .sc-ctrl {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .footer {
    padding: 10px 12px;
  }

  .btn {
    white-space: normal;
  }

  .confirm-box {
    width: calc(100vw - 24px);
    min-width: 0;
    max-height: 88vh;
    overflow: auto;
    padding: 16px;
  }

  .confirm-box .confirm-actions {
    flex-wrap: wrap;
  }

  .confirm-box .confirm-actions .btn {
    flex: 1 1 140px;
  }

  .hero-user-panel {
    width: min(92vw, 320px);
  }

  .user-access-list {
    overflow: auto;
  }

  .analytics-table {
    min-width: 520px;
  }

  .analytics-table th,
  .analytics-table td {
    padding: 8px;
    font-size: 12px;
  }

  .backup-restore-row {
    grid-template-columns: 1fr;
  }

  .backup-restore-row .btn {
    width: 100%;
    justify-content: center;
  }

  .avatar-crop-viewport {
    width: min(86vw, 320px);
    height: min(86vw, 320px);
  }

  #adminRoot.page {
    padding-bottom: 16px;
  }

  #adminRoot .shell-main {
    padding: 10px 10px 0;
  }

  #adminRoot .hero {
    padding: 12px;
  }

  #adminRoot .hero-content {
    position: relative;
    display: block;
    min-height: 74px;
    gap: 0;
  }

  #adminRoot .hero-text {
    min-width: 0;
    width: 100%;
    padding-right: 142px;
  }

  #adminRoot .eyebrow {
    margin-bottom: 5px;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  #adminRoot h1 {
    font-size: 22px;
    line-height: 1.15;
    margin-bottom: 6px;
  }

  #adminRoot .sub {
    font-size: 13px;
    line-height: 1.35;
    max-width: 36ch;
  }

  #adminRoot .hero-user-card {
    position: absolute;
    top: 0;
    right: 0;
    width: auto;
    min-width: 134px;
    max-width: 140px;
    padding: 6px;
    border-radius: 10px;
  }

  #adminRoot .hero-user-actions {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  #adminRoot .account-trigger {
    min-width: 0;
    padding: 5px 6px;
    gap: 6px;
  }

  #adminRoot .user-avatar {
    width: 24px;
    height: 24px;
  }

  #adminRoot .user-name {
    font-size: 12px;
    line-height: 1.2;
    max-width: 7ch;
  }

  #adminRoot .top-theme-toggle {
    min-height: 30px;
    height: 30px;
    width: 30px;
    padding: 0 !important;
    justify-content: center;
    align-items: center;
    display: inline-flex;
    gap: 0;
    line-height: 1;
  }

  #adminRoot .hero-user-panel {
    width: min(90vw, 300px);
    max-width: min(90vw, 300px);
    right: 0;
    left: auto;
    top: calc(100% + 8px);
  }

  #adminRoot .admin-tabs {
    margin: 8px;
    gap: 6px;
    padding-bottom: 0;
  }

  #adminRoot .admin-tab {
    padding: 9px 10px;
  }

  #adminRoot .tab-popup-menu {
    position: static;
    transform: none;
  }

  #adminRoot .editor-kpis {
    gap: 8px;
  }

  #adminRoot .layout {
    gap: 12px;
  }

  #adminRoot .sidebar {
    padding: 14px;
  }

  #adminRoot .card-header,
  #adminRoot .form-section,
  #adminRoot .form-actions {
    padding: 14px;
  }

  #adminRoot .settings-section,
  #adminRoot .analytics-section,
  #adminRoot .analytics-charts {
    padding: 12px;
  }

  #adminRoot .settings-grid {
    gap: 10px;
  }

  #adminRoot .settings-pro-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  #adminRoot .settings-config-topnav {
    padding: 4px;
  }

  #adminRoot .settings-section-head,
  #adminRoot .settings-setting-row {
    flex-direction: column;
    align-items: stretch;
  }

  #adminRoot .settings-pro-row-colors .settings-color-input-wrap {
    justify-self: stretch;
  }

  #adminRoot .settings-color-input-wrap input[type="text"],
  #adminRoot .settings-pro-row > input[type="text"],
  #adminRoot .settings-pro-row > input[type="tel"],
  #adminRoot .settings-pro-row > input[type="number"],
  #adminRoot .settings-tip-input,
  #adminRoot .settings-phone-input-wrap,
  #adminRoot .settings-setting-control,
  #adminRoot .settings-row-input,
  #adminRoot .settings-upload-label,
  #adminRoot .settings-inline-pair {
    width: 100%;
  }

  #adminRoot .settings-config-preview {
    padding: 12px;
  }

  #adminRoot .settings-config-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  #adminRoot .settings-config-preview-wrap {
    position: static;
    top: auto;
  }

  #adminRoot .settings-config-preview {
    max-height: none;
    overflow: visible;
  }

  #adminRoot #settingsUsersPanel .users-head {
    flex-direction: column;
    align-items: stretch;
  }

  #adminRoot #settingsUsersPanel .users-head > div:last-child {
    width: 100%;
  }

  #adminRoot #settingsUsersPanel .users-head > div:last-child .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  #adminRoot .pv-preview-host .cosh-pv-grid-2 {
    grid-template-columns: 1fr;
  }

  #adminRoot .settings-pv-real-layout {
    grid-template-columns: 1fr;
  }

  #adminRoot .pv-preview-host .cosh-pv-modal-content {
    min-height: 430px;
    max-height: 62vh;
  }

  #adminRoot .settings-pv-modal-content-result {
    min-height: 340px;
  }

  #adminRoot .settings-pv-tip-row {
    flex-direction: column;
    align-items: stretch;
  }

  #adminRoot .pv-preview-host .cosh-how-to-measure-btn {
    width: 100%;
    justify-content: center;
  }

  #adminRoot .btn-group {
    width: 100%;
  }

  #adminRoot .btn-group .btn,
  #adminRoot .btn-group label.btn {
    flex: 1 1 100%;
    width: 100%;
    justify-content: center;
  }

  #adminRoot .measures-table {
    min-width: 540px;
  }
}

@media (max-width: 480px) {
  .auth-panel {
    padding: 28px 18px;
  }

  .about-modal,
  .user-modal,
  .avatar-crop-modal {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .about-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .about-version-pill {
    justify-self: start;
  }

  .hero-user-panel,
  #adminRoot .hero-user-panel {
    width: min(94vw, 360px);
  }

  .top-user-email {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .analytics-table {
    min-width: 440px;
  }

  .measures-table {
    min-width: 500px;
  }
}

/* Sidebar account card (moved from hero to menu footer) */
#adminRoot .hero {
  display: none;
}

#adminRoot .admin-tabs {
  flex: 1;
}

#adminRoot .sidebar-user-card {
  position: sticky;
  bottom: 14px;
  z-index: 40;
  width: auto;
  min-width: 0;
  max-width: none;
  margin: auto 12px 8px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#adminRoot .sidebar-user-card .hero-user-actions {
  gap: 0;
}

#adminRoot .sidebar-user-card .account-trigger {
  min-height: 36px;
  padding: 6px 4px 6px 8px;
  border-radius: 10px;
}

#adminRoot .sidebar-user-card .account-trigger-caret {
  margin-left: auto;
  margin-right: 4px;
  padding-right: 0;
}

#adminRoot .sidebar-user-card .hero-user-panel {
  top: auto;
  bottom: calc(100% + 10px);
  left: 0;
  right: auto;
  width: 100%;
  min-width: 0;
  max-width: none;
}

/* Profile modal redesign */
#profileModal.profile-modal-pro {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #13161d;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 0;
  overflow: hidden;
}

#profileModal.profile-modal-pro > p {
  display: none;
}

#profileModal.profile-modal-pro form {
  display: block;
}

#profileModal .pm-header {
  position: relative;
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

#profileModal .pm-header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb 0%, transparent 70%);
}

#profileModal .pm-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6f7687;
}

#profileModal .pm-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #8a93a6;
  cursor: pointer;
}

#profileModal .pm-avatar-section {
  display: flex;
  justify-content: center;
  padding: 24px 24px 18px;
}

#profileModal .pm-avatar-ring {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(#2563eb 0deg, rgba(37, 99, 235, 0.2) 240deg, #2563eb 360deg);
}

#profileModal .pm-avatar-initial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1a1e28;
  border: 3px solid #13161d;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  text-transform: uppercase;
}

#profileModal .pm-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 24px;
}

#profileModal .pm-fields {
  padding: 20px 24px 14px;
  display: grid;
  gap: 14px;
}

#profileModal .pm-field-group {
  display: grid;
  gap: 5px;
}

#profileModal .pm-field-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6f7687;
}

#profileModal .pm-field-value {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  background: #1a1e28;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

#profileModal .pm-field-icon {
  color: #7b8498;
  font-size: 13px;
  flex-shrink: 0;
}

#profileModal .pm-field-value input[readonly] {
  border: 0 !important;
  background: transparent !important;
  color: #e8eaf0 !important;
  padding: 0 !important;
  height: auto;
  min-height: 0;
}

#profileModal .pm-field-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.26);
}

#profileModal .pm-error {
  margin: 0 24px;
  min-height: 16px;
  color: #e05a6a;
  font-size: 12px;
}

#profileModal .pm-actions {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: flex-end;
}

/* About modal redesign */
#aboutModal.about-modal-pro {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #13161d;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  padding: 0;
  overflow: hidden;
}

#aboutModal.about-modal-pro .about-pro-hero {
  position: relative;
  padding: 30px 24px 24px;
  overflow: hidden;
}

#aboutModal.about-modal-pro .about-pro-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb 0%, transparent 70%);
}

#aboutModal.about-modal-pro .about-pro-hero::after {
  content: "";
  position: absolute;
  top: -44px;
  right: -44px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, transparent 70%);
  pointer-events: none;
}

#aboutModal.about-modal-pro .about-pro-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

#aboutModal.about-modal-pro .about-pro-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e2330 0%, #252b3b 100%);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#aboutModal.about-modal-pro .about-pro-app-icon svg {
  width: 22px;
  height: 22px;
}

#aboutModal.about-modal-pro .about-pro-app-meta {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 3px;
}

#aboutModal.about-modal-pro .about-pro-app-name {
  font-size: 15px;
  font-weight: 600;
  color: #e8eaf0;
  letter-spacing: -0.01em;
}

#aboutModal.about-modal-pro .about-pro-app-subtitle {
  font-size: 12px;
  color: #8892a4;
}

#aboutModal.about-modal-pro .about-pro-version-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

#aboutModal.about-modal-pro .about-pro-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 24px;
}

#aboutModal.about-modal-pro .about-pro-status-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 24px;
}

#aboutModal.about-modal-pro .about-pro-status-card {
  background: #1a1e28;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 13px 14px;
  display: grid;
  gap: 6px;
}

#aboutModal.about-modal-pro .about-pro-status-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5a6070;
}

#aboutModal.about-modal-pro .about-pro-status-value {
  font-size: 12.5px;
  color: #8892a4;
}

#aboutModal.about-modal-pro .about-pro-status-value.is-online {
  color: #4ade80;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#aboutModal.about-modal-pro .about-pro-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

#aboutModal.about-modal-pro .about-pro-modules-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#aboutModal.about-modal-pro .about-pro-module-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #5a6070;
  letter-spacing: 0.03em;
}

#aboutModal.about-modal-pro .about-pro-notes-section {
  padding: 16px 24px 20px;
  display: grid;
  gap: 8px;
}

#aboutModal.about-modal-pro .about-pro-note-main {
  font-size: 13px;
  line-height: 1.65;
  color: #8892a4;
  margin: 0;
}

#aboutModal.about-modal-pro .about-pro-note-muted {
  margin: 0;
  font-size: 11.5px;
  color: #5a6070;
  line-height: 1.6;
  padding-left: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

#aboutModal.about-modal-pro .about-pro-actions {
  padding: 0 24px 24px;
}

#aboutModal.about-modal-pro .about-pro-btn-close {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 1100px) {
  #adminRoot .hero {
    display: block;
    margin-bottom: 10px;
    border: 0;
    background: transparent;
    padding: 0;
  }

  #adminRoot .hero-content {
    display: block;
    min-height: 0;
  }

  #adminRoot .hero-text {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
  }

  #adminRoot .hero-text .eyebrow,
  #adminRoot .hero-text h1,
  #adminRoot .hero-text .sub {
    display: none;
  }

  #adminRoot .sidebar-user-card {
    position: relative;
    bottom: auto;
    z-index: auto;
    margin: 10px 12px 12px;
  }
}

/* ===== Dashboard Multi-sistemas ===== */
#adminRoot.page {
  grid-template-columns: 1fr;
}

#adminRoot .shell-sidebar {
  display: none;
}

#adminRoot .shell-main {
  min-height: 100vh;
  height: 100vh;
  padding: 0 0 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
}

#adminRoot .hero {
  display: none !important;
}

#adminRoot .global-admin-navbar {
  position: sticky;
  top: 0;
  z-index: 80;
  margin: 0;
  padding: 0 18px;
  min-height: 52px;
  background: color-mix(in srgb, var(--admin-surface) 92%, #dfe7fb);
  border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 70%, #b6c5ef);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(28, 43, 89, 0.08), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}

#adminRoot .global-admin-navbar-inner {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}

#adminRoot .global-admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

#adminRoot .nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

#adminRoot .nav-logo-img {
  display: block;
  width: auto;
  height: 30px;
  max-width: min(250px, 32vw);
  object-fit: contain;
}

[data-theme="dark"] #adminRoot .nav-logo-img {
  filter: brightness(0) invert(1);
}

#adminRoot .global-admin-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #45b6ff;
  box-shadow: 0 0 12px rgba(69, 182, 255, 0.75);
}

#adminRoot .global-systems-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  flex-wrap: nowrap;
}

#adminRoot .global-system-menu {
  position: relative;
}

#adminRoot .global-system-btn {
  border: 1px solid color-mix(in srgb, var(--admin-border) 70%, #bfccef);
  background: color-mix(in srgb, var(--admin-surface-2) 86%, #f1f5ff);
  color: var(--admin-text-muted);
  padding: 0 13px;
  height: 37px;
  border-radius: 10px;
  font-family: "DM Sans", "Manrope", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s, box-shadow .15s, transform .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#adminRoot .global-system-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.9;
}

#adminRoot .global-system-icon svg {
  width: 16px;
  height: 16px;
}

#adminRoot .global-system-caret {
  margin-left: auto;
  width: 10px;
  height: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.72;
  transform: rotate(0deg);
  transition: transform .15s ease, opacity .15s ease;
}

#adminRoot .global-system-caret svg {
  width: 10px;
  height: 10px;
}

#adminRoot .global-system-btn:hover,
#adminRoot .global-system-btn.is-active,
#adminRoot .global-system-btn[aria-expanded="true"] {
  color: var(--admin-text);
  border-color: #c5cef8;
  background: var(--admin-surface);
  box-shadow: 0 4px 12px rgba(55, 86, 170, 0.10);
  transform: translateY(-1px);
}

#adminRoot .global-system-btn:hover .global-system-caret,
#adminRoot .global-system-btn[aria-expanded="true"] .global-system-caret {
  transform: rotate(180deg);
  opacity: 1;
}

#adminRoot .global-system-submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 210px;
  background: var(--admin-surface);
  border: 1px solid color-mix(in srgb, var(--admin-border) 70%, #c3cff0);
  border-radius: 0;
  box-shadow: 0 14px 34px rgba(18, 35, 82, 0.16), 0 3px 8px rgba(0, 0, 0, 0.08);
  padding: 7px;
  display: grid;
  gap: 4px;
}

#adminRoot .global-system-submenu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

#adminRoot .global-system-submenu[hidden] {
  display: none !important;
}

#adminRoot .global-system-submenu button {
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--admin-text-muted);
  text-align: left;
  padding: 8px 10px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

#adminRoot .global-system-submenu button:hover {
  background: color-mix(in srgb, #eef1fd 62%, #fff);
  border-left-color: rgba(37, 99, 235, 0.34);
  color: var(--admin-text);
}

#adminRoot .global-submenu-group {
  position: relative;
}

#adminRoot .global-submenu-group::after {
  content: "";
  position: absolute;
  top: 0;
  right: -10px;
  width: 12px;
  height: 100%;
}

#adminRoot .global-submenu-parent {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

#adminRoot .global-submenu-group:hover .global-submenu-parent,
#adminRoot .global-submenu-group:focus-within .global-submenu-parent {
  background: color-mix(in srgb, #eef1fd 62%, #fff);
  color: var(--admin-text);
}

#adminRoot .global-submenu-arrow {
  margin-left: auto;
  font-size: 12px;
  color: var(--admin-text-muted);
}

#adminRoot .submenu-item-icon {
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.95;
  flex-shrink: 0;
}

#adminRoot .submenu-item-icon svg {
  width: 15px;
  height: 15px;
}

#adminRoot .global-submenu-flyout {
  position: absolute;
  top: 0;
  left: calc(100% + 10px);
  min-width: 190px;
  background: var(--admin-surface);
  border: 1px solid color-mix(in srgb, var(--admin-border) 70%, #c3cff0);
  border-radius: 0;
  box-shadow: 0 14px 34px rgba(18, 35, 82, 0.16), 0 3px 8px rgba(0, 0, 0, 0.08);
  padding: 6px;
  display: grid;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s ease;
  z-index: 5;
}

#adminRoot .global-submenu-group:hover .global-submenu-flyout,
#adminRoot .global-submenu-group:focus-within .global-submenu-flyout {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

#adminRoot .global-user-mount {
  display: flex;
  justify-content: flex-end;
}

#adminRoot .global-user-mount .sidebar-user-card {
  margin: 0;
  position: static;
  width: auto;
  min-width: 58px;
}

#adminRoot .global-user-mount .sidebar-user-card .hero-user-panel {
  bottom: auto;
  top: calc(100% + 8px);
  right: 12px;
  left: auto;
  width: 232px;
  background: var(--user-menu-bg, #f2f2f2);
  border: 1px solid var(--user-menu-border, #d7d7d7);
  border-radius: 6px;
  box-shadow: 0 14px 34px -20px rgba(0, 0, 0, 0.38);
  padding: 0;
}

#adminRoot .global-user-mount .sidebar-user-card .hero-user-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

#adminRoot .global-user-mount .account-trigger {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  justify-content: space-between;
  border-radius: 8px;
  background: var(--admin-surface);
  border-color: color-mix(in srgb, var(--admin-border) 70%, #bfccef);
  transition: color .15s, border-color .15s, background .15s, box-shadow .15s, transform .15s;
}

#adminRoot .global-user-mount .account-trigger .user-avatar {
  width: 20px;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--admin-border) 70%, #bfccef);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  transition: color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

#adminRoot .global-user-mount .account-trigger-caret-svg {
  color: currentColor;
  transition: transform .15s ease, color .15s ease;
}

#adminRoot .global-user-mount .account-trigger:hover,
#adminRoot .global-user-mount .account-trigger[aria-expanded="true"] {
  color: var(--admin-text);
  border-color: #c5cef8;
  background: var(--admin-surface);
  box-shadow: 0 4px 12px rgba(55, 86, 170, 0.10);
  transform: translateY(-1px);
}

#adminRoot .global-user-mount .account-trigger:hover .account-trigger-caret-svg,
#adminRoot .global-user-mount .account-trigger[aria-expanded="true"] .account-trigger-caret-svg {
  transform: rotate(180deg);
  color: var(--admin-text);
}

#adminRoot .global-user-mount .account-trigger:hover .user-avatar,
#adminRoot .global-user-mount .account-trigger[aria-expanded="true"] .user-avatar {
  border-color: #c5cef8;
  box-shadow: 0 0 0 2px color-mix(in srgb, #c5cef8 30%, transparent);
}

#adminRoot .container-action {
  padding: 0;
  color: var(--user-menu-text, #2f2f2f);
}

#adminRoot .user_info_container {
  border: 0;
  border-bottom: 1px solid var(--user-menu-divider, #d6d6d6);
  border-radius: 0;
  background: transparent;
  padding: 10px 10px 9px 12px;
}

#adminRoot .user_logado {
  font-size: 11px;
  color: var(--user-menu-muted, #8a8a8a);
}

#adminRoot .user_identity_row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

#adminRoot .user_nome {
  font-size: 14px;
  font-weight: 700;
  color: var(--user-menu-text-strong, #242424);
}

#adminRoot .user_cargo {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--user-menu-badge-text, #3f7edb);
  border: 1px solid var(--user-menu-badge-border, #d9e5f7);
  background: var(--user-menu-badge-bg, #e8eef8);
}

#adminRoot .admin-slide-toogle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 10px 9px 12px;
  border-bottom: 1px solid var(--user-menu-divider, #d6d6d6);
  font-size: 12px;
  color: var(--user-menu-muted-2, #505050);
}

#adminRoot .admin-slide-toogle input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--user-menu-switch-border, #c9c9c9);
  background: var(--user-menu-switch-bg, #e7e7e7);
  cursor: pointer;
  margin: 0;
  position: relative;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

#adminRoot .admin-slide-toogle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--user-menu-switch-knob, #ffffff);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

#adminRoot .admin-slide-toogle input[type="checkbox"]:checked {
  background: var(--user-menu-switch-bg-checked, #cfd8e8);
  border-color: var(--user-menu-switch-border-checked, #b8c5db);
}

#adminRoot .admin-slide-toogle input[type="checkbox"]:checked::after {
  transform: translateX(14px);
}

#adminRoot .lista-action {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  display: grid;
  gap: 0;
}

#adminRoot .lista-action a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--user-menu-link, #5a5a5a);
  font-size: 12px;
  font-weight: 400;
  border-radius: 0;
  padding: 7px 10px 7px 12px;
}

#adminRoot .lista-action a:hover {
  background: var(--user-menu-hover, #ececec);
}

#adminRoot .lista-action .sub-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

#adminRoot .lista-action li:last-child a {
  color: var(--user-menu-link-danger, #4f4f4f);
}

[data-theme="light"] #adminRoot {
  --user-menu-bg: #f2f2f2;
  --user-menu-border: #d7d7d7;
  --user-menu-divider: #d6d6d6;
  --user-menu-text: #2f2f2f;
  --user-menu-text-strong: #242424;
  --user-menu-muted: #8a8a8a;
  --user-menu-muted-2: #505050;
  --user-menu-link: #5a5a5a;
  --user-menu-link-danger: #4f4f4f;
  --user-menu-hover: #ececec;
  --user-menu-badge-text: #3f7edb;
  --user-menu-badge-border: #d9e5f7;
  --user-menu-badge-bg: #e8eef8;
  --user-menu-switch-border: #c9c9c9;
  --user-menu-switch-bg: #e7e7e7;
  --user-menu-switch-knob: #ffffff;
  --user-menu-switch-bg-checked: #cfd8e8;
  --user-menu-switch-border-checked: #b8c5db;
}

[data-theme="dark"] #adminRoot {
  --user-menu-bg: #1b1f29;
  --user-menu-border: #30384a;
  --user-menu-divider: #30384a;
  --user-menu-text: #e5e7eb;
  --user-menu-text-strong: #f8fafc;
  --user-menu-muted: #9ca3af;
  --user-menu-muted-2: #cbd5e1;
  --user-menu-link: #e2e8f0;
  --user-menu-link-danger: #fca5a5;
  --user-menu-hover: rgba(69, 182, 255, 0.14);
  --user-menu-badge-text: #7dd3fc;
  --user-menu-badge-border: rgba(125, 211, 252, 0.4);
  --user-menu-badge-bg: rgba(125, 211, 252, 0.15);
  --user-menu-switch-border: #4b5563;
  --user-menu-switch-bg: #374151;
  --user-menu-switch-knob: #f8fafc;
  --user-menu-switch-bg-checked: #1d4ed8;
  --user-menu-switch-border-checked: #3b82f6;
}

#adminRoot .workspace-tabs-shell {
  border-top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--admin-border) 70%, #d4d4d0);
  border-left: 0;
  border-right: 0;
  background: #eceff5;
  border-radius: 0;
  padding: 0;
  flex: 0 0 auto;
}

#adminRoot .workspace-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  min-height: 38px;
  padding: 0;
}

#adminRoot .empty-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

#adminRoot .empty-workspace-logo {
  width: min(900px, 74vw);
  max-width: 100%;
  height: auto;
  opacity: 0.12;
  filter: grayscale(1);
  user-select: none;
  pointer-events: none;
}

[data-theme="dark"] #adminRoot .empty-workspace {
  background: #111315;
}

[data-theme="dark"] #adminRoot .empty-workspace-logo {
  filter: grayscale(1) brightness(0) invert(1);
  opacity: 0.1;
}

[data-theme="dark"] #adminRoot .empty-workspace h1,
[data-theme="dark"] #adminRoot .empty-workspace h2,
[data-theme="dark"] #adminRoot .empty-workspace h3,
[data-theme="dark"] #adminRoot .empty-workspace p,
[data-theme="dark"] #adminRoot .empty-workspace span {
  color: #eef2f7;
}

#adminRoot .workspace-tab {
  border-right: 1px solid #e5e5e3;
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
  background: transparent;
  color: #57574f;
  border-radius: 0;
  padding: 0 10px;
  min-height: 38px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: max-width 0.2s ease, width 0.2s ease, opacity 0.16s ease, padding 0.2s ease, border-color 0.2s ease;
  transform-origin: left center;
}

#adminRoot .workspace-tab.is-closing {
  opacity: 0;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  pointer-events: none;
}

#adminRoot .workspace-tab-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#adminRoot .workspace-tab-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.92;
  flex-shrink: 0;
}

#adminRoot .workspace-tab-icon svg {
  width: 14px;
  height: 14px;
}

#adminRoot .workspace-tab-label {
  display: inline-block;
}

#adminRoot .workspace-tab-close {
  border: 0;
  background: transparent;
  color: #80807a;
  width: 14px;
  height: 14px;
  border-radius: 0;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}

#adminRoot .workspace-tab:not(.is-active) .workspace-tab-close:hover {
  background: rgba(17, 24, 39, 0.08);
  color: #111827;
  border-radius: 4px;
}

#adminRoot .workspace-tab.is-active {
  background: #ffffff;
  border-right-color: #d4d4d0;
  color: #1a1a18;
}

#adminRoot .workspace-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 0;
  background: #3b5bdb;
}

[data-theme="dark"] #adminRoot .workspace-tabs-shell {
  background: #eceff5;
  border-top-color: #d4d4d0;
  border-bottom-color: #d4d4d0;
}

[data-theme="dark"] #adminRoot .workspace-tab {
  background: transparent;
  border-right-color: #e5e5e3;
  color: #4b5563;
}

[data-theme="dark"] #adminRoot .workspace-tab .workspace-tab-label,
[data-theme="dark"] #adminRoot .workspace-tab .workspace-tab-icon {
  color: #4b5563;
}

[data-theme="dark"] #adminRoot .workspace-tab-close {
  background: transparent;
  border: 0;
  color: #6b7280;
}

[data-theme="dark"] #adminRoot .workspace-tab:not(.is-active) .workspace-tab-close:hover {
  background: rgba(17, 24, 39, 0.08);
  color: #111827;
  border-radius: 4px;
}

[data-theme="dark"] #adminRoot .workspace-tab.is-active .workspace-tab-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #eef2f7;
  border-radius: 4px;
}

[data-theme="dark"] #adminRoot .workspace-tab.is-active {
  background: #191c20;
  border-right-color: #2f3f72;
  color: #eef2f7;
}

[data-theme="dark"] #adminRoot .workspace-tab.is-active .workspace-tab-label,
[data-theme="dark"] #adminRoot .workspace-tab.is-active .workspace-tab-icon,
[data-theme="dark"] #adminRoot .workspace-tab.is-active .workspace-tab-close {
  color: #eef2f7;
}

[data-theme="dark"] #adminRoot .workspace-tab.is-active::after {
  background: #7c9cff;
}

/* No tema escuro, manter a área de trabalho (abas + conteúdo) em estilo claro.
   Apenas navbar e menu de usuário seguem o visual dark. */
[data-theme="dark"] #adminRoot .shell-main {
  background: #ffffff;
}

[data-theme="dark"] #adminRoot .admin-panel {
  --bg: #f6f3ef;
  --bg-subtle: #fff8f1;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --text: #111827;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.16);
  --accent: #2563eb;
  --accent-light: rgba(37, 99, 235, 0.16);
  --admin-app-bg: #f3f4f6;
  --admin-sidebar-bg: #ffffff;
  --admin-surface: #ffffff;
  --admin-surface-2: #f8fafc;
  --admin-border: rgba(15, 23, 42, 0.1);
  --admin-text: #111827;
  --admin-text-muted: rgba(17, 24, 39, 0.62);
  --admin-tab-text: rgba(17, 24, 39, 0.65);
  --admin-tab-hover-bg: rgba(15, 23, 42, 0.05);
  --admin-card-glass-top: rgba(15, 23, 42, 0.02);
  --admin-text-muted: rgba(17, 24, 39, 0.78);
  --text-secondary: #334155;
  --text-tertiary: #475569;
}

/* No dark mode, manter alto contraste do conteúdo dos painéis (sem afetar navbar/abas) */
[data-theme="dark"] #adminRoot .admin-panel h1,
[data-theme="dark"] #adminRoot .admin-panel h2,
[data-theme="dark"] #adminRoot .admin-panel h3,
[data-theme="dark"] #adminRoot .admin-panel h4,
[data-theme="dark"] #adminRoot .admin-panel h5,
[data-theme="dark"] #adminRoot .admin-panel h6,
[data-theme="dark"] #adminRoot .admin-panel .field-label,
[data-theme="dark"] #adminRoot .admin-panel .t-bold,
[data-theme="dark"] #adminRoot .admin-panel .t-id,
[data-theme="dark"] #adminRoot .admin-panel .analytics-value,
[data-theme="dark"] #adminRoot .admin-panel .metric-value {
  color: #0f172a !important;
}

[data-theme="dark"] #adminRoot .admin-panel .status-text,
[data-theme="dark"] #adminRoot .admin-panel .field-hint,
[data-theme="dark"] #adminRoot .admin-panel .product-row-meta,
[data-theme="dark"] #adminRoot .admin-panel .xpg-label,
[data-theme="dark"] #adminRoot .admin-panel .analytics-subtitle,
[data-theme="dark"] #adminRoot .admin-panel .analytics-label,
[data-theme="dark"] #adminRoot .admin-panel .sku-count,
[data-theme="dark"] #adminRoot .admin-panel .sync-status {
  color: #334155 !important;
}

/* Contraste extra dos textos de analytics no tema escuro
   (a área de conteúdo continua clara). */
[data-theme="dark"] #adminRoot #panelAnalytics h2,
[data-theme="dark"] #adminRoot #panelAnalytics h3,
[data-theme="dark"] #adminRoot #panelAnalytics .analytics-value,
[data-theme="dark"] #adminRoot #panelAnalytics .analytics-donut-center strong,
[data-theme="dark"] #adminRoot #panelAnalytics #analyticsDonutTotal {
  color: #111827 !important;
}

[data-theme="dark"] #adminRoot #panelAnalytics .analytics-subtitle,
[data-theme="dark"] #adminRoot #panelAnalytics .analytics-label,
[data-theme="dark"] #adminRoot #panelAnalytics .analytics-pro-head p,
[data-theme="dark"] #adminRoot #panelAnalytics .analytics-donut-center small,
[data-theme="dark"] #adminRoot #panelAnalytics .analytics-chart-label,
[data-theme="dark"] #adminRoot #panelAnalytics .analytics-chart-value,
[data-theme="dark"] #adminRoot #panelAnalytics .analytics-table th,
[data-theme="dark"] #adminRoot #panelAnalytics .analytics-table td,
[data-theme="dark"] #adminRoot #panelAnalytics #analyticsMeasuresRangeLabel,
[data-theme="dark"] #adminRoot #panelAnalytics #analyticsAllProductsRangeLabel {
  color: #334155 !important;
}

[data-theme="dark"] #adminRoot .global-system-btn {
  background: #20252b;
  border-color: #2c333b;
  color: #c1cad4;
}

[data-theme="dark"] #adminRoot .global-system-btn:hover,
[data-theme="dark"] #adminRoot .global-system-btn.is-active,
[data-theme="dark"] #adminRoot .global-system-btn[aria-expanded="true"] {
  background: #202c4f;
  border-color: #2f3f72;
  color: #eef2f7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] #adminRoot .global-system-submenu {
  background: #191c20;
  border-color: #2c333b;
}

[data-theme="dark"] #adminRoot .global-system-submenu button {
  color: #c1cad4;
}

[data-theme="dark"] #adminRoot .global-system-submenu button:hover {
  background: #273353;
  color: #eef2f7;
}

[data-theme="dark"] #adminRoot .global-submenu-group:hover .global-submenu-parent,
[data-theme="dark"] #adminRoot .global-submenu-group:focus-within .global-submenu-parent {
  background: #273353;
  color: #eef2f7;
}

[data-theme="dark"] #adminRoot .global-submenu-flyout {
  background: #191c20;
  border-color: #2c333b;
}

#adminRoot .admin-panel {
  display: none;
}

#adminRoot .admin-panel.is-active {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 18px 30px;
}

/* Lista de produtos em largura total útil (sem sobras laterais) */
#adminRoot #panelEditor.is-products-list.admin-panel.is-active {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  margin: 0 !important;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#adminRoot #panelEditor.is-products-list #editorLayout {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  min-height: 0;
}

#adminRoot #panelEditor.is-products-list #editorSidebarSection {
  width: 100%;
  height: 100%;
  min-height: 0;
  gap: 0;
}

#adminRoot #panelEditor.is-products-list .products-admin {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#adminRoot .shell-main.is-products-list-mode {
  padding: 0 !important;
}

#adminRoot .shell-main.is-analytics-measures-mode {
  padding: 0 !important;
}

#adminRoot .shell-main.is-analytics-flat-mode {
  padding: 0 !important;
}

#adminRoot .shell-main.is-products-list-mode .workspace-tabs-shell {
  margin: 0;
}

#adminRoot .shell-main.is-analytics-measures-mode .workspace-tabs-shell {
  margin: 0;
}

#adminRoot #panelEditor.is-products-list .customers-header-filter {
  margin-bottom: 0;
}

#adminRoot #panelEditor.is-products-list .products-grid-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

#adminRoot #panelAnalytics.is-measures-mode.admin-panel.is-active {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  margin: 0 !important;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#adminRoot #panelAnalytics.is-flat-mode.admin-panel.is-active {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  margin: 0 !important;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

#adminRoot #panelAnalytics.is-flat-mode .analytics-section {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#adminRoot #panelAnalytics.is-flat-mode .analytics-header {
  margin: 0;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
}

#adminRoot #panelAnalytics.is-flat-mode #analyticsColumnsSection {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

#adminRoot #panelAnalytics.is-flat-mode #analyticsTopSection {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
  padding-bottom: 0;
}

#adminRoot #panelAnalytics.is-flat-mode #analyticsTopSection > h3 {
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

#adminRoot #panelAnalytics.is-flat-mode #analyticsTopSection > h3:nth-of-type(2) {
  border-top: 1px solid var(--border);
}

#adminRoot #panelAnalytics.is-flat-mode #analyticsTopSection .analytics-table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: auto;
  margin: 0;
}

#adminRoot #panelAnalytics.is-flat-mode #analyticsTopSection .analytics-table-wrap:first-of-type {
  min-height: auto;
  max-height: 240px;
}

#adminRoot #panelAnalytics.is-flat-mode #analyticsTopSection .analytics-table-wrap:last-of-type {
  min-height: 0;
  height: 100%;
}

#adminRoot #panelAnalytics.is-flat-mode .analytics-top-secondary-title {
  margin: 0;
  padding: 10px 12px;
  font-size: 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Top produtos: neutraliza largura herdada da grade de produtos (checkbox/sku) */
#adminRoot #panelAnalytics .analytics-top-grid,
#adminRoot #panelAnalytics .analytics-all-products-grid {
  table-layout: auto !important;
  width: 100%;
}

#adminRoot #panelAnalytics #analyticsTopSection .products-grid th,
#adminRoot #panelAnalytics #analyticsTopSection .products-grid td {
  font-size: 13px;
  line-height: 1.35;
  padding: 10px 12px;
}

#adminRoot #panelAnalytics .analytics-top-grid thead th:first-child,
#adminRoot #panelAnalytics .analytics-top-grid tbody td:first-child {
  text-align: left;
  white-space: normal;
  word-break: break-word;
  min-width: 420px;
}

#adminRoot #panelAnalytics .analytics-top-grid thead th:nth-child(2),
#adminRoot #panelAnalytics .analytics-top-grid tbody td:nth-child(2),
#adminRoot #panelAnalytics .analytics-top-grid thead th:nth-child(3),
#adminRoot #panelAnalytics .analytics-top-grid tbody td:nth-child(3) {
  width: 130px !important;
  text-align: left;
  white-space: nowrap;
}

#adminRoot #panelAnalytics .analytics-all-products-grid thead th:first-child,
#adminRoot #panelAnalytics .analytics-all-products-grid tbody td:first-child {
  width: 160px !important;
  text-align: left;
  white-space: nowrap;
}

#adminRoot #panelAnalytics .analytics-all-products-grid thead th:nth-child(2),
#adminRoot #panelAnalytics .analytics-all-products-grid tbody td:nth-child(2) {
  text-align: left;
  white-space: normal;
  word-break: break-word;
  min-width: 460px;
}

#adminRoot #panelAnalytics .analytics-all-products-grid thead th:nth-child(3),
#adminRoot #panelAnalytics .analytics-all-products-grid tbody td:nth-child(3),
#adminRoot #panelAnalytics .analytics-all-products-grid thead th:nth-child(4),
#adminRoot #panelAnalytics .analytics-all-products-grid tbody td:nth-child(4) {
  width: 120px !important;
  text-align: left;
  white-space: nowrap;
}

#adminRoot #panelAnalytics #analyticsAllProductsPaging.products-paging {
  position: sticky;
  bottom: 0;
  z-index: 8;
  margin-top: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

#adminRoot #panelAnalytics.is-measures-mode .analytics-section {
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin: 0;
  height: 100%;
  min-height: 0;
}

#adminRoot #panelAnalytics.is-measures-mode .analytics-header {
  margin: 0;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
}

#adminRoot #panelAnalytics.is-measures-mode #analyticsColumnsSection {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

#adminRoot #panelAnalytics.is-measures-mode #analyticsMeasuresSection {
  margin-top: 0;
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  overflow: hidden;
}

#adminRoot #panelAnalytics.is-measures-mode #analyticsMeasuresSection .customers-header-filter {
  margin-bottom: 0;
}

#adminRoot #panelAnalytics.is-measures-mode #analyticsMeasuresSection .analytics-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: auto;
}

#adminRoot #panelAnalytics.is-measures-mode .analytics-paging {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  margin: 0;
  border: 0 !important;
  border-top: 1px solid var(--border) !important;
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
}

#adminRoot #panelAnalytics.is-measures-mode #analyticsMeasuresPaging.products-paging {
  margin-top: 0;
}

#adminRoot .generic-module-card {
  border: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  padding: 18px 20px;
  color: var(--text);
}

#adminRoot .generic-module-system {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

#adminRoot .generic-module-card h2 {
  margin: 0 0 8px;
  font-size: 26px;
}

#adminRoot .generic-module-description {
  margin: 0;
  color: var(--text-secondary);
}

#adminRoot .generic-module-note {
  margin-top: 18px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 0;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  font-size: 13px;
}

#adminRoot .storys-manager {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

#adminRoot .storys-manager-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

#adminRoot .storys-search-input {
  width: min(100%, 320px);
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

#adminRoot .storys-search-input::placeholder {
  color: var(--text-secondary);
}

#adminRoot .storys-manager .btn.is-attention {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 45%, transparent);
}

#adminRoot .storys-manager-table-wrap {
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: auto;
}

#adminRoot .storys-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

#adminRoot .storys-pagination-info {
  font-size: 12px;
  color: var(--text-secondary);
}

#adminRoot .storys-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

#adminRoot .storys-table th,
#adminRoot .storys-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  font-size: 12px;
}

#adminRoot .storys-table th {
  color: var(--text-secondary);
  font-weight: 600;
}

#adminRoot .storys-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

#adminRoot video.storys-thumb {
  background: #000;
}

#adminRoot .storys-thumb-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f172a, #334155);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

#adminRoot .storys-v4-thumb video {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

#adminRoot .storys-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#adminRoot .storys-update-meta {
  display: grid;
  gap: 2px;
}

#adminRoot .storys-update-date {
  font-weight: 600;
}

#adminRoot .storys-update-reason {
  color: var(--text-secondary);
  line-height: 1.35;
}

#adminRoot .storys-empty {
  margin: 0;
  padding: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

#adminRoot .storys-empty.is-hidden,
#adminRoot .storys-manager.is-hidden {
  display: none;
}

#adminRoot .storys-modal {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.storys-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.storys-v4-modal {
  display: none;
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.storys-v4-modal.is-open {
  display: flex;
  flex-direction: column;
}

#adminRoot .storys-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

#adminRoot .storys-preview-overlay.is-hidden {
  display: none;
}

#adminRoot .storys-preview-modal {
  width: min(560px, calc(100vw - 24px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

#adminRoot .storys-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

#adminRoot .storys-preview-copy h3,
#adminRoot .storys-preview-copy p {
  margin: 0;
}

#adminRoot .storys-preview-copy h3 {
  font-size: 15px;
  font-weight: 700;
}

#adminRoot .storys-preview-copy p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

#adminRoot .storys-preview-close {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

#adminRoot .storys-preview-body {
  padding: 16px;
}

#adminRoot .storys-preview-body video {
  width: 100%;
  max-height: min(72vh, 760px);
  border-radius: 12px;
  background: #000;
  display: block;
}

.storys-v4-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.storys-v4-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.storys-v4-close {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.storys-v4-body {
  display: flex;
  min-height: 420px;
}

.storys-v4-left {
  width: 230px;
  border-right: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
}

.storys-v4-left-head {
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 11px;
}

.storys-v4-tabs {
  flex: 1;
  overflow: auto;
  padding: 6px;
}

.storys-v4-tab-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  margin-bottom: 4px;
  cursor: pointer;
  text-align: left;
}

.storys-v4-tab-item:hover,
.storys-v4-tab-item.is-active {
  background: var(--surface);
  border-color: var(--border);
}

.storys-v4-thumb {
  width: 32px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 10px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.storys-v4-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.storys-v4-tab-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}

.storys-v4-tab-title,
.storys-v4-tab-sub {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.storys-v4-tab-sub {
  color: var(--text-secondary);
}

.storys-v4-tab-remove {
  color: var(--text-secondary);
  font-size: 11px;
}

.storys-v4-add-btn {
  margin: 6px;
  border: 1px dashed var(--border);
  background: transparent;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  font-size: 12px;
}

.storys-v4-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.storys-v4-empty {
  margin: auto;
  color: var(--text-secondary);
  font-size: 13px;
}

.storys-v4-empty.is-hidden {
  display: none;
}

.storys-v4-editor {
  padding: 14px;
  overflow: auto;
}

.storys-v4-editor-card {
  display: grid;
  gap: 10px;
}

.storys-v4-time-grid,
.storys-v4-upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.storys-v4-time-pair {
  display: flex;
  align-items: center;
  gap: 6px;
}

.storys-v4-time-pair input {
  width: 64px;
  text-align: center;
}

.storys-v4-preview {
  width: 100%;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  margin-top: 6px;
}

.storys-v4-upload-zone {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: 8px;
  min-height: 116px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  background: var(--bg-subtle);
}

.storys-v4-upload-zone:hover {
  border-color: var(--text-secondary);
}

.storys-v4-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.storys-v4-upload-placeholder {
  display: grid;
  gap: 2px;
  text-align: center;
}

.storys-v4-upload-placeholder strong {
  font-size: 12px;
  color: var(--text);
}

.storys-v4-upload-placeholder span {
  font-size: 11px;
  color: var(--text-secondary);
}

.storys-v4-file-name {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-secondary);
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.storys-v4-foot {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.storys-v4-ref-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.storys-v4-ref-wrap label {
  font-size: 12px;
  color: var(--text-secondary);
}

.storys-v4-ref-wrap input {
  width: 120px;
}

.storys-v4-actions {
  display: flex;
  gap: 8px;
}

.storys-v4-error {
  padding: 0 14px 8px;
}

@media (max-width: 980px) {
  #adminRoot .shell-main {
    padding: 0 10px 12px;
  }

  #adminRoot .global-admin-navbar {
    margin: 0 -10px;
    padding: 8px 10px;
  }

  #adminRoot .global-admin-navbar-inner {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #adminRoot .nav-logo-img {
    height: 26px;
    max-width: min(220px, 70vw);
  }

  #adminRoot .global-systems-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  #adminRoot .global-system-submenu {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 102px;
    min-width: 0;
    z-index: 120;
  }

  #adminRoot .global-user-mount {
    justify-content: flex-start;
  }

  #adminRoot .global-user-mount .sidebar-user-card {
    min-width: 0;
    width: 100%;
    max-width: 230px;
  }
}

/* Settings: padrao visual igual listas/produtos (tema claro e layout plano) */
#adminRoot #settingsConfigPanel,
#adminRoot #settingsUsersPanel,
#adminRoot #settingsBackupsPanel {
  --cfg-bg: #f8fafc;
  --cfg-bg-2: #ffffff;
  --cfg-bg-3: #f8fafc;
  --cfg-bg-4: #eef2f7;
  --cfg-bg-5: #e8eefb;
  --cfg-border: rgba(15, 23, 42, 0.1);
  --cfg-border-hi: rgba(15, 23, 42, 0.14);
  --cfg-text: #111827;
  --cfg-text-2: #475569;
  --cfg-text-3: #64748b;
  --cfg-accent: #2563eb;
  --cfg-accent-dim: rgba(37, 99, 235, 0.12);
  --cfg-accent-br: rgba(37, 99, 235, 0.28);
  color: var(--cfg-text);
}

#adminRoot .settings-config-card,
#adminRoot .settings-config-preview,
#adminRoot .settings-pro-card,
#adminRoot .settings-section-card,
#adminRoot #settingsUsersPanel .action-card,
#adminRoot #settingsBackupsPanel .action-card,
#adminRoot #settingsUsersPanel .sc,
#adminRoot #settingsBackupsPanel .sc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

#adminRoot #settingsConfigPanel .settings-config-card {
  margin-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

#adminRoot .settings-config-topnav {
  background: color-mix(in srgb, var(--surface) 92%, var(--bg-subtle) 8%);
  border: 1px solid var(--border);
  border-radius: 0;
}

#adminRoot .settings-config-topnav-btn {
  color: var(--text-secondary);
  border-radius: 0;
}

#adminRoot .settings-config-topnav-btn.is-active {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

#adminRoot .settings-pro-card-head {
  background: color-mix(in srgb, var(--surface) 92%, var(--bg-subtle) 8%);
  border-bottom-color: var(--border);
}

#adminRoot .settings-pro-card-head h3,
#adminRoot .settings-section-title,
#adminRoot #settingsUsersPanel .sc-title,
#adminRoot #settingsBackupsPanel .sc-title {
  color: var(--text);
}

#adminRoot .settings-pro-card-head p,
#adminRoot .settings-section-desc,
#adminRoot .settings-pro-hint,
#adminRoot .settings-setting-hint,
#adminRoot .settings-config-actions .field-hint,
#adminRoot #settingsBackupsPanel .action-card .field-hint,
#adminRoot #settingsBackupsPanel .action-card .action-label {
  color: var(--text-secondary);
}

#adminRoot .settings-sub-section {
  background: var(--surface);
}

#adminRoot .settings-pv-stage-launcher,
#adminRoot .settings-pv-shell,
#adminRoot .settings-config-preview {
  background: var(--surface);
  border-color: var(--border);
}

#adminRoot #settingsConfigPanel .btn:not(.btn-primary),
#adminRoot #settingsUsersPanel .btn:not(.btn-primary),
#adminRoot #settingsBackupsPanel .btn:not(.btn-primary),
#adminRoot .settings-color-input-wrap input[type="text"],
#adminRoot .settings-pro-row > input[type="text"],
#adminRoot .settings-pro-row > input[type="tel"],
#adminRoot .settings-pro-row > input[type="number"],
#adminRoot .settings-tip-input,
#adminRoot .settings-row-input,
#adminRoot .settings-phone-input-wrap input,
#adminRoot #backupNameInput,
#adminRoot #backupSelect,
#adminRoot #settingsBackupsPanel .inp,
#adminRoot #settingsBackupsPanel .sel {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

#adminRoot .settings-phone-input-wrap span,
#adminRoot .settings-upload-zone,
#adminRoot .settings-upload-icon,
#adminRoot .settings-switch-track {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-secondary);
}

#adminRoot .settings-model-dropdown {
  border-top: 1px solid var(--border);
}

#adminRoot .settings-model-dropdown-toggle {
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

#adminRoot .settings-pro-row,
#adminRoot .settings-setting-row,
#adminRoot #settingsUsersPanel th,
#adminRoot #settingsUsersPanel td,
#adminRoot #settingsBackupsPanel th,
#adminRoot #settingsBackupsPanel td,
#adminRoot #settingsBackupsPanel .sr,
#adminRoot #settingsBackupsPanel .sc-head,
#adminRoot #settingsUsersPanel .users-head {
  border-bottom-color: var(--border);
}

#adminRoot .settings-config-layout {
  grid-template-columns: minmax(0, 1fr) minmax(440px, 560px);
  gap: 12px;
}

@media (max-width: 1100px) {
  #adminRoot .settings-config-layout {
    grid-template-columns: 1fr;
  }
}
