/* ================================================================
   1. Fonte, tokens e base
   ================================================================ */
@font-face {
  font-family: "Montserrat";
  src: url("/fonts/Montserrat-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --brand-primary: #44b9b7;
  --brand-primary-hover: #399f9d;
  --brand-primary-active: #2f8583;
  --brand-primary-strong: #276e6d;
  --brand-primary-vivid: #44b9b7;
  --brand-primary-soft: #e6f7f7;
  --brand-primary-muted: #a5dedd;
  --brand-primary-transparent: rgba(68, 185, 183, 0.16);
  --brand-secondary: #9254aa;
  --brand-secondary-hover: #7f4596;
  --brand-secondary-strong: #67447d;
  --brand-secondary-soft: #f1e7f5;
  --brand-secondary-muted: #d9bfe4;
  --brand-secondary-transparent: rgba(146, 84, 170, 0.16);
  /* Aliases de compatibilidade: componentes existentes herdam o novo eixo sem duplicar valores. */
  --brand: var(--brand-primary);
  --brand-hover: var(--brand-primary-hover);
  --action: var(--brand-primary);
  --action-hover: var(--brand-primary-hover);
  --brand-strong: var(--brand-primary-strong);
  --brand-soft: var(--brand-primary-soft);
  --accent: var(--brand-secondary);
  --accent-strong: var(--brand-secondary-strong);
  --accent-pale: var(--brand-secondary-muted);
  --accent-soft: var(--brand-secondary-soft);
  --background: #f4f4f5;
  --surface: #ffffff;
  --surface-soft: #faf9fb;
  --surface-elevated: #ffffff;
  --input-background: #f8f8f9;
  --heading: #1f1d22;
  --text: #4d4951;
  --muted: #6f6b73;
  --border: #e7e5e9;
  --border-strong: #cbc8cf;
  --row-hover: #faf8fb;
  --success: #2f9a67;
  --success-soft: #e8f6ed;
  --warning: #ca7b21;
  --warning-soft: #fff3df;
  --danger: #df5364;
  --danger-soft: #fdebec;
  --sidebar: #44b9b7;
  --sidebar-gradient: linear-gradient(160deg, #3aa3a1 0%, #44b9b7 52%, #5cc8c6 100%);
  --auth-gradient: linear-gradient(160deg, #5cc8c6 0%, #44b9b7 54%, #3aa3a1 100%);
  --metric-total-start: #399f9d;
  --metric-total-end: #44b9b7;
  --sidebar-hover: rgba(255, 255, 255, 0.09);
  --sidebar-active: rgba(255, 255, 255, 0.17);
  --sidebar-active-shadow: rgba(9, 60, 55, 0.18);
  --sidebar-text: #ffffff;
  --brand-institutional-gradient: linear-gradient(108deg, #71348a 0%, #70468e 38%, #43bcb8 100%);
  --brand-institutional-shadow: rgba(60, 35, 74, 0.14);
  --brand-institutional-purple: #71348a;
  --brand-institutional-purple-strong: #5f3a73;
  --brand-institutional-purple-deep: #4f2d64;
  --brand-institutional-purple-soft: #f7f3f8;
  --brand-institutional-purple-transparent: rgba(79, 33, 96, 0.28);
  --chart-secondary-accent: #8b75d1;
  --shadow-soft: 0 2px 6px rgba(28, 22, 32, 0.09);
  --shadow-card: 0 1px 4px rgba(28, 22, 32, 0.07);
  --radius-input: 5px;
  --radius-card: 9px;
  --radius-shell: 11px;
  --card-padding: 16px;
  --section-padding: 16px;
  --form-gap: 12px;
  --sidebar-collapsed-width: 64px;
  --sidebar-expanded-width: 246px;
  --sidebar-current-width: var(--sidebar-collapsed-width);
  --shell-gap: 10px;
  --header-height: 70px;
  --shell-motion: 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-sidebar="expanded"] {
  --sidebar-current-width: var(--sidebar-expanded-width);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-primary: #44b9b7;
  --brand-primary-hover: #5cc8c6;
  --brand-primary-active: #399f9d;
  --brand-primary-strong: #8bdad8;
  --brand-primary-vivid: #44b9b7;
  --brand-primary-soft: #1b3d3c;
  --brand-primary-muted: #3b7d7b;
  --brand-primary-transparent: rgba(68, 185, 183, 0.16);
  --brand-secondary: #b875cd;
  --brand-secondary-hover: #c98adc;
  --brand-secondary-strong: #e3b8ef;
  --brand-secondary-soft: #35273d;
  --brand-secondary-muted: #8f6ba0;
  --brand-secondary-transparent: rgba(184, 117, 205, 0.16);
  --action: #44b9b7;
  --action-hover: #399f9d;
  --background: #121216;
  --surface: #1d1d21;
  --surface-soft: #25242a;
  --surface-elevated: #202025;
  --input-background: #17171b;
  --heading: #f3f1f4;
  --text: #d7d4d9;
  --muted: #9b979f;
  --border: #313036;
  --border-strong: #4b4850;
  --row-hover: #26242b;
  --success: #60c995;
  --success-soft: #20382c;
  --warning: #e5a657;
  --warning-soft: #402f1d;
  --danger: #ee7b88;
  --danger-soft: #42242b;
  --sidebar: #44b9b7;
  --sidebar-gradient: linear-gradient(160deg, #369997 0%, #44b9b7 52%, #57c5c3 100%);
  --auth-gradient: linear-gradient(160deg, #57c5c3 0%, #44b9b7 54%, #369997 100%);
  --metric-total-start: #399f9d;
  --metric-total-end: #44b9b7;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: rgba(255, 255, 255, 0.15);
  --sidebar-active-shadow: rgba(0, 0, 0, 0.24);
  --chart-secondary-accent: #a892e8;
  --shadow-soft: 0 2px 7px rgba(0, 0, 0, 0.32);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Montserrat", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  background: var(--background);
  background-attachment: fixed;
}

body,
.sidebar,
.workspace-header,
.panel,
.auth-card,
.error-card,
input,
select,
textarea {
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

a {
  color: var(--brand);
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--heading);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(24px, 2vw, 28px);
  font-weight: 750;
}

h2 {
  margin-bottom: 5px;
  font-size: 1.125rem;
  font-weight: 720;
}

h3 {
  margin-bottom: 5px;
  font-size: 0.96rem;
  font-weight: 700;
}

.hidden {
  display: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.uppercase {
  text-transform: uppercase;
}

.ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

/* ================================================================
   2. Shell, sidebar e topbar
   ================================================================ */
.app-layout {
  min-height: 100vh;
  padding-left: calc(var(--sidebar-current-width) + var(--shell-gap) * 2);
  transition: padding-left var(--shell-motion);
}

.sidebar {
  position: fixed;
  z-index: 40;
  inset: var(--shell-gap) auto var(--shell-gap) var(--shell-gap);
  display: flex;
  width: var(--sidebar-current-width);
  flex-direction: column;
  align-items: stretch;
  padding: 6px;
  border-radius: var(--radius-shell);
  background: var(--sidebar-gradient);
  color: var(--sidebar-text);
  box-shadow: var(--shadow-soft);
  transition: width var(--shell-motion), transform var(--shell-motion);
}

.sidebar-brand {
  position: relative;
  display: grid;
  width: 100%;
  height: 60px;
  flex: 0 0 60px;
  place-items: center;
  overflow: hidden;
  color: #ffffff;
}

.sidebar-logo-mark {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  object-position: center;
  opacity: 1;
  transition: opacity 120ms ease;
}

.sidebar-logo-full {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 160px;
  height: auto;
  opacity: 0;
  transform: translate(-50%, -50%) translateX(-8px);
  transition: opacity 140ms ease, transform var(--shell-motion);
}

:root[data-sidebar="expanded"] .sidebar-logo-mark {
  opacity: 0;
}

:root[data-sidebar="expanded"] .sidebar-logo-full {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.sidebar-resize {
  display: flex;
  width: 100%;
  height: 44px;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
  cursor: pointer;
  transition: background 140ms ease;
}

.sidebar-resize:hover {
  background: rgba(255, 255, 255, 0.22);
}

.sidebar-resize .ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  transition: transform var(--shell-motion);
}

.sidebar-resize-label {
  display: none;
  font-size: 12px;
  font-weight: 700;
}

:root[data-sidebar="expanded"] .sidebar-resize {
  justify-content: flex-start;
  padding-left: 17px;
}

:root[data-sidebar="expanded"] .sidebar-resize-label {
  display: inline;
}

:root[data-sidebar="expanded"] .sidebar-resize .ui-icon {
  transform: rotate(180deg);
}

@media (min-width: 721px) and (hover: hover) and (pointer: fine) {
  .sidebar-resize {
    display: none;
  }
}

@media (min-width: 721px) and (any-pointer: coarse) {
  .sidebar-resize {
    display: flex;
  }
}

.sidebar-nav {
  display: flex;
  width: 100%;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 12px;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

.nav-section-label {
  height: 0;
  overflow: hidden;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  opacity: 0;
  text-transform: uppercase;
  white-space: nowrap;
  transition: height var(--shell-motion), margin var(--shell-motion), opacity 140ms ease;
}

.nav-section-label.current {
  color: #ffffff;
}

:root[data-sidebar="expanded"] .nav-section-label {
  height: 24px;
  flex: 0 0 24px;
  margin-top: 8px;
  opacity: 1;
}

.sidebar-nav a {
  display: grid;
  width: 100%;
  height: 46px;
  min-width: 0;
  flex: 0 0 46px;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.84);
  transition: background 140ms ease, color 140ms ease;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-nav a.active {
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.1));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 5px 14px var(--sidebar-active-shadow);
}

.sidebar-nav .ui-icon {
  justify-self: center;
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  stroke-width: 1.55;
}

.nav-label {
  overflow: hidden;
  padding-right: 10px;
  font-size: 14px;
  font-weight: 620;
  opacity: 0;
  text-overflow: ellipsis;
  transform: translateX(-6px);
  white-space: nowrap;
  transition: opacity 120ms ease, transform var(--shell-motion);
}

:root[data-sidebar="expanded"] .nav-label {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-user {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar-user form {
  margin: 0;
}

.sidebar-user-profile {
  display: grid;
  width: 46px;
  height: 46px;
  min-width: 0;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
  color: #ffffff;
  transition: width var(--shell-motion), background 140ms ease;
}

.sidebar-user-profile:hover,
.sidebar-user-profile.active {
  background: var(--sidebar-hover);
}

:root[data-sidebar="expanded"] .sidebar-user {
  flex-direction: row;
}

:root[data-sidebar="expanded"] .sidebar-user-profile {
  width: calc(100% - 40px);
}

.user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  justify-self: center;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  font-weight: 780;
  overflow: hidden;
}

.sidebar-resize:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

.user-avatar img,
.profile-avatar img,
.profile-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details {
  display: grid;
  min-width: 0;
  gap: 1px;
  padding-right: 8px;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 120ms ease, transform var(--shell-motion);
}

.user-details strong,
.user-details small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-details strong {
  color: #ffffff;
  font-size: 12px;
}

.user-details small {
  color: rgba(255, 255, 255, 0.64);
  font-size: 11.5px;
  text-transform: capitalize;
}

:root[data-sidebar="expanded"] .user-details {
  opacity: 1;
  transform: translateX(0);
}

.icon-button,
.nav-toggle,
.theme-toggle {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.sidebar .icon-button {
  color: rgba(255, 255, 255, 0.76);
}

.sidebar [data-tooltip]:not(.sidebar-resize) {
  position: relative;
}

:root:not([data-sidebar="expanded"]) .sidebar [data-tooltip]::after {
  position: absolute;
  z-index: 80;
  top: 50%;
  left: calc(100% + 12px);
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-elevated);
  color: var(--heading);
  box-shadow: var(--shadow-soft);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 620;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

:root:not([data-sidebar="expanded"]) .sidebar [data-tooltip]:hover::after,
:root:not([data-sidebar="expanded"]) .sidebar [data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.icon-button:hover,
.nav-toggle:hover,
.theme-toggle:hover {
  background: var(--surface-soft);
  color: var(--heading);
}

.sidebar .icon-button:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-backdrop {
  display: none;
}

.app-workspace {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
}

.workspace-header {
  position: sticky;
  z-index: 25;
  top: var(--shell-gap);
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  gap: 11px;
  margin: var(--shell-gap) var(--shell-gap) 0;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-shell);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.nav-toggle {
  display: none;
}

.workspace-context {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
}

.workspace-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--brand-primary);
}

.workspace-mark img {
  display: block;
  width: 38px;
  height: 38px;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}

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

.workspace-copy > strong {
  overflow: hidden;
  color: var(--heading);
  font-size: 14px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-breadcrumb {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.workspace-breadcrumb b {
  overflow: hidden;
  color: var(--brand);
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle {
  flex: 0 0 38px;
  color: var(--heading);
}

.theme-toggle-icon,
.theme-toggle-icon > span {
  display: grid;
  place-items: center;
}

.theme-toggle-icon {
  width: 20px;
  height: 20px;
}

.theme-toggle-icon > .theme-icon-sun,
.theme-toggle-icon[data-theme="dark"] > .theme-icon-moon {
  display: none;
}

.theme-toggle-icon[data-theme="dark"] > .theme-icon-sun {
  display: grid;
}

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

.page-container {
  width: 100%;
  max-width: 1780px;
  flex: 1;
  margin: 0 auto;
  padding: 22px 24px 36px;
}

/* Comunicado principal: composição baseada no banner institucional da marca. */
.announcement-banner {
  position: relative;
  display: flex;
  min-height: 218px;
  align-items: center;
  margin-bottom: 22px;
  overflow: hidden;
  padding: 28px 76px 28px 34px;
  border-radius: 15px;
  background: var(--brand-institutional-gradient);
  box-shadow: 0 8px 22px var(--brand-institutional-shadow);
  color: #ffffff;
}

.announcement-banner[hidden] {
  display: none;
}

.announcement-content {
  position: relative;
  z-index: 2;
  display: flex;
  max-width: 720px;
  align-items: flex-start;
  gap: 22px;
}

.announcement-icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: var(--brand-institutional-purple);
}

.announcement-icon .ui-icon {
  width: 29px;
  height: 29px;
}

.announcement-copy {
  display: grid;
  justify-items: start;
}

.announcement-eyebrow {
  margin-bottom: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--brand-institutional-purple-transparent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.025em;
}

.announcement-copy h2 {
  margin-bottom: 2px;
  color: #ffffff;
  font-size: clamp(22px, 2.1vw, 30px);
  letter-spacing: -0.035em;
}

.announcement-copy p {
  max-width: 620px;
  margin-bottom: 17px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.announcement-action {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 9px 17px;
  border-radius: 6px;
  background: #ffffff;
  color: var(--brand-institutional-purple-strong);
  font-size: 13px;
  font-weight: 710;
  transition: background 140ms ease, transform 140ms ease;
}

.announcement-action:hover {
  background: var(--brand-institutional-purple-soft);
  color: var(--brand-institutional-purple-deep);
  transform: translateY(-1px);
}

.announcement-action .ui-icon {
  width: 15px;
  height: 15px;
}

.announcement-brand-art {
  position: absolute;
  top: -82px;
  right: 2.5%;
  bottom: auto;
  width: min(40vw, 450px);
  opacity: 0.25;
  pointer-events: none;
}

.announcement-close {
  position: absolute;
  z-index: 3;
  top: 17px;
  right: 17px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.announcement-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.announcement-close .ui-icon {
  width: 18px;
  height: 18px;
}

.announcement-spark {
  position: absolute;
  z-index: 1;
  color: rgba(255, 255, 255, 0.42);
  font-size: 36px;
  line-height: 1;
}

.announcement-spark-one {
  right: 30%;
  bottom: 15px;
}

.announcement-spark-two {
  top: 39px;
  right: 10%;
  font-size: 28px;
}

.announcement-position {
  position: absolute;
  z-index: 2;
  bottom: 13px;
  left: 50%;
  display: flex;
  transform: translateX(-50%);
}

.announcement-position i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffffff;
}

.site-footer {
  padding: 7px 16px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ================================================================
   3. Títulos e ações
   ================================================================ */
.page-heading {
  margin-bottom: 18px;
}

.page-heading.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.app-shell .page-heading .eyebrow {
  display: none;
}

.page-heading p:last-child {
  margin-bottom: 0;
}

.dashboard-heading {
  margin-bottom: 16px;
  padding: 0 1px;
}

.dashboard-copy {
  max-width: 640px;
}

.dashboard-copy h1 {
  font-size: clamp(24px, 2vw, 28px);
}

.dashboard-copy > p:last-child {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 630;
}

.back-link:hover {
  color: var(--brand);
}

.back-link .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  font-size: 13px;
  font-weight: 690;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease, color 130ms ease;
}

.button.primary {
  border-color: var(--action);
  background: var(--action);
  color: #ffffff;
}

.button.primary:hover {
  border-color: var(--action-hover);
  background: var(--action-hover);
}

.button.secondary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button.ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--heading);
}

.button.ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.button.small {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

.button.full {
  width: 100%;
}

.button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.button .ui-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

/* ================================================================
   4. KPIs e superfícies
   ================================================================ */
.metrics-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.status-metrics {
  display: contents;
}

.metric-primary,
.status-metric {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 142px;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 16px 17px 15px;
  border: 1px solid color-mix(in srgb, var(--metric-color) 24%, var(--border));
  border-radius: 11px;
  color: var(--text);
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.metric-primary {
  --metric-color: var(--brand);
  border-color: transparent;
  background: var(--metric-total-end);
  color: #ffffff;
}

.status-metric {
  --metric-color: var(--status-color);
  background: color-mix(in srgb, var(--metric-color) 8%, var(--surface));
}

.status-metric.status-ativo {
  --metric-color: var(--success);
}

.status-metric.status-implementacao {
  --metric-color: var(--danger);
}

.status-metric.status-aguardando {
  --metric-color: var(--warning);
}

.metric-primary:hover,
.metric-primary:focus-visible,
.status-metric:hover {
  border-color: color-mix(in srgb, var(--metric-color) 48%, var(--border));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--metric-color) 16%, transparent);
  color: inherit;
  transform: translateY(-2px);
}

.status-metric:focus-visible,
.metric-primary.active,
.status-metric.active {
  border-color: color-mix(in srgb, var(--metric-color) 68%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--metric-color) 14%, transparent), 0 8px 20px color-mix(in srgb, var(--metric-color) 14%, transparent);
}

.metric-primary-label,
.status-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, var(--metric-color) 84%, var(--heading));
  font-size: 13px;
  font-weight: 720;
}

.metric-primary-label {
  color: rgba(255, 255, 255, 0.9);
}

.status-metric-label {
  color: color-mix(in srgb, var(--metric-color) 86%, var(--heading));
}

.metric-primary-label .ui-icon,
.status-metric-label .ui-icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.metric-primary-value,
.status-metric-value {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
}

.metric-primary-value strong,
.status-metric-value strong {
  color: var(--heading);
  font-size: 2rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-primary-value strong {
  color: #ffffff;
}

.metric-primary-value span,
.status-metric-value small,
.status-metric-share {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 520;
}

.status-metric-share {
  min-height: 12px;
}

.metric-primary-value span,
.metric-primary .metric-card-footer,
.metric-primary .metric-card-footer small {
  color: rgba(255, 255, 255, 0.78);
}

.metric-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
}

.metric-card-footer small {
  font-size: inherit;
}

.metric-card-footer b {
  color: color-mix(in srgb, var(--metric-color) 82%, var(--heading));
  font-size: 11px;
  font-weight: 720;
}

.metric-primary .metric-card-footer b {
  color: #ffffff;
}

.metric-progress {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--metric-color) 13%, var(--surface-soft));
}

.metric-primary .metric-progress {
  background: rgba(255, 255, 255, 0.2);
}

.metric-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--metric-color);
}

.metric-primary .metric-progress > span {
  background: #ffffff;
}

.panel {
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.table-panel,
.detail-main,
.history-card {
  background: var(--surface-elevated);
  box-shadow: var(--shadow-card);
}

.filters-panel,
.upload-panel {
  overflow: visible;
}

.panel-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
}

.panel-header.compact {
  min-height: auto;
  padding-bottom: 4px;
  border-bottom: 0;
}

.panel-header h2,
.panel-header p {
  margin-bottom: 0;
}

.panel-header p {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric-card {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: space-between;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-card);
}

.metric-card > span,
.metric-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 610;
}

.metric-card strong {
  color: var(--heading);
  font-size: 1.65rem;
  line-height: 1;
}

.metric-card.total strong {
  color: var(--brand);
}

.metric-card.success strong {
  color: var(--success);
}

.metric-card.update strong {
  color: var(--warning);
}

.metric-card.danger strong {
  color: var(--danger);
}

.alert,
.info-callout,
.validation-message {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  font-size: 13px;
}

.feedback-toast {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.feedback-toast[hidden] {
  display: none;
}

.feedback-toast-card {
  position: relative;
  display: flex;
  width: min(100%, 560px);
  min-height: 76px;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  overflow: hidden;
  color: #ffffff;
  box-shadow: 0 14px 36px rgba(21, 18, 24, 0.25);
  pointer-events: auto;
}

.feedback-toast.is-entering .feedback-toast-card {
  animation: feedback-fade-in 260ms ease-out both;
}

.feedback-toast.is-hiding .feedback-toast-card {
  animation: feedback-fade-out 300ms ease-in both;
}

.feedback-toast-card > :not(.feedback-toast-brand) {
  position: relative;
  z-index: 1;
}

.feedback-toast-brand {
  position: absolute;
  top: 50%;
  right: 52px;
  width: 88px;
  height: auto;
  transform: translateY(-50%);
  opacity: 0.18;
  pointer-events: none;
}

.feedback-toast-card.success {
  background: linear-gradient(135deg, #3fba5a, #10822a);
}

.feedback-toast-card.error {
  background: linear-gradient(135deg, #df5252, #871717);
}

.feedback-toast-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.feedback-toast-icon .ui-icon {
  width: 25px;
  height: 25px;
}

.feedback-toast-card.success .feedback-toast-error-icon,
.feedback-toast-card.error .feedback-toast-success-icon {
  display: none;
}

.feedback-toast-message {
  min-width: 0;
  flex: 1;
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.feedback-toast-close {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  align-self: flex-start;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.feedback-toast-close:hover,
.feedback-toast-close:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.feedback-toast-close .ui-icon {
  width: 16px;
  height: 16px;
}

@keyframes feedback-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes feedback-fade-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

.info-callout {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}

.validation-message {
  display: inline-flex;
  margin: 1px;
  padding: 3px 5px;
  font-size: 12px;
}

.alert.sucesso,
.validation-message.ok {
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.alert.erro,
.validation-message.error {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

.validation-message.warning,
.info-callout {
  border-color: color-mix(in srgb, var(--warning) 28%, var(--border));
  background: var(--warning-soft);
  color: var(--warning);
}

/* ================================================================
   5. Filtros e formulários
   ================================================================ */
.filters-toolbar {
  margin-bottom: 14px;
}

.filters-form {
  display: grid;
  grid-template-columns: minmax(240px, 2.2fr) repeat(3, minmax(105px, 0.8fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 0;
}

.filters-panel .filters-form {
  padding: 13px 15px;
}

.filters-form.compact {
  grid-template-columns: minmax(240px, 1fr) auto;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 660;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  outline: none;
  background: var(--input-background);
  color: var(--heading);
  font-size: 13px;
  font-weight: 470;
  transition: border-color 130ms ease, box-shadow 130ms ease, background 130ms ease;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--border-strong));
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 16%, transparent);
}

.feedback-invalid-field:is(input, select, textarea, label) {
  outline: 2px solid #df5252;
  outline-offset: 2px;
}

.file-drop.feedback-invalid-field {
  border-color: #df5252;
}

.search-control {
  position: relative;
  display: block;
}

.search-control .ui-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-control input {
  padding-left: 36px;
}

.filter-actions,
.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.entity-form,
.upload-panel,
.create-user-card {
  padding: var(--card-padding);
}

.entity-form.narrow {
  max-width: 700px;
}

.credential-form-shell {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
}

.credential-form-shell .page-heading {
  margin-bottom: 24px;
}

.entity-form.credential-form {
  width: 100%;
}

.credential-form .form-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.form-stack,
.form-grid {
  display: grid;
  gap: 15px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-two {
  grid-column: span 2;
}

fieldset {
  min-width: 0;
  margin: 5px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

legend {
  padding: 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 720;
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 620;
}

.secret-field {
  display: flex;
  align-items: stretch;
}

.secret-field input {
  border-radius: var(--radius-input) 0 0 var(--radius-input);
}

.secret-field button {
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
  background: var(--surface-soft);
  color: var(--brand);
  cursor: pointer;
}

.upload-form {
  display: grid;
  gap: 10px;
}

.upload-panel > .info-callout {
  margin-top: 20px;
}

.upload-progress {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 630;
}

.upload-progress[hidden] {
  display: none;
}

.upload-spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 2px solid var(--brand-primary-muted);
  border-top-color: var(--brand-primary-strong);
  border-radius: 50%;
  animation: upload-spin 700ms linear infinite;
}

.upload-form.is-submitting .file-drop {
  opacity: 0.68;
  pointer-events: none;
}

@keyframes upload-spin {
  to { transform: rotate(360deg); }
}

.file-drop {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease;
}

.file-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.file-drop:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.file-icon {
  display: inline-flex;
  margin: 0 auto 6px;
  color: var(--brand);
}

.file-icon .ui-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}

/* ================================================================
   6. Tabelas, metadados e listas
   ================================================================ */
.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr {
  transition: background 110ms ease;
}

tbody tr:hover {
  background: var(--row-hover);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.row-error {
  background: var(--danger-soft);
}

.table-title {
  display: block;
  color: var(--heading);
  font-size: 13.5px;
  font-weight: 700;
}

.table-title:hover {
  color: var(--brand);
}

td small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.row-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 690;
  white-space: nowrap;
}

.row-action:hover {
  color: var(--brand-hover);
}

.row-action .ui-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 690;
  text-transform: capitalize;
}

.uf-inline,
.status-inline,
.action-text,
.status-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.uf-inline .ui-icon {
  color: var(--brand);
}

.status-inline {
  color: color-mix(in srgb, var(--status-color, var(--success)) 82%, var(--heading));
}

.status-inline.status-aguardando {
  color: color-mix(in srgb, var(--warning) 82%, var(--heading));
}

.status-inline.status-implementacao {
  color: color-mix(in srgb, var(--danger) 82%, var(--heading));
}

.status-inline.large {
  font-size: 14px;
  font-weight: 720;
}

.status-inline.tone-success {
  --status-color: var(--success);
}

.status-inline.tone-warning {
  --status-color: var(--warning);
}

.status-inline.tone-danger {
  --status-color: var(--danger);
}

.action-text.criar,
.status-text.active {
  color: var(--success);
}

.action-text.ignorar,
.action-text.update {
  color: var(--warning);
}

.status-text.inactive {
  color: var(--danger);
}

.copyable {
  font-family: Consolas, "Courier New", monospace;
}

details summary {
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 680;
  cursor: pointer;
}

.empty-state {
  display: grid;
  min-height: 135px;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.empty-state strong {
  color: var(--heading);
}

.empty-state.compact {
  min-height: 84px;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

.pagination > :last-child {
  justify-self: end;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 680;
}

.pagination a .ui-icon {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
}

.table-note {
  padding: 7px 11px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* ================================================================
   7. Detalhes, histórico e administração
   ================================================================ */
.detail-layout,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(245px, 0.78fr);
  align-items: start;
  gap: 10px;
}

.detail-main {
  padding: 12px;
}

.history-card {
  padding: 0;
}

.history-card .timeline {
  padding: 12px;
}

.detail-status-row {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.detail-status-row > div small,
.detail-status-row > div strong {
  display: block;
}

.detail-status-row > div small {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.detail-status-row > div strong {
  color: var(--heading);
  font-size: 13px;
}

.detail-section {
  padding: 12px 2px;
  border-top: 1px solid var(--border);
}

.detail-section:first-of-type {
  border-top: 0;
}

.detail-section h2 {
  margin-bottom: 9px;
  color: var(--brand);
  font-size: 0.82rem;
}

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

.detail-grid > div small,
.detail-grid > div strong,
.detail-grid dt,
.detail-grid dd {
  display: block;
}

.detail-grid > div small,
.detail-grid dt {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 640;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.detail-grid > div strong,
.detail-grid dd {
  margin: 0;
  color: var(--heading);
  font-size: 13px;
  font-weight: 540;
  overflow-wrap: anywhere;
}

.timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.timeline::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 18px;
  width: 1px;
  background: var(--border-strong);
  content: "";
}

.timeline > article,
.timeline > li {
  position: relative;
  padding: 0 0 14px 22px;
  list-style: none;
}

.timeline-dot {
  position: absolute;
  z-index: 1;
  top: 4px;
  left: 1px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface-elevated);
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 0 1px var(--brand-primary);
}

.timeline p,
.timeline time {
  color: var(--muted);
  font-size: 12px;
}

.confirm-bar {
  position: sticky;
  z-index: 10;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-soft);
  font-size: 12.5px;
}

.change-list {
  margin: 5px 0 0;
  padding-left: 12px;
  color: var(--muted);
  font-size: 12px;
}

.status-active,
.status-inactive {
  font-weight: 700;
}

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

.status-inactive {
  color: var(--danger);
}

.create-user-card {
  background: var(--surface);
}

/* ================================================================
   8. Autenticação e erros
   ================================================================ */
.auth-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-rows: 1fr auto;
  overflow-x: hidden;
  background: var(--background);
}

.auth-shell::before {
  position: fixed;
  inset: 0 58% 0 0;
  background: var(--auth-gradient);
  content: "";
}

.auth-theme-toggle {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 14px;
}

.auth-container {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  place-items: center;
  padding: 54px 4% 24px 44%;
}

.auth-shell .site-footer {
  position: relative;
  z-index: 1;
  padding-left: 42%;
}

.auth-card,
.error-card {
  width: min(100%, 400px);
  padding: 25px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-soft);
}

.auth-card.wide {
  width: min(100%, 610px);
}

.auth-brand {
  margin-bottom: 18px;
  text-align: center;
}

.auth-logo {
  display: block;
  width: min(100%, 210px);
  height: 58px;
  margin: 0 auto 6px;
  object-fit: contain;
}

.logo-dark {
  display: none;
}

:root[data-theme="dark"] .logo-light {
  display: none;
}

:root[data-theme="dark"] .logo-dark {
  display: block;
}

.auth-brand small {
  color: var(--muted);
  font-size: 12px;
}

.auth-card h1 {
  font-size: 1.35rem;
  text-align: center;
}

.auth-card > p,
.auth-card > div > p {
  text-align: center;
}

.auth-card form {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.auth-card .alert {
  margin-top: 12px;
  margin-bottom: 0;
}

.error-card {
  text-align: center;
}

.error-page-container {
  display: grid;
  place-items: center;
}

.error-code {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 1.2rem;
  font-weight: 800;
}

/* ================================================================
   9. Módulo Customer Service
   ================================================================ */
.customer-service-heading {
  margin-bottom: 10px;
}

.page-eyebrow,
.dataset-label {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cs-empty-dashboard {
  display: grid;
  min-height: 330px;
  place-items: center;
  align-content: center;
  padding: 40px;
  text-align: center;
}

.cs-empty-dashboard p {
  margin-bottom: 18px;
  color: var(--muted);
}

.empty-illustration {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--brand);
}

.empty-illustration .ui-icon {
  width: 22px;
  height: 22px;
}

.snapshot-toolbar {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 8px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-card);
}

.snapshot-nav,
.snapshot-meta {
  display: flex;
  align-items: center;
  gap: 7px;
}

.snapshot-nav label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
}

.snapshot-nav select {
  min-width: 142px;
  height: 40px;
  padding-block: 7px;
  color: var(--text);
  font-size: 13px;
  text-transform: none;
}

.snapshot-toolbar .icon-button {
  width: 30px;
  height: 30px;
}

.icon-button.disabled {
  display: grid;
  place-items: center;
  color: var(--border-strong);
  pointer-events: none;
}

.snapshot-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 13px;
}

.snapshot-meta > span + span::before {
  margin-right: 7px;
  color: var(--border-strong);
  content: "·";
}

.snapshot-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.snapshot-state.current {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.snapshot-state.draft {
  border-color: color-mix(in srgb, var(--warning) 40%, var(--border));
  background: var(--warning-soft);
  color: var(--warning);
}

.cs-filters {
  display: flex;
  align-items: end;
  gap: 14px;
  padding: var(--section-padding);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  margin-bottom: 12px;
  background: var(--surface-soft);
}

.cs-view-mode {
  display: inline-flex;
  align-self: end;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
}

.cs-view-mode button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: .78rem;
  font-weight: 650;
  cursor: pointer;
}

.cs-view-mode button.active {
  color: var(--heading);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(20, 24, 32, .12);
}

.cs-multi-field[hidden] {
  display: none !important;
}

.dashboard-alias-panel,
.dashboard-periods-panel {
  margin-bottom: 18px;
}

.dashboard-alias-panel {
  padding-bottom: var(--card-padding);
}

.dashboard-alias-panel > .button {
  margin-inline: var(--card-padding);
}

.dashboard-alias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 12px;
  margin: 16px var(--card-padding);
}

.dashboard-alias-grid label {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
}

.dashboard-alias-grid label > span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 650;
  text-transform: uppercase;
}

.dashboard-period-groups {
  display: grid;
  gap: 14px;
  padding: 0 var(--card-padding) var(--card-padding);
}

.dashboard-period-groups > div {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.dashboard-period-groups > div > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.period-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  font-size: .78rem;
  font-weight: 600;
}

.period-token.new {
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border));
  background: var(--brand-primary-muted);
}

.period-token small {
  color: var(--brand-primary-strong);
  font-size: .64rem;
  text-transform: uppercase;
}

.details-copy {
  margin: 14px 0 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .dashboard-period-groups > div { grid-template-columns: 1fr; gap: 8px; }
}

.cs-filter-grid {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(125px, 0.75fr) minmax(82px, 0.45fr) minmax(180px, 1.1fr) minmax(175px, 1fr) minmax(200px, 1.15fr);
  gap: 12px;
}

.cs-filter-grid label,
.cs-multi-field,
.cs-editor-meta label,
.editor-context label,
.cs-publish-panel label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.cs-filter-grid > label,
.cs-filter-grid > .cs-multi-field {
  grid-template-rows: 18px 40px;
  align-content: start;
}

.cs-filter-grid select {
  height: 40px;
  min-height: 40px;
  padding: 7px 9px;
  font-size: 13px;
}

.cs-multi-field {
  position: relative;
  align-content: start;
}

.cs-field-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

.cs-multi-select {
  position: relative;
  height: 40px;
}

.cs-multi-select summary {
  display: flex;
  height: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input);
  background: var(--input-background);
  color: var(--heading);
  font-size: 13px;
  font-weight: 520;
  cursor: pointer;
  list-style: none;
}

.cs-multi-select summary::-webkit-details-marker {
  display: none;
}

.cs-multi-select summary .ui-icon {
  width: 15px;
  height: 15px;
  transition: transform 150ms ease;
}

.cs-multi-select[open] summary {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 13%, transparent);
}

.cs-multi-select[open] summary .ui-icon {
  transform: rotate(180deg);
}

.cs-multi-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  min-width: 220px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
  box-shadow: 0 12px 28px rgba(25, 20, 29, 0.16);
}

.cs-multi-options {
  display: grid;
  max-height: 230px;
  overflow-y: auto;
}

.cs-multi-option {
  display: flex;
  min-height: 35px;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 540;
  cursor: pointer;
}

.cs-multi-option:hover {
  background: var(--row-hover);
}

.cs-multi-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand);
}

.cs-multi-popover > button {
  width: 100%;
  margin-top: 6px;
  padding: 7px;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.cs-filter-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
}

.cs-filters > [data-cs-reset] {
  min-height: 40px;
  align-self: flex-start;
  margin-top: 22px;
}

.cs-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.cs-kpi {
  --kpi-tone: var(--brand);
  display: grid;
  min-height: 92px;
  align-content: center;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--kpi-tone) 7%, var(--surface));
  box-shadow: var(--shadow-card);
}

.cs-kpi:nth-child(2) {
  --kpi-tone: var(--accent);
}

.cs-kpi:nth-child(3) {
  --kpi-tone: var(--success);
}

.cs-kpi > span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 680;
}

.cs-kpi strong {
  margin: 3px 0 1px;
  color: color-mix(in srgb, var(--kpi-tone) 76%, var(--heading));
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.04em;
  line-height: 1;
}

.cs-kpi small {
  color: var(--muted);
  font-size: 11.5px;
}

.cs-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.cs-chart-card {
  --chart-tone: var(--brand);
  position: relative;
  min-width: 0;
  padding: 0 12px 14px;
  border-color: var(--border);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-card);
}

.cs-chart-card.chart-tone-aqua {
  --chart-tone: var(--brand-primary);
}

.cs-chart-card.chart-tone-coral {
  --chart-tone: var(--warning);
}

.cs-chart-card.chart-tone-lavender {
  --chart-tone: var(--chart-secondary-accent);
}

.cs-chart-card .panel-header.compact {
  position: relative;
  z-index: 1;
  padding: 15px 3px 10px;
}

.cs-chart-card .panel-header h2 {
  font-size: 18px;
}

.cs-chart-card .panel-header p {
  margin-top: 3px;
  font-size: 12px;
}

.cs-chart-card canvas {
  display: block;
}

.cs-chart-wide,
.cs-chart-full {
  grid-column: 1 / -1;
}

.cs-chart-scroll {
  max-height: none;
  overflow-x: hidden;
  overflow-y: hidden;
  padding: 0;
}

.cs-chart-unit {
  width: 100%;
  height: 380px;
}

.cs-chart-medium {
  height: 310px;
}

.cs-chart-revenue {
  height: 320px;
}

.cs-goal-layout {
  display: grid;
  min-height: 310px;
  align-content: center;
  justify-items: center;
}

.cs-goal-gauge {
  position: relative;
  width: min(100%, 360px);
  height: 235px;
}

.cs-gauge-caption {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  justify-items: center;
  color: var(--muted);
  font-size: 11.5px;
  pointer-events: none;
}

.cs-gauge-caption strong {
  color: var(--heading);
  font-size: 12px;
  text-transform: capitalize;
}

.cs-gauge-center {
  position: absolute;
  right: 0;
  bottom: 22px;
  left: 0;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.cs-gauge-center strong {
  color: var(--heading);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.06em;
  line-height: 1;
}

.cs-gauge-center b {
  margin-top: 5px;
  color: var(--danger);
  font-size: 1.05rem;
}

.cs-gauge-center b[data-state="success"] { color: var(--success); }
.cs-gauge-center b[data-state="empty"] { color: var(--muted); }

.cs-goal-summary {
  width: min(100%, 360px);
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--border));
  border-radius: 7px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.cs-goal-summary[data-state="success"] {
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
}

.section-heading small {
  color: var(--muted);
  font-size: 12px;
}

.cs-insights {
  margin-bottom: 8px;
}

.cs-insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.cs-insight-card {
  min-height: 110px;
  padding: 13px 14px;
  border-right: 1px solid var(--border);
}

.cs-insight-card:last-child {
  border-right: 0;
}

.cs-insight-card h3 {
  margin-bottom: 7px;
  color: var(--heading);
  font-size: 13px;
  letter-spacing: 0;
}

.cs-insight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.58;
}

.cs-insight-card.positive h3 {
  color: var(--success);
}

.cs-insight-card.attention h3 {
  color: var(--warning);
}

.cs-summary-panel {
  margin-bottom: 8px;
}

.cs-insight-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-bottom: 10px;
}

.cs-insight-detail-grid > .panel {
  min-width: 0;
}

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

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

.snapshot-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 4px 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.editor-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: var(--card-padding);
  margin-bottom: 8px;
}

.editor-context > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3px 8px;
}

.editor-version-copy {
  min-width: 0;
}

.editor-context h2,
.editor-context p {
  margin: 0;
}

.editor-context p {
  grid-column: 2;
  color: var(--muted);
  font-size: 12.5px;
}

.editor-context label {
  min-width: 210px;
}

.cs-editor-form {
  display: grid;
  gap: var(--form-gap);
}

.cs-editor-meta {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--form-gap);
  padding: var(--section-padding);
}

.cs-editor-meta input,
.editor-context select,
.cs-publish-panel input {
  height: 32px;
  padding: 5px 8px;
}

.cs-editor-section {
  min-width: 0;
}

.cs-editor-section .panel-header {
  margin-bottom: 7px;
}

.cs-editor-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.editor-table {
  min-width: 560px;
}

.cs-editor-daily-section .editor-table {
  min-width: 980px;
}

.editor-table th,
.editor-table td {
  padding: 6px 7px;
}

.editor-table th:first-child,
.editor-table td:first-child {
  padding-left: 12px;
}

.editor-table th:last-child,
.editor-table td:last-child {
  padding-right: 12px;
}

.editor-table input {
  width: 100%;
  min-width: 96px;
  height: 38px;
  padding: 7px 8px;
  font-size: 12.5px;
}

.editor-table td:first-child input {
  min-width: 190px;
}

.editor-remove {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.editor-remove:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.editor-empty-row {
  padding: 16px !important;
  color: var(--muted);
  text-align: center;
}

.cs-publish-bar {
  position: sticky;
  z-index: 10;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: 0 8px 28px rgba(25, 20, 29, 0.14);
  backdrop-filter: blur(12px);
}

.cs-publish-bar > div:first-child {
  display: grid;
}

.cs-publish-bar strong {
  color: var(--heading);
  font-size: 13px;
}

.cs-publish-bar span {
  color: var(--muted);
  font-size: 11.5px;
}

/* Central de edição: leitura leve, agrupamento e edição focada. */
.cs-editor-daily-section {
  overflow: visible;
}

.editor-toolbar {
  position: sticky;
  z-index: 8;
  top: calc(var(--header-height) + 8px);
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) repeat(4, minmax(125px, .75fr)) auto;
  align-items: end;
  gap: 8px;
  padding: 10px var(--section-padding);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
}

.editor-toolbar label {
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.editor-toolbar input,
.editor-toolbar select {
  width: 100%;
  height: 36px;
  padding: 6px 8px;
  font-size: 12px;
}

.editor-toolbar .search-control input {
  padding-left: 34px;
}

.editor-toolbar > .button {
  min-height: 36px;
}

.editor-result-count {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.editor-change-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px var(--section-padding);
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11.5px;
}

.editor-change-strip strong {
  color: var(--heading);
  font-size: 12px;
}

.editor-table-scroll {
  max-height: 62vh;
  overflow: auto;
}

.editor-table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
}

.editor-daily-table {
  min-width: 760px;
}

.editor-table thead th {
  position: sticky;
  z-index: 4;
  top: 0;
  background: var(--surface-soft);
  box-shadow: 0 1px 0 var(--border);
}

.editor-table th,
.editor-table td {
  height: 43px;
  padding: 8px 10px;
}

.editor-table th:first-child,
.editor-table td:first-child {
  padding-left: var(--section-padding);
}

.editor-table th:last-child,
.editor-table td:last-child {
  padding-right: var(--section-padding);
}

.editor-data-row {
  cursor: pointer;
}

.editor-data-row:hover td {
  background: var(--row-hover);
}

.editor-data-row.changed td:first-child {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--brand-secondary) 55%, transparent);
}

.editor-data-row.new td:first-child {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--brand) 60%, transparent);
}

.editor-group-row td {
  height: auto;
  padding: 0 !important;
  background: var(--surface-soft);
}

.editor-group-row button {
  display: grid;
  width: 100%;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 9px var(--section-padding);
  border: 0;
  background: transparent;
  color: var(--heading);
  text-align: left;
  cursor: pointer;
}

.editor-group-row.period button {
  padding-block: 7px;
  padding-left: calc(var(--section-padding) + 22px);
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
}

.editor-group-row button:hover {
  background: var(--row-hover);
}

.editor-group-row button > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.editor-group-chevron {
  color: var(--brand);
  font-size: 20px;
  line-height: 1;
}

.editor-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 23px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.editor-status.changed {
  border-color: color-mix(in srgb, var(--brand-secondary) 24%, var(--border));
  color: var(--brand-secondary-strong);
  background: var(--brand-secondary-soft);
}

.editor-status.new {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--border));
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.editor-actions-column {
  width: 106px;
  text-align: right;
  white-space: nowrap;
}

.editor-actions-column .editor-status + .editor-edit-button {
  margin-left: 6px;
}

.editor-edit-button {
  min-height: 30px;
  padding-inline: 8px;
}

.editor-edit-button .ui-icon {
  width: 14px;
  height: 14px;
}

.editor-compact-table .editor-actions-column {
  width: 190px;
}

.table-scroll > .editor-compact-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.editor-compact-table .editor-actions-column {
  width: 196px;
}

.editor-compact-table th:nth-child(3) {
  white-space: normal;
}

.editor-drawer-backdrop {
  position: fixed;
  z-index: 79;
  inset: 0;
  background: rgba(17, 15, 19, .35);
  backdrop-filter: blur(1px);
}

.editor-drawer {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  display: grid;
  width: min(440px, 100vw);
  height: 100dvh;
  grid-template-rows: auto 1fr auto;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -14px 0 36px rgba(22, 18, 25, .18);
  transform: translateX(104%);
  transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.editor-drawer.open {
  transform: translateX(0);
}

.editor-drawer > header,
.editor-drawer > footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--section-padding);
}

.editor-drawer > header {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.editor-drawer > header h2,
.editor-drawer > header span {
  margin: 0;
}

.editor-drawer > footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.editor-drawer-fields {
  display: grid;
  align-content: start;
  gap: var(--form-gap);
  overflow-y: auto;
  padding: var(--section-padding);
}

.editor-drawer-fields label {
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.editor-drawer-fields input,
.editor-drawer-fields select {
  width: 100%;
  min-height: 40px;
}

.editor-drawer-fields input[readonly] {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: default;
}

.editor-drawer-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--form-gap);
}

.editor-derived-preview {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface-soft);
}

.editor-derived-preview small,
.editor-derived-preview span {
  color: var(--muted);
  font-size: 11px;
}

.editor-derived-preview strong {
  color: var(--heading);
  font-size: 13px;
}

.button.danger.ghost {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  color: var(--danger);
}

.button.danger.ghost:hover {
  background: var(--danger-soft);
}

.cs-import-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 8px;
  margin-bottom: 8px;
}

.cs-import-card,
.cs-import-guide {
  padding: var(--card-padding);
}

.import-step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.import-step > span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 5px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
}

.import-step div {
  display: grid;
}

.import-step strong {
  color: var(--heading);
  font-size: 14px;
}

.import-step small {
  color: var(--muted);
  font-size: 11.5px;
}

.upload-form {
  display: grid;
  gap: 8px;
}

.upload-dropzone {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  background: var(--surface-soft);
  cursor: pointer;
  text-align: center;
}

.upload-dropzone:hover {
  border-color: var(--brand);
}

.upload-dropzone.is-dragover,
.file-drop.is-dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 24%, transparent);
}

.upload-dropzone.is-dragover {
  transform: translateY(-1px);
}

.upload-dropzone.has-file,
.file-drop.has-file {
  border-style: solid;
  border-color: var(--brand);
}

.upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-dropzone strong {
  color: var(--heading);
  font-size: 14px;
}

.upload-dropzone > span:last-child {
  color: var(--muted);
  font-size: 11.5px;
}

.upload-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--brand);
}

.cs-import-guide dl {
  display: grid;
  gap: 9px;
  margin: 13px 0;
}

.cs-import-guide dl div {
  display: grid;
  grid-template-columns: 102px 1fr;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.cs-import-guide dt {
  color: var(--heading);
  font-size: 13px;
  font-weight: 720;
}

.cs-import-guide dd,
.cs-import-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.preview-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.preview-summary-grid article {
  display: grid;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.preview-summary-grid span,
.preview-summary-grid small {
  color: var(--muted);
  font-size: 12px;
}

.preview-summary-grid strong {
  color: var(--heading);
  font-size: 1.45rem;
  line-height: 1.25;
}

.alert.aviso {
  border-color: color-mix(in srgb, var(--warning) 32%, var(--border));
  background: var(--warning-soft);
  color: var(--warning);
}

.alert ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.preview-file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: var(--card-padding);
  margin-bottom: 8px;
}

.preview-file-meta h2,
.preview-file-meta p {
  margin: 0;
}

.preview-file-meta p {
  color: var(--muted);
  font-size: 12px;
}

.preview-file-meta .inline-form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.preview-file-meta .inline-form label,
.upload-form > label:not(.upload-dropzone) {
  display: grid;
  gap: 5px;
  color: var(--heading);
  font-size: 12px;
  font-weight: 700;
}

.upload-form > label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.preview-datasets details > summary {
  padding: 14px;
  color: var(--muted);
  cursor: pointer;
}

.preview-datasets {
  display: grid;
  gap: 8px;
}

.cs-publish-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 160px minmax(220px, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: var(--section-padding);
  margin-top: 8px;
  border-color: color-mix(in srgb, var(--brand) 32%, var(--border));
}

.cs-publish-panel.revenue-publish-panel {
  grid-template-columns: minmax(260px, 1.5fr) minmax(220px, 1fr) auto;
}

.cs-publish-panel h2,
.cs-publish-panel p {
  margin: 0;
}

.cs-publish-panel p {
  color: var(--muted);
  font-size: 12px;
}

/* ================================================================
   10. Perfil do usuário
   ================================================================ */
.profile-heading {
  max-width: 760px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.profile-identity {
  position: sticky;
  top: calc(var(--header-height) + var(--shell-gap) * 2 + 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 22px 22px;
  text-align: center;
}

.profile-avatar {
  display: grid;
  width: 92px;
  height: 92px;
  margin-bottom: 16px;
  place-items: center;
  border: 5px solid var(--brand-soft);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--brand-strong);
  font-size: 28px;
  font-weight: 760;
  letter-spacing: -0.04em;
  overflow: hidden;
}

.profile-photo-editor {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-soft);
}

.profile-photo-preview {
  display: grid;
  width: 84px;
  height: 84px;
  flex: 0 0 84px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--brand-strong);
  font-size: 24px;
  font-weight: 760;
}

.profile-photo-preview [hidden] {
  display: none;
}

.profile-photo-controls {
  min-width: 0;
  flex: 1;
}

.profile-photo-controls h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.profile-photo-controls > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.profile-photo-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.profile-photo-form label {
  min-width: min(100%, 240px);
  flex: 1;
}

.profile-photo-form input[type="file"] {
  min-width: 0;
  padding: 8px;
}

.profile-photo-feedback {
  min-height: 18px;
  margin: 7px 0 10px !important;
}

@media (max-width: 520px) {
  .profile-photo-editor {
    flex-direction: column;
  }
}

.profile-identity h2 {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.profile-email {
  width: 100%;
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.profile-account-meta {
  width: 100%;
  margin: 0 0 20px;
  border-top: 1px solid var(--border);
  text-align: left;
}

.profile-account-meta div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.profile-account-meta dt,
.profile-account-meta dd {
  margin: 0;
  font-size: 11.5px;
}

.profile-account-meta dt {
  color: var(--muted);
}

.profile-account-meta dd {
  color: var(--heading);
  font-weight: 650;
  text-align: right;
}

.profile-content {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.profile-tabs {
  position: sticky;
  z-index: 12;
  top: calc(var(--header-height) + var(--shell-gap) * 2);
  display: flex;
  gap: 4px;
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tabs a {
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.profile-tabs a:hover,
.profile-tabs a:focus-visible {
  background: var(--surface-soft);
  color: var(--brand);
}

.profile-section {
  scroll-margin-top: calc(var(--header-height) + 78px);
}

.profile-form,
.profile-preferences {
  padding: 18px;
}

.profile-readonly {
  display: flex;
  min-height: 74px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--surface-soft);
}

.profile-readonly > span,
.profile-readonly small {
  color: var(--muted);
  font-size: 11.5px;
}

.profile-readonly strong {
  color: var(--heading);
  font-size: 13px;
}

.profile-preferences {
  display: grid;
}

.preference-row {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.preference-row:first-child {
  padding-top: 0;
}

.preference-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.preference-row > div:first-child {
  display: grid;
  gap: 3px;
}

.preference-row strong {
  color: var(--heading);
  font-size: 13px;
}

.preference-row small {
  color: var(--muted);
  font-size: 12px;
}

.segmented-control {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 34px;
  padding: 6px 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.segmented-control button:hover {
  color: var(--heading);
}

.segmented-control button.active {
  background: var(--surface-elevated);
  color: var(--brand);
  box-shadow: var(--shadow-card);
}

.activity-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 18px 18px;
  list-style: none;
}

.activity-list li {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-list li:last-child {
  border-bottom: 0;
}

.activity-marker {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--brand-primary);
}

.activity-list li > div {
  display: grid;
  gap: 2px;
}

.activity-list strong {
  color: var(--heading);
  font-size: 12.5px;
  font-weight: 650;
}

.activity-list small,
.empty-profile-state {
  color: var(--muted);
  font-size: 11.5px;
}

.empty-profile-state {
  margin: 0;
  padding: 20px 18px;
}

/* ================================================================
   11. Responsividade
   ================================================================ */
@media (max-width: 1120px) {
  .announcement-banner {
    min-height: 202px;
  }

  .announcement-brand-art {
    right: 1%;
    top: -72px;
    bottom: auto;
    width: 400px;
  }

  .filters-form {
    grid-template-columns: minmax(230px, 2fr) repeat(2, minmax(115px, 1fr));
  }

  .filter-actions {
    grid-column: span 2;
  }

  .cs-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-insight-detail-grid {
    grid-template-columns: 1fr;
  }

  .cs-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-insight-card:nth-child(2) {
    border-right: 0;
  }

  .cs-insight-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .cs-publish-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .metrics-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: span 2;
  }

  .filter-actions {
    grid-column: auto;
  }

  .detail-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .auth-shell::before {
    right: 66%;
  }

  .auth-container {
    padding-left: 35%;
  }

  .snapshot-toolbar,
  .preview-file-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .snapshot-meta {
    justify-content: flex-start;
  }

  .cs-import-layout,
  .cs-editor-split {
    grid-template-columns: 1fr;
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-identity {
    position: static;
  }
}

@media (max-width: 720px) {
  :root {
    --card-padding: 13px;
    --section-padding: 13px;
    --form-gap: 10px;
  }

  .app-layout {
    padding-left: 0;
  }

  .sidebar {
    width: min(82vw, 260px);
    transform: translateX(calc(-100% - var(--shell-gap) * 2));
    transition: transform 170ms ease;
  }

  .sidebar-resize {
    display: none;
  }

  .sidebar-logo-mark {
    opacity: 0;
  }

  .sidebar-logo-full {
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  .nav-section-label {
    height: 24px;
    flex: 0 0 24px;
    margin-top: 8px;
    opacity: 1;
  }

  .nav-label,
  .user-details {
    opacity: 1;
    transform: translateX(0);
  }

  .sidebar-user {
    flex-direction: row;
  }

  .sidebar-user-profile {
    width: calc(100% - 40px);
  }

  :root:not([data-sidebar="expanded"]) .sidebar [data-tooltip]::after {
    display: none;
  }

  .nav-open {
    overflow: hidden;
  }

  .nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(18, 16, 21, 0.52);
    opacity: 0;
    pointer-events: none;
    transition: opacity 170ms ease;
  }

  .nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .page-container {
    padding: 14px 14px 28px;
  }

  .announcement-banner {
    min-height: 230px;
    padding: 26px 54px 30px 24px;
  }

  .announcement-brand-art {
    right: -65px;
    top: 0;
    bottom: auto;
    width: 300px;
    opacity: 0.17;
  }

  .announcement-content {
    max-width: 82%;
  }

  .cs-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .cs-chart-wide,
  .cs-chart-full {
    grid-column: auto;
  }
}

@media (max-width: 1120px) {
  .editor-toolbar {
    grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(140px, 1fr)) auto;
  }

  .editor-search {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .editor-toolbar {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .editor-search,
  .editor-result-count {
    grid-column: 1 / -1;
  }

  .editor-toolbar > .button {
    align-self: end;
  }

  .editor-change-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .editor-table-scroll {
    max-height: none;
  }

  .editor-daily-table,
  .editor-daily-table tbody,
  .editor-daily-table tr,
  .editor-daily-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .editor-daily-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .editor-daily-table .editor-data-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 9px var(--section-padding);
    border-bottom: 1px solid var(--border);
  }

  .editor-daily-table .editor-data-row td {
    display: grid;
    height: auto;
    min-height: 42px;
    gap: 2px;
    padding: 5px 0 !important;
    border: 0;
    text-align: left;
  }

  .editor-daily-table .editor-data-row td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
  }

  .editor-daily-table .editor-data-row td:first-child,
  .editor-daily-table .editor-data-row .editor-actions-column {
    grid-column: 1 / -1;
  }

  .editor-daily-table .editor-data-row.changed td:first-child,
  .editor-daily-table .editor-data-row.new td:first-child {
    box-shadow: none;
  }

  .editor-group-row td {
    display: table-cell;
  }
}

@media (max-width: 520px) {
  .editor-toolbar,
  .editor-drawer-date-grid {
    grid-template-columns: 1fr;
  }

  .editor-search,
  .editor-result-count {
    grid-column: auto;
  }

  .editor-drawer > footer {
    grid-template-columns: 1fr 1fr;
  }

  .editor-drawer > footer > span {
    display: none;
  }

  .editor-delete-action {
    grid-column: 1 / -1;
  }

  .cs-publish-bar .heading-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .workspace-breadcrumb > span:first-child,
  .workspace-breadcrumb > span[aria-hidden] {
    display: none;
  }

  .page-container {
    padding: 11px 10px 22px;
  }

  .announcement-banner {
    min-height: 268px;
    align-items: flex-start;
    padding: 24px 42px 34px 20px;
    border-radius: 11px;
  }

  .announcement-content {
    max-width: none;
    gap: 13px;
  }

  .announcement-icon {
    width: 43px;
    height: 43px;
    flex-basis: 43px;
  }

  .announcement-icon .ui-icon {
    width: 22px;
    height: 22px;
  }

  .announcement-copy h2 {
    font-size: 21px;
  }

  .announcement-copy p {
    font-size: 12.5px;
  }

  .announcement-brand-art {
    right: -68px;
    top: 80px;
    bottom: auto;
    width: 250px;
  }

  .page-heading.split {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .metrics-overview {
    gap: 6px;
  }

  .metric-primary,
  .status-metric {
    min-height: 132px;
    padding: 13px 12px;
  }

  .filters-form,
  .filters-form.compact,
  .form-grid.two,
  .form-grid.three,
  .detail-grid,
  .profile-form {
    grid-template-columns: 1fr;
  }

  .search-field,
  .filter-actions,
  .span-two,
  .profile-form .span-two {
    grid-column: auto;
  }

  .preference-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .segmented-control {
    width: 100%;
  }

  .segmented-control button {
    flex: 1;
  }

  .filter-actions,
  .form-actions {
    flex-wrap: wrap;
  }

  .filter-actions .button {
    flex: 1;
  }

  .panel-header {
    align-items: flex-start;
  }

  .table-scroll table {
    min-width: 700px;
  }

  .detail-status-row {
    grid-template-columns: 1fr;
  }

  .confirm-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination {
    grid-template-columns: 1fr 1fr;
  }

  .pagination > span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }

  .auth-shell::before {
    display: none;
  }

  .auth-container {
    padding: 54px 14px 22px;
  }

  .auth-shell .site-footer {
    padding-left: 16px;
  }

  .snapshot-nav {
    width: 100%;
  }

  .snapshot-nav label {
    flex: 1;
  }

  .snapshot-nav select {
    width: 100%;
  }

  .cs-filters {
    align-items: stretch;
    flex-direction: column;
    padding: 13px;
  }

  .cs-filter-grid > label {
    grid-template-rows: auto 40px;
  }

  .cs-filter-grid > .cs-multi-field {
    grid-template-rows: auto 40px auto;
  }

  .cs-filters > [data-cs-reset] {
    align-self: stretch;
    margin-top: 0;
  }

  .cs-filter-grid,
  .cs-kpis,
  .cs-editor-meta,
  .preview-summary-grid,
  .cs-publish-panel {
    grid-template-columns: 1fr;
  }

  .cs-chart-unit {
    height: 330px;
  }

  .cs-insight-grid {
    grid-template-columns: 1fr;
  }

  .cs-insight-card,
  .cs-insight-card:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .cs-insight-card:last-child {
    border-bottom: 0;
  }

  .editor-context,
  .cs-publish-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-context label {
    min-width: 0;
  }
}

@media (max-width: 390px) {
  .workspace-mark {
    display: none;
  }

  .metric-primary-value strong,
  .status-metric-value strong {
    font-size: 1.65rem;
  }

  .metric-primary-label,
  .status-metric-label {
    font-size: 11.5px;
  }

  .entity-form,
  .upload-panel,
  .create-user-card,
  .auth-card,
  .error-card {
    padding: 12px;
  }

  .announcement-content {
    display: grid;
  }

  .announcement-icon {
    display: none;
  }

}

@media (prefers-reduced-motion: reduce) {
  .feedback-toast.is-entering .feedback-toast-card,
  .feedback-toast.is-hiding .feedback-toast-card {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .upload-spinner {
    animation: none;
  }
}

/* Sincronização de credenciais */
.credential-import-summary {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.credential-import-summary .credential-state-new {
  border-color: color-mix(in srgb, var(--success) 34%, var(--border));
}

.credential-import-summary .credential-state-changed {
  border-color: color-mix(in srgb, #d29132 38%, var(--border));
}

.credential-import-summary .credential-state-removed,
.credential-removal-panel {
  border-color: color-mix(in srgb, #dc5967 38%, var(--border));
}

.credential-preview-sections {
  display: grid;
  gap: var(--section-gap);
  margin-top: var(--section-gap);
}

.credential-count {
  min-width: 34px;
  padding: 5px 9px;
  border-radius: 6px;
  text-align: center;
}

.credential-count.new {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
}

.credential-count.changed {
  color: #b7771e;
  background: color-mix(in srgb, #d29132 13%, transparent);
}

.credential-count.removed {
  color: #c53d50;
  background: color-mix(in srgb, #dc5967 12%, transparent);
}

.credential-change-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.credential-change-list li,
.credential-change-list span {
  display: grid;
  gap: 2px;
}

.credential-change-list strong {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.credential-change-list del {
  color: #b84b59;
}

.credential-change-list ins {
  color: var(--success);
  text-decoration: none;
}

.credential-danger-confirm {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, #dc5967 42%, var(--border));
  border-radius: 7px;
  background: color-mix(in srgb, #dc5967 8%, var(--surface));
}

.credential-danger-confirm input {
  margin-top: 3px;
}

.credential-missing-id {
  display: block;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, #dc5967 38%, var(--border));
  border-radius: 6px;
  color: #c53d50;
  background: color-mix(in srgb, #dc5967 8%, var(--surface));
}

@media (max-width: 1100px) {
  .credential-import-summary {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 560px) {
  .credential-import-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}
