:root {
  /* Paleta CEOS Horizon — alinhada ao painel operacional (azul #3B82F6). */
  --brand-950: #0C2461;
  --brand-900: #13327d;
  --brand-800: #17408b;
  --brand-700: #1D4ED8;
  --brand-600: #2563EB;
  --brand-500: #3B82F6;
  --brand-400: #60A5FA;
  --brand-200: #BFDBFE;
  --brand-100: #DBEAFE;
  --brand-50: #EFF6FF;

  --red-700: #B91C1C;
  --red-600: #DC2626;
  --red-100: #FEE2E2;
  --orange-700: #B45309;
  --orange-600: #D97706;
  --orange-100: #FEF3C7;
  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-100: #DBEAFE;
  --purple-700: #6D28D9;
  --purple-600: #7C3AED;
  --purple-100: #EDE9FE;
  --green-700: #047857;
  --green-100: #D1FAE5;

  /* Tons de texto/borda em cinza-azulado, como no painel (#0F172A / #64748B). */
  --ink-950: #020617;
  --ink-900: #0F172A;
  --ink-800: #1E293B;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748B;
  --ink-400: #94A3B8;
  --ink-300: #CBD5E1;
  --ink-200: #D6E4FF;
  --ink-150: #E2E8F0;
  --ink-100: #EBF5FF;
  --ink-50: #F8FBFF;

  --surface: #FFFFFF;
  --surface-soft: #F8FBFF;
  --surface-muted: #EBF5FF;
  --canvas: #EFF6FF;
  --canvas-deep: #DBEAFE;
  --overlay: rgba(12, 36, 97, 0.56);

  --shadow-xs: 0 1px 2px rgba(46, 33, 222, 0.05);
  --shadow-sm: 0 2px 8px rgba(46, 33, 222, 0.07);
  --shadow-md: 0 14px 34px rgba(29, 78, 216, 0.10);
  --shadow-lg: 0 24px 70px rgba(12, 36, 97, 0.18);
  --ring: 0 0 0 3px rgba(59, 130, 246, 0.18);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --sidebar-width: 286px;
  --topbar-height: 92px;
  --transition: 180ms ease;
  --font: Reyhan, "Plus Jakarta Sans", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* Fonte do painel CEOS (mesmos arquivos servidos em /assets/fonts). */
@font-face {
  font-family: Reyhan;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/Reyhan-Regular.woff2") format("woff2");
}

@font-face {
  font-family: Reyhan;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/Reyhan-Medium.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 85% 0%, rgba(59, 130, 246, 0.07), transparent 32%),
    var(--canvas);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

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

button {
  color: inherit;
}

button,
a,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

[hidden] {
  display: none !important;
}

svg {
  width: 1em;
  height: 1em;
  display: block;
  flex: 0 0 auto;
}

/* Authentication */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 1.15fr) minmax(420px, 0.85fr);
  background: var(--surface);
}

.auth-visual {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: clamp(44px, 7vw, 100px);
  display: flex;
  align-items: center;
  color: white;
  background:
    linear-gradient(145deg, rgba(1, 39, 28, 0.98), rgba(5, 94, 65, 0.95)),
    var(--brand-900);
}

.auth-grid {
  position: absolute;
  inset: 0;
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 80%);
}

.auth-visual::before,
.auth-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.auth-visual::before {
  width: 460px;
  height: 460px;
  right: -180px;
  top: -140px;
  background: radial-gradient(circle, rgba(66, 218, 161, 0.3), transparent 67%);
}

.auth-visual::after {
  width: 520px;
  height: 520px;
  left: -290px;
  bottom: -260px;
  background: radial-gradient(circle, rgba(117, 236, 193, 0.18), transparent 68%);
}

.auth-orbit {
  position: absolute;
  border: 1px solid rgba(198, 244, 226, 0.2);
  border-radius: 50%;
}

.auth-orbit-one {
  width: 440px;
  height: 440px;
  right: -80px;
  bottom: -60px;
}

.auth-orbit-two {
  width: 300px;
  height: 300px;
  right: -10px;
  bottom: 10px;
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  width: min(660px, 100%);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  margin-bottom: clamp(72px, 10vh, 130px);
}

.brand-lockup strong {
  display: block;
  font-size: 36px;
  line-height: 0.9;
  letter-spacing: 0.02em;
}

.brand-lockup small {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.27em;
  color: rgba(218, 249, 237, 0.82);
}

.brand-mark {
  position: relative;
  width: 57px;
  height: 57px;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-right-color: transparent;
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span,
.brand-mark i {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.brand-mark::before {
  inset: 7px;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-left-color: transparent;
}

.brand-mark::after {
  inset: 18px;
  border: 2px solid white;
  border-top-color: transparent;
}

.brand-mark span {
  width: 8px;
  height: 8px;
  left: 24px;
  top: 24px;
  background: #60A5FA;
}

.brand-mark i {
  width: 7px;
  height: 7px;
  right: 3px;
  top: 6px;
  background: #60A5FA;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--brand-600);
}

.eyebrow-light {
  color: #82e5bd;
}

.auth-visual h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(39px, 5vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.045em;
  font-weight: 750;
}

.auth-visual-content > p:not(.eyebrow) {
  max-width: 590px;
  margin: 28px 0 0;
  color: rgba(235, 250, 244, 0.76);
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.65;
}

.auth-features {
  margin-top: 45px;
  display: grid;
  gap: 16px;
}

.auth-features > div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(244, 255, 251, 0.88);
}

.feature-check {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-900);
  background: #79e3b8;
  font-weight: 900;
}

.auth-form-panel {
  min-height: 100vh;
  padding: 40px clamp(34px, 6vw, 92px);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.06), transparent 30%),
    var(--surface);
}

.auth-form-wrap {
  width: min(440px, 100%);
}

.auth-logo {
  width: 148px;
  height: auto;
  object-fit: contain;
  margin-bottom: 62px;
}

.auth-heading h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: clamp(29px, 3.3vw, 39px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.auth-heading > p:last-child {
  margin: 14px 0 0;
  color: var(--ink-600);
  font-size: 15px;
}

.auth-form {
  margin-top: 40px;
  display: grid;
  gap: 21px;
}

.field {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.field > span:first-child,
.field-label {
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.input-shell {
  position: relative;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input-shell:focus-within {
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}

.input-shell input,
.input-shell select,
.input-shell textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink-900);
  background: transparent;
}

.input-shell input::placeholder,
.input-shell textarea::placeholder {
  color: var(--ink-400);
}

.input-icon {
  color: var(--ink-500);
  font-size: 18px;
}

.form-error {
  margin-top: -5px;
  padding: 12px 14px;
  border: 1px solid #f6bec3;
  border-radius: var(--radius-sm);
  color: var(--red-700);
  background: #fff3f4;
  font-size: 13px;
}

.auth-note {
  margin-top: 34px;
  padding-top: 24px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid var(--ink-100);
  color: var(--ink-500);
}

.auth-note svg {
  margin-top: 1px;
  color: var(--brand-600);
  font-size: 18px;
}

.auth-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

/* Buttons and common controls */
.button {
  min-height: 42px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

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

.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  border-color: rgba(4, 82, 57, 0.35);
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.18);
}

.button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.button.secondary {
  color: var(--brand-800);
  border-color: var(--brand-200);
  background: var(--surface);
}

.button.secondary:hover:not(:disabled) {
  border-color: var(--brand-500);
  background: var(--brand-50);
}

.button.neutral {
  color: var(--ink-700);
  border-color: var(--ink-200);
  background: var(--surface);
}

.button.neutral:hover:not(:disabled) {
  border-color: var(--ink-300);
  background: var(--surface-soft);
}

.button.danger {
  color: white;
  background: var(--red-600);
}

.button.danger-outline {
  color: var(--red-700);
  border-color: #efb8bd;
  background: #fff;
}

.button.large {
  min-height: 52px;
  padding-inline: 20px;
  border-radius: 12px;
  font-size: 14px;
}

.button.small {
  min-height: 34px;
  padding-inline: 12px;
  border-radius: 8px;
  font-size: 12px;
}

.button.full {
  width: 100%;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ink-150);
  border-radius: 10px;
  color: var(--ink-700);
  background: var(--surface);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--transition);
}

.icon-button:hover:not(:disabled) {
  color: var(--brand-700);
  border-color: var(--brand-200);
  background: var(--brand-50);
}

.icon-button.small {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.icon-button.ghost {
  border-color: transparent;
  background: transparent;
}

.icon-button.danger:hover {
  color: var(--red-700);
  border-color: #f2c2c6;
  background: #fff3f4;
}

/* Main application shell */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns var(--transition);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 35;
  top: 0;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ink-150);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 8px 0 28px rgba(31, 54, 44, 0.03);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.sidebar-top {
  min-height: var(--topbar-height);
  padding: 15px 15px 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink-100);
}

.sidebar-brand {
  width: 155px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
}

.sidebar-brand img {
  width: 148px;
  display: block;
  transition: width var(--transition), transform var(--transition);
}

.sidebar-collapse {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

.sidebar-nav {
  padding: 7px 14px 0;
  display: grid;
  gap: 4px;
}

.sidebar-nav-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.32) transparent;
}

.sidebar-nav.secondary {
  padding-top: 7px;
}

.sidebar-nav-group {
  padding-top: 16px;
}

.sidebar-nav-group.secondary {
  padding-top: 11px;
}

.sidebar-nav-heading {
  margin: 0;
  padding: 0 25px;
  color: var(--ink-400);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.sidebar-divider {
  height: 1px;
  margin: 14px 17px 0;
  background: var(--ink-100);
}

.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink-700);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}

.nav-item:hover {
  color: var(--brand-800);
  background: var(--brand-50);
}

.nav-item.active {
  color: white;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
  border-color: rgba(4, 92, 63, 0.35);
  box-shadow: 0 7px 16px rgba(37, 99, 235, 0.16);
}

.nav-item-icon {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 21px;
  font-size: 19px;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--ink-700);
  background: var(--ink-100);
  font-size: 10px;
  font-weight: 850;
}

.nav-item.active .nav-badge {
  color: var(--brand-900);
  background: rgba(255, 255, 255, 0.88);
}

.nav-badge.red {
  color: var(--red-700);
  background: var(--red-100);
}

.nav-badge.orange {
  color: var(--orange-700);
  background: var(--orange-100);
}

.nav-badge.blue {
  color: var(--blue-700);
  background: var(--blue-100);
}

.nav-badge.purple {
  color: var(--purple-700);
  background: var(--purple-100);
}

.nav-badge.green {
  color: var(--green-700);
  background: var(--green-100);
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px;
  border-top: 1px solid var(--ink-100);
  overflow: hidden;
}

.sidebar-footer > p {
  margin: 13px 0 0;
  color: var(--ink-400);
  font-size: 10px;
  white-space: nowrap;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

.system-status > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #27b77e;
  box-shadow: 0 0 0 5px rgba(39, 183, 126, 0.12);
}

.system-status strong,
.system-status small {
  display: block;
}

.system-status strong {
  color: var(--ink-700);
  font-size: 11px;
}

.system-status small {
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 9px;
}

.sidebar-collapsed .sidebar-top {
  padding-inline: 12px;
  justify-content: center;
}

.sidebar-collapsed .sidebar-brand {
  width: 46px;
}

.sidebar-collapsed .sidebar-brand img {
  width: 145px;
  max-width: none;
  transform: translateX(-2px);
  clip-path: inset(0 96px 0 0);
}

.sidebar-collapsed .sidebar-collapse {
  display: none;
}

.sidebar-collapsed .sidebar-nav {
  padding-inline: 11px;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 9px;
}

.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-badge,
.sidebar-collapsed .sidebar-footer > p,
.sidebar-collapsed .system-status div {
  display: none;
}

.sidebar-collapsed .system-status {
  min-width: 0;
  justify-content: center;
}

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

.topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  min-height: var(--topbar-height);
  padding: 14px clamp(18px, 2.2vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(216, 221, 218, 0.9);
  background: rgba(255, 255, 255, 0.89);
  backdrop-filter: blur(18px);
}

.topbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.breadcrumb {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--ink-400);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.breadcrumb span:first-child {
  color: var(--brand-600);
}

.topbar h1 {
  margin: 4px 0 0;
  color: var(--ink-950);
  font-size: clamp(22px, 2.2vw, 29px);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.topbar-left p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.3;
}

.topbar-actions,
.context-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-button {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: var(--radius-pill);
  color: white;
  background: var(--red-600);
  font-size: 9px;
  font-weight: 850;
}

.user-chip {
  min-height: 45px;
  max-width: 230px;
  padding: 5px 8px 5px 6px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ink-150);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.user-chip:hover {
  border-color: var(--brand-200);
  background: var(--brand-50);
}

.avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 34px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-400));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 850;
}

.avatar.small {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 9px;
}

.avatar.tiny {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  font-size: 8px;
}

.user-chip-copy {
  min-width: 0;
  display: block;
  text-align: left;
}

.user-chip-copy strong,
.user-chip-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-copy strong {
  color: var(--ink-800);
  font-size: 11px;
}

.user-chip-copy small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.user-chip > svg {
  color: var(--ink-400);
  font-size: 14px;
}

.main-content {
  min-width: 0;
  flex: 1;
  padding: clamp(18px, 2.4vw, 34px);
}

/* Popovers */
.popover-anchor {
  position: relative;
}

.popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 10px);
  right: 0;
  border: 1px solid var(--ink-150);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popover-in 140ms ease-out;
}

@keyframes popover-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-popover {
  width: 255px;
  padding: 9px;
}

.popover-user-card {
  padding: 11px 10px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--ink-100);
  margin-bottom: 7px;
}

.popover-user-card strong,
.popover-user-card small {
  display: block;
}

.popover-user-card strong {
  color: var(--ink-800);
  font-size: 12px;
}

.popover-user-card small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 10px;
}

.popover-menu-button {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-700);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}

.popover-menu-button:hover {
  color: var(--brand-800);
  background: var(--brand-50);
}

.popover-menu-button.danger:hover {
  color: var(--red-700);
  background: #fff1f2;
}

.notifications-popover {
  width: min(390px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 125px));
  display: flex;
  flex-direction: column;
}

.popover-header {
  padding: 17px 17px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--ink-100);
}

.popover-header h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 14px;
}

.link-button {
  padding: 0;
  border: 0;
  color: var(--brand-700);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.notification-list {
  overflow: auto;
}

.notification-item {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  gap: 11px;
  border: 0;
  border-bottom: 1px solid var(--ink-100);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.notification-item:hover {
  background: var(--surface-soft);
}

.notification-item.unread {
  background: var(--brand-50);
}

.notification-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand-500);
}

.notification-item.urgent .notification-dot {
  background: var(--red-600);
}

.notification-copy {
  min-width: 0;
}

.notification-copy strong {
  display: block;
  color: var(--ink-800);
  font-size: 11px;
  line-height: 1.35;
}

.notification-copy p {
  margin: 4px 0 0;
  color: var(--ink-600);
  font-size: 10px;
  line-height: 1.45;
}

.notification-copy time {
  display: block;
  margin-top: 6px;
  color: var(--ink-400);
  font-size: 9px;
}

/* Dashboard cards */
.page-stack {
  display: grid;
  gap: 19px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 13px;
}

.metric-card {
  position: relative;
  min-height: 108px;
  padding: 15px 15px 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--metric-color, var(--brand-600));
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--metric-color, var(--brand-600)) 35%, var(--ink-150));
  box-shadow: var(--shadow-sm);
}

.metric-card.red { --metric-color: var(--red-600); }
.metric-card.orange { --metric-color: var(--orange-600); }
.metric-card.blue { --metric-color: var(--blue-600); }
.metric-card.purple { --metric-color: var(--purple-600); }
.metric-card.green { --metric-color: var(--brand-600); }

.metric-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.metric-card-top > span:first-child {
  min-width: 0;
}

.metric-card-label,
.metric-value {
  display: block;
}

.metric-card-label {
  color: var(--metric-color);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-icon {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--metric-color);
  background: color-mix(in srgb, var(--metric-color) 11%, white);
  font-size: 17px;
}

.metric-value {
  margin-top: 7px;
  color: var(--ink-950);
  font-size: 28px;
  line-height: 0.95;
  font-weight: 740;
  letter-spacing: -0.04em;
}

.metric-helper {
  margin-top: 8px;
  color: var(--ink-500);
  font-size: 9px;
}

/* Panels, toolbar, filters */
.panel {
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-xs);
}

.panel-header {
  min-height: 66px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--ink-100);
}

.panel-title h2,
.panel-title h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.panel-title p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 10px;
}

.toolbar-panel {
  padding: 15px;
  display: grid;
  gap: 14px;
}

.toolbar-main {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.toolbar-main > .filter-sector,
.toolbar-main > .filter-priority,
.toolbar-main > .filter-responsible,
.toolbar-main > .filter-status {
  display: none;
}

.toolbar-main.filters-open {
  grid-template-columns: minmax(260px, 1.35fr) repeat(4, minmax(145px, .75fr)) auto;
}

.toolbar-main.filters-open > .filter-sector,
.toolbar-main.filters-open > .filter-priority,
.toolbar-main.filters-open > .filter-responsible,
.toolbar-main.filters-open > .filter-status {
  display: grid;
}

.search-control,
.select-control {
  position: relative;
}

.control-label {
  display: block;
  margin: 0 0 6px 3px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 750;
}

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

.search-control > svg {
  position: absolute;
  z-index: 1;
  left: 13px;
  bottom: 12px;
  color: var(--ink-500);
  font-size: 17px;
}

.control-input,
.control-select,
.control-textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  outline: 0;
  color: var(--ink-800);
  background: var(--surface);
  font-size: 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.control-textarea {
  min-height: 112px;
  padding-block: 11px;
  resize: vertical;
  line-height: 1.5;
}

.control-input:focus,
.control-select:focus,
.control-textarea:focus {
  border-color: var(--brand-500);
  box-shadow: var(--ring);
}

.control-input::placeholder,
.control-textarea::placeholder {
  color: var(--ink-400);
}

.control-select {
  cursor: pointer;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.filters-toggle {
  display: inline-flex;
}

.view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--ink-150);
  border-radius: 10px;
  background: var(--surface-muted);
}

.view-switch button {
  min-width: 35px;
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  color: var(--ink-500);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}

.view-switch button.active {
  color: var(--brand-800);
  background: white;
  box-shadow: var(--shadow-xs);
}

.record-tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.record-tab {
  position: relative;
  min-height: 40px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  color: var(--ink-600);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 750;
}

.record-tab::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: transparent;
}

.record-tab:hover,
.record-tab.active {
  color: var(--brand-800);
}

.record-tab.active::after {
  background: var(--brand-600);
}

.record-tab-count {
  min-width: 19px;
  height: 19px;
  padding-inline: 5px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--ink-600);
  background: var(--ink-100);
  font-size: 8px;
}

.records-panel {
  overflow: hidden;
}

.records-summary {
  color: var(--ink-500);
  font-size: 10px;
}

/* Table/list view */
.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table thead th {
  height: 42px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-800), var(--brand-700));
  font-size: 9px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.data-table thead th:first-child {
  padding-left: 17px;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--ink-100);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--brand-50);
}

.data-table tbody tr:last-child {
  border-bottom: 0;
}

.data-table td {
  height: 69px;
  padding: 10px 12px;
  color: var(--ink-700);
  font-size: 10px;
  vertical-align: middle;
}

.data-table td:first-child {
  padding-left: 17px;
}

.title-cell {
  min-width: 0;
}

.title-cell strong {
  display: block;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-cell p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-code {
  margin-right: 6px;
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 750;
}

.person-inline,
.sector-inline,
.deadline-inline {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.person-inline span:last-child,
.sector-inline span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--brand-600);
}

.deadline-inline svg,
.person-inline > svg {
  color: var(--ink-500);
  font-size: 15px;
}

.deadline-copy strong,
.deadline-copy small {
  display: block;
}

.deadline-copy strong {
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 650;
}

.deadline-copy small {
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 8px;
}

.deadline-inline.overdue .deadline-copy strong,
.deadline-inline.overdue svg {
  color: var(--red-700);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

.row-action {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--ink-500);
  background: transparent;
  cursor: pointer;
  font-size: 15px;
}

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

.row-action.danger:hover {
  color: var(--red-700);
  background: var(--red-100);
}

/* Badges */
.badge {
  min-height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-pill);
  font-size: 8px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.urgent {
  color: var(--red-700);
  background: var(--red-100);
}

.badge.high,
.badge.pending,
.badge.in-progress {
  color: var(--orange-700);
  background: var(--orange-100);
}

.badge.normal,
.badge.active,
.badge.notice {
  color: var(--blue-700);
  background: var(--blue-100);
}

.badge.low {
  color: var(--ink-600);
  background: var(--ink-100);
}

.badge.waiting,
.badge.occurrence {
  color: var(--purple-700);
  background: var(--purple-100);
}

.badge.resolved,
.badge.success {
  color: var(--green-700);
  background: var(--green-100);
}

.badge.admin {
  color: #5c33a7;
  background: #eee6fb;
}

.badge.coordinator {
  color: #1b639f;
  background: #e4f1fb;
}

.badge.operator {
  color: #b16005;
  background: #fff0d8;
}

.badge.viewer {
  color: var(--ink-600);
  background: var(--ink-100);
}

/* Kanban */
.kanban-wrap {
  padding: 15px;
  overflow-x: auto;
  background:
    linear-gradient(var(--surface-soft), var(--surface-soft)) padding-box,
    repeating-linear-gradient(0deg, transparent, transparent 35px, rgba(37, 99, 235, 0.025) 36px) border-box;
}

.kanban-board {
  min-width: 1260px;
  display: grid;
  grid-template-columns: repeat(5, minmax(236px, 1fr));
  gap: 12px;
  align-items: start;
}

.kanban-column {
  min-height: 420px;
  padding: 10px;
  border: 1px solid var(--ink-150);
  border-radius: 14px;
  background: rgba(240, 245, 242, 0.84);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.kanban-column.drag-over {
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: var(--ring);
}

.kanban-column-header {
  min-height: 42px;
  padding: 1px 5px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.kanban-column-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-800);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kanban-column-title > span:first-child {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--column-color, var(--ink-400));
}

.kanban-count {
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--ink-600);
  background: rgba(255, 255, 255, 0.85);
  font-size: 9px;
  font-weight: 800;
}

.kanban-cards {
  display: grid;
  gap: 9px;
}

.kanban-card {
  position: relative;
  padding: 13px;
  border: 1px solid var(--ink-150);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), opacity var(--transition);
}

.kanban-card[draggable="true"] {
  cursor: grab;
}

.kanban-card[draggable="true"]:active {
  cursor: grabbing;
}

.kanban-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-200);
  box-shadow: var(--shadow-sm);
}

.kanban-card.dragging {
  opacity: 0.45;
  transform: rotate(1.2deg) scale(0.99);
}

.kanban-card-accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 12px 0 0 12px;
  background: var(--card-accent, var(--brand-600));
}

.kanban-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.kanban-card-code {
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 800;
}

.kanban-card-menu {
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--ink-400);
  background: transparent;
  cursor: pointer;
}

.kanban-card-menu:hover {
  color: var(--brand-700);
  background: var(--brand-50);
}

.kanban-card h4 {
  margin: 10px 0 0;
  color: var(--ink-900);
  font-size: 11px;
  line-height: 1.4;
}

.kanban-card p {
  margin: 6px 0 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.kanban-card-badges {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.kanban-card-footer {
  margin-top: 13px;
  padding-top: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--ink-100);
}

.card-deadline,
.card-comments {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-500);
  font-size: 8px;
}

.card-deadline.overdue {
  color: var(--red-700);
}

.kanban-empty {
  min-height: 90px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--ink-200);
  border-radius: 10px;
  color: var(--ink-400);
  font-size: 9px;
  text-align: center;
}

/* Empty, loading and errors */
.empty-state {
  min-height: 310px;
  padding: 40px;
  display: grid;
  place-items: center;
  text-align: center;
}

.empty-state-inner {
  max-width: 390px;
}

.empty-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--brand-600);
  background: var(--brand-100);
  font-size: 27px;
}

.empty-state h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 15px;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.55;
}

.empty-state .button {
  margin-top: 18px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ink-100);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  animation: shimmer 1.25s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.loading-block {
  height: 300px;
  margin: 15px;
}

/* Modals and drawers */
.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  animation: fade-in 150ms ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 170ms ease-out;
}

.modal.wide {
  width: min(900px, 100%);
}

.modal.compact {
  width: min(510px, 100%);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(9px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  min-height: 72px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--ink-100);
}

.modal-title h2,
.modal-title h3 {
  margin: 0;
  color: var(--ink-950);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.modal-title p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 10px;
}

.modal > form {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.modal > form > .modal-body {
  min-height: 0;
  overflow-y: auto;
}

.modal-body {
  padding: 20px;
  overflow: auto;
}

.modal-footer {
  min-height: 70px;
  flex: 0 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--ink-100);
  background: var(--surface-soft);
}

.drawer-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(12, 36, 97, 0.38);
  backdrop-filter: blur(2px);
  animation: fade-in 150ms ease-out;
}

.drawer {
  position: fixed;
  z-index: 95;
  top: 0;
  right: 0;
  width: min(650px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--ink-150);
  background: var(--surface);
  box-shadow: -22px 0 60px rgba(12, 36, 97, 0.17);
  animation: drawer-in 190ms ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.drawer-header {
  min-height: 80px;
  padding: 17px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--ink-100);
}

.drawer-header h2 {
  max-width: 480px;
  margin: 7px 0 0;
  color: var(--ink-950);
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.drawer-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.drawer-footer {
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--ink-100);
  background: var(--surface-soft);
}

.drawer-actions {
  display: flex;
  gap: 8px;
}

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

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

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

.form-grid .span-full {
  grid-column: 1 / -1;
}

.field-error {
  margin: 5px 0 0;
  color: var(--red-700);
  font-size: 9px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.segmented-option {
  min-height: 46px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  color: var(--ink-600);
  background: var(--surface);
  cursor: pointer;
  font-size: 9px;
  font-weight: 750;
}

.segmented-option svg {
  font-size: 17px;
}

.segmented-option.active {
  color: var(--brand-800);
  border-color: var(--brand-500);
  background: var(--brand-50);
  box-shadow: var(--ring);
}

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

.check-card {
  min-height: 42px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ink-150);
  border-radius: 9px;
  color: var(--ink-700);
  background: var(--surface);
  font-size: 10px;
  cursor: pointer;
}

.check-card:has(input:checked) {
  border-color: var(--brand-400);
  background: var(--brand-50);
}

.check-card input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand-600);
}

.switch-row {
  min-height: 52px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--ink-150);
  border-radius: 10px;
  background: var(--surface);
}

.switch-row strong,
.switch-row small {
  display: block;
}

.switch-row strong {
  color: var(--ink-800);
  font-size: 11px;
}

.switch-row small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.switch {
  position: relative;
  width: 40px;
  height: 23px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--ink-300);
  cursor: pointer;
  transition: background var(--transition);
}

.switch span::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition);
}

.switch input:checked + span {
  background: var(--brand-600);
}

.switch input:checked + span::after {
  transform: translateX(17px);
}

/* Notice detail */
.detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-description {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--ink-150);
  border-radius: 12px;
  background: var(--surface-soft);
}

.detail-description h3 {
  margin: 0 0 8px;
  color: var(--ink-800);
  font-size: 11px;
}

.detail-description p {
  margin: 0;
  color: var(--ink-600);
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.detail-meta-grid {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.meta-card {
  min-height: 64px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ink-150);
  border-radius: 10px;
  background: var(--surface);
}

.meta-card-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--brand-700);
  background: var(--brand-50);
  font-size: 16px;
}

.meta-card small,
.meta-card strong {
  display: block;
}

.meta-card small {
  color: var(--ink-400);
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 750;
}

.meta-card strong {
  margin-top: 4px;
  color: var(--ink-800);
  font-size: 10px;
  line-height: 1.35;
}

.detail-tabs {
  margin-top: 22px;
  display: flex;
  border-bottom: 1px solid var(--ink-150);
}

.detail-tab {
  position: relative;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  color: var(--ink-500);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.detail-tab::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: transparent;
}

.detail-tab.active {
  color: var(--brand-800);
}

.detail-tab.active::after {
  background: var(--brand-600);
}

.detail-tab-content {
  padding-top: 16px;
}

.comment-list,
.timeline {
  display: grid;
  gap: 11px;
}

.comment {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.comment-bubble {
  flex: 1;
  padding: 11px 12px;
  border: 1px solid var(--ink-150);
  border-radius: 5px 12px 12px 12px;
  background: var(--surface-soft);
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-header strong {
  color: var(--ink-800);
  font-size: 10px;
}

.comment-header time {
  color: var(--ink-400);
  font-size: 8px;
}

.comment-bubble p {
  margin: 7px 0 0;
  color: var(--ink-600);
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.comment-form {
  margin-top: 13px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.comment-form textarea {
  min-height: 72px;
}

.timeline-item {
  position: relative;
  padding-left: 29px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 21px;
  bottom: -14px;
  width: 1px;
  background: var(--ink-150);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-marker {
  position: absolute;
  left: 1px;
  top: 2px;
  width: 15px;
  height: 15px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 1px var(--brand-200);
}

.timeline-card {
  padding: 10px 12px;
  border: 1px solid var(--ink-150);
  border-radius: 10px;
  background: var(--surface);
}

.timeline-card strong {
  color: var(--ink-800);
  font-size: 10px;
}

.timeline-card p {
  margin: 5px 0 0;
  color: var(--ink-600);
  font-size: 9px;
  line-height: 1.45;
}

.timeline-card time {
  display: block;
  margin-top: 6px;
  color: var(--ink-400);
  font-size: 8px;
}

/* Calendar */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-toolbar strong {
  min-width: 150px;
  color: var(--ink-800);
  font-size: 12px;
  text-align: center;
  text-transform: capitalize;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(115px, 1fr));
  min-width: 805px;
}

.calendar-weekday {
  height: 38px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-500);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-day {
  min-height: 128px;
  padding: 9px;
  border-right: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
  background: var(--surface);
}

.calendar-day.outside {
  background: var(--surface-soft);
}

.calendar-day.today {
  background: var(--brand-50);
}

.calendar-day-number {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 750;
}

.calendar-day.today .calendar-day-number {
  color: white;
  background: var(--brand-600);
}

.calendar-day.outside .calendar-day-number {
  color: var(--ink-300);
}

.calendar-events {
  margin-top: 5px;
  display: grid;
  gap: 4px;
}

.calendar-event {
  width: 100%;
  min-height: 25px;
  padding: 5px 7px;
  display: block;
  overflow: hidden;
  border: 0;
  border-left: 3px solid var(--event-color, var(--brand-500));
  border-radius: 6px;
  color: var(--ink-700);
  background: color-mix(in srgb, var(--event-color) 9%, white);
  cursor: pointer;
  font-size: 8px;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-more {
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 700;
}

.calendar-scroll {
  overflow-x: auto;
}

/* Reports */
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.report-summary-card {
  padding: 16px;
  border: 1px solid var(--ink-150);
  border-radius: 14px;
  background: var(--surface);
}

.report-summary-card small {
  display: block;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
}

.report-summary-card strong {
  display: block;
  margin-top: 10px;
  color: var(--ink-950);
  font-size: 27px;
  letter-spacing: -0.035em;
}

.report-summary-card span {
  display: block;
  margin-top: 4px;
  color: var(--ink-400);
  font-size: 8px;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.chart-panel-body {
  padding: 18px;
}

.line-chart {
  width: 100%;
  min-height: 230px;
}

.chart-legend {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  gap: 20px;
  color: var(--ink-500);
  font-size: 9px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 12px;
  height: 3px;
  border-radius: 3px;
  background: var(--legend-color);
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row-header {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-600);
  font-size: 9px;
}

.bar-row-header strong {
  color: var(--ink-800);
}

.bar-track {
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-700), var(--brand-400));
}

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

.report-table th,
.report-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--ink-100);
  font-size: 9px;
  text-align: left;
}

.report-table th {
  color: var(--ink-500);
  background: var(--surface-soft);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-table td {
  color: var(--ink-700);
}

.report-table tr:last-child td {
  border-bottom: 0;
}

/* Users */
.user-list {
  display: grid;
}

.user-row {
  min-height: 72px;
  padding: 13px 17px;
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(120px, 0.65fr) minmax(180px, 1fr) minmax(100px, 0.55fr) auto;
  gap: 15px;
  align-items: center;
  border-bottom: 1px solid var(--ink-100);
}

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

.user-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.user-identity strong {
  color: var(--ink-800);
  font-size: 11px;
}

.user-identity small {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 9px;
}

.sector-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mini-chip {
  min-height: 21px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  color: var(--ink-600);
  background: var(--ink-100);
  font-size: 8px;
  font-weight: 700;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 650;
}

.status-indicator::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-400);
}

.status-indicator.active::before {
  background: #20a976;
}

/* Audit */
.audit-list {
  display: grid;
}

.audit-row {
  min-height: 70px;
  padding: 13px 17px;
  display: grid;
  grid-template-columns: 160px minmax(260px, 1fr) minmax(150px, 0.65fr) auto;
  gap: 17px;
  align-items: center;
  border-bottom: 1px solid var(--ink-100);
}

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

.audit-actor {
  display: flex;
  align-items: center;
  gap: 9px;
}

.audit-actor strong,
.audit-actor small {
  display: block;
}

.audit-actor strong {
  color: var(--ink-800);
  font-size: 10px;
}

.audit-actor small {
  margin-top: 3px;
  color: var(--ink-400);
  font-size: 8px;
}

.audit-description strong {
  display: block;
  color: var(--ink-800);
  font-size: 10px;
}

.audit-description p {
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.4;
}

.audit-meta {
  color: var(--ink-500);
  font-size: 9px;
}

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

.diff-panel {
  min-width: 0;
  border: 1px solid var(--ink-150);
  border-radius: 10px;
  overflow: hidden;
}

.diff-panel h4 {
  margin: 0;
  padding: 10px 12px;
  color: var(--ink-700);
  background: var(--surface-soft);
  font-size: 10px;
}

.diff-panel pre {
  max-height: 340px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: var(--ink-700);
  background: #fbfcfc;
  font-family: Consolas, "Courier New", monospace;
  font-size: 9px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Settings and help */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.settings-body {
  padding: 19px;
}

.info-card {
  padding: 17px;
  border: 1px solid var(--brand-200);
  border-radius: 14px;
  background: var(--brand-50);
}

.info-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--brand-700);
  background: white;
  font-size: 20px;
}

.info-card h3 {
  margin: 13px 0 0;
  color: var(--brand-900);
  font-size: 13px;
}

.info-card p {
  margin: 7px 0 0;
  color: var(--brand-800);
  font-size: 10px;
  line-height: 1.55;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.help-card {
  padding: 18px;
  border: 1px solid var(--ink-150);
  border-radius: 14px;
  background: var(--surface);
}

.help-card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--brand-700);
  background: var(--brand-100);
  font-size: 20px;
}

.help-card h3 {
  margin: 14px 0 0;
  color: var(--ink-900);
  font-size: 12px;
}

.help-card p {
  margin: 7px 0 0;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.55;
}

.help-card ul {
  margin: 10px 0 0;
  padding-left: 17px;
  color: var(--ink-600);
  font-size: 9px;
  line-height: 1.65;
}

.rule-banner {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--brand-200);
  border-radius: 14px;
  color: var(--brand-900);
  background: linear-gradient(120deg, var(--brand-50), #fff);
}

.rule-banner-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  border-radius: 13px;
  color: white;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-500));
  font-size: 20px;
}

.rule-banner strong {
  display: block;
  font-size: 12px;
}

.rule-banner p {
  margin: 5px 0 0;
  color: var(--brand-800);
  font-size: 10px;
  line-height: 1.5;
}

/* Toasts */
.toast-root {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  width: min(370px, calc(100vw - 36px));
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.toast {
  min-height: 60px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--ink-150);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
  animation: toast-in 200ms ease-out;
  pointer-events: auto;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  border-radius: 9px;
  color: var(--brand-700);
  background: var(--brand-100);
}

.toast.error .toast-icon {
  color: var(--red-700);
  background: var(--red-100);
}

.toast.warning .toast-icon {
  color: var(--orange-700);
  background: var(--orange-100);
}

.toast-copy strong,
.toast-copy p {
  display: block;
  margin: 0;
}

.toast-copy strong {
  color: var(--ink-800);
  font-size: 10px;
}

.toast-copy p {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.45;
}

.toast-close {
  margin-left: auto;
  padding: 0;
  border: 0;
  color: var(--ink-400);
  background: transparent;
  cursor: pointer;
}

/* Theme: dark */
body.theme-dark {
  --ink-950: #f3f8f5;
  --ink-900: #e9f1ed;
  --ink-800: #d8e4de;
  --ink-700: #bbc9c2;
  --ink-600: #9caaa3;
  --ink-500: #7f8f87;
  --ink-400: #67766f;
  --ink-300: #4c5a53;
  --ink-200: #39463f;
  --ink-150: #2d3933;
  --ink-100: #25302b;
  --ink-50: #1d2722;
  --surface: #16201b;
  --surface-soft: #1a2520;
  --surface-muted: #202b26;
  --canvas: #111a16;
  --canvas-deep: #0e1713;
  --overlay: rgba(0, 7, 4, 0.7);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 26px 80px rgba(0, 0, 0, 0.48);
}

body.theme-dark .sidebar,
body.theme-dark .topbar,
body.theme-dark .popover {
  background: rgba(22, 32, 27, 0.95);
}

body.theme-dark .sidebar-brand img,
body.theme-dark .auth-logo {
  border-radius: 8px;
  background: white;
}

body.theme-dark .metric-card,
body.theme-dark .panel,
body.theme-dark .data-table tbody tr,
body.theme-dark .kanban-card,
body.theme-dark .modal,
body.theme-dark .drawer,
body.theme-dark .report-summary-card,
body.theme-dark .help-card,
body.theme-dark .control-input,
body.theme-dark .control-select,
body.theme-dark .control-textarea,
body.theme-dark .input-shell,
body.theme-dark .check-card,
body.theme-dark .switch-row,
body.theme-dark .meta-card,
body.theme-dark .timeline-card {
  background: var(--surface);
}

body.theme-dark .kanban-column {
  background: rgba(28, 40, 34, 0.9);
}

body.theme-dark .data-table thead th {
  background: linear-gradient(90deg, #07583e, #08724f);
}

body.theme-dark .notification-badge {
  border-color: var(--surface);
}

body.theme-dark .diff-panel pre {
  background: #101814;
}

/* Mobile and responsive */
.mobile-only {
  display: none;
}

.mobile-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: rgba(12, 36, 97, 0.45);
  backdrop-filter: blur(2px);
}

@media (max-width: 1240px) {
  .metric-grid,
  .report-summary-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .toolbar-main {
    grid-template-columns: minmax(240px, 1.3fr) repeat(2, minmax(150px, 0.7fr)) auto;
  }

  .toolbar-main .filter-responsible,
  .toolbar-main .filter-status {
    display: none;
  }

  .filters-toggle {
    display: inline-flex;
  }

  .toolbar-main.filters-open .filter-responsible,
  .toolbar-main.filters-open .filter-status {
    display: grid;
  }

  .topbar-actions .context-actions {
    display: none;
  }

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

@media (max-width: 1000px) {
  :root {
    --topbar-height: 82px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(285px, 87vw);
    transform: translateX(-102%);
    transition: transform var(--transition);
  }

  .app-shell.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-collapse {
    display: none;
  }

  .mobile-only {
    display: inline-grid;
  }

  .topbar {
    padding-inline: 17px;
  }

  .user-chip-copy,
  .user-chip > svg {
    display: none;
  }

  .user-chip {
    padding: 5px;
  }

  .topbar-left p,
  .breadcrumb {
    display: none;
  }

  .main-content {
    padding: 18px;
  }

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

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

@media (max-width: 760px) {
  .topbar-actions {
    gap: 6px;
  }

  #new-notice-button span:last-child {
    display: none;
  }

  #new-notice-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .metric-grid,
  .report-summary-grid {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
    scroll-snap-type: x mandatory;
  }

  .metric-card,
  .report-summary-card {
    min-width: 210px;
    scroll-snap-align: start;
  }

  .toolbar-main {
    grid-template-columns: 1fr;
  }

  .toolbar-main > .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-main > .toolbar-actions .button {
    width: 100%;
  }

  .toolbar-main .filter-sector,
  .toolbar-main .filter-priority,
  .toolbar-main .filter-responsible,
  .toolbar-main .filter-status {
    display: none;
  }

  .toolbar-main.filters-open {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-main.filters-open .search-control,
  .toolbar-main.filters-open .toolbar-actions {
    grid-column: 1 / -1;
  }

  .toolbar-main.filters-open .filter-sector,
  .toolbar-main.filters-open .filter-priority,
  .toolbar-main.filters-open .filter-responsible,
  .toolbar-main.filters-open .filter-status {
    display: grid;
  }

  .table-wrap {
    overflow: visible;
    padding: 0 12px 12px;
  }

  .data-table,
  .data-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .data-table colgroup,
  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    margin-bottom: 10px;
    padding: 15px;
    border: 1px solid var(--ink-100);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 38, 66, 0.05);
  }

  .data-table td,
  .data-table td:first-child {
    display: flex;
    height: auto;
    min-width: 0;
    padding: 0;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--ink-400);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .data-table .title-cell,
  .data-table td[data-label="Ações"] {
    grid-column: 1 / -1;
  }

  .data-table .title-cell strong,
  .data-table .title-cell p {
    white-space: normal;
  }

  .data-table .title-cell strong {
    font-size: 13px;
  }

  .data-table .title-cell p {
    font-size: 11px;
  }

  .data-table .row-actions {
    justify-content: flex-start;
  }

  .record-tabs {
    margin-inline: -4px;
  }

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

  .form-grid,
  .form-grid.three,
  .detail-meta-grid,
  .diff-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2,
  .form-grid .span-full {
    grid-column: auto;
  }

  .segmented {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .user-row,
  .audit-row {
    grid-template-columns: 1fr auto;
  }

  .user-row > :nth-child(2),
  .user-row > :nth-child(3),
  .user-row > :nth-child(4),
  .audit-row > :nth-child(3) {
    display: none;
  }

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

  .drawer {
    width: 100vw;
  }

  .drawer-header,
  .drawer-body,
  .drawer-footer {
    padding-inline: 15px;
  }

  .drawer-footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .drawer-actions {
    width: 100%;
  }

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

  .modal-backdrop {
    padding: 0;
    align-items: end;
  }

  .modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }
}

@media (max-width: 480px) {
  .auth-form-panel {
    padding: 28px 22px;
  }

  .auth-logo {
    margin-bottom: 45px;
  }

  .topbar h1 {
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .notification-button,
  .user-chip,
  #new-notice-button,
  #mobile-menu {
    width: 38px;
    height: 38px;
    min-height: 38px;
  }

  .avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .main-content {
    padding: 13px;
  }

  .page-stack {
    gap: 13px;
  }

  .toolbar-panel {
    padding: 11px;
  }

  .metric-card {
    min-width: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =====================================================================
   V4 · Identidade CEOS Horizon + bases + checklists
   ===================================================================== */
:root {
  --brand-950: #0C2461;
  --brand-900: #13327d;
  --brand-800: #17408b;
  --brand-700: #1D4ED8;
  --brand-600: #2563EB;
  --brand-500: #3B82F6;
  --brand-400: #60A5FA;
  --brand-200: #BFDBFE;
  --brand-100: #DBEAFE;
  --brand-50: #EFF6FF;
  --canvas: #EFF6FF;
  --canvas-deep: #DBEAFE;
  --overlay: rgba(12, 36, 97, 0.58);
  --shadow-xs: 0 1px 2px rgba(46, 33, 222, 0.05);
  --shadow-sm: 0 2px 8px rgba(46, 33, 222, 0.07);
  --shadow-md: 0 14px 34px rgba(29, 78, 216, 0.10);
  --shadow-lg: 0 24px 70px rgba(12, 36, 97, 0.19);
  --ring: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

body {
  background:
    radial-gradient(circle at 88% -5%, rgba(59, 130, 246, 0.09), transparent 34%),
    var(--canvas);
}

/* Login CEOS */
.ceos-auth-shell {
  grid-template-columns: minmax(440px, 1fr) minmax(560px, 1fr);
  padding: 0;
  background: #102746;
}

.ceos-auth-panel {
  min-height: 100vh;
  padding: clamp(38px, 6vw, 92px) clamp(38px, 8vw, 126px);
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 20% 8%, rgba(96, 165, 250, 0.16), transparent 30%),
    linear-gradient(145deg, #1a3a60 0%, #102846 48%, #0b1e36 100%);
}

.ceos-auth-panel .auth-form-wrap {
  width: min(520px, 100%);
}

.ceos-auth-logo {
  width: min(260px, 64vw);
  max-height: 86px;
  margin: 0 0 clamp(42px, 6vh, 62px);
  object-position: left center;
}

.ceos-auth-panel .auth-intro {
  max-width: 390px;
  margin: 0;
  color: rgba(219, 234, 254, 0.72);
  font-size: 14px;
  line-height: 1.6;
}

.ceos-auth-panel .auth-form {
  margin-top: 30px;
}

.ceos-auth-panel .auth-heading .eyebrow {
  color: #72a7ff;
}

.ceos-auth-panel .auth-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(31px, 3.2vw, 43px);
  letter-spacing: -0.035em;
}

.ceos-auth-panel .auth-heading > p:last-child {
  color: rgba(219, 234, 254, 0.72);
  font-size: 15px;
}

.ceos-auth-panel .field > span:first-child {
  color: rgba(235, 242, 252, 0.76);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ceos-auth-panel .input-shell {
  min-height: 56px;
  border-color: rgba(162, 190, 226, 0.18);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.ceos-auth-panel .input-shell:focus-within {
  border-color: rgba(96, 165, 250, 0.95);
  background: rgba(255, 255, 255, 0.075);
}

.ceos-auth-panel .input-shell input {
  color: #fff;
}

.ceos-auth-panel .input-shell input::placeholder {
  color: rgba(201, 216, 237, 0.40);
}

.ceos-auth-panel .input-icon,
.ceos-auth-panel #toggle-password {
  color: rgba(205, 220, 241, 0.55);
}

.ceos-auth-panel .button.primary.large {
  min-height: 58px;
  border: 1px solid rgba(122, 169, 255, 0.35);
  background: linear-gradient(135deg, #3B82F6, #60A5FA);
  box-shadow: 0 14px 32px rgba(24, 91, 220, 0.28);
}

.ceos-auth-note {
  margin-top: 24px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: rgba(210, 224, 244, 0.62);
  font-size: 12px;
  line-height: 1.5;
}

.ceos-auth-note svg {
  margin-top: 2px;
  color: #65a1ff;
  font-size: 17px;
}

.ceos-auth-note p {
  margin: 0;
}

.auth-powered {
  margin: 28px 0 0;
  color: rgba(204, 220, 242, 0.48);
  font-size: 11px;
  letter-spacing: 0.025em;
}

.auth-powered strong {
  color: rgba(231, 240, 252, 0.78);
}

.ceos-auth-visual {
  position: relative;
  min-height: calc(100vh - 30px);
  margin: 15px 15px 15px 0;
  padding: clamp(48px, 5vw, 74px);
  align-items: flex-start;
  border: 1px solid rgba(132, 174, 235, 0.14);
  border-radius: 28px;
  isolation: isolate;
  background:
    linear-gradient(160deg, rgba(4, 17, 35, 0.56), rgba(6, 18, 38, 0.12)),
    #0b1e3a;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 22px 70px rgba(0, 9, 26, 0.27);
}

.ceos-auth-visual::before,
.ceos-auth-visual::after {
  display: none;
}

.signal-noise,
.signal-glow,
.signal-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.signal-noise {
  z-index: -3;
  opacity: 0.78;
  background:
    radial-gradient(circle at 83% 22%, rgba(66, 142, 255, 0.98) 0 4%, rgba(59, 130, 246, 0.56) 18%, transparent 40%),
    radial-gradient(circle at 25% 71%, rgba(41, 115, 255, 0.86) 0 7%, rgba(15, 82, 207, 0.42) 27%, transparent 54%),
    radial-gradient(circle at 52% 48%, rgba(225, 236, 255, 0.68), transparent 17%),
    linear-gradient(140deg, #071529 12%, #142949 43%, #0a3d93 75%, #2d7dff 100%);
}

.signal-noise::after {
  content: "";
  position: absolute;
  inset: -20%;
  opacity: 0.30;
  background-image:
    repeating-radial-gradient(circle at 30% 50%, rgba(255,255,255,.8) 0 0.45px, transparent .55px 3px),
    repeating-radial-gradient(circle at 70% 40%, rgba(0,8,25,.85) 0 0.65px, transparent .75px 4px);
  background-size: 5px 5px, 7px 7px;
  transform: rotate(-9deg) scale(1.15);
  mix-blend-mode: screen;
}

.signal-glow-one {
  z-index: -2;
  inset: auto -16% 3% 27%;
  height: 54%;
  filter: blur(45px);
  background: radial-gradient(ellipse, rgba(59, 132, 255, 0.78), transparent 68%);
}

.signal-glow-two {
  z-index: -2;
  inset: 23% auto auto -12%;
  width: 62%;
  height: 38%;
  filter: blur(42px);
  background: radial-gradient(ellipse, rgba(221, 234, 255, 0.54), transparent 70%);
}

.ceos-visual-content {
  z-index: 2;
  width: min(660px, 100%);
}

.ceos-visual-content .eyebrow {
  color: rgba(221, 233, 253, 0.78);
}

.ceos-visual-content h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(42px, 4.2vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 620;
}

.ceos-visual-content > p:not(.eyebrow) {
  max-width: 520px;
  margin: 25px 0 0;
  color: rgba(235, 242, 255, 0.76);
  font-size: 16px;
  line-height: 1.6;
}

.visual-chip-row {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.visual-chip-row span {
  padding: 8px 12px;
  border: 1px solid rgba(210, 227, 255, 0.22);
  border-radius: 999px;
  color: rgba(241, 246, 255, 0.90);
  background: rgba(5, 22, 51, 0.28);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 700;
}

.signal-art {
  z-index: -1;
}

.signal-block {
  position: absolute;
  display: block;
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(230, 240, 255, 0.20), rgba(41, 111, 255, 0.08));
  filter: blur(1px);
  transform: rotate(-28deg);
}

.signal-block.b1 { width: 54%; height: 17%; left: -8%; top: 35%; }
.signal-block.b2 { width: 45%; height: 18%; right: -4%; top: 27%; }
.signal-block.b3 { width: 62%; height: 18%; left: 13%; bottom: 24%; }
.signal-block.b4 { width: 32%; height: 13%; right: 8%; bottom: 8%; }
.signal-block.b5 { width: 26%; height: 12%; left: -6%; bottom: 7%; }
.signal-block.b6 { width: 20%; height: 11%; right: -4%; top: 58%; }

/* Cabeçalho, bases e assinatura visual */
.sidebar-base-summary {
  margin: 4px 12px 13px;
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--brand-100);
  border-radius: 12px;
  color: var(--brand-800);
  background: linear-gradient(135deg, var(--brand-50), #fff);
}

.sidebar-base-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border-radius: 10px;
  color: #fff;
  background: var(--brand-500);
}

.sidebar-base-summary span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sidebar-base-summary small {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
}

.sidebar-base-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.sidebar-powered {
  margin: 13px 13px 7px;
  padding: 10px 12px;
  display: grid;
  gap: 7px;
  border: 1px solid var(--ink-150);
  border-radius: 11px;
  background: var(--surface-soft);
}

.sidebar-powered small {
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .16em;
}

.sidebar-powered img {
  width: 112px;
  max-height: 34px;
  object-fit: contain;
  object-position: left center;
}

.branch-switcher {
  position: relative;
  min-width: 210px;
  min-height: 48px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ink-150);
  border-radius: 12px;
  color: var(--brand-700);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.branch-switcher > svg {
  font-size: 20px;
}

.branch-switcher-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 1px;
}

.branch-switcher-copy small {
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
}

.branch-switcher select {
  width: 100%;
  padding: 0 22px 0 0;
  border: 0;
  outline: 0;
  color: var(--ink-800);
  background: transparent;
  appearance: none;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.branch-chevron {
  color: var(--ink-400);
  pointer-events: none;
}

.sidebar-collapsed .sidebar-base-summary,
.sidebar-collapsed .sidebar-powered {
  margin-inline: 10px;
  padding-inline: 10px;
  justify-content: center;
}

.sidebar-collapsed .sidebar-base-summary > span:last-child,
.sidebar-collapsed .sidebar-powered small,
.sidebar-collapsed .sidebar-powered img {
  display: none;
}

/* Checklists */
.checklist-page {
  padding-bottom: 24px;
}

.checklist-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 13px;
}

.checklist-summary-card {
  min-height: 110px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--ink-150);
  border-radius: 16px;
  background: linear-gradient(145deg, #fff, var(--brand-50));
  box-shadow: var(--shadow-xs);
}

.checklist-summary-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  border-radius: 14px;
  color: var(--brand-600);
  background: var(--brand-100);
  font-size: 22px;
}

.checklist-summary-card > span:last-child {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 8px;
}

.checklist-summary-card small {
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 750;
}

.checklist-summary-card strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--brand-800);
  font-size: 30px;
  letter-spacing: -.04em;
}

.checklist-summary-card em {
  color: var(--ink-400);
  font-size: 10px;
  font-style: normal;
}

.checklist-toolbar-panel {
  padding: 13px;
}

.checklist-toolbar {
  display: grid;
  grid-template-columns: minmax(250px, 1.3fr) minmax(180px, .6fr) auto;
  align-items: end;
  gap: 13px;
}

.checklist-toolbar-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding-bottom: 4px;
}

.checklist-toolbar-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-800);
  font-size: 12px;
}

.checklist-toolbar-copy span {
  color: var(--ink-500);
  font-size: 10px;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 15px;
  align-items: stretch;
}

.checklist-grid > .checklist-empty {
  grid-column: 1 / -1;
}

.checklist-card {
  min-width: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink-150);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.checklist-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-200);
  box-shadow: var(--shadow-md);
}

.checklist-card-header,
.checklist-card-header > div,
.checklist-card-actions,
.checklist-card-footer,
.checklist-progress-copy,
.checklist-due,
.checklist-branch {
  display: flex;
  align-items: center;
}

.checklist-card-header {
  justify-content: space-between;
  gap: 10px;
}

.checklist-card-header > div:first-child {
  flex-wrap: wrap;
  gap: 7px;
}

.checklist-card-actions {
  gap: 3px;
}

.checklist-code {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}

.recurrence-badge,
.checklist-branch,
.mini-chip {
  width: fit-content;
  padding: 5px 8px;
  gap: 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.recurrence-badge {
  display: inline-flex;
  align-items: center;
  color: var(--brand-700);
  background: var(--brand-100);
}

.recurrence-badge svg,
.checklist-branch svg {
  font-size: 12px;
}

.checklist-branch {
  margin-top: 11px;
  color: var(--ink-600);
  background: var(--surface-muted);
}

.checklist-card h3 {
  margin: 18px 0 8px;
  color: var(--ink-900);
  font-size: 17px;
  line-height: 1.28;
  letter-spacing: -.02em;
}

.checklist-description {
  min-height: 40px;
  margin: 0;
  color: var(--ink-600);
  font-size: 12px;
  line-height: 1.55;
}

.checklist-preview {
  margin: 17px 0 15px;
  display: grid;
  gap: 7px;
}

.checklist-preview > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-700);
  font-size: 11px;
}

.checklist-preview > span svg {
  color: var(--brand-500);
}

.checklist-preview em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.checklist-preview small {
  color: var(--ink-400);
  font-size: 10px;
}

.checklist-progress-block {
  margin-top: auto;
  padding: 13px;
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  background: var(--surface-soft);
}

.checklist-progress-copy {
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-600);
  font-size: 10px;
}

.checklist-progress-copy strong {
  color: var(--ink-800);
}

.checklist-progress-copy em {
  min-width: 34px;
  color: var(--brand-700);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.progress-track {
  height: 7px;
  margin: 9px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink-100);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-500), #6ba4ff);
  transition: width var(--transition);
}

.checklist-due {
  gap: 5px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.35;
}

.checklist-card-footer {
  min-height: 38px;
  margin-top: 14px;
  justify-content: space-between;
  gap: 10px;
}

.checklist-card-footer > span {
  color: var(--ink-400);
  font-size: 9px;
}

.checklist-card-footer .button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 10px;
}

.checklist-items-builder {
  display: grid;
  gap: 9px;
}

.checklist-builder-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}

.checklist-builder-index {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--brand-700);
  background: var(--brand-100);
  font-size: 10px;
  font-weight: 800;
}

.checklist-drawer-header p {
  max-width: 650px;
}

.drawer-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.checklist-run-hero {
  margin-bottom: 16px;
  padding: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--brand-100);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-50), #fff);
}

.checklist-run-hero > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.checklist-run-hero small {
  color: var(--brand-600);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .1em;
}

.checklist-run-hero strong {
  color: var(--ink-900);
  font-size: 17px;
}

.checklist-run-hero span {
  color: var(--ink-500);
  font-size: 10px;
}

.run-progress-ring {
  --progress: 0;
  width: 78px;
  height: 78px;
  display: grid;
  place-content: center;
  flex: 0 0 78px;
  border-radius: 50%;
  text-align: center;
  background:
    radial-gradient(circle closest-side, #fff 72%, transparent 74% 99%, #fff 100%),
    conic-gradient(var(--brand-500) calc(var(--progress) * 1%), var(--ink-100) 0);
}

.run-progress-ring strong {
  color: var(--brand-800);
  font-size: 16px;
}

.run-progress-ring small {
  color: var(--ink-500);
  font-size: 8px;
  letter-spacing: 0;
}

.checklist-run-items {
  display: grid;
  gap: 9px;
}

.checklist-run-item {
  min-height: 62px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--ink-150);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.checklist-run-item:hover {
  border-color: var(--brand-200);
}

.checklist-run-item.checked {
  border-color: var(--brand-100);
  background: var(--brand-50);
}

.checklist-run-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-check {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  border: 1.5px solid var(--ink-300);
  border-radius: 8px;
  color: transparent;
  background: #fff;
}

.checklist-run-item.checked .custom-check {
  border-color: var(--brand-500);
  color: #fff;
  background: var(--brand-500);
}

.run-item-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.run-item-copy strong {
  color: var(--ink-800);
  font-size: 12px;
}

.run-item-copy small {
  color: var(--ink-400);
  font-size: 9px;
}

.checklist-history {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--ink-150);
}

.checklist-history > header {
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.checklist-history h3 {
  margin: 0;
  font-size: 13px;
}

.checklist-history > header span {
  color: var(--ink-400);
  font-size: 9px;
}

.checklist-history > div {
  display: grid;
  gap: 7px;
}

.checklist-history button {
  width: 100%;
  min-height: 55px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ink-150);
  border-radius: 11px;
  text-align: left;
  background: var(--surface);
  cursor: pointer;
}

.checklist-history button:hover {
  border-color: var(--brand-200);
  background: var(--brand-50);
}

.checklist-history button > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.checklist-history button strong {
  font-size: 11px;
}

.checklist-history button small {
  color: var(--ink-500);
  font-size: 9px;
}

.checklist-history button em {
  color: var(--brand-700);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.history-status {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--orange-700);
  background: var(--orange-100);
}

.history-status.completed {
  color: var(--green-700);
  background: var(--green-100);
}

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

body.theme-dark .data-table thead th {
  background: linear-gradient(90deg, #123b79, #245fbd);
}

body.theme-dark .checklist-summary-card,
body.theme-dark .checklist-card,
body.theme-dark .checklist-run-item,
body.theme-dark .checklist-history button {
  background: var(--surface);
}

body.theme-dark .checklist-progress-block,
body.theme-dark .sidebar-powered {
  background: var(--surface-soft);
}

/* Responsividade V4 */
@media (max-width: 1320px) {
  .checklist-summary-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .checklist-grid { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
  .branch-switcher { min-width: 185px; }
}

@media (max-width: 1000px) {
  .ceos-auth-shell { grid-template-columns: 1fr; }
  .ceos-auth-panel { min-height: 100vh; }
  .ceos-auth-visual { display: none; }
  .sidebar-base-summary { margin-top: 7px; }
  .branch-switcher { min-width: 170px; }
}

@media (max-width: 760px) {
  .ceos-auth-panel { padding: 30px 22px; }
  .ceos-auth-logo { width: 250px; margin-bottom: 44px; }
  .checklist-summary-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 3px;
  }
  .checklist-summary-card { min-width: 230px; scroll-snap-align: start; }
  .checklist-toolbar { grid-template-columns: 1fr auto; }
  .checklist-toolbar-copy { display: none; }
  .checklist-grid { grid-template-columns: 1fr; }
  .branch-switcher { min-width: 144px; max-width: 180px; }
  .branch-switcher-copy small { display: none; }
  .branch-switcher select { font-size: 11px; }
  .checklist-run-hero { align-items: flex-start; }
}

@media (max-width: 560px) {
  .topbar { min-width: 0; }
  .topbar-left { min-width: 0; }
  .page-heading-copy { min-width: 0; }
  .branch-switcher {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }
  .branch-switcher-copy,
  .branch-chevron { display: none; }
  .branch-switcher > svg { font-size: 19px; }
  .checklist-toolbar { grid-template-columns: 1fr 42px; }
  .checklist-toolbar .button { width: 42px; min-width: 42px; padding: 0; }
  .checklist-toolbar .button svg { margin: auto; }
  .checklist-toolbar .button { font-size: 0; }
  .checklist-builder-row { grid-template-columns: 26px minmax(0, 1fr) 34px; }
  .checklist-run-hero { padding: 14px; }
  .run-progress-ring { width: 68px; height: 68px; flex-basis: 68px; }
}

/* ========================================================================== */
/* V4 · CEOS Horizon visual system, multi-base navigation and checklists      */
/* ========================================================================== */

:root {
  --brand-950: #0C2461;
  --brand-900: #13327d;
  --brand-800: #17408b;
  --brand-700: #1D4ED8;
  --brand-600: #2563EB;
  --brand-500: #3B82F6;
  --brand-400: #60A5FA;
  --brand-200: #BFDBFE;
  --brand-100: #DBEAFE;
  --brand-50: #EFF6FF;

  --ink-950: #020617;
  --ink-900: #0F172A;
  --ink-800: #1E293B;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748B;
  --ink-400: #94A3B8;
  --ink-300: #CBD5E1;
  --ink-200: #D6E4FF;
  --ink-150: #E2E8F0;
  --ink-100: #EBF5FF;
  --ink-50: #F8FBFF;

  --surface-soft: #F8FBFF;
  --surface-muted: #EBF5FF;
  --canvas: #EFF6FF;
  --canvas-deep: #DBEAFE;
  --overlay: rgba(12, 36, 97, 0.62);
  --ring: 0 0 0 3px rgba(59, 130, 246, 0.18);
  --shadow-xs: 0 1px 2px rgba(46, 33, 222, 0.05);
  --shadow-sm: 0 2px 8px rgba(46, 33, 222, 0.08);
  --shadow-md: 0 16px 42px rgba(29, 78, 216, 0.11);
  --shadow-lg: 0 28px 80px rgba(12, 36, 97, 0.2);
}

body {
  background:
    radial-gradient(circle at 93% 0%, rgba(59, 130, 246, 0.085), transparent 29rem),
    linear-gradient(180deg, #F8FBFF 0, var(--canvas) 18rem);
}

.button.primary {
  border-color: rgba(29, 78, 216, 0.35);
  background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 72%, #60A5FA 100%);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.22);
}

.button.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1D4ED8, #2563EB 68%, #60A5FA);
  box-shadow: 0 11px 26px rgba(59, 130, 246, 0.3);
}

/* CEOS login */
.ceos-auth-shell {
  grid-template-columns: minmax(430px, 0.9fr) minmax(560px, 1.22fr);
  min-height: 100svh;
  color: #fff;
  background: #0a1b37;
}

.ceos-auth-panel {
  position: relative;
  min-height: 100svh;
  padding: clamp(34px, 5vw, 76px) clamp(34px, 7vw, 112px);
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 12%, rgba(72, 139, 255, 0.19), transparent 24rem),
    radial-gradient(circle at 86% 90%, rgba(22, 76, 166, 0.24), transparent 30rem),
    linear-gradient(145deg, #13327d 0%, #0C2461 46%, #071a3d 100%);
}

.ceos-auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.032) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 30% 44%, #000 0%, transparent 72%);
}

.ceos-auth-panel .auth-form-wrap {
  position: relative;
  z-index: 1;
  width: min(486px, 100%);
}

.ceos-auth-logo {
  width: min(320px, 78%);
  max-height: 94px;
  margin: 0 0 clamp(54px, 8vh, 88px);
  object-fit: contain;
  object-position: left center;
}

.ceos-auth-panel .auth-heading .eyebrow {
  margin-bottom: 13px;
  color: #79a9ff;
}

.ceos-auth-panel .auth-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.ceos-auth-panel .auth-heading > p:last-child {
  max-width: 430px;
  margin-top: 17px;
  color: rgba(224, 234, 250, 0.72);
  font-size: 15px;
  line-height: 1.6;
}

.ceos-auth-panel .auth-form {
  margin-top: 38px;
  gap: 22px;
}

.ceos-auth-panel .field > span:first-child {
  color: rgba(231, 238, 250, 0.77);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ceos-auth-panel .input-shell {
  min-height: 57px;
  border-color: rgba(154, 181, 224, 0.19);
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(10px);
}

.ceos-auth-panel .input-shell:hover {
  border-color: rgba(120, 164, 238, 0.36);
}

.ceos-auth-panel .input-shell:focus-within {
  border-color: #60A5FA;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.19), inset 0 1px 0 rgba(255,255,255,.04);
}

.ceos-auth-panel .input-shell input {
  color: #fff;
}

.ceos-auth-panel .input-shell input::placeholder {
  color: rgba(202, 215, 237, 0.4);
}

.ceos-auth-panel .input-icon,
.ceos-auth-panel #toggle-password {
  color: rgba(194, 211, 240, 0.58);
}

.ceos-auth-panel #toggle-password:hover {
  color: #fff;
  background: rgba(255,255,255,.07);
}

.ceos-auth-panel .button.large {
  min-height: 58px;
  border-radius: 12px;
  font-size: 15px;
}

.ceos-auth-note {
  margin-top: 32px;
  padding-top: 22px;
  border-top-color: rgba(170, 195, 235, 0.15);
  color: rgba(202, 216, 239, 0.57);
}

.ceos-auth-note svg {
  color: #6fa4ff;
}

.auth-powered {
  margin: 24px 0 0;
  color: rgba(183, 203, 235, 0.47);
  font-size: 11px;
  letter-spacing: 0.035em;
}

.auth-powered strong {
  color: rgba(222, 234, 253, 0.76);
}

.ceos-auth-visual {
  position: relative;
  min-height: calc(100svh - 32px);
  margin: 16px 16px 16px 0;
  padding: clamp(48px, 6vw, 92px);
  align-items: flex-start;
  border: 1px solid rgba(144, 182, 245, 0.15);
  border-radius: 26px;
  isolation: isolate;
  background:
    radial-gradient(circle at 77% 18%, rgba(96, 165, 250, .94), transparent 28%),
    radial-gradient(circle at 14% 89%, rgba(202, 224, 255, .9), transparent 26%),
    radial-gradient(circle at 80% 88%, rgba(15, 72, 166, .7), transparent 35%),
    linear-gradient(135deg, #071a3d 8%, #13327d 46%, #3B82F6 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 24px 70px rgba(2, 12, 31, .35);
}

.ceos-auth-visual::before,
.ceos-auth-visual::after {
  display: none;
}

.signal-noise {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  opacity: .58;
  mix-blend-mode: screen;
  background-image:
    repeating-radial-gradient(circle at 20% 30%, rgba(255,255,255,.26) 0 1px, transparent 1px 4px),
    repeating-radial-gradient(circle at 80% 60%, rgba(15,31,58,.6) 0 1px, transparent 1px 3px);
  background-size: 7px 7px, 5px 5px;
  mask-image: linear-gradient(120deg, transparent 4%, #000 24%, #000 72%, transparent 100%);
  transform: scale(1.05) rotate(-2deg);
}

.signal-glow {
  position: absolute;
  z-index: -2;
  border-radius: 50%;
  filter: blur(28px);
  pointer-events: none;
}

.signal-glow-one {
  width: 58%;
  aspect-ratio: 1;
  right: -8%;
  top: 5%;
  background: rgba(102, 163, 255, .62);
}

.signal-glow-two {
  width: 52%;
  aspect-ratio: 1;
  left: -14%;
  bottom: -12%;
  background: rgba(223, 235, 255, .48);
}

.ceos-visual-content {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
}

.ceos-visual-content h2 {
  max-width: 700px;
  margin: 0;
  color: #fff;
  font-size: clamp(44px, 5.8vw, 82px);
  font-weight: 560;
  line-height: .98;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.ceos-visual-content > p:not(.eyebrow) {
  max-width: 590px;
  margin: 28px 0 0;
  color: rgba(237, 244, 255, .76);
  font-size: 17px;
  line-height: 1.65;
}

.visual-chip-row {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.visual-chip-row span {
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: rgba(255,255,255,.88);
  background: rgba(4, 19, 45, .24);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 700;
}

.signal-art {
  position: absolute;
  z-index: 1;
  right: 5%;
  bottom: 5%;
  width: 58%;
  height: 45%;
  opacity: .3;
  transform: perspective(700px) rotateX(58deg) rotateZ(-16deg);
}

.signal-block {
  position: absolute;
  display: block;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.17), rgba(255,255,255,.02));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 18px 60px rgba(1,9,26,.25);
}

.signal-block.b1 { inset: 4% 54% 56% 2%; }
.signal-block.b2 { inset: 12% 7% 48% 51%; }
.signal-block.b3 { inset: 48% 61% 7% 0; }
.signal-block.b4 { inset: 52% 18% 2% 37%; }
.signal-block.b5 { inset: 29% 40% 33% 25%; }
.signal-block.b6 { inset: 35% 0 16% 72%; }

/* Application shell and sidebar */
.app-shell {
  background: transparent;
}

.sidebar {
  color: rgba(236, 243, 255, .78);
  border-right: 1px solid rgba(107, 145, 204, .14);
  background: #0C2461;
  box-shadow: 8px 0 24px rgba(12, 36, 97, .06);
  backdrop-filter: none;
}

.sidebar-top {
  min-height: var(--topbar-height);
  padding: 14px 18px;
  border-bottom-color: rgba(147, 197, 253, .12);
}

.sidebar-brand {
  width: 196px;
  height: 62px;
  padding: 8px 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.1);
}

.sidebar-brand img {
  width: 158px;
  max-height: 48px;
  object-fit: contain;
}

.sidebar-collapse {
  color: rgba(228, 238, 255, .67);
  border-color: rgba(151, 181, 230, .14);
  background: rgba(255,255,255,.045);
}

.sidebar-collapse:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(108,158,241,.42);
  background: rgba(59, 130, 246,.16);
}

.sidebar-base-summary {
  margin: 16px 14px 2px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(117, 158, 222, .15);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}

.sidebar-base-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 31px;
  border-radius: 9px;
  color: #8cb7ff;
  background: rgba(59, 130, 246,.16);
}

.sidebar-base-summary > span:last-child {
  min-width: 0;
}

.sidebar-base-summary small,
.sidebar-base-summary strong {
  display: block;
}

.sidebar-base-summary small {
  color: rgba(189, 207, 236, .43);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
}

.sidebar-base-summary strong {
  margin-top: 3px;
  overflow: hidden;
  color: #F8FBFF;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .nav-item {
  color: rgba(222, 233, 250, .76);
  border-color: transparent;
}

.sidebar .nav-item:hover {
  color: #fff;
  background: rgba(96, 165, 250, .11);
}

.sidebar .nav-item.active {
  color: #fff;
  border-color: rgba(126, 170, 239, .18);
  background: rgba(59, 130, 246, .2);
  box-shadow: inset 3px 0 0 #6ea4ff;
}

.sidebar .sidebar-nav-heading {
  color: rgba(183, 204, 235, .52);
}

.sidebar .nav-item.active .nav-icon,
.sidebar .nav-item:hover .nav-icon {
  color: #8db8ff;
}

.sidebar-divider,
.sidebar-footer,
.sidebar-top {
  border-color: rgba(147, 197, 253, .12);
}

.sidebar-footer {
  padding-top: 14px;
}

.sidebar .system-status > span {
  background: #60A5FA;
  box-shadow: 0 0 0 5px rgba(96, 165, 250,.11);
}

.sidebar .system-status strong {
  color: rgba(239,245,255,.84);
}

.sidebar .system-status small,
.sidebar-footer > p {
  color: rgba(191, 219, 254,.43);
}

.sidebar-powered {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(147, 197, 253,.1);
}

.sidebar-powered small {
  display: block;
  margin-bottom: 7px;
  color: rgba(191, 219, 254,.35);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .15em;
}

.sidebar-powered img {
  width: 110px;
  max-height: 30px;
  object-fit: contain;
  object-position: left center;
  opacity: .72;
}

.sidebar-collapsed .sidebar-brand {
  width: 53px;
  height: 53px;
  padding: 6px;
}

.sidebar-collapsed .sidebar-brand img {
  width: 48px;
  max-width: 48px;
  transform: none;
  clip-path: none;
}

.sidebar-collapsed .sidebar-base-summary,
.sidebar-collapsed .sidebar-powered {
  display: none;
}

.sidebar-collapsed .sidebar-footer {
  padding-inline: 12px;
}

.topbar {
  border-bottom-color: rgba(206, 216, 230, .84);
  background: rgba(255,255,255,.91);
  box-shadow: 0 6px 24px rgba(46, 33, 222,.035);
}

.breadcrumb span:first-child {
  color: var(--brand-600);
}

/* Multi-base switcher */
.branch-switcher {
  position: relative;
  min-width: 198px;
  height: 49px;
  padding: 6px 36px 6px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--ink-150);
  border-radius: 12px;
  color: var(--brand-600);
  background: #fff;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.branch-switcher:hover,
.branch-switcher:focus-within {
  border-color: var(--brand-200);
  background: var(--brand-50);
  box-shadow: var(--ring);
}

.branch-switcher > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.branch-switcher-copy {
  min-width: 0;
  display: grid;
}

.branch-switcher-copy small {
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .13em;
}

.branch-switcher-copy select {
  width: 100%;
  max-width: 148px;
  padding: 1px 0 0;
  appearance: none;
  border: 0;
  outline: 0;
  color: var(--ink-800);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
}

.branch-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
}

.inline-branch,
.kanban-branch,
.checklist-branch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brand-700);
  font-weight: 750;
}

.inline-branch {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-50);
  font-size: 9px;
}

.kanban-branch,
.checklist-branch {
  width: fit-content;
  padding: 5px 8px;
  border: 1px solid var(--brand-100);
  border-radius: 999px;
  background: var(--brand-50);
  font-size: 9px;
}

.kanban-branch svg,
.checklist-branch svg {
  width: 12px;
  height: 12px;
}

/* Checklist overview */
.checklist-page {
  gap: 18px;
}

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

.checklist-summary-card {
  min-width: 0;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(205, 215, 229, .86);
  border-radius: 15px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-xs);
}

.checklist-summary-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  border: 1px solid #dce8ff;
  border-radius: 13px;
  color: var(--brand-600);
  background: linear-gradient(145deg, #f2f6ff, #e7f0ff);
}

.checklist-summary-icon svg {
  width: 21px;
  height: 21px;
}

.checklist-summary-card > span:last-child {
  min-width: 0;
}

.checklist-summary-card small,
.checklist-summary-card strong,
.checklist-summary-card em {
  display: block;
}

.checklist-summary-card small {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.checklist-summary-card strong {
  margin-top: 3px;
  color: var(--ink-950);
  font-size: 26px;
  line-height: 1;
}

.checklist-summary-card em {
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink-400);
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checklist-toolbar-panel {
  padding: 13px;
}

.checklist-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 14px;
}

.checklist-toolbar .search-control {
  max-width: 570px;
}

.checklist-toolbar-copy {
  min-width: 165px;
  padding-bottom: 4px;
  text-align: right;
}

.checklist-toolbar-copy strong,
.checklist-toolbar-copy span {
  display: block;
}

.checklist-toolbar-copy strong {
  color: var(--ink-800);
  font-size: 11px;
}

.checklist-toolbar-copy span {
  margin-top: 3px;
  color: var(--ink-400);
  font-size: 9px;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(270px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.checklist-card {
  position: relative;
  min-width: 0;
  min-height: 375px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(203, 214, 229, .9);
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246,.075), transparent 12rem),
    #fff;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.checklist-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 17px 0 0 17px;
  background: linear-gradient(180deg, #3B82F6, #1D4ED8);
  opacity: .86;
}

.checklist-card:hover {
  transform: translateY(-3px);
  border-color: #b8cff7;
  box-shadow: 0 15px 38px rgba(13,48,108,.12);
}

.checklist-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.checklist-card-header > div:first-child {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.checklist-code {
  color: var(--ink-400);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
}

.recurrence-badge {
  min-height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #cfddf6;
  border-radius: 999px;
  color: #245bbb;
  background: #eef4ff;
  font-size: 9px;
  font-weight: 800;
}

.recurrence-badge svg {
  width: 12px;
  height: 12px;
}

.recurrence-none {
  color: var(--ink-600);
  border-color: var(--ink-150);
  background: var(--ink-50);
}

.recurrence-weekly {
  color: #6941c6;
  border-color: #ded1fa;
  background: #f4f0ff;
}

.recurrence-monthly {
  color: #026aa2;
  border-color: #c5e4f5;
  background: #edf9ff;
}

.checklist-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.danger-ghost:hover:not(:disabled) {
  color: var(--red-700);
  background: #fff2f3;
}

.checklist-branch {
  margin-top: 13px;
}

.checklist-card h3 {
  margin: 17px 0 0;
  color: var(--ink-950);
  font-size: 17px;
  line-height: 1.27;
  letter-spacing: -.018em;
}

.checklist-description {
  min-height: 42px;
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 11px;
  line-height: 1.55;
}

.checklist-preview {
  margin-top: 16px;
  padding: 12px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--ink-100);
  border-radius: 12px;
  background: var(--surface-soft);
}

.checklist-preview > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-700);
}

.checklist-preview > span svg {
  width: 14px;
  height: 14px;
  padding: 2px;
  flex: 0 0 14px;
  border-radius: 50%;
  color: var(--brand-600);
  background: var(--brand-100);
}

.checklist-preview em {
  overflow: hidden;
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checklist-preview > small {
  padding-left: 22px;
  color: var(--ink-400);
  font-size: 9px;
}

.checklist-progress-block {
  margin-top: auto;
  padding-top: 17px;
}

.checklist-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-500);
  font-size: 9px;
}

.checklist-progress-copy strong {
  color: var(--ink-800);
  font-size: 10px;
}

.progress-track {
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

.progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563EB, #60A5FA);
  transition: width 260ms ease;
}

.checklist-due {
  min-height: 29px;
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.45;
}

.checklist-due svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: var(--brand-500);
}

.checklist-card-footer {
  margin: 12px -18px -18px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--ink-100);
}

.checklist-card-footer > span {
  color: var(--ink-400);
  font-size: 9px;
}

.checklist-empty {
  grid-column: 1 / -1;
}

/* Checklist form and detail */
.field-hint {
  margin-left: 5px;
  color: var(--ink-400);
  font-size: 9px;
  font-weight: 500;
}

.checklist-items-textarea {
  min-height: 145px;
  line-height: 1.65;
}

.checklist-form-tip {
  margin-top: 18px;
  padding: 13px 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid #cfe0ff;
  border-radius: 12px;
  color: var(--brand-700);
  background: var(--brand-50);
}

.checklist-form-tip > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.checklist-form-tip strong,
.checklist-form-tip small {
  display: block;
}

.checklist-form-tip strong {
  font-size: 11px;
}

.checklist-form-tip small {
  margin-top: 3px;
  color: var(--ink-600);
  font-size: 9px;
  line-height: 1.45;
}

.checklist-drawer-header {
  background:
    radial-gradient(circle at 90% 10%, rgba(59, 130, 246,.12), transparent 14rem),
    #fff;
}

.checklist-drawer-header h2 {
  margin-top: 11px;
}

.checklist-drawer-header p {
  max-width: 620px;
  line-height: 1.55;
}

.checklist-drawer-body {
  background: #F8FBFF;
}

.checklist-run-hero {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #d5e3fb;
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(59, 130, 246,.11), transparent 13rem),
    #fff;
  box-shadow: var(--shadow-xs);
}

.checklist-run-hero > div:first-child small,
.checklist-run-hero > div:first-child strong,
.checklist-run-hero > div:first-child span {
  display: block;
}

.checklist-run-hero > div:first-child small {
  color: var(--brand-600);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .1em;
}

.checklist-run-hero > div:first-child strong {
  margin-top: 6px;
  color: var(--ink-950);
  font-size: 21px;
}

.checklist-run-hero > div:first-child span {
  margin-top: 5px;
  color: var(--ink-500);
  font-size: 10px;
}

.checklist-run-hero > div:first-child .checklist-autosave-hint {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--brand-600);
  font-weight: 700;
}

.checklist-autosave-hint svg {
  width: 13px;
  height: 13px;
}

.run-progress-ring {
  --value: calc(var(--progress) * 1%);
  position: relative;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  flex: 0 0 82px;
  border-radius: 50%;
  background: conic-gradient(var(--brand-500) var(--value), #e4ebf5 0);
}

.run-progress-ring::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
}

.run-progress-ring strong,
.run-progress-ring small {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
}

.run-progress-ring strong {
  align-self: end;
  color: var(--ink-950);
  font-size: 17px;
  line-height: 1;
}

.run-progress-ring small {
  align-self: start;
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 7px;
}

.checklist-run-items {
  margin-top: 16px;
  display: grid;
  gap: 9px;
}

.checklist-run-item {
  min-height: 60px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ink-150);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.checklist-run-item:hover {
  transform: translateX(2px);
  border-color: var(--brand-200);
}

.checklist-run-item.checked {
  border-color: #bdd5ff;
  background: #F8FBFF;
}

.checklist-run-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-check {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  border: 1.5px solid var(--ink-300);
  border-radius: 7px;
  color: transparent;
  background: #fff;
  transition: all var(--transition);
}

.custom-check svg {
  width: 15px;
  height: 15px;
}

.checklist-run-item.checked .custom-check {
  color: #fff;
  border-color: var(--brand-500);
  background: var(--brand-500);
  box-shadow: 0 5px 12px rgba(59, 130, 246,.2);
}

.run-item-copy {
  min-width: 0;
}

.run-item-copy strong,
.run-item-copy small {
  display: block;
}

.run-item-copy strong {
  color: var(--ink-800);
  font-size: 11px;
  line-height: 1.4;
}

.checklist-run-item.checked .run-item-copy strong {
  color: var(--ink-500);
  text-decoration: line-through;
}

.run-item-copy small {
  margin-top: 4px;
  color: var(--ink-400);
  font-size: 8px;
}

.checklist-history {
  margin-top: 23px;
}

.checklist-history > header {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checklist-history h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 13px;
}

.checklist-history > header > span {
  color: var(--ink-400);
  font-size: 9px;
}

.checklist-history > div {
  display: grid;
  gap: 8px;
}

.checklist-history button {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ink-150);
  border-radius: 11px;
  text-align: left;
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.checklist-history button:hover {
  border-color: var(--brand-200);
  background: var(--brand-50);
}

.history-status {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #b36b08;
  background: #fff1d7;
}

.history-status.completed {
  color: #047857;
  background: #D1FAE5;
}

.history-status svg {
  width: 15px;
  height: 15px;
}

.checklist-history button > span:nth-child(2) {
  min-width: 0;
}

.checklist-history button strong,
.checklist-history button small {
  display: block;
}

.checklist-history button strong {
  color: var(--ink-800);
  font-size: 10px;
}

.checklist-history button small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-400);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checklist-history button em {
  color: var(--brand-600);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.muted-copy {
  margin: 0;
  color: var(--ink-400);
  font-size: 10px;
}

/* Dark mode compatibility for V4 */
body.theme-dark {
  --ink-950: #f2f6fd;
  --ink-900: #e9eef8;
  --ink-800: #d7e0ee;
  --ink-700: #bdc9db;
  --ink-600: #9facbf;
  --ink-500: #8492a6;
  --ink-400: #6f7d91;
  --ink-300: #526075;
  --ink-200: #3d4b60;
  --ink-150: #303d50;
  --ink-100: #263346;
  --ink-50: #1c293b;
  --surface: #101d30;
  --surface-soft: #142238;
  --surface-muted: #17263c;
  --canvas: #0b1524;
  --canvas-deep: #07111e;
}

body.theme-dark .topbar,
body.theme-dark .checklist-summary-card,
body.theme-dark .checklist-card,
body.theme-dark .checklist-run-hero,
body.theme-dark .checklist-run-item,
body.theme-dark .checklist-history button,
body.theme-dark .branch-switcher,
body.theme-dark .checklist-drawer-header {
  background-color: var(--surface);
}

body.theme-dark .checklist-drawer-body {
  background: var(--canvas);
}

body.theme-dark .run-progress-ring::before,
body.theme-dark .custom-check {
  background: var(--surface);
}

body.theme-dark .sidebar-brand img,
body.theme-dark .ceos-auth-logo,
body.theme-dark .sidebar-powered img {
  background: transparent;
}

/* V4 responsive behaviour */
@media (max-width: 1360px) {
  .checklist-grid {
    grid-template-columns: repeat(2, minmax(270px, 1fr));
  }

  .checklist-summary-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .branch-switcher {
    min-width: 178px;
  }
}

@media (max-width: 1120px) {
  .ceos-auth-shell {
    grid-template-columns: minmax(420px, .9fr) minmax(460px, 1.1fr);
  }

  .topbar {
    gap: 14px;
  }

  .topbar-actions {
    gap: 7px;
  }

  .branch-switcher {
    min-width: 150px;
  }

  .branch-switcher-copy select {
    max-width: 108px;
  }
}

@media (max-width: 1000px) {
  .ceos-auth-shell {
    grid-template-columns: 1fr;
  }

  .ceos-auth-panel {
    min-height: 100svh;
  }

  .ceos-auth-visual {
    display: none;
  }

  .sidebar {
    width: min(300px, 88vw);
    box-shadow: 20px 0 60px rgba(2,12,31,.3);
  }

  .app-shell.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-backdrop {
    background: rgba(4,14,30,.62);
  }

  .sidebar-collapse {
    display: none;
  }

  .topbar {
    min-height: 78px;
  }

  .topbar-left {
    flex: 1 1 auto;
  }

  .page-heading-copy {
    min-width: 0;
  }

  .branch-switcher {
    min-width: 48px;
    width: 48px;
    padding: 0;
    justify-content: center;
  }

  .branch-switcher-copy,
  .branch-chevron {
    display: block;
    position: absolute;
    inset: 0;
    opacity: 0;
  }

  .branch-switcher-copy select {
    width: 100%;
    max-width: none;
    height: 100%;
  }

  .checklist-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 760px) {
  .ceos-auth-panel {
    padding: 30px 24px;
  }

  .ceos-auth-logo {
    width: min(240px, 64vw);
    margin-bottom: 48px;
  }

  .ceos-auth-panel .auth-heading h1 {
    font-size: 34px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .topbar h1 {
    max-width: min(43vw, 260px);
    font-size: 19px;
  }

  .branch-switcher,
  .notification-button,
  .user-chip,
  #new-notice-button,
  #mobile-menu {
    width: 39px;
    min-width: 39px;
    height: 39px;
    min-height: 39px;
  }

  .checklist-summary-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .checklist-summary-card {
    min-width: 220px;
    scroll-snap-align: start;
  }

  .checklist-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .checklist-toolbar-copy {
    display: none;
  }

  .checklist-toolbar #checklist-new-inline {
    width: 40px;
    min-width: 40px;
    padding: 0;
    font-size: 0;
  }

  .checklist-toolbar #checklist-new-inline svg {
    width: 17px;
    height: 17px;
  }

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

  .checklist-card {
    min-height: 345px;
  }

  .checklist-run-hero {
    padding: 15px;
  }

  .run-progress-ring {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }
}

@media (max-width: 480px) {
  .ceos-auth-panel {
    padding-inline: 20px;
  }

  .ceos-auth-logo {
    margin-bottom: 38px;
  }

  .ceos-auth-panel .auth-heading h1 {
    font-size: 30px;
  }

  .ceos-auth-panel .auth-form {
    margin-top: 30px;
  }

  .topbar h1 {
    max-width: 124px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .branch-switcher,
  .notification-button,
  .user-chip,
  #new-notice-button,
  #mobile-menu {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  .checklist-summary-card {
    min-width: 198px;
  }

  .checklist-card {
    padding: 15px;
  }

  .checklist-card-footer {
    margin: 12px -15px -15px;
    padding-inline: 15px;
  }

  .checklist-run-hero {
    align-items: flex-start;
  }

  .checklist-run-hero > div:first-child strong {
    font-size: 18px;
  }

  .run-progress-ring {
    width: 66px;
    height: 66px;
    flex-basis: 66px;
  }

  .checklist-history button {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .checklist-history button em {
    display: none;
  }
}
/* ==========================================================================
   Login — harmonização (append; sobrescreve o bloco "Login CEOS" acima)
   Objetivo: ritmo vertical consistente, colunas equilibradas e paleta
   alinhada ao painel (#3B82F6 / #0F172A / #BFDBFE).
   ========================================================================== */

/* Colunas: formulário um pouco mais estreito que o visual (proporção aurea-ish),
   antes era 440/560 competindo entre si. */
.ceos-auth-shell {
  grid-template-columns: minmax(420px, 0.86fr) minmax(520px, 1.14fr);
  background: #0b1e36;
}

/* Padding lateral menor -> o formulário respira sem empurrar o conteudo. */
.ceos-auth-panel {
  padding: clamp(40px, 5vw, 76px) clamp(36px, 6vw, 96px);
}

.ceos-auth-panel .auth-form-wrap {
  width: min(400px, 100%);
}

/* --- Ritmo vertical: escada consistente 24 / 28 / 32 -------------------- */
.ceos-auth-logo {
  width: min(190px, 52vw);
  max-height: 58px;
  margin: 0 0 44px;
}

.ceos-auth-panel .auth-heading {
  margin-bottom: 32px;
}

.ceos-auth-panel .auth-heading .eyebrow {
  margin: 0 0 10px;
  color: #60A5FA;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ceos-auth-panel .auth-heading h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(28px, 2.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 600;
}

.ceos-auth-panel .auth-intro {
  max-width: 340px;
  margin: 0;
  color: rgba(191, 219, 254, 0.62);
  font-size: 14px;
  line-height: 1.55;
}

/* --- Campos: altura e espaçamento uniformes ---------------------------- */
.ceos-auth-panel .auth-form {
  margin-top: 0;
  display: grid;
  gap: 18px;
}

.ceos-auth-panel .field > span:first-child {
  margin-bottom: 7px;
  display: block;
  color: rgba(219, 234, 254, 0.70);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ceos-auth-panel .input-shell {
  min-height: 50px;
  border-radius: 10px;
  border-color: rgba(147, 197, 253, 0.16);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.ceos-auth-panel .input-shell:hover {
  border-color: rgba(147, 197, 253, 0.28);
}

.ceos-auth-panel .input-shell:focus-within {
  border-color: #3B82F6;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.ceos-auth-panel .input-shell input {
  font-size: 14.5px;
}

/* Botao com a mesma altura dos campos + 4px, para nao destoar. */
.ceos-auth-panel .button.primary.large {
  min-height: 52px;
  margin-top: 6px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #2563EB, #3B82F6);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.30);
  font-size: 14.5px;
  font-weight: 600;
  transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.ceos-auth-panel .button.primary.large:hover {
  filter: brightness(1.07);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.38);
}

.ceos-auth-panel .button.primary.large:active {
  transform: translateY(1px);
}

/* --- Rodape: nota e assinatura como um bloco so ------------------------ */
.ceos-auth-note {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid rgba(147, 197, 253, 0.12);
  gap: 9px;
  color: rgba(191, 219, 254, 0.52);
  font-size: 11.5px;
}

.ceos-auth-note svg {
  color: #60A5FA;
  font-size: 15px;
}

.auth-powered {
  margin: 12px 0 0;
  color: rgba(191, 219, 254, 0.38);
  font-size: 11px;
}

.auth-powered strong {
  color: rgba(219, 234, 254, 0.62);
  font-weight: 600;
}

/* --- Painel visual: centralizado e com hierarquia ---------------------- */
.ceos-auth-visual {
  margin: 14px 14px 14px 0;
  padding: clamp(44px, 4.5vw, 66px);
  align-items: center;
  border-radius: 24px;
  border-color: rgba(147, 197, 253, 0.12);
}

.ceos-visual-content {
  width: min(500px, 100%);
}

.ceos-visual-content .eyebrow {
  margin: 0 0 14px;
  color: rgba(191, 219, 254, 0.70);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ceos-visual-content h2 {
  font-size: clamp(36px, 3.4vw, 50px);
  line-height: 1.06;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.ceos-visual-content > p:not(.eyebrow) {
  max-width: 400px;
  margin: 20px 0 0;
  color: rgba(219, 234, 254, 0.68);
  font-size: 15px;
  line-height: 1.6;
}

.visual-chip-row {
  margin-top: 30px;
  gap: 8px;
}

.visual-chip-row span {
  padding: 7px 13px;
  border-color: rgba(191, 219, 254, 0.20);
  color: rgba(219, 234, 254, 0.86);
  background: rgba(11, 30, 58, 0.42);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* --- Mensagem de erro: legivel sobre o fundo escuro -------------------- */
.ceos-auth-panel .form-error:not([hidden]) {
  margin: 0;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-radius: 9px;
  background: rgba(220, 38, 38, 0.13);
  color: #FCA5A5;
  font-size: 13px;
  line-height: 1.45;
}

/* --- Responsivo -------------------------------------------------------- */
@media (max-width: 1080px) {
  .ceos-auth-shell {
    grid-template-columns: 1fr;
  }

  .ceos-auth-visual {
    display: none;
  }

  .ceos-auth-panel {
    min-height: 100vh;
    padding: clamp(36px, 8vw, 64px) clamp(28px, 7vw, 56px);
  }

  .ceos-auth-panel .auth-form-wrap {
    width: min(400px, 100%);
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .ceos-auth-logo {
    max-height: 50px;
    margin-bottom: 34px;
  }

  .ceos-auth-panel .auth-heading {
    margin-bottom: 26px;
  }

  .ceos-auth-panel .auth-heading h1 {
    font-size: 26px;
  }

  .ceos-auth-panel .input-shell,
  .ceos-auth-panel .button.primary.large {
    min-height: 48px;
  }
}

/* Telas baixas: evita corte vertical do formulario. */
@media (max-height: 720px) {
  .ceos-auth-logo {
    max-height: 46px;
    margin-bottom: 28px;
  }

  .ceos-auth-panel .auth-heading {
    margin-bottom: 24px;
  }

  .ceos-auth-note {
    margin-top: 22px;
    padding-top: 16px;
  }
}

/* Foco: o anel pertence ao .input-shell. O input interno herdava um --ring
   proprio do tema antigo, o que desenhava um segundo contorno concentrico. */
.ceos-auth-panel .input-shell input:focus,
.ceos-auth-panel .input-shell input:focus-visible {
  outline: none;
  box-shadow: none;
}
