/* =============================================================================
   PMO Dashboard Autus - stylesheet (vanilla CSS, no build step)
   Palette and rationale: DESIGN.md. Graphite + paper + Autus navy; no glass, glow
   or gradients.

   File structure, top to bottom:
   1. Design tokens: ONE :root (dark, default) and ONE body[data-theme="light"] with
      only the tokens that differ. The app sets data-theme="light" or leaves it unset
      (public/app.js), so there are no other themes. Tokens defined here are the final
      cascade values; do not redefine them further down.
   2. Base, layout and components, grouped by view (auth, sidebar, projects, kanban,
      gantt, calendar, risks, KPIs/BSC, notes, whiteboard, command palette ...).
   3. "AUTUS WORKBENCH REPLACEMENT" layer: global 2px-radius / no-shadow rules and the
      shared component look (buttons, inputs, pills, cards) that override section 2.
      Keep new component rules BEFORE this layer unless they must win over it.
      !important is reserved for what plain specificity cannot do: beating the many inline
      style="" attributes emitted by the JS templates (colors, borders, padding), the global
      radius/box-shadow reset, display/opacity/pointer-events state toggles, and the touch
      block. Do not add it to make a rule win over another stylesheet rule: raise specificity
      or move the rule after the layer. Test a candidate by dropping it and checking that no
      computed style changes in both themes.
   4. Late additions (KPI hierarchy/entry, BSC, filters, command palette), responsive
      rules and, at the very end, the touch-target block (WCAG 2.5.8, 44px) which must
      stay last.
   ============================================================================= */

/* ================= DESIGN TOKENS ================= */
:root {
  color-scheme: dark;

  /* Surfaces */
  --bg-primary: #11161b;
  --bg-secondary: #192128;
  --bg-tertiary: #222c34;
  --glass-bg: #1b252d;
  --glass-border: #3d4b55;
  --glass-border-focus: #8da7b8;
  --glass-hover: #26343e;
  --input-border: #6b7b85;

  /* Text */
  --text-main: #f1f0eb;
  --text-muted: #bec8cc;
  --text-dim: #8c9aa1;

  /* Brand (--brand-navy is the exact Autus logo tone, #282c6a) */
  --brand-navy: #282c6a;
  --primary: #394a83;
  --primary-glow: transparent;
  --primary-hover: #4c609f;
  --primary-ink: #ffffff;
  --primary-text: #b9c8f4;

  /* State accents (status / priority / role / error only) */
  --accent-blue: #75b7d8;
  --accent-emerald: #72c49c;
  --accent-amber: #e0ae61;
  --accent-rose: #e28388;
  --accent-rose-ink: #11161b;

  /* Shape and depth */
  --border-radius-xl: 2px;
  --border-radius-lg: 2px;
  --border-radius-md: 2px;
  --border-radius-sm: 2px;
  --shadow-sm: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.28);
  --shadow-lg: 0 12px 24px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.07);

  /* Type */
  --font-family-title: 'IBM Plex Sans', sans-serif;
  --font-family-body: 'IBM Plex Sans', sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.1s;
  --dur-base: 0.15s;
  --dur-slow: 0.22s;
}

/* Light (paper): only what differs from dark. Everything else is inherited from :root. */
body[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #f2f1eb;
  --bg-secondary: #faf9f5;
  --bg-tertiary: #ffffff;
  --glass-bg: #fffefa;
  --glass-border: #8e9693;
  --glass-border-focus: #394a83;
  --glass-hover: #eceeea;
  --input-border: #848c89;
  --text-main: #132128;
  --text-muted: #31444c;
  --text-dim: #56686e;
  --primary: #1F3760;
  --primary-hover: #394a83;
  --primary-text: #1F3760;
  --accent-blue: #17688d;
  --accent-emerald: #1d7652;
  --accent-amber: #8d5e15;
  --accent-rose: #a53e48;
  --accent-rose-ink: #ffffff;
}

/* ================= BASIC STYLES & RESETS ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) transparent;
}

body {
  background-color: var(--bg-primary);
  font-family: var(--font-family-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  width: 100vw;}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

a {
  color: var(--primary-text);
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-out);
}

a:hover {
  color: var(--primary-hover);
}

/* Consistent, visible keyboard focus for any element made activatable via
   makeKeyboardActivatable() (project cards, sprint rows, etc.) — mouse clicks
   don't trigger :focus-visible, so this never shows up as a click outline. */
[role="button"][tabindex]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Skip link: oculto até receber foco por teclado. */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 8px 14px;
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.app-content:focus { outline: none; }

/* ================= UTILITY CLASSES ================= */
.hidden {
  display: none !important;
}

.flex-column {
  flex-direction: column;
}

.align-start {
  align-items: flex-start !important;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 12px;
  letter-spacing: 0.05em;
}

.badge[data-status] {
  background: var(--badge-bg);
  color: var(--badge-color);
}

.badge[data-status="planning"] { --badge-bg: rgba(14,165,233,0.15); --badge-color: var(--accent-blue); }
.badge[data-status="active"] { --badge-bg: rgba(16,185,129,0.15); --badge-color: var(--accent-emerald); }
.badge[data-status="completed"] { --badge-bg: rgba(70,85,201,0.15); --badge-color: var(--text-main); }
.badge[data-status="cancelled"] { --badge-bg: rgba(239,68,68,0.12); --badge-color: var(--accent-rose); }
.badge[data-status="closed"] { --badge-bg: rgba(100,116,139,0.2); --badge-color: var(--text-muted); }

.badge-planning {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-blue);
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.badge-completed {
  background: rgba(70, 85, 201, 0.15);
  color: var(--text-main);
}

.badge-cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-rose);
}

.badge-closed {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}

.badge-low {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

.badge-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}

.badge-high {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
}

.badge-admin {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.badge-developer {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ================= SCREEN CONTROLLERS ================= */
.screen {
  opacity: 0;
  animation: fadeIn var(--dur-slow) forwards var(--ease-out);
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

.screen.active {
  display: flex !important;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* ================= AUTHENTICATION SCREEN ================= */
#auth-screen {
  display: none;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-primary);
}

.auth-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-xl);
  width: 450px;
  max-width: 90%;
  text-align: center;
  animation: scaleUp var(--dur-slow) forwards var(--ease-out);}

@keyframes scaleUp {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 100%;
}

.brand-lockup #auth-logo-img {
  width: auto;
  max-width: 170px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 1;
}

.brand-lockup #sidebar-logo-img {
  width: auto;
  max-width: 105px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 1;
}

.brand-wordmark {
  width: auto;
  object-fit: contain;
  flex-shrink: 1;
}

.auth-logo .brand-wordmark { height: 80px; max-width: 150px; }
.sidebar-logo .brand-wordmark { height: 50px; max-width: 105px; }
.brand-wordmark-light { display: none; }
body[data-theme="light"] .brand-wordmark-dark { display: none; }
body[data-theme="light"] .brand-wordmark-light { display: block; }

.auth-logo h1 {
  font-family: var(--font-family-title);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 30px;
}

/* MS Auth Button styling */
.btn-ms-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #ffffff;
  color: #2f2f2f;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid #dcdcdc;
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 25px;
}

.btn-ms-auth:hover {
  background: #f7f7f7;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

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

.ms-logo {
  width: 18px;
  height: 18px;
  margin-right: 12px;
}

/* Mock Login Panel */
.mock-login-box {
  background: color-mix(in srgb, var(--text-main) 2%, transparent);
  border: 1px dashed var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-top: 10px;
  text-align: left;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.03em;
}

.form-group label.label-required::after {
  content: " *";
  color: var(--accent-rose);
}

.field-error {
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent-rose);
}

input[aria-invalid="true"] {
  border-color: var(--accent-rose);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="date"],
textarea,
select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: var(--border-radius-md);
  font-family: var(--font-family-body);
  font-size: 13px;
  transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--glass-border-focus);
}

.form-control:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.auth-error-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  font-size: 12px;
  gap: 8px;}

/* ================= MAIN APP LAYOUT ================= */
#app-screen {
  display: none;
  flex-direction: row;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  background: var(--bg-primary);
}

/* Sidebar */
.app-sidebar {
  height: 100%;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overscroll-behavior: contain;}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  font-family: var(--font-family-title);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 35px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex-grow: 1;}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--border-radius-md);
  transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);}

.nav-item.active {
  box-shadow: 0 4px 12px var(--primary-glow);}

.sidebar-footer {
  border-top: 1px solid var(--glass-border);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile .avatar {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-family-title);
  color: #ffffff;
}

.user-details h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  font-family: var(--font-family-body);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-1px);}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-hover);
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  width: 100%;
}

.btn-logout:hover {
  background: rgba(244, 63, 94, 0.08);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.2);
}

/* Main Workspace Content Area */
.app-content {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;}

/* View Panels */
.view-panel {
  display: none;
  flex-direction: column;
  gap: 15px;
  animation: fadeIn var(--dur-slow) var(--ease-out);
}

.view-panel.active {
  display: flex;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;}

.view-header h1 {
  font-family: var(--font-family-title);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ================= PROJECTS GRID ================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  justify-content: space-between;}

.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.notes-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0; flex: 1; min-height: 0; }
.notes-folders, .notes-workspace { padding: 20px; }
.notes-folders h3 { margin: 0 0 10px; }
.notes-folder, .notes-list-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-radius: var(--border-radius-sm); padding: 9px 10px; color: var(--text-main); background: transparent; text-align: left; cursor: pointer; }
.notes-folder:hover, .notes-folder.active, .notes-list-item:hover { background: var(--glass-hover); color: var(--primary-text); }
.notes-folder svg { width: 15px; height: 15px; flex-shrink: 0; }
.notes-folder-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.notes-folder-header h2 { margin: 0; }
.notes-editor-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; flex: 1; min-height: 0; }
.notes-list { border-right: 1px solid var(--glass-border); padding-right: 10px; }
.notes-list-item { flex-direction: column; align-items: flex-start; }
.notes-list-item small { color: var(--text-muted); font-size: 11px; }
.notes-editor-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.notes-editor-actions { display: flex; justify-content: flex-end; padding: 0 0 8px; }
.notes-editor-actions .btn { min-height: 30px; }
.notes-editor { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--glass-border); border-radius: var(--border-radius-sm); background: #fff; }
body.notes-focus #app-screen { display: block; }
body.notes-focus .app-sidebar, body.notes-focus .mobile-topbar, body.notes-focus #mobile-nav-backdrop { display: none !important; }
body.notes-focus .app-content { height: 100vh; height: 100dvh; padding: 0; overflow: hidden; }
body.notes-focus #notes-view { height: 100%; gap: 0; background: var(--bg-primary); }
body.notes-focus .notes-app-header { flex: 0 0 auto; padding: 16px 24px; gap: 16px; }
body.notes-focus .notes-folders { overflow-y: auto;}
body.notes-focus .notes-workspace { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
body.notes-focus,
body.notes-focus #app-screen,
body.notes-focus .app-content,
body.notes-focus #notes-view { background: var(--bg-secondary); color: var(--text-main); }
body.notes-focus #notes-view,
body.notes-focus .notes-layout,
body.notes-focus .notes-folders,
body.notes-focus .notes-workspace { border-radius: 0; box-shadow: none; }
body.notes-focus .notes-app-header { min-height: 56px; border-color: var(--glass-border); background: var(--bg-secondary); }
body.notes-focus .notes-app-header h1 { margin: 0; color: var(--text-main); font-size: 16px; font-weight: 700; }
body.notes-focus .notes-app-header .subtitle { margin: 2px 0 0; color: var(--text-dim); font-size: 12px; }
body.notes-focus #notes-home-btn { min-height: 34px; padding: 6px 10px; border: 1px solid var(--glass-border); border-radius: 2px; background: var(--bg-secondary); color: var(--text-muted); box-shadow: none; }
body.notes-focus #notes-home-btn:hover { border-color: var(--text-dim); background: var(--bg-tertiary); }
body.notes-focus #notes-nav-toggle { display: none; min-height: 34px; padding: 6px 8px; border: 1px solid var(--glass-border); border-radius: 2px; background: var(--bg-secondary); color: var(--text-muted); box-shadow: none; }
body.notes-focus .notes-layout { grid-template-columns: 232px minmax(0, 1fr); }
body.notes-focus .notes-folders { padding: 12px 10px; border-right: 1px solid var(--glass-border); background: var(--bg-primary); }
body.notes-focus .notes-folders h3 { padding: 0 8px; color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
body.notes-focus .notes-folder { min-height: 36px; padding: 7px 8px; border: 1px solid transparent; border-radius: 2px; color: var(--text-muted); font-size: 13px; }
body.notes-focus .notes-folder:hover { background: var(--bg-tertiary); color: var(--text-main); }
body.notes-focus .notes-folder.active { border-color: var(--glass-border-focus); background: var(--primary-glow); color: var(--primary-text); font-weight: 700; }
body.notes-focus .notes-workspace { padding: 0; background: var(--bg-secondary); }
body.notes-focus .notes-folder-header { min-height: 56px; margin: 0; padding: 10px 18px; align-items: center; border-bottom: 1px solid var(--glass-border); }
body.notes-focus .notes-folder-header h2 { color: var(--text-main); font-size: 14px; font-weight: 700; }
body.notes-focus #notes-status { color: var(--text-dim); font-size: 11px; }
body.notes-focus #notes-new-btn { min-height: 34px; padding: 6px 10px; border: 1px solid var(--primary); border-radius: 2px; background: var(--primary); color: var(--primary-ink); box-shadow: none; }
body.notes-focus .notes-editor-layout { grid-template-columns: 248px minmax(0, 1fr); gap: 0; }
body.notes-focus .notes-list { overflow-y: auto; padding: 10px 8px; border-right: 1px solid var(--glass-border); background: var(--bg-secondary); }
body.notes-focus .notes-list-item { min-height: 50px; padding: 8px 10px; border: 1px solid transparent; border-radius: 2px; color: var(--text-muted); font-size: 13px; }
body.notes-focus .notes-list-item:hover { background: var(--bg-tertiary); color: var(--text-main); }
body.notes-focus .notes-list-item.active { border-color: var(--glass-border-focus); background: var(--primary-glow); color: var(--primary-text); font-weight: 700; }
body.notes-focus .notes-list-item small { color: var(--text-dim); }
body.notes-focus .notes-editor-wrap { background: var(--bg-secondary); }
body.notes-focus .notes-editor-actions { padding: 8px 16px; border-bottom: 1px solid var(--glass-border); }
body.notes-focus .notes-entry-hint { margin-right: auto; color: var(--text-dim); font-size: 12px; }
body.notes-focus #notes-delete-btn { min-height: 30px; padding: 5px 8px; border: 1px solid var(--accent-rose); border-radius: 2px; background: var(--bg-secondary); color: var(--accent-rose); box-shadow: none; font-size: 12px; }
body.notes-focus #notes-board-btn { min-height: 30px; margin-right: auto; padding: 5px 8px; border: 1px solid var(--glass-border); border-radius: 2px; background: var(--bg-secondary); color: var(--text-muted); box-shadow: none; font-size: 12px; }
body.notes-focus #notes-board-btn.active { border-color: var(--primary); background: var(--primary-glow); color: var(--primary-text); }
body.notes-focus #notes-editor { border: 0; border-radius: 0; background: var(--bg-secondary); }
body.notes-focus #notes-editor .bn-editor { min-height: 100%; padding: 24px 48px 96px; }
.blocknote-cursor-avatar { width: 18px; height: 18px; margin-right: 5px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
/* Cursor labels do colaborador sempre visíveis: o vendor só expande o label sob [data-active],
   mas showCursorLabels:"always" impede que qualquer caminho JS adicione esse atributo. */
#notes-editor .bn-collaboration-cursor__label { color: #0d0d0d; border-radius: 3px 3px 3px 0; max-width: 20rem; max-height: 1.1rem; padding: .1rem .3rem; top: -17px; }
body.notes-opening #notes-view { animation: notes-app-open .6s cubic-bezier(.4, 0, .2, 1) both; }
body.notes-closing #notes-view { animation: notes-app-close .32s cubic-bezier(.7, 0, .84, 0) both; pointer-events: none; }
/* Transição pelo botão flutuante (View Transitions): a tela anterior fica sob o círculo. */
html[data-notes-vt]::view-transition-old(root), html[data-notes-vt]::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html[data-notes-vt="open"]::view-transition-new(root) { animation: notes-app-open .6s cubic-bezier(.4, 0, .2, 1) both; }
html[data-notes-vt="close"]::view-transition-old(root) { animation: notes-app-close .45s cubic-bezier(.4, 0, .2, 1) both; z-index: 2; }
@keyframes notes-app-open { from { clip-path: circle(0% at var(--notes-origin, 50% 50%)); opacity: .1; } to { clip-path: circle(150% at var(--notes-origin, 50% 50%)); opacity: 1; } }
@keyframes notes-app-close { from { clip-path: circle(150% at var(--notes-origin, 50% 50%)); opacity: 1; } to { clip-path: circle(0% at var(--notes-origin, 50% 50%)); opacity: .1; } }
@media (max-width: 900px) { body.notes-focus .notes-layout { grid-template-columns: 200px minmax(0, 1fr); } body.notes-focus .notes-editor-layout { grid-template-columns: 216px minmax(0, 1fr); } }
@media (max-width: 768px) { .notes-layout, .notes-editor-layout { grid-template-columns: 1fr; } .notes-list { border-right: 0; border-bottom: 1px solid var(--glass-border); padding: 0 0 10px; } body.notes-focus .notes-app-header { padding: 12px 16px; } body.notes-focus #notes-nav-toggle { display: inline-flex; } body.notes-focus .notes-layout { display: block; overflow: hidden; } body.notes-focus .notes-folders, body.notes-focus #notes-list { display: none; } body.notes-focus #notes-view.notes-navigation-open .notes-folders, body.notes-focus #notes-view.notes-navigation-open #notes-list { display: block; position: absolute; z-index: 2; background: var(--bg-secondary); box-shadow: var(--shadow-lg); } body.notes-focus #notes-view.notes-navigation-open .notes-folders { top: 56px; bottom: 0; left: 0; width: min(78vw, 280px); max-height: none; padding: 12px 10px; overflow-y: auto; border-right: 1px solid var(--glass-border); border-bottom: 0; } body.notes-focus #notes-view.notes-navigation-open #notes-list { top: 56px; bottom: 0; left: min(78vw, 280px); width: calc(100vw - min(78vw, 280px)); max-height: none; padding: 12px 8px; overflow-y: auto; border-right: 0; border-bottom: 0; } body.notes-focus .notes-workspace { min-height: 0; height: calc(100vh - 56px); height: calc(100dvh - 56px); overflow: hidden; } body.notes-focus .notes-editor-layout { display: block; min-height: 0; height: calc(100vh - 112px); height: calc(100dvh - 112px); } body.notes-focus .notes-editor-wrap { height: 100%; } body.notes-focus .notes-entry-hint { display: none; } }

@media (max-width: 768px) { body.notes-focus .notes-app-header { flex-direction: row; align-items: center; } }

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

.project-card h3 {
  font-family: var(--font-family-title);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
}

.project-card p {
  color: var(--text-muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-top: 8px;
  flex-grow: 1;
}

.project-card-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 15px;
  width: 100%;
}

/* ================= PROJECT DETAIL & SPRINT NAVIGATION ================= */
.breadcrumbs {
  margin-bottom: 8px;
}

.breadcrumbs a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.breadcrumbs a:hover {
  color: var(--text-main);
}

.header-main-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.sprint-info-badge {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= KANBAN BOARD ================= */
.board-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  flex-grow: 1;
  min-height: 400px;
  overflow-x: auto;}

.board-column {
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 300px);
  max-height: calc(100dvh - 300px);
  min-width: 220px;}

.column-header {
  position: relative;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}

.column-title {
  font-family: var(--font-family-title);
  font-weight: 600;
  font-size: 14px;
}

.column-count {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 0 7px;
  border-radius: 50%;
  font-weight: 600;
}

/* Column status color: the board's four columns read identically today
   (title text only) — a top accent + tinted count reuses the same
   semantic accents as step badges/health pills so state is scannable
   at a glance, not just by column position. */
.board-column[data-status="todo"] {
  border-top: 1px solid var(--text-dim);
}

.board-column[data-status="in_progress"] {
  border-top: 1px solid var(--accent-amber);
}

.board-column[data-status="in_review"] {
  border-top: 1px solid var(--accent-blue);
}

.board-column[data-status="done"] {
  border-top: 1px solid var(--accent-emerald);
}

.board-column[data-status="todo"] .column-count {
  background: rgba(131, 130, 136, 0.15);
  color: var(--text-dim);
}

.board-column[data-status="in_progress"] .column-count {
  background: rgba(240, 160, 32, 0.15);
  color: var(--accent-amber);
}

.board-column[data-status="in_review"] .column-count {
  background: rgba(79, 169, 232, 0.15);
  color: var(--accent-blue);
}

.board-column[data-status="done"] .column-count {
  background: rgba(61, 220, 151, 0.15);
  color: var(--accent-emerald);
}

.btn-column-add {
  width: 30px;
  height: 30px;
  padding: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board-assignee-fuzzy { position: relative; width: 160px; }
.board-assignee-fuzzy .fuzzy-select-trigger { min-height: 28px; width: 100%; padding: 0 8px; font-size: 11px; display: flex; justify-content: space-between; align-items: center; }
.board-assignee-fuzzy .fuzzy-select-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-assignee-fuzzy .fuzzy-select-dropdown { min-width: 220px; z-index: 10050; }

.btn-column-add:hover {
  color: var(--primary-text);
  border-color: var(--primary-text);
}

.btn-column-add i {
  width: 18px;
  height: 18px;
}

.column-cards {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow-y: auto;}

/* Kanban Cards Drag and Drop Styles */
.column-cards.drag-over {
  background: rgba(70, 85, 201, 0.04);
  border: 2px dashed var(--primary);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

.step-card {
  position: relative;
  border-radius: var(--border-radius-md);
  cursor: grab;
  transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 6px;}

/* Priority marker: a thin colored tab flush with the card's top-right edge,
   replacing the old priority badge pill to keep cards compact. */
.step-card-priority-marker {
  position: absolute;
  top: 0;
  right: 14px;
  width: 26px;
  border-radius: 0 0 3px 3px;}

.step-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);}

.step-card:active {
  cursor: grabbing;}

.step-card h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.step-card-assignee {
  width: 22px;
  height: 22px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* ================= TABLES / LISTS ================= */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.users-table th,
.users-table td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--glass-border);
}

.users-table th {
  font-family: var(--font-family-title);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.users-table tr:hover td {
  background: var(--glass-hover);
}

.btn-danger-small {
  background: transparent;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.btn-danger-small:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

.btn-danger-small i {
  width: 16px;
  height: 16px;
}

/* ================= MODAL LAYOUT ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s forwards;}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-xl);
  width: 500px;
  max-width: 90%;
  animation: scaleUp var(--dur-base) forwards var(--ease-out);
  display: flex;
  flex-direction: column;}

.modal-large {
  width: 780px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-family: var(--font-family-title);
  font-size: 20px;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-close-modal:hover {
  color: var(--text-main);
}

.btn-close-modal i {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.modal-footer {
  padding: 15px 24px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ================= STEP DETAIL MODAL CUSTOM ================= */
.step-detail-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 30px;
}

.step-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 15px;
  margin-bottom: 24px;
  background: var(--bg-primary);
  padding: 15px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
  white-space: pre-line;
}

.attachments-section h3 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.attachment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  padding: 8px 12px;
  border-radius: var(--border-radius-md);
  font-size: 12px;
}

.attachment-item a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.attachment-item a:hover {
  color: var(--primary-text);
}

.attachment-item a i {
  color: var(--primary-text);
  width: 14px;
  height: 14px;
}

.attachment-meta {
  font-size: 11px;
  color: var(--text-dim);
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed var(--glass-border);
  padding: 12px;
  border-radius: var(--border-radius-md);
}

.file-input-hidden {
  display: none;
}

.selected-file-label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.step-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: var(--bg-primary);
  padding: 20px;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
}

.step-detail-sidebar .form-group {
  margin-bottom: 0;
}

.btn-small {
  padding: 6px 12px;
  font-size: 11px;
}

/* ================= MOBILE TOPBAR & NAV BACKDROP (hidden on desktop) ================= */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  border-radius: var(--border-radius-md);
}

.btn-icon:hover {
  background: var(--glass-hover);
}

.mobile-topbar {
  display: none;
}

.mobile-brand { display: flex; align-items: center; gap: 10px; }
.mobile-brand span { color: var(--text-main); font-size: 38px; font-weight: 900; letter-spacing: -0.06em; line-height: 1; }

#mobile-nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1150;
}

#mobile-nav-backdrop.visible {
  display: block;
}

/* Responsive fixes */
@media(max-width: 768px) {
  #app-screen {
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* iOS: 100vh inclui a área da barra do navegador */
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1050;
    flex-shrink: 0;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 82%;
    max-width: 300px;
    height: 100vh;
    height: 100dvh;
    border-right: 1px solid var(--glass-border);
    border-bottom: none;
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease-out);
    z-index: 1200;
  }

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

  .app-content {
    padding: 16px;
  }

  .view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .view-header > div:last-child:not(:only-child) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .view-header .btn {
    width: auto;
  }

  /* Navegador de mês do Calendário: grupo compacto (prev/label/next), não é uma
     pilha de botões de ação — mantém o layout horizontal original, só centraliza. */
  #calendar-month-nav {
    flex-direction: row;
    width: 100%;
    justify-content: center;
  }

  #calendar-month-nav .btn {
    width: auto;
  }

  .board-container {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .board-column {
    max-height: none;
  }

  .column-cards {
    overflow-y: visible;
  }

  #my-steps-view .board-column {
    width: 100% !important;
    min-width: 0 !important;
  }

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

  .form-row {
    grid-template-columns: 1fr !important;
  }

  .modal-card,
  .modal-large {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    margin: 16px;
  }

  /* Calendário: diferente do Gantt/tabelas, aqui rolar horizontalmente escondia
     3 dos 7 dias da semana sem nenhuma pista visual de que dava pra arrastar —
     na prática o usuário via um calendário "quebrado". Em vez disso, encolhe
     as 7 colunas pra caber nativamente na tela (sem scroll), sacrificando
     densidade de conteúdo por célula. */
  .calendar-body-scroll {
    padding: 10px !important;
  }

  #calendar-weekday-header,
  #calendar-days-grid {
    gap: 3px !important;
  }

  #calendar-weekday-header > div {
    font-size: 11px;
  }

  #calendar-days-grid > div {
    min-height: 52px !important;
    padding: 3px !important;
    gap: 2px !important;
  }
}

@media(max-width: 480px) {
  #calendar-days-grid > div {
    min-height: 44px !important;
  }
}

/* ================= CUSTOM TAGS & DUE DATE INDICATORS ================= */
.tag-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(70, 85, 201, 0.1);
  color: #a5b4fc;
  border: 1px solid rgba(70, 85, 201, 0.2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.step-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.card-due-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

.card-due-date.overdue {
  color: var(--accent-rose);
  font-weight: 600;
}

.card-due-date.approaching {
  color: var(--accent-amber);
  font-weight: 600;
}

.card-due-date i {
  width: 12px;
  height: 12px;
}

.sprint-tags-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: 15px;
}

.due-date-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  text-transform: uppercase;
}

.due-date-meta.overdue {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.2);
}

.due-date-meta.approaching {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.detail-tags-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ================= WEBKIT CALENDAR INDICATOR ================= */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--dur-base);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

body[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0);
}

/* ================= GANTT CHART SCHEDULE TIMELINE ================= */
.gantt-scroll-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 15px;
  border-radius: var(--border-radius-md);
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
}

.gantt-chart {
  display: flex;
  flex-direction: column;
  min-width: 800px;
  padding: 15px;
  position: relative;
}

.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed rgba(239, 68, 68, 0.45);
  z-index: 5;
  pointer-events: none;
}

.gantt-today-badge {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  background: var(--accent-rose, #ef4444);
  color: var(--accent-rose-ink);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  z-index: 6;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.gantt-header {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 2px solid var(--glass-border);
  padding-bottom: 10px;
}

.gantt-timeline-weeks {
  display: flex;
  width: 100%;
}

.gantt-week-col {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-left: 1px dashed var(--glass-border);
  padding: 0 4px;
}

.gantt-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--glass-border);
  padding: 12px 0;
  align-items: center;
  cursor: pointer;
}

.gantt-row:hover {
  background: var(--glass-hover);
}

.btn-edit-sprint {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--border-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--dur-base), background-color var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base), opacity var(--dur-base), transform var(--dur-base);
}

.btn-edit-sprint:hover {
  color: var(--primary-text);
  background: rgba(70, 85, 201, 0.15);
}

.btn-edit-sprint i {
  width: 14px;
  height: 14px;
}

.gantt-sprint-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 10px;
}

.gantt-bar-container {
  position: relative;
  height: 24px;
  width: 100%;
  background: color-mix(in srgb, var(--text-main) 1%, transparent);
  border-radius: 4px;
}

.gantt-bar {
  position: absolute;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-blue) 100%);
  opacity: 0.85;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 10px;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border: 1px solid color-mix(in srgb, var(--text-main) 15%, transparent);
}

.gantt-bar:hover {
  opacity: 1;
  transform: scaleY(1.08);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.gantt-placeholder {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-style: italic;
  font-size: 13px;
}

/* ================= SPRINTS TABLE OVERVIEW ================= */
.sprints-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.sprints-table th,
.sprints-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.sprints-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.sprints-table tbody tr {
  cursor: pointer;
  transition: background var(--dur-base);
}

.sprints-table tbody tr:hover {
  background: var(--glass-hover);
}

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.health-on_time {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.health-delayed {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.health-completed {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(14, 165, 233, 0.2);
}

/* ================= NEW UI STYLES ================= */

/* Project Members Dropdown Overlay */
.members-dropdown-overlay {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  border-color: var(--glass-border) !important;
}

.dropdown-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--border-radius-sm);
  background: color-mix(in srgb, var(--text-main) 3%, transparent);
  border: 1px solid var(--glass-border);
  font-size: 12px;
  margin-bottom: 4px;
}

.dropdown-user-item:hover {
  background: var(--glass-hover);
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.dropdown-user-name {
  font-weight: 500;
  color: var(--text-main);
}

.dropdown-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.dropdown-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--dur-base), background-color var(--dur-base), border-color var(--dur-base), box-shadow var(--dur-base), opacity var(--dur-base), transform var(--dur-base);
}

.dropdown-action-btn-add {
  color: var(--primary-text);
}

.dropdown-action-btn-add:hover {
  background: rgba(70, 85, 201, 0.15);
}

.dropdown-action-btn-remove {
  color: var(--accent-rose);
}

.dropdown-action-btn-remove:hover {
  background: rgba(244, 63, 94, 0.15);
}

/* Theme Toggle styles */
.theme-toggle-container button i {
  transition: transform var(--dur-slow);
}

.theme-toggle-container button:hover i {
  transform: rotate(20deg);
}

/* File Viewer iframe support */
#file-viewer-modal iframe {
  background: #ffffff;
}

/* Project action buttons display on hover */
.project-card {
  position: relative;
}

.project-card .project-card-actions {
  opacity: 0.8;
  transition: opacity var(--dur-base);
}

.project-card:hover .project-card-actions {
  opacity: 1;
}

.badge-archived {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ================= TOAST NOTIFICATIONS ================= */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999999;
}

.personal-notes-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50% !important;
  background: #282c6a;
  color: #fff;
  cursor: pointer;
  opacity: .9;
  z-index: 999998;
  transition: opacity var(--dur-fast), transform var(--dur-fast);
}

body:has(.modal-overlay:not(.hidden)) .personal-notes-fab {
  display: none;
}

.personal-notes-fab:hover {
  opacity: 1;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .personal-notes-fab {
    right: 16px;
    bottom: 16px;
  }
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 12px 20px;
  color: var(--text-main);
  box-shadow: var(--shadow-lg), 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  animation: toastSlideIn var(--dur-base) var(--ease-out);
  min-width: 280px;
  max-width: 420px;
  transition: color var(--dur-slow) var(--ease-out), background-color var(--dur-slow) var(--ease-out), border-color var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) var(--ease-out), opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

/* Status reads from the icon, not a side-tab border on the card. */
.toast-success i {
  color: var(--accent-emerald);
}

.toast-error i {
  color: var(--accent-rose);
}

.toast-info i {
  color: var(--accent-blue);
}

.toast-action {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm, 6px);
  color: var(--accent-blue);
  font: inherit;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
}

.toast-action:hover {
  background: var(--bg-tertiary, rgba(255, 255, 255, 0.06));
}

.toast-action:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%) translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    transform: translateY(10px);
    opacity: 0;
  }
}

/* ================= KPI SCROLL & STYLING ================= */
[id^="kpi-monthly-table-"] {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  padding-bottom: 8px;
  overflow-x: auto;
}

[id^="kpi-monthly-table-"]::-webkit-scrollbar {
  height: 6px;
}

[id^="kpi-monthly-table-"]::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--border-radius-sm);
}

[id^="kpi-monthly-table-"]::-webkit-scrollbar-track {
  background: var(--glass-hover);
  border-radius: var(--border-radius-sm);
}

/* Scroll Buttons for KPI Horizontal Calendar */
.kpi-scroll-wrapper {
  position: relative;
  width: 100%;
}

.kpi-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0.6;
  transition: opacity var(--dur-base), background var(--dur-base), color var(--dur-base);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.kpi-scroll-btn:hover {
  opacity: 1;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.kpi-scroll-btn.scroll-left {
  left: -8px;
}

.kpi-scroll-btn.scroll-right {
  right: -8px;
}

/* Toggle Switch Component */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--input-border);
  transition: .3s;
  border-radius: 22px;
  border: 1px solid var(--glass-border);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked+.toggle-slider {
  background-color: var(--primary);
  border-color: var(--primary-glow);
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(22px);
}

/* Risk Matrix Grid Cells */
.risk-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--text-main) 5%, transparent);
  transition: color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  user-select: none;
  padding: 0;
  font-family: inherit;
}

.risk-cell:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.risk-cell:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.risk-cell.selected {
  border: 2px solid var(--text-main) !important;
  box-shadow: 0 0 10px color-mix(in srgb, var(--text-main) 50%, transparent);
  transform: scale(1.05);
}

/* Severity background styling */
.risk-green {
  background: rgba(16, 185, 129, 0.18) !important;
  color: var(--accent-emerald) !important;
}

.risk-yellow {
  background: rgba(245, 158, 11, 0.18) !important;
  color: var(--accent-amber) !important;
}

.risk-red {
  background: rgba(239, 68, 68, 0.18) !important;
  color: var(--accent-rose) !important;
}

.risks-table th,
.risks-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
}

.risks-table tbody tr:hover {
  background: var(--glass-hover);
}

/* User avatar on step card */
.step-card-avatar, .user-avatar, .fuzzy-option-avatar, .avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--text-main) 15%, transparent);
}

.subproject-card { transition: transform var(--dur-fast) var(--ease-standard), border-color var(--dur-base) var(--ease-standard), background-color var(--dur-base) var(--ease-standard); }
.subproject-card:hover { border-color: var(--primary-text) !important; background: var(--glass-hover) !important; transform: translateY(-1px); }
.subproject-card:active { transform: translateY(1px); }

/* Refined monthly boxes for KPI list */
.kpi-month-cell {
  background: color-mix(in srgb, var(--text-main) 2%, transparent);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  transition: color var(--dur-base) var(--ease-standard), background-color var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard), box-shadow var(--dur-base) var(--ease-standard), opacity var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard);
  padding: 10px 8px !important;
  vertical-align: top;
}

.kpi-month-cell:hover {
  background: var(--glass-hover) !important;
  border-color: rgba(70, 85, 201, 0.4) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Hide scrollbar for KPI horizontal scroll wrapper */
.kpi-scroll-container::-webkit-scrollbar {
  display: none;
}

.kpi-scroll-container {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

/* Disabled styling for circular floating year navigation buttons */
.kpi-scroll-btn:disabled {
  opacity: 0.15 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* KPI Year Slide transitions */
.kpi-scroll-container {
  transition: transform var(--dur-base) var(--ease-standard), opacity var(--dur-base) var(--ease-standard);
}

.kpi-slide-out-left {
  transform: translateX(-30px);
  opacity: 0;
}

.kpi-slide-out-right {
  transform: translateX(30px);
  opacity: 0;
}

.kpi-slide-in-left {
  transform: translateX(-30px);
  opacity: 0;
}

.kpi-slide-in-right {
  transform: translateX(30px);
  opacity: 0;
}

/* KPI Bar Chart (BSC / Meus KPIs favoritos — read-only, purely visual view) */

.kpi-bar-chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.kpi-legend-dash {
  display: inline-block;
  width: 12px;
  border-top: 2px dashed var(--text-dim);
}

.kpi-bar-chart {
  min-width: 700px;
  padding: 8px 4px 0;
}

.kpi-bar-chart-bars {
  position: relative;
  display: flex;
  gap: 6px;
  height: 130px;
}

.kpi-bar-col {
  flex: 1;
  min-width: 0;
  position: relative;
  border-radius: 6px;
  outline: none;
}

.kpi-bar-col.kpi-bar-current-month {
  background: rgba(70, 85, 201, 0.08);
}

.kpi-bar-col:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.kpi-bar-col:hover .kpi-bar,
.kpi-bar-col:focus-visible .kpi-bar {
  filter: brightness(1.15);
}

.kpi-bar-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.kpi-bar {
  width: 60%;
  min-width: 10px;
  max-width: 22px;
  height: 100%;
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  transition: transform var(--dur-slow) var(--ease-out), filter var(--dur-fast) var(--ease-out);
}

.kpi-bar-ghost {
  height: 3px !important;
  width: 60%;
  min-width: 10px;
  max-width: 22px;
  background: var(--glass-border);
  border-radius: 2px;
}

.kpi-bar-value-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-text);
  white-space: nowrap;
  pointer-events: none;
}

.kpi-bar-chart-target-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 2px dashed var(--text-dim);
  z-index: 2;
  pointer-events: none;
}

.kpi-bar-chart-target-label {
  position: absolute;
  right: 2px;
  top: -16px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
}

.kpi-bar-chart-labels {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.kpi-bar-chart-labels span {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-bar-chart-table {
  max-height: 220px;
  overflow-y: auto;
}

.kpi-bar-chart-table table td,
.kpi-bar-chart-table table th {
  border-bottom: 1px solid var(--glass-border);
}

.kpi-bar-chart-table table th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
}

.kpi-bar-chart-table table td {
  padding: 6px 8px;
  color: var(--text-main);
}

/* (i) com explicação no hover/foco: <span class="info-tip" tabindex="0"><i data-lucide="info"></i><span class="info-tip-bubble" role="tooltip">…</span></span> */
.info-tip { position: relative; display: inline-flex; align-items: center; vertical-align: middle; margin-left: 2px; color: var(--text-muted); cursor: help; }
.info-tip i, .info-tip svg { width: 14px; height: 14px; }
.info-tip:hover, .info-tip:focus-visible { color: var(--accent-blue); }
.info-tip:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.info-tip-bubble {
  position: absolute;
  right: -6px;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--glass-border);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-fast) var(--ease-out), visibility var(--dur-fast);
}
.info-tip:hover .info-tip-bubble, .info-tip:focus-visible .info-tip-bubble { opacity: 1; visibility: visible; }

/* Floating tooltip shared by every KPI bar chart (see setupKpiBarChartTooltip) */
.kpi-bar-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 10px;
  max-width: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.kpi-bar-tooltip.hidden {
  display: none;
}

.kpi-bar-tooltip-month {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.kpi-bar-tooltip-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.kpi-bar-tooltip-target {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Step Card Description line breaks */
.step-card-description {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  display: block !important;
  -webkit-line-clamp: unset !important;
  max-height: none !important;
}

.my-steps-include-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: 4px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard);
}

.my-steps-include-control i {
  width: 15px;
  height: 15px;
}

.my-steps-include-control[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

body[data-theme="light"] .my-steps-include-control[aria-pressed="true"] {
  background: #1F3760;
  border-color: #1F3760;
}

.my-steps-include-control:hover {
  border-color: var(--primary);
}

.my-steps-include-control:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.my-steps-toolbar-controls {
  flex-wrap: wrap;
  justify-content: flex-start;
}

#my-steps-view .step-desc-toggle-wrapper {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

#my-steps-view .step-desc-toggle-wrapper > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steps-data-table {
  min-width: 920px;
  table-layout: fixed;
}

/* Colunas por classe (o nth-child(2) antigo mirava o Status quando a seleção em massa está ligada).
   Larguras fixas nas demais colunas (inline nos <th>); o nome leva o resto, com piso. */
.steps-data-table {
  min-width: 1060px;
}

.steps-data-table th.tbl-col-name,
.steps-data-table td.tbl-col-name {
  width: 30%;
  min-width: 260px;
  overflow: hidden;
}

/* !important: a descrição traz max-width:320px inline e estouraria a célula estreita. */
.steps-data-table td.tbl-col-name > div {
  max-width: 100% !important;
}

.steps-data-table th.tbl-col-assignee,
.steps-data-table td.tbl-col-assignee {
  width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.steps-data-table th {
  white-space: nowrap;
}

.steps-data-table .tbl-filter-input {
  min-width: 90px;
}

/* Usuários: coluna Ações fixa à direita para ficar alcançável sem rolar. */
.users-table-sticky-actions th:last-child,
.users-table-sticky-actions td:last-child {
  position: sticky;
  right: 0;
  background: var(--bg-secondary);
  border-left: 1px solid var(--glass-border);
}

.users-table-sticky-actions tr:hover td:last-child {
  background: var(--glass-hover);
}

/* Rolagem horizontal visível dentro do próprio wrapper (a página nunca rola na horizontal). */
.table-responsive {
  max-width: 100%;
  scrollbar-width: auto;
  scrollbar-color: var(--text-dim) var(--bg-tertiary);
}

@media (max-width: 768px) {
  .my-steps-toolbar,
  .my-steps-toolbar-controls {
    align-items: flex-start !important;
    width: 100%;
  }

  .my-steps-toolbar {
    flex-wrap: wrap;
  }

  .my-steps-toolbar-controls {
    height: auto !important;
  }

  #my-steps-view .step-desc-toggle-wrapper {
    min-width: 0;
    max-width: 100%;
  }
}

/* ================= RESPONSIVE HEADER BUTTONS (COLLAPSE & EXPAND ON HOVER) ================= */
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 1200px) {
  .btn-responsive {
    position: relative;
    padding: 8px 12px;
    min-width: 36px;
    height: 36px;
  }

  .btn-responsive span {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--bg-primary);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard), opacity var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    z-index: 10000;
  }

  .btn-responsive:hover span {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  .btn-responsive:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(70, 85, 201, 0.25);
    z-index: 999;
  }
}

@media (max-width: 768px) {
  .header-main-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ================= KANBAN VIEW MODE TOGGLE & TABLE FILTER CONTROLS ================= */
.view-mode-toggle-group {
  display: flex;
  gap: 4px;
  background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
  padding: 3px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
}

.btn-view-mode {
  height: 24px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

.btn-view-mode:hover {
  color: var(--text-main);
  background: color-mix(in srgb, var(--text-main) 8%, transparent);
}

.btn-view-mode.active {
  color: #ffffff !important;
  background: var(--primary) !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

body[data-theme="light"] .view-mode-toggle-group {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}

body[data-theme="light"] .btn-view-mode {
  color: #475569;
}

body[data-theme="light"] .btn-view-mode:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .btn-view-mode.active {
  color: #ffffff;
  background: var(--primary) !important;
}

/* Status Pills for Table & Kanban */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.status-pill.status-todo {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}
.status-pill.status-in_progress {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
}
.status-pill.status-in_review {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-blue);
}
.status-pill.status-done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
}

/* Column Header Filter Inputs & Selects in Table View */
.tbl-filter-input {
  margin-top: 4px;
  width: 100%;
  height: 24px;
  font-size: 11px;
  background: var(--bg-tertiary, rgba(30, 41, 59, 0.8));
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-radius: 3px;
  padding: 0 6px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.tbl-filter-input option {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.tbl-filter-input:focus {
  border-color: var(--primary);
}

/* Multi-select filter dropdown for Kanban Table */
.tbl-multi-select-wrapper {
  position: relative;
  margin-top: 4px;
  width: 100%;
}

.tbl-multi-select-btn {
  width: 100%;
  height: 24px;
  font-size: 11px;
  background: var(--bg-tertiary, rgba(30, 41, 59, 0.8));
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-radius: 3px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  outline: none;
  font-weight: 500;
  text-transform: none;
  font-family: inherit;
}

.tbl-multi-select-btn:hover,
.tbl-multi-select-btn:focus {
  border-color: var(--primary);
}

.steps-table-container {
  overflow: visible;
}

.tbl-multi-select-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 140px;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm, 4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  padding: 4px 0;
}

.tbl-multi-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  text-transform: none;
  font-weight: normal;
}

.tbl-multi-option:hover {
  background: var(--glass-hover);
}

.tbl-multi-option input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
}

.kanban-table-row:hover {
  background: var(--glass-hover);
}

/* Seleção e edição em massa na tabela de steps */
.tbl-select-col,
.tbl-select-cell {
  width: 36px;
  padding: 10px 0 10px 14px;
  text-align: center;
}

.tbl-select-col input[type="checkbox"],
.tbl-select-cell input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
}

.bulk-bar {
  position: sticky;
  top: 8px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border-focus);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
}

.bulk-bar.hidden {
  display: none;
}

.bulk-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin-right: 4px;
}

.bulk-field {
  min-width: 140px;
  height: 30px;
  font-size: 12px;
  font-family: inherit;
  background: var(--bg-tertiary);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  border-radius: var(--border-radius-sm);
  padding: 0 8px;
  outline: none;
}

.bulk-field:focus {
  border-color: var(--glass-border-focus);
}

.bulk-field option {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.excalidraw-root {
  height: 100%;
}

.whiteboard-error {
  padding: 24px;
  color: var(--accent-rose);
  text-align: center;
  font-weight: 600;
}

#whiteboard-container-mount a[href*="excalidraw.com"],
#whiteboard-container-mount a[href*="discord"],
#whiteboard-container-mount a[href*="github.com"],
#whiteboard-container-mount a[href*="instagram.com"],
#whiteboard-container-mount a[href*="linkedin.com"],
#whiteboard-container-mount a[href*="mastodon"],
#whiteboard-container-mount a[href*="twitter.com"],
#whiteboard-container-mount a[href*="x.com"],
#whiteboard-container-mount a[href*="youtube.com"] {
  display: none !important;
}

/* ================= STEP DETAIL MODERN PILLS & FUZZY SELECT ================= */
.status-pills-group,
.priority-pills-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.status-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  background: var(--bg-secondary, rgba(255, 255, 255, 0.05));
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.status-pill:hover,
.priority-pill:hover {
  background: var(--glass-hover);
  color: var(--text-main);
}

.status-pill svg,
.priority-pill svg {
  width: 14px;
  height: 14px;
}

/* Active Status Pill Themes */
.status-pill[data-value="todo"].active {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
  border-color: var(--text-muted);
}

.status-pill[data-value="in_progress"].active {
  background: rgba(14, 165, 233, 0.2);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.status-pill[data-value="in_review"].active {
  background: rgba(113, 133, 193, 0.2);
  color: var(--primary-text);
  border-color: var(--primary-text);
}

.status-pill[data-value="done"].active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

/* Active Priority Pill Themes */
.priority-pill[data-value="low"].active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.priority-pill[data-value="medium"].active {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

.priority-pill[data-value="high"].active {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-rose);
  border-color: var(--accent-rose);
}

/* Custom Fuzzy Select Wrapper */
.fuzzy-select-wrapper {
  position: relative;
  width: 100%;
  margin-top: 4px;
}

.fuzzy-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-secondary, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm, 6px);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fuzzy-select-trigger:focus,
.fuzzy-select-trigger:hover {
  border-color: var(--primary);
}

.assignee-trigger-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.fuzzy-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.fuzzy-select-wrapper.open .fuzzy-chevron {
  transform: rotate(180deg);
}

.fuzzy-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10050;
  background: var(--bg-primary, #1e293b);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md, 8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.fuzzy-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.15);
}

.fuzzy-search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.fuzzy-search-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 12px;
}

.fuzzy-options-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.fuzzy-option-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s ease;
}

.fuzzy-option-item:hover,
.fuzzy-option-item.selected {
  background: var(--glass-hover);
}

.fuzzy-option-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.project-user-fuzzy { position: relative; }
.project-user-fuzzy .fuzzy-select-trigger { width: 100%; min-height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; text-align: left; }
.project-user-fuzzy .fuzzy-select-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-user-fuzzy .fuzzy-select-dropdown { width: 100%; min-width: 260px; top: calc(100% + 5px); z-index: 10050; background: var(--glass-bg); border-color: var(--glass-border); }
.project-user-fuzzy .fuzzy-search-box { padding: 9px 10px; background: var(--bg-secondary); }
.project-user-fuzzy .fuzzy-search-box input { min-height: 26px; padding: 0; }
.project-user-fuzzy .fuzzy-options-list { max-height: 264px; padding: 4px; }
.project-user-fuzzy .project-user-option { width: 100%; min-height: 48px; border: 0; padding: 7px 8px; text-align: left; background: transparent; }
.project-user-fuzzy .project-user-option:hover { background: var(--glass-hover); }
.project-user-fuzzy .project-user-option-copy { min-width: 0; display: grid; gap: 2px; line-height: 1.2; }
.project-user-fuzzy .project-user-option-copy strong, .project-user-fuzzy .project-user-option-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-user-fuzzy .project-user-option-copy small { color: var(--text-muted); font-size: 11px; }

/* ================= AUTUS WORKBENCH REPLACEMENT =================
   Graphite, paper, navy. No glass, gradient, neon, or ambient glow. */
body:not(.notes-focus) *, body:not(.notes-focus) *::before, body:not(.notes-focus) *::after {
  border-radius: 2px !important;
  box-shadow: none !important;
}

body {
  background: var(--bg-primary);
  color: var(--text-main);
  letter-spacing: .01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background: repeating-linear-gradient(0deg, transparent 0 3px, currentColor 3px 4px);
}

button, input, select, textarea { font: inherit; }
button, .btn, .nav-item, .btn-icon, .btn-column-add, .tag-pill, .status-pill, .priority-pill {
  transition: background-color var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard), border-color var(--dur-base) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}

.app-sidebar {
  width: 248px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  padding: 24px 16px;
}
.sidebar-logo { border-bottom: 1px solid var(--glass-border); padding-bottom: 20px; }
.sidebar-nav { gap: 3px; }
.nav-item {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid transparent;
  color: var(--text-muted);
}
.nav-item:hover { background: var(--glass-hover); border-color: var(--glass-border); color: var(--text-main); }
.nav-item.active { background: var(--primary); border-color: #7185c1; color: #fff; }
.nav-item i { width: 16px; height: 16px; }
.app-content { padding: 28px 32px 40px; background: var(--bg-primary); }
.mobile-topbar { background: var(--bg-secondary); border-bottom: 1px solid var(--glass-border); }

.view-header { border-bottom: 1px solid var(--glass-border); padding-bottom: 16px; margin-bottom: 20px; }
.view-header h1, .auth-card h1 { color: var(--text-main); letter-spacing: -.02em; }
.view-header p, .auth-subtitle, .text-muted { color: var(--text-muted); }
.glass-card, .card, .auth-card, .modal-card, .fuzzy-select-dropdown {
  background: var(--glass-bg) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 2px !important;
}
.glass-card, .card { padding: 16px; }

.btn, button {
  min-height: 34px;
  border: 1px solid var(--glass-border);
  border-radius: 2px !important;
  font-weight: 700;
  letter-spacing: .015em;
  cursor: pointer;
}
.btn-primary, .btn-primary:hover {
  background: var(--primary) !important;
  border-color: #7185c1 !important;
  color: var(--primary-ink) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -2px 0 rgba(0,0,0,.3) !important;
}
.btn-primary:hover { background: var(--primary-hover) !important; }
.btn-primary:active { transform: translateY(1px); box-shadow: inset 0 2px 0 rgba(0,0,0,.3) !important; }
.btn-secondary, .btn-icon, .btn-view-mode, .btn-column-add {
  background: var(--bg-tertiary) !important;
  border-color: var(--glass-border) !important;
  color: var(--text-main) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 -1px 0 rgba(0,0,0,.25) !important;
}
.btn-secondary:hover, .btn-icon:hover, .btn-view-mode:hover, .btn-column-add:hover { background: var(--glass-hover) !important; border-color: var(--primary-text) !important; }
.btn-confirm-danger { background: var(--accent-rose); border-color: var(--accent-rose); color: #fff; }
.btn-confirm-danger:hover { filter: brightness(1.1); }
.btn-danger-small, .btn-logout { color: var(--accent-rose) !important; border-color: currentColor !important; background: transparent !important; }
.btn:disabled, button:disabled { opacity: .48; cursor: not-allowed; transform: none; }

input, select, textarea, .fuzzy-select-trigger {
  background: var(--bg-tertiary) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--input-border) !important;
  border-radius: 2px !important;
  min-height: 34px;
}
input:focus, select:focus, textarea:focus, [tabindex]:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-color: var(--glass-border-focus) !important;
}
::placeholder { color: var(--text-dim); opacity: 1; }
label { color: var(--text-muted); font-weight: 700; }

.board-filters-bar { background: var(--bg-secondary); border: 1px solid var(--glass-border); }
.board-container { gap: 12px; }
.board-column { background: var(--bg-secondary); padding: 12px; }
.board-column h3, .column-header { border-bottom: 1px solid var(--glass-border); padding-bottom: 9px; }
.column-cards { gap: 8px; }
.step-card { background: var(--bg-tertiary) !important; border: 1px solid var(--glass-border) !important; padding: 12px; }
.step-card:hover { border-color: var(--primary-text) !important; }
.step-card:active { transform: translateY(1px); }
.step-card-priority-marker { height: 6px; }

.tag-pill, .status-pill, .priority-pill, .badge, [class*="badge-"] {
  clip-path: none;
  padding: 4px 8px;
  border: 1px solid currentColor !important;
  background: color-mix(in srgb, currentColor 12%, var(--glass-bg)) !important;
  font-weight: 700;
  letter-spacing: .04em;
}
.status-pill.active, .priority-pill.active { outline: 2px solid currentColor; outline-offset: -2px; }

.board-column[data-status] .column-header {
  background: color-mix(in srgb, var(--column-accent) 15%, var(--bg-secondary));
  border-color: color-mix(in srgb, var(--column-accent) 58%, var(--glass-border));
}
.board-column[data-status] .column-cards {
  background: color-mix(in srgb, var(--column-accent) 6%, var(--bg-secondary));
}
.board-column[data-status="todo"] { --column-accent: var(--text-dim); }
.board-column[data-status="in_progress"] { --column-accent: var(--accent-amber); }
.board-column[data-status="in_review"] { --column-accent: var(--accent-blue); }
.board-column[data-status="done"] { --column-accent: var(--accent-emerald); }
.board-column[data-status] { border-top-color: var(--column-accent); }

.calendar-day { border: 1px solid var(--glass-border) !important; background: var(--glass-bg) !important; }
.calendar-day--today { border: 2px solid var(--primary-text) !important; background: color-mix(in srgb, var(--primary) 10%, var(--glass-bg)) !important; }
.calendar-days-busy { opacity: .45; pointer-events: none; transition: opacity var(--dur-base) var(--ease-out); }
.calendar-day--outside { background: var(--bg-secondary) !important; opacity: .5; }

table { border-collapse: collapse; width: 100%; }
th { background: var(--bg-tertiary); color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
th, td { border-bottom: 1px solid var(--glass-border); padding: 10px 9px; }
tbody tr:hover { background: var(--glass-hover); }

.kpi-hierarchy-controls, .kpi-hierarchy-create { display: grid; grid-template-columns: minmax(220px, 1fr) 180px 220px auto; gap: 10px; margin-bottom: 14px; padding: 12px; }
.kpi-hierarchy-controls { grid-template-columns: minmax(220px, 1fr) 180px; }
.kpi-hierarchy-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kpi-hierarchy-header-actions .btn, .kpi-hierarchy-add-indicator, .kpi-hierarchy-branch-collapse, .kpi-hierarchy-branch-expand { align-items: center; display: inline-flex; gap: 5px; }
.kpi-hierarchy-header-actions .btn i, .kpi-hierarchy-add-indicator i, .kpi-hierarchy-branch-collapse i, .kpi-hierarchy-branch-expand i { height: 14px; width: 14px; }
.kpi-hierarchy-tree-wrap { padding: 12px; }
.kpi-hierarchy-tree, .kpi-hierarchy-tree ul { list-style: none; margin: 0; padding-left: 22px; }
.kpi-hierarchy-tree { padding-left: 0; }
.kpi-hierarchy-tree ul { position: relative; }
.kpi-hierarchy-tree ul::before { border-left: 1px solid var(--glass-border); bottom: 20px; content: ""; left: 10px; position: absolute; top: -4px; }
.kpi-hierarchy-tree ul > li { position: relative; }
.kpi-hierarchy-tree ul > li::before { border-top: 1px solid var(--glass-border); content: ""; left: -12px; position: absolute; top: 21px; width: 12px; }
.kpi-hierarchy-tree ul > li:last-child::after { background: var(--glass-bg); bottom: -4px; content: ""; left: -12px; position: absolute; top: 22px; width: 1px; }
.kpi-hierarchy-node, .kpi-hierarchy-indicator { margin: 4px 0; }
.kpi-hierarchy-row { align-items: center; border: 1px solid var(--glass-border); display: flex; gap: 9px; min-height: 42px; padding: 7px 9px; transition: background var(--dur-fast), border-color var(--dur-fast); }
.kpi-hierarchy-row:hover { background: var(--glass-hover); border-color: var(--primary); }
.kpi-hierarchy-row.drop-target, .kpi-hierarchy-row.is-move-target { background: color-mix(in srgb, var(--primary) 16%, var(--glass-bg)); border-color: var(--primary-text); }
.kpi-hierarchy-drag, .kpi-hierarchy-drag-placeholder { align-items: center; color: var(--text-dim); display: inline-flex; flex: 0 0 30px; height: 30px; justify-content: center; }
.kpi-hierarchy-drag { background: transparent; border: 0; cursor: grab; padding: 0; }
.kpi-hierarchy-drag:active { cursor: grabbing; }
.kpi-hierarchy-drag i { height: 18px; width: 18px; }
.kpi-hierarchy-collapse, .kpi-hierarchy-collapse-placeholder { align-items: center; color: var(--text-muted); display: inline-flex; flex: 0 0 18px; height: 24px; justify-content: center; }
.kpi-hierarchy-collapse { background: transparent; border: 0; cursor: pointer; padding: 0; }
.kpi-hierarchy-collapse i { height: 16px; width: 16px; }
.kpi-hierarchy-level { background: var(--bg-tertiary); border: 1px solid var(--glass-border); font-size: 11px; font-weight: 800; padding: 2px 5px; }
.level-1 > .kpi-hierarchy-row .kpi-hierarchy-level { border-color: var(--accent-blue); color: var(--accent-blue); }
.level-2 > .kpi-hierarchy-row .kpi-hierarchy-level { border-color: var(--accent-emerald); color: var(--accent-emerald); }
.level-3 > .kpi-hierarchy-row .kpi-hierarchy-level { border-color: var(--accent-amber); color: var(--accent-amber); }
.kpi-hierarchy-indicator .kpi-hierarchy-level { border-color: var(--text-main); color: var(--text-main); }
.kpi-hierarchy-name { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.kpi-hierarchy-count { color: var(--text-dim); font-size: 12px; }
.kpi-hierarchy-indicator-meta { color: var(--text-dim); font-size: 12px; }
.kpi-hierarchy-move, .kpi-hierarchy-target, .kpi-hierarchy-add-indicator { flex: 0 0 auto; }
.kpi-hierarchy-row:has(> .kpi-hierarchy-reviewer), .kpi-hierarchy-indicator > .kpi-hierarchy-row { flex-wrap: wrap; }
.kpi-hierarchy-row:has(> .kpi-hierarchy-reviewer) > .kpi-hierarchy-name, .kpi-hierarchy-indicator > .kpi-hierarchy-row > .kpi-hierarchy-name { flex-basis: 160px; }
.kpi-hierarchy-reviewer { align-items: center; border: 1px solid var(--glass-border); color: var(--text-muted); display: inline-flex; flex: 0 1 auto; flex-wrap: wrap; gap: 4px 6px; max-width: 100%; min-width: 0; padding: 2px 0 2px 8px; }
.kpi-hierarchy-reviewer:focus-within { border-color: var(--accent-blue); }
.kpi-hierarchy-reviewer i { flex: 0 0 auto; height: 14px; width: 14px; }
.kpi-reviewer-chip { align-items: center; background: var(--bg-secondary); border: 1px solid var(--glass-border); color: var(--text-main); display: inline-flex; font-size: 12px; gap: 2px; padding: 0 2px 0 6px; }
.kpi-reviewer-remove { background: transparent; border: 0; color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 4px; }
.kpi-reviewer-remove:hover, .kpi-reviewer-remove:focus-visible { color: var(--text-main); }
.kpi-reviewer-remove:disabled, .kpi-reviewer-add:disabled { cursor: wait; opacity: .5; }
.kpi-reviewer-add { background: transparent; border: 0; color: var(--text-main); font: inherit; font-size: 12px; height: 26px; max-width: 100%; min-width: 110px; outline: none; padding: 0 4px; }
.kpi-reviewer-none { color: var(--text-dim); font-size: 12px; }
.kpi-hierarchy-reviewer option { background: var(--bg-secondary); color: var(--text-main); }
.kpi-hierarchy-reviewer-name { align-items: center; color: var(--text-muted); display: inline-flex; font-size: 12px; gap: 5px; }
.kpi-hierarchy-reviewer-name i { height: 14px; width: 14px; }
.kpi-hierarchy-status { color: var(--text-muted); font-size: 13px; margin: 10px 0 0; min-height: 20px; }
.kpi-hierarchy-status.is-error { color: var(--accent-rose); }
body[data-theme="light"] .kpi-hierarchy-level { background: var(--glass-bg); border-width: 2px; }
body[data-theme="light"] .level-1 > .kpi-hierarchy-row .kpi-hierarchy-level { background: color-mix(in srgb, var(--accent-blue) 12%, var(--glass-bg)); }
body[data-theme="light"] .level-2 > .kpi-hierarchy-row .kpi-hierarchy-level { background: color-mix(in srgb, var(--accent-emerald) 12%, var(--glass-bg)); }
body[data-theme="light"] .level-3 > .kpi-hierarchy-row .kpi-hierarchy-level { background: color-mix(in srgb, var(--accent-amber) 14%, var(--glass-bg)); }
@media (max-width: 768px) {
  .kpi-hierarchy-controls, .kpi-hierarchy-create { grid-template-columns: 1fr; }
  .kpi-hierarchy-header-actions { width: 100%; }
  .kpi-hierarchy-tree, .kpi-hierarchy-tree ul { padding-left: 10px; }
  .kpi-hierarchy-header-actions .btn, .kpi-hierarchy-indicator .btn, .kpi-hierarchy-row .btn, .kpi-hierarchy-create .btn { gap: 0; justify-content: center; min-width: 34px; padding-left: 8px; padding-right: 8px; }
  .kpi-hierarchy-action-label { display: none; }
}
@media (max-width: 480px) {
  .kpi-hierarchy-tree-wrap { padding: 8px; }
  .kpi-hierarchy-tree, .kpi-hierarchy-tree ul { padding-left: 0; }
  .kpi-hierarchy-tree ul::before, .kpi-hierarchy-tree ul > li::before, .kpi-hierarchy-tree ul > li:last-child::after { display: none; }
  .kpi-hierarchy-row { flex-wrap: wrap; gap: 6px; padding: 7px; }
  .kpi-hierarchy-name { flex-basis: calc(100% - 96px); }
  .kpi-hierarchy-indicator-meta { flex-basis: calc(100% - 42px); margin-left: 42px; }
}

.modal-overlay { background: rgba(8, 11, 14, .72) !important; backdrop-filter: none !important; }
.modal-card { box-shadow: var(--shadow-lg) !important; }
.modal-header, .modal-footer { border-color: var(--glass-border) !important; }
.auth-card { box-shadow: var(--shadow-lg) !important; padding: 32px; }
.auth-error-msg { border: 1px solid var(--accent-rose); background: rgba(226,131,136,.12); color: var(--accent-rose); }

/* Sidebar compacta (desktop): fora de "Meus Steps" fica só com ícones; o nome aparece numa dica ao passar o mouse. */
.sidebar-tip {
  position: fixed; z-index: 1300; pointer-events: none; white-space: nowrap;
  padding: 7px 12px; font-size: 12px; font-weight: 600; color: var(--text-main);
  background: var(--bg-tertiary); border: 1px solid var(--glass-border-focus); border-radius: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  opacity: 0; transform: translate(-6px, -50%) scale(.97); transform-origin: left center;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.sidebar-tip.is-visible { opacity: 1; transform: translate(0, -50%) scale(1); }
@media (min-width: 769px) {
  .app-sidebar { transition: width var(--dur-slow) var(--ease-out), padding var(--dur-slow) var(--ease-out); }
  body.sidebar-compact .app-sidebar { width: 64px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
  body.sidebar-compact .sidebar-logo { margin-bottom: 20px; padding-bottom: 14px; }
  body.sidebar-compact .brand-wordmark { display: none; }
  body.sidebar-compact .brand-lockup #sidebar-logo-img { max-width: 40px; height: 32px; }
  /* O texto continua no DOM (leitores de tela); só some da vista. */
  body.sidebar-compact .nav-item > span:not(.sidebar-dot),
  body.sidebar-compact #theme-text, body.sidebar-compact .btn-logout > span, body.sidebar-compact .user-details {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  body.sidebar-compact .nav-item { position: relative; justify-content: center !important; gap: 0 !important; padding-left: 0; padding-right: 0; }
  body.sidebar-compact .nav-item .sidebar-dot { position: absolute; top: 6px; right: 9px; margin: 0 !important; }
  body.sidebar-compact .theme-toggle-container { padding: 10px 0 !important; }
  body.sidebar-compact #theme-toggle-btn, body.sidebar-compact .btn-logout { padding-left: 0; padding-right: 0; gap: 0 !important; justify-content: center; }
  body.sidebar-compact .user-profile { flex-direction: column; gap: 10px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 768px) {
  .app-sidebar {
    width: min(248px, 86vw);
    padding: max(18px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .app-content { padding: 20px 16px 32px; }
  .view-header { align-items: flex-start; gap: 12px; }
  .view-header .btn { min-height: 34px; }
  .board-container { overflow-x: auto; padding-bottom: 10px; }
  .board-column { min-width: 270px; }
  .modal-card, .modal-large { width: calc(100vw - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
}
@media (max-width: 480px) {
  .app-content { padding: 16px 10px 24px; }
  .view-header h1 { font-size: 20px; }
  .btn-responsive span { display: inline; }
  th, td { padding: 8px 6px; }
}

/* Itens de notificação: hover sem handlers inline */
.notification-item:hover,
.notification-item:focus-visible {
  background: var(--glass-hover) !important;
}

.btn-delete-attachment {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.btn-delete-attachment:hover,
.btn-delete-attachment:focus-visible {
  color: var(--accent-rose, #f87171);
}

.btn-delete-attachment i {
  width: 13px;
  height: 13px;
}

/* Aviso de nova versão (service worker atualizado) */
.app-update-banner {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm, 8px);
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
}

/* "Mover para…" nos cards do kanban (alternativa ao arrastar) */
.step-card-move {
  margin-top: 6px;
  width: 100%;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.step-card:hover .step-card-move,
.step-card:focus-within .step-card-move,
.step-card-move:focus {
  opacity: 1;
}

@media (pointer: coarse) {
  .step-card-move {
    opacity: 1;
  }
}

/* Aviso de step cancelado no modal de detalhe */
.step-cancelled-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--accent-rose);
  border-radius: var(--border-radius-sm);
  background: var(--glass-bg);
  color: var(--text-main);
  font-size: 12px;
}

.step-cancelled-banner span {
  color: var(--text-muted);
}

.step-cancelled-banner p {
  margin: 0;
  white-space: pre-wrap;
}

.step-cancelled-banner .btn {
  align-self: flex-start;
  margin-top: 4px;
}

.status-badge-cancelled {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* ================= BSC: hierarquia, cartões recolhíveis e visões ================= */
.bsc-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
}

.bsc-toolbar .form-control { height: 34px; padding: 0 10px; font-size: 13px; }
.bsc-search { flex: 1 1 220px; min-width: 0; }
.bsc-status-filter { flex: 0 0 auto; width: auto; }
.bsc-toolbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.bsc-toolbar .btn svg, .bsc-card .btn svg, .bsc-card-toolbar .btn-view-mode svg { width: 14px; height: 14px; }

.bsc-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
}

.bsc-year-nav { display: inline-flex; align-items: center; gap: 4px; }
.bsc-year-label, .bsc-card-year {
  min-width: 44px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.bsc-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.bsc-summary strong { color: var(--text-main); font-variant-numeric: tabular-nums; }

.bsc-empty { padding: 24px; text-align: center; font-size: 13px; color: var(--text-dim); }

/* Status: sempre ícone + texto; a cor só reforça. */
.kpi-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-dim);
}
.kpi-status-chip i, .kpi-status-chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.kpi-status-chip.status-met { color: var(--accent-emerald); }
.kpi-status-chip.status-close { color: var(--accent-amber); }
.kpi-status-chip.status-missed { color: var(--accent-rose); }

/* Nós da hierarquia */
.bsc-tree { display: flex; flex-direction: column; gap: 10px; }
.bsc-node { border: 1px solid var(--glass-border); background: var(--bg-secondary); }
.bsc-node .bsc-node { border-width: 1px 0 0; background: transparent; }

.bsc-node-header {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto minmax(60px, 160px) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.bsc-node-header:hover { background: var(--glass-hover); }
.bsc-node-header:focus-visible, .bsc-card-toggle:focus-visible, .bsc-history-toggle:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: -2px;
}
.bsc-level-1 > .bsc-node-header { font-size: 15px; font-weight: 800; }
.bsc-level-2 > .bsc-node-header { font-size: 13px; font-weight: 700; padding-left: 28px; }
.bsc-level-3 > .bsc-node-header { font-size: 12px; font-weight: 700; padding-left: 42px; color: var(--text-muted); }
.bsc-node-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsc-node-count { font-size: 11px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.bsc-node-score { display: inline-flex; align-items: baseline; gap: 4px; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bsc-node-score small { font-size: 11px; font-weight: 600; color: var(--text-dim); }

.bsc-status-bar { display: flex; height: 6px; background: var(--bg-tertiary); overflow: hidden; }
.bsc-status-bar > span { min-width: 3px; }
.bsc-status-bar .status-met { background: var(--accent-emerald); }
.bsc-status-bar .status-close { background: var(--accent-amber); }
.bsc-status-bar .status-missed { background: var(--accent-rose); }
.bsc-status-bar .status-none { background: var(--glass-border); }

.bsc-chevron { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-dim); transition: transform var(--dur-fast) var(--ease-out); }
.bsc-node:not(.is-collapsed) > .bsc-node-header > .bsc-chevron,
.bsc-card.is-expanded .bsc-card-title > .bsc-chevron { transform: rotate(90deg); }

.bsc-node.is-collapsed > .bsc-node-body { display: none; }
.bsc-node-body > .bsc-grid { padding: 4px 14px 14px; }

/* Cartões */
.bsc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  align-items: start;
}

.bsc-card {
  min-width: 0;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.bsc-card:hover { border-color: var(--glass-border-focus); }
.bsc-card.is-expanded { grid-column: 1 / -1; border-color: var(--glass-border-focus); }
.bsc-card.is-retired { opacity: .72; }

.bsc-card-head { display: flex; align-items: stretch; }
.bsc-card-toggle {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title title"
    "goal  goal"
    "value spark"
    "chip  spark";
  column-gap: 12px;
  row-gap: 3px;
  padding: 10px 4px 10px 12px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.bsc-card-title { grid-area: title; display: flex; align-items: center; gap: 6px; min-width: 0; }
.bsc-card-name { font-size: 13px; font-weight: 700; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bsc-card-goal { grid-area: goal; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); padding-left: 20px; }
.bsc-card-value { grid-area: value; display: flex; align-items: baseline; gap: 6px; min-width: 0; padding-left: 20px; margin-top: 4px; }
.bsc-card-value strong { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bsc-card-value span { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsc-card-toggle > .kpi-status-chip { grid-area: chip; padding-left: 20px; }
.bsc-card-toggle > .kpi-sparkline { grid-area: spark; align-self: end; }
.bsc-card.is-expanded .bsc-card-toggle > .kpi-sparkline { visibility: hidden; }

.bsc-card-dept, .bsc-retired-badge {
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}
.bsc-retired-badge { color: var(--accent-amber); }

.bsc-card-actions { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 8px 0; }
.btn-icon-only { width: 30px; min-height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.bsc-card-actions .is-favorite { fill: var(--accent-amber); color: var(--accent-amber); }

.bsc-card-body { padding: 0 12px 12px; border-top: 1px solid var(--glass-border); }
.bsc-card-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; }
.bsc-card-toolbar .btn-view-mode { gap: 5px; }
/* O :hover global (com !important) apagava o destaque do botão ativo. */
.bsc-toolbar .btn-view-mode.active:hover, .bsc-card-toolbar .btn-view-mode.active:hover { background: var(--primary) !important; color: #ffffff !important; }
.bsc-card-chart { min-height: 170px; }
.bsc-card-body .kpi-bar-chart-legend { margin-top: 8px; }
.bsc-card-body .kpi-bar-chart-legend svg { width: 12px; height: 12px; }

/* Gráficos (barras reaproveita .kpi-bar-*; linha usa as mesmas colunas por cima do SVG) */
.bsc-card .kpi-bar-chart { min-width: 0; padding: 18px 0 0; }
.bsc-card .kpi-bar-chart-bars { height: 150px; gap: 4px; }
.bsc-card .kpi-bar-chart-labels { gap: 4px; }
.bsc-card .kpi-bar-chart-labels .is-reference { color: var(--primary-text); font-weight: 800; }
.bsc-card .kpi-bar-col:focus-visible { outline: 2px solid var(--accent-blue); }
.kpi-line-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.kpi-line-col { z-index: 3; }
.kpi-line-dot {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  border: 2px solid var(--glass-bg);
  transform: translate(-50%, 50%);
}
.kpi-line-col:hover .kpi-line-dot, .kpi-line-col:focus-visible .kpi-line-dot { width: 12px; height: 12px; }
.kpi-sparkline { display: block; }

.bsc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bsc-table th {
  position: sticky;
  top: 0;
  padding: 6px 8px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
}
.bsc-table td { padding: 6px 8px; border-bottom: 1px solid var(--glass-border); color: var(--text-main); }
.bsc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bsc-table tr.is-reference td { background: var(--glass-hover); font-weight: 700; }
.bsc-card .kpi-bar-chart-table { max-height: 320px; }

.bsc-history-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 12px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.bsc-history-toggle span { display: inline-flex; align-items: center; gap: 6px; }
.bsc-history-toggle svg { width: 14px; height: 14px; transition: transform var(--dur-fast) var(--ease-out); }
.bsc-history-content { max-height: 220px; overflow: auto; margin-top: 8px; font-size: 12px; }

@media (max-width: 768px) {
  .bsc-toolbar { position: static; }
  .bsc-toolbar-end { margin-left: 0; width: 100%; }
  .bsc-action-label { display: none; }
  .bsc-grid { grid-template-columns: 1fr; }
  .bsc-node-header { grid-template-columns: 16px minmax(0, 1fr) auto; row-gap: 6px; }
  .bsc-node-header .bsc-status-bar { grid-column: 2 / -1; }
  .bsc-node-header .bsc-node-score { grid-column: 3; grid-row: 1; }
  .bsc-node-header .bsc-node-count { display: none; }
  .bsc-level-2 > .bsc-node-header { padding-left: 20px; }
  .bsc-level-3 > .bsc-node-header { padding-left: 28px; }
}

@media (max-width: 480px) {
  .bsc-card .kpi-bar-chart { min-width: 420px; }
  .bsc-card-chart { overflow-x: auto; }
  .bsc-toolbar .btn-view-mode { padding: 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .bsc-chevron, .bsc-card, .bsc-history-toggle svg { transition: none; }
}

/* ================= DETALHE DO STEP =================
   Cabeçalho e rodapé fixos, corpo rolável em duas colunas (conteúdo à esquerda,
   propriedades à direita). Ações destrutivas ficam separadas das principais. */
.step-detail-card {
  width: min(1040px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
}

.step-detail-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.step-detail-header-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step-detail-header .btn-close-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 32px;
  margin: -4px -8px -4px 0;
  border-color: transparent;
}
.step-detail-header .btn-close-modal:hover { border-color: var(--glass-border); }

.step-detail-context {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.step-detail-context span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-detail-context svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-dim); }
.step-detail-context .step-detail-context-sep { width: 12px; height: 12px; }

.step-detail-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  overflow-wrap: anywhere;
}
.step-detail-title-input {
  width: calc(100% + 18px);
  min-height: 42px;
  margin: 0 -9px;
  padding: 4px 8px;
  font-size: 22px !important;
  font-weight: 800;
  line-height: 1.25;
  background: transparent !important;
  border: 1px solid transparent !important;
}
.step-detail-title-input:hover { border-color: var(--glass-border) !important; }
.step-detail-title-input:focus { background: var(--bg-tertiary) !important; outline-offset: 0; }

.step-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step-detail-meta .due-date-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.step-detail-meta .due-date-meta svg { width: 13px; height: 13px; }
.step-detail-meta .detail-tags-list { display: flex; flex-wrap: wrap; gap: 6px; }
.step-detail-meta .detail-tags-list:empty { display: none; }

/* Corpo */
.step-detail-card .step-detail-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
  padding: 0;
}
.step-detail-main { min-width: 0; padding: 20px 24px 24px; }

.step-detail-section + .step-detail-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
}
.step-detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.step-detail-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.step-detail-section-head .step-detail-section-title { margin-bottom: 0; }
.step-detail-section-title svg { width: 15px; height: 15px; color: var(--text-dim); }
.step-detail-card .attachments-section h3 { margin-bottom: 10px; }

.step-detail-desc-input { width: 100%; min-height: 96px; resize: vertical; line-height: 1.5; }
.step-detail-card .step-description { margin: 0; padding: 12px; font-size: 13px; line-height: 1.5; color: var(--text-main); }
.step-detail-card .step-description.is-empty { color: var(--text-dim); font-style: italic; }

.step-detail-pct { font-size: 12px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* Comentários do step com @menções */
.step-comments-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; margin-bottom: 10px; }
.step-comments-empty { margin: 4px 0 8px; font-size: 12px; font-style: italic; color: var(--text-dim); }
.step-comment { padding: 8px 12px; background: var(--bg-tertiary); border: 1px solid var(--glass-border); border-radius: var(--border-radius-md); }
.step-comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; }
.step-comment-author { font-weight: 700; color: var(--text-main); }
.step-comment-date { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.step-comment-delete { margin-left: auto; padding: 2px 4px; background: none; border: none; color: var(--text-dim); cursor: pointer; }
.step-comment-delete:hover, .step-comment-delete:focus-visible { color: var(--accent-rose); }
.step-comment-delete svg { width: 13px; height: 13px; }
.step-comment-body { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-main); white-space: pre-wrap; overflow-wrap: anywhere; }
.step-comment-mention { font-weight: 700; color: var(--primary-text); }
.step-comment-form { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.step-comment-input-wrap { position: relative; width: 100%; }
.step-comment-input { width: 100%; resize: vertical; line-height: 1.5; }
.step-mention-list { position: absolute; left: 0; bottom: 100%; z-index: 10; min-width: 220px; max-width: 100%; margin: 0 0 2px; padding: 2px 0; list-style: none; background: var(--glass-bg); border: 1px solid var(--glass-border-focus); border-radius: var(--border-radius-md); box-shadow: var(--shadow-lg); }
.step-mention-option { padding: 6px 12px; font-size: 13px; color: var(--text-main); cursor: pointer; }
.step-mention-option:hover, .step-mention-option[aria-selected="true"] { background: var(--glass-hover); color: var(--primary-text); }

.step-detail-progress { height: 4px; margin: 8px 0 10px; background: var(--bg-tertiary); overflow: hidden; }
#detail-step-completion-bar { width: 100%; height: 100%; background: var(--accent-emerald); transform: scaleX(0); transform-origin: left; transition: transform var(--dur-base) var(--ease-out); }

.subtasks-list { display: flex; flex-direction: column; max-height: 264px; overflow-y: auto; margin-bottom: 10px; }
.subtasks-empty { margin: 4px 0 8px; font-size: 12px; color: var(--text-dim); }
.subtask-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 8px;
  border: 1px solid transparent;
}
.subtask-item:hover, .subtask-item:focus-within { background: var(--glass-hover); border-color: var(--glass-border); }
.subtask-item-label { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 28px; font-size: 13px; font-weight: 500; color: var(--text-main); cursor: pointer; }
.subtask-item-label span { overflow-wrap: anywhere; }
.subtask-item-label input[type="checkbox"] { width: 15px; height: 15px; min-height: 0; margin: 0; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.subtask-item.is-done .subtask-item-label span { color: var(--text-dim); text-decoration: line-through; }
.subtask-item-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text-dim);
  opacity: 0;
}
.subtask-item:hover .subtask-item-delete, .subtask-item-delete:focus-visible { opacity: 1; }
.subtask-item-delete:hover { color: var(--accent-rose); }
.subtask-item-delete svg { width: 14px; height: 14px; }
@media (hover: none) { .subtask-item-delete { opacity: 1; } }

.subtask-add-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.subtask-add-form .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.subtask-add-form svg, .step-detail-card .upload-box svg { width: 14px; height: 14px; }

.step-detail-card .upload-box { padding: 10px 12px; }
.step-detail-card .selected-file-label { flex: 1; max-width: none; }

/* Propriedades */
.step-detail-card .step-detail-sidebar {
  gap: 18px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 0;
  border-left: 1px solid var(--glass-border);
}

.step-detail-sidebar .status-pills-group { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 0; }
.step-detail-sidebar .priority-pills-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 0; }
.step-detail-sidebar .status-pill,
.step-detail-sidebar .priority-pill {
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  outline: none;
}
.step-detail-sidebar .status-pill svg, .step-detail-sidebar .priority-pill svg { width: 13px; height: 13px; flex-shrink: 0; }
.step-detail-sidebar .status-pill:not(.active),
.step-detail-sidebar .priority-pill:not(.active) {
  color: var(--text-muted);
  background: var(--bg-tertiary) !important;
  border-color: var(--glass-border) !important;
}
.step-detail-sidebar .status-pill:not(.active):hover,
.step-detail-sidebar .priority-pill:not(.active):hover { color: var(--text-main); border-color: var(--glass-border-focus) !important; }
.step-detail-sidebar .status-pill.active,
.step-detail-sidebar .priority-pill.active {
  outline: none;
  border-color: currentColor !important;
  background: color-mix(in srgb, currentColor 14%, var(--glass-bg)) !important;
  box-shadow: inset 0 0 0 1px currentColor !important;
}
.step-detail-sidebar .status-pill:focus-visible,
.step-detail-sidebar .priority-pill:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.step-detail-sidebar .status-pill[data-value="todo"].active { color: var(--text-muted); }
.step-detail-sidebar .status-pill[data-value="in_progress"].active { color: var(--accent-blue); }
.step-detail-sidebar .status-pill[data-value="in_review"].active { color: var(--primary-text); }
.step-detail-sidebar .status-pill[data-value="done"].active { color: var(--accent-emerald); }
.step-detail-sidebar .priority-pill[data-value="low"].active { color: var(--text-muted); }
.step-detail-sidebar .priority-pill[data-value="medium"].active { color: var(--accent-amber); }
.step-detail-sidebar .priority-pill[data-value="high"].active { color: var(--accent-rose); }

.step-detail-sidebar .form-control, .step-detail-sidebar .fuzzy-select-trigger { width: 100%; }
.step-detail-tags-edit { display: flex; flex-wrap: wrap; gap: 6px; }

/* Rodapé */
.step-detail-card .step-detail-footer {
  flex-shrink: 0;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-secondary);
}
.step-detail-footer-secondary, .step-detail-footer-primary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.step-detail-footer .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.step-detail-footer .btn svg { width: 15px; height: 15px; }
.step-detail-btn-danger {
  color: var(--accent-rose);
  background: transparent;
  border-color: transparent;
}
.step-detail-btn-danger:hover { border-color: var(--accent-rose) !important; background: color-mix(in srgb, var(--accent-rose) 10%, transparent) !important; }

@media (max-width: 860px) {
  .step-detail-card .step-detail-grid { grid-template-columns: 1fr; }
  .step-detail-card .step-detail-sidebar { order: -1; border-left: 0; border-bottom: 1px solid var(--glass-border); }
}

@media (max-width: 768px) {
  .step-detail-card { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: 0; }
  .step-detail-header, .step-detail-main { padding-left: 16px; padding-right: 16px; }
  .step-detail-card .step-detail-sidebar { padding: 16px; }
  .step-detail-card .step-detail-footer { padding: 10px 16px; }
  .step-detail-title, .step-detail-title-input { font-size: 19px !important; }
  .step-detail-footer-primary { flex: 1 1 100%; }
  .step-detail-footer-primary .btn { flex: 1; }
}

@media (max-width: 480px) {
  .subtask-add-form { grid-template-columns: minmax(0, 1fr) auto; }
  .subtask-add-form #suggest-subtasks-ai-btn { grid-column: 1 / -1; }
  .step-detail-footer-primary { flex-direction: column-reverse; align-items: stretch; }
}

/* Seletor de tags (detalhe e criação de step) */
button.tag-pill.clickable-tag-pill {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-tertiary) !important;
  border-color: var(--glass-border) !important;
  cursor: pointer;
}
button.tag-pill.clickable-tag-pill:hover:not(:disabled) { color: var(--text-main); border-color: var(--glass-border-focus) !important; }
button.tag-pill.clickable-tag-pill.active {
  color: var(--primary-ink);
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}
button.tag-pill.clickable-tag-pill:disabled { opacity: 1; cursor: default; }
button.tag-pill.clickable-tag-pill:disabled:not(.active) { opacity: .6; }
.step-detail-meta .tag-pill { color: var(--primary-text); font-size: 11px; }

/* Dropdown de notificações: fica no <body> e é posicionado pelo JS acima do sino.
   Acima dos modais (1000) e da sidebar mobile (1200). */
.notifications-dropdown {
  position: fixed;
  z-index: 1250;
  display: flex;
  flex-direction: column;
  width: min(280px, calc(100vw - 16px));
  max-height: min(350px, calc(100dvh - 96px));
  padding: 12px;
  text-align: left;
}

/* ================= REGISTRAR KPIs =================
   Abas (Preencher / Aprovar / Favoritos), faixa de prazo + progresso e linhas de
   lançamento inline agrupadas por departamento. Situação sempre com ícone + texto. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#my-kpis-view {
  --entry-missing: var(--text-muted);
  --entry-rejected: var(--accent-rose);
  --entry-pending: var(--accent-blue);
  --entry-approved: var(--accent-emerald);
  /* Trilhas fixas: todas as linhas (e o cabeçalho) alinham nas mesmas colunas. */
  --col-figures: 264px;
  --col-state: 184px;
  --col-form: 284px;
  --col-actions: 212px;
}

.kpi-entry-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.kpi-entry-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  margin-bottom: -1px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.kpi-entry-tab svg { width: 15px; height: 15px; }
.kpi-entry-tab:hover { color: var(--text-main); }
.kpi-entry-tab.active { color: var(--text-main); border-bottom-color: var(--primary); }
.kpi-entry-tab:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: -2px; }
.kpi-entry-tab-count:empty { display: none; }
.kpi-entry-tab-count {
  min-width: 20px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  color: var(--primary-ink);
  background: var(--primary);
  font-variant-numeric: tabular-nums;
}

.kpi-entry-hint { margin: 0 0 14px; font-size: 12px; color: var(--text-muted); }

.kpi-entry-toolbar .kpi-entry-period { flex: 0 0 auto; }
.kpi-entry-period .view-mode-toggle-group { padding: 2px; }
.kpi-entry-period .btn-view-mode { height: 28px; padding: 0 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.kpi-entry-period .btn-view-mode.active:hover { background: var(--primary) !important; }
.kpi-entry-period select { width: auto; }

/* Prazo + progresso */
.kpi-entry-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-entry-overview:empty { display: none; }
.kpi-entry-deadline {
  --tone: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-main);
  background: color-mix(in srgb, var(--tone) 6%, var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--tone) 35%, var(--glass-border));
}
.kpi-entry-deadline svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: var(--tone); }
.kpi-entry-deadline.is-late { --tone: var(--accent-rose); }
.kpi-entry-deadline.is-soon { --tone: var(--accent-amber); }
.kpi-entry-deadline.is-ok { --tone: var(--accent-blue); }
.kpi-entry-deadline.is-done { --tone: var(--accent-emerald); }

.kpi-entry-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
}
.kpi-entry-progress-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--text-muted); }
.kpi-entry-progress-head strong { font-size: 18px; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }
.kpi-entry-progress-pct { font-size: 13px; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }
.kpi-entry-bar { display: flex; height: 8px; background: var(--bg-tertiary); overflow: hidden; }
.kpi-entry-bar > span { min-width: 3px; }
.kpi-entry-bar > span + span { border-left: 1px solid var(--bg-secondary); }
.kpi-entry-bar .state-approved { background: var(--entry-approved); }
.kpi-entry-bar .state-pending { background: var(--entry-pending); }
.kpi-entry-bar .state-rejected { background: var(--entry-rejected); }
.kpi-entry-bar .state-missing { background: var(--glass-border); }

.kpi-entry-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--glass-border);
  cursor: pointer;
}
.kpi-entry-legend-item svg { width: 13px; height: 13px; }
.kpi-entry-legend-item strong { color: var(--text-main); font-variant-numeric: tabular-nums; }
.kpi-entry-legend-item:hover { border-color: var(--glass-border-focus); color: var(--text-main); }
.kpi-entry-legend-item.state-missing svg { color: var(--entry-missing); }
.kpi-entry-legend-item.state-rejected svg { color: var(--entry-rejected); }
.kpi-entry-legend-item.state-pending svg { color: var(--entry-pending); }
.kpi-entry-legend-item.state-approved svg { color: var(--entry-approved); }
.kpi-entry-legend-item.active { color: var(--text-main); border-color: var(--text-main); background: var(--glass-hover); }

/* Lista */
.kpi-entry-list { display: flex; flex-direction: column; gap: 16px; }
.kpi-entry-group { border: 1px solid var(--glass-border); background: var(--bg-secondary); }
.kpi-entry-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
}
.kpi-entry-group-head h2 { margin: 0; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-main); }
.kpi-entry-group-head span { font-size: 11px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }

.kpi-entry-row, .kpi-entry-cols {
  --state: var(--entry-missing);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--col-figures) var(--col-state) var(--col-form);
  grid-template-areas: "info figures state form" "note note note note";
  align-items: center;
  column-gap: 20px;
  padding: 10px 14px 10px 17px;
}
.kpi-approval-row, .kpi-entry-cols.is-approval {
  grid-template-columns: minmax(0, 1fr) var(--col-figures) var(--col-state) var(--col-actions);
  grid-template-areas: "info figures state actions" "note note note note";
}
.kpi-approval-row { --state: var(--entry-pending); }

/* Cabeçalho das colunas (só na largura de tabela) */
.kpi-entry-cols {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-dim);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--glass-border);
}
.kpi-entry-cols > span:first-child { grid-area: info; }
.kpi-entry-cols-figures { grid-area: figures; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: right; }
.kpi-entry-cols > span:nth-child(3) { grid-area: state; }
.kpi-entry-cols > span:nth-child(4) { grid-area: form; }
.kpi-entry-cols.is-approval > span:nth-child(4) { grid-area: actions; text-align: right; }
.kpi-entry-row + .kpi-entry-row { border-top: 1px solid var(--glass-border); }
/* Faixa da situação à esquerda; o id vence o box-shadow: none !important global. */
#my-kpis-view .kpi-entry-row { box-shadow: inset 3px 0 0 var(--state) !important; }
.kpi-entry-cols + .kpi-entry-row { border-top: 0; }
.kpi-entry-row:hover, .kpi-entry-row:focus-within { background: var(--glass-hover); }
.kpi-entry-row.state-rejected { --state: var(--entry-rejected); }
.kpi-entry-row.state-pending { --state: var(--entry-pending); }
.kpi-entry-row.state-approved { --state: var(--entry-approved); }

.kpi-entry-info { grid-area: info; min-width: 0; }
.kpi-entry-name { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--text-main); overflow-wrap: anywhere; }
.kpi-entry-level {
  flex-shrink: 0;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}
.kpi-entry-meta { margin-top: 2px; font-size: 11px; line-height: 1.4; color: var(--text-dim); }

.kpi-entry-figures { grid-area: figures; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: var(--col-figures); margin: 0; text-align: right; }
.kpi-entry-figures > div { min-width: 0; }
.kpi-entry-figures dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.kpi-entry-figures dd { margin: 1px 0 0; font-size: 13px; font-weight: 700; color: var(--text-main); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-entry-dir { cursor: help; }
.kpi-entry-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; font-size: 12px; color: var(--text-muted); }
.kpi-entry-legend b { color: var(--text-main); }
.kpi-entry-figures dd small { font-size: 11px; font-weight: 500; color: var(--text-muted); white-space: normal; }

.kpi-entry-state { grid-area: state; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.kpi-entry-state-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--state);
  white-space: nowrap;
}
.kpi-entry-state-chip svg { width: 14px; height: 14px; flex-shrink: 0; }
.kpi-entry-state-chip.state-missing { color: var(--text-muted); }
.kpi-entry-state-chip.state-rejected { color: var(--entry-rejected); }
.kpi-entry-state-chip.state-pending { color: var(--entry-pending); }
.kpi-entry-state-chip.state-approved { color: var(--entry-approved); }
.kpi-entry-by { max-width: 100%; font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kpi-entry-form {
  grid-area: form;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px 34px;
  grid-template-areas: "input save more";
  align-items: center;
  gap: 6px;
  width: 100%;
}
.kpi-entry-input {
  grid-area: input;
  display: flex;
  align-items: center;
  min-width: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
}
.kpi-entry-input:focus-within { border-color: var(--glass-border-focus); outline: 2px solid var(--accent-blue); outline-offset: -1px; }
.kpi-entry-input > span { padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--text-dim); }
.kpi-entry-input > span:first-child { padding-right: 0; }
.kpi-entry-input > input + span { padding-left: 0; }
.kpi-entry-form .kpi-entry-input input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: transparent !important;
  border: 0 !important;
  outline: none;
}
.kpi-entry-form .kpi-entry-input input.is-invalid { color: var(--accent-rose); }
.kpi-entry-input:has(input.is-invalid) { border-color: var(--accent-rose); }
.kpi-entry-save { grid-area: save; min-height: 34px; }
.kpi-entry-more { grid-area: more; display: inline-flex; align-items: center; justify-content: center; width: 34px; min-height: 34px; padding: 0; }
.kpi-entry-more svg { width: 16px; height: 16px; }
.kpi-entry-preview:empty { display: none; }
.kpi-entry-invalid { font-size: 11px; font-weight: 700; color: var(--accent-rose); }

.kpi-entry-note {
  grid-area: note;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-main);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
}
.kpi-entry-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; color: var(--text-dim); }
.kpi-entry-note.is-rejected { border-color: color-mix(in srgb, var(--accent-rose) 45%, var(--glass-border)); background: color-mix(in srgb, var(--accent-rose) 8%, var(--bg-secondary)); }
.kpi-entry-note.is-rejected svg { color: var(--accent-rose); }

.kpi-entry-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px dashed var(--glass-border);
}
.kpi-entry-empty svg { width: 32px; height: 32px; color: var(--text-dim); }
.kpi-entry-empty p { margin: 0; max-width: 420px; }

/* Aprovação */
.kpi-approval-actions { grid-area: actions; display: flex; gap: 6px; justify-self: end; }
.kpi-approval-actions .btn, .kpi-approval-reject .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.kpi-approval-actions svg { width: 14px; height: 14px; }
.kpi-approval-reject { grid-area: note; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.kpi-approval-reject label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.kpi-approval-reject textarea { resize: vertical; min-height: 56px; }
.kpi-approval-reject-actions { display: flex; justify-content: flex-end; gap: 6px; }
.kpi-approval-confirm { border-color: var(--accent-rose) !important; }

/* Comprovantes e histórico de um lançamento (kpiRecordHtml) */
.kpi-record-toggle {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 2px 4px;
  border: 0; background: none; color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
}
.kpi-record-toggle:hover { color: var(--accent-blue); }
.kpi-record-toggle:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 1px; }
.kpi-record-toggle[aria-expanded="true"] { color: var(--text-main); }
.kpi-record-toggle svg { width: 13px; height: 13px; }
.kpi-record-count { display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; }
.kpi-record-count svg { width: 11px; height: 11px; }
.kpi-entry-record { grid-column: 1 / -1; margin-top: 8px; }
.kpi-record {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px;
  padding: 10px 12px; font-size: 12px; color: var(--text-main);
  background: var(--bg-tertiary); border: 1px solid var(--glass-border);
}
#kpi-value-history-log .kpi-record, .kpi-record-row .kpi-record { grid-template-columns: 1fr; gap: 12px; }
.kpi-record:has(> .kpi-record-empty:only-child) { display: block; }
.kpi-record-row td { padding: 4px 4px 10px !important; }
.kpi-record-section { min-width: 0; }
.kpi-record-section h3 { margin: 0 0 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.kpi-record-empty { margin: 0; color: var(--text-dim); }
.kpi-record-empty.is-error { color: var(--accent-rose); }
.kpi-record-files { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.kpi-record-files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
.kpi-record-file {
  display: inline-flex; align-items: center; gap: 4px; justify-self: start; max-width: 100%; min-width: 0; padding: 0;
  border: 0; background: none; color: var(--accent-blue); font: inherit; font-weight: 600; cursor: pointer; text-align: left;
}
.kpi-record-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi-record-file:hover span { text-decoration: underline; }
.kpi-record-file svg, .kpi-record-remove svg { width: 13px; height: 13px; flex-shrink: 0; }
.kpi-record-sub { grid-column: 1; font-size: 11px; color: var(--text-dim); }
.kpi-record-remove { grid-column: 2; grid-row: 1 / span 2; padding: 2px; border: 0; background: none; color: var(--text-dim); cursor: pointer; }
.kpi-record-remove:hover { color: var(--accent-rose); }
.kpi-record-comments { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.kpi-record-comments li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; padding-left: 8px; border-left: 2px solid var(--glass-border); }
.kpi-record-comments p { grid-column: 1; margin: 0; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.kpi-record-add { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.kpi-record-add textarea { min-height: 52px; resize: vertical; font-size: 12px; }
.kpi-record-add-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.kpi-record-upload { position: relative; cursor: pointer; }
.kpi-record-upload:focus-within { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.kpi-record-upload.is-loading { opacity: .6; pointer-events: none; }
.kpi-record-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.kpi-record-event { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; }
.kpi-record-event > svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; color: var(--text-dim); }
.kpi-record-event > div { display: flex; flex-direction: column; min-width: 0; }
.kpi-record-event b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-record-event time { font-size: 11px; color: var(--text-dim); }
.kpi-record-event.is-approved > svg { color: var(--accent-emerald); }
.kpi-record-event.is-rejected > svg, .kpi-record-event.is-deleted > svg { color: var(--accent-rose); }
.kpi-record-reason { color: var(--text-muted); font-style: italic; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .kpi-record { grid-template-columns: 1fr; gap: 12px; }
}

/* Na largura de tabela o cabeçalho nomeia as colunas; os rótulos por linha somem. */
@media (min-width: 1181px) {
  .kpi-entry-figures dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (max-width: 1180px) {
  .kpi-entry-cols { display: none; }
  .kpi-entry-row, .kpi-approval-row {
    grid-template-columns: minmax(0, 1fr) var(--col-form);
    grid-template-areas: "info state" "figures form" "note note";
    row-gap: 8px;
  }
  .kpi-approval-row { grid-template-columns: minmax(0, 1fr) var(--col-actions); grid-template-areas: "info state" "figures actions" "note note"; }
  .kpi-entry-state { align-items: flex-end; text-align: right; }
  .kpi-entry-figures { display: flex; flex-wrap: wrap; gap: 4px 20px; width: auto; min-width: 0; text-align: left; }
}

@media (max-width: 900px) {
  .kpi-entry-overview { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .kpi-entry-toolbar .kpi-entry-period, .kpi-entry-period .view-mode-toggle-group { width: 100%; }
  .kpi-entry-period .btn-view-mode { flex: 1; justify-content: center; }
  .kpi-entry-toolbar .bsc-status-filter { flex: 1 1 100%; width: 100%; }
  .kpi-entry-row, .kpi-approval-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "info info" "figures state" "form form" "note note";
    padding: 12px 12px 12px 15px;
  }
  .kpi-entry-figures { width: auto; }
  .kpi-approval-row { grid-template-areas: "info info" "figures state" "actions actions" "note note"; }
  .kpi-entry-meta { white-space: normal; }
  .kpi-approval-actions { justify-self: stretch; }
  .kpi-approval-actions .btn { flex: 1; min-height: 36px; }
  .kpi-entry-group-head { flex-direction: column; gap: 2px; }
}

/* ===== Paleta de comandos (Ctrl+K) ===== */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(10, 14, 18, .62);
}
.cmdk-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  max-height: min(70vh, 560px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
}
.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid var(--glass-border);
}
.cmdk-input-row svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-dim); }
.cmdk-input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0;
  font: inherit;
  font-size: 15px;
  color: var(--text-main);
  background: transparent !important;
  border: 0 !important;
}
.cmdk-input:focus, .cmdk-input:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }
.cmdk-kbd {
  padding: 2px 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
.cmdk-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 0; }
.cmdk-group-label {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.cmdk-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  min-height: 36px;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.cmdk-option:hover { background: var(--glass-hover); }
.cmdk-option.is-active { background: var(--glass-hover); border-left-color: var(--accent-blue); }
.cmdk-option-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cmdk-option-detail { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.cmdk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--glass-border);
}
.cmdk-hints { color: var(--text-dim); white-space: nowrap; }
.step-detail-copy-link { margin-left: auto; white-space: nowrap; }
@media (max-width: 640px) {
  .cmdk-overlay { padding: 0; align-items: stretch; }
  .cmdk-dialog { max-width: none; max-height: none; height: 100%; border-left: 0; border-right: 0; }
  .cmdk-hints, .cmdk-kbd { display: none; }
  .cmdk-option { flex-direction: column; align-items: flex-start; gap: 2px; }
  .cmdk-option-detail { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cmdk-overlay, .cmdk-dialog, .cmdk-option { animation: none; transition: none; }
}

/* Filtros da lista de Projetos */
.projects-filter-bar { background: var(--bg-secondary); border: 1px solid var(--glass-border); padding: 12px; margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.pf-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.pf-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; min-width: 150px; }
.pf-field.pf-search { flex: 1 1 220px; }
.pf-field input, .pf-field select { width: 100%; min-height: 34px; background: var(--bg-tertiary); border: 1px solid var(--glass-border); color: var(--text-main); padding: 6px 8px; font-size: 13px; text-transform: none; letter-spacing: normal; }
.pf-views-row { border-top: 1px solid var(--glass-border); padding-top: 10px; }
.pf-count { color: var(--text-muted); font-size: 12px; font-weight: 700; margin-right: auto; align-self: center; }
.projects-filter-bar .btn:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 480px) {
  .pf-field, .pf-field.pf-search { flex: 1 1 100%; min-width: 0; }
  .pf-row > .btn { flex: 1 1 100%; }
  .pf-count { flex: 1 1 100%; }
}

/* ================= PLANEJAMENTO ESTRATÉGICO (visão geral) ================= */
.pe-body { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pe-state { padding: 24px; text-align: center; font-size: 13px; color: var(--text-dim); border: 1px solid var(--glass-border); background: var(--glass-bg); }
.pe-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pe-tile { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--glass-border); border-left-width: 3px; background: var(--glass-bg); min-width: 0; }
.pe-tile-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pe-tile-value { font-size: 26px; font-weight: 700; color: var(--text-main); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pe-tile-ok { border-left-color: var(--accent-emerald); }
.pe-tile-below { border-left-color: var(--accent-rose); }
.pe-tile-above, .pe-tile-target { border-left-color: var(--glass-border-focus); }
.pe-tile-none { border-left-color: var(--glass-border); }
.pe-tile-none .pe-tile-value { color: var(--text-dim); }
.pe-section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pe-section-title { font-size: 14px; font-weight: 700; color: var(--text-main); }
.pe-wrap { border: 1px solid var(--glass-border); background: var(--glass-bg); }
.pe-wrap:focus-visible { outline: 2px solid var(--glass-border-focus); outline-offset: 2px; }
.pe-table { width: 100%; min-width: 1000px; border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.pe-table-pr { min-width: 1240px; }
.pe-table:not(.pe-act-table) { table-layout: fixed; }
.pe-table:not(.pe-act-table) th, .pe-table:not(.pe-act-table) td { padding-left: 4px; padding-right: 4px; }
.pe-table:not(.pe-act-table) .pe-sticky { width: 180px; min-width: 180px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; padding-left: 12px; padding-right: 8px; }
.pe-caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pe-table th, .pe-table td { padding: 8px 10px; border-bottom: 1px solid var(--glass-border); border-right: 1px solid var(--glass-border); text-align: center; white-space: nowrap; }
.pe-table thead th { background: var(--bg-tertiary); color: var(--text-muted); font-weight: 700; }
.pe-table .pe-sub { font-weight: 600; font-size: 11px; padding: 4px 6px; }
.pe-table .pe-sticky { position: sticky; left: 0; z-index: 1; min-width: 160px; max-width: 240px; text-align: left; background: var(--glass-bg); color: var(--text-main); font-weight: 600; border-right: 2px solid var(--glass-border); }
.pe-table thead .pe-sticky { background: var(--bg-tertiary); }
.pe-plan { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pe-plan-name { overflow: hidden; text-overflow: ellipsis; }
.pe-detail-link { flex: none; width: 28px; height: 28px; padding: 0; }
.pe-cell { font-weight: 700; color: var(--text-main); }
.pe-cell-ok { background: color-mix(in srgb, var(--accent-emerald) 22%, transparent); }
.pe-cell-below { background: color-mix(in srgb, var(--accent-rose) 22%, transparent); }
.pe-cell-above { background: transparent; }
.pe-cell-none { color: var(--text-dim); font-weight: 500; }
.pe-flag { font-size: 9px; color: var(--accent-rose); }
.pe-table td.pe-cell-open { color: var(--text-dim); font-weight: 500; }
.pe-table td.pe-cell-ok.pe-cell-open, .pe-table td.pe-cell-below.pe-cell-open { background: transparent; }
.pe-table th.pe-cell-open { color: var(--text-dim); }
.pe-table td.pe-now, .pe-table th.pe-now { box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--primary) 9%, transparent); }
.pe-table thead th.pe-now { color: var(--text-main); box-shadow: inset 0 -2px 0 var(--primary), inset 0 0 0 999px color-mix(in srgb, var(--primary) 9%, transparent); }
.pe-total-row th, .pe-total-row td { border-top: 2px solid var(--glass-border-focus); font-weight: 700; }
@media (max-width: 768px) {
  .pe-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-tile-value { font-size: 22px; }
  .pe-table .pe-sticky { min-width: 120px; max-width: 150px; }
  .pe-table:not(.pe-act-table) .pe-sticky { width: 130px; min-width: 130px; max-width: 130px; }
}

/* ---- PE: detalhe do plano (atividades, marcas por mês, filtros, menu) ---- */
.pe-detail-state { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.pe-readonly { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 12px; color: var(--text-muted); border: 1px solid var(--glass-border); border-left: 3px solid var(--glass-border-focus); background: var(--glass-bg); }
.pe-readonly svg { width: 16px; height: 16px; flex: none; }
.pe-table-mini { min-width: 1000px; }
.pe-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.pe-filter { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; max-width: 240px; min-width: 0; }
.pe-filter-q { flex: 2 1 220px; max-width: 360px; }
.pe-filter label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.pe-filter-check { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: 13px; color: var(--text-main); cursor: pointer; }
.pe-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pe-count { margin-right: auto; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pe-act-wrap { overflow: auto; max-height: 70vh; }
.pe-act-table { min-width: 1120px; }
.pe-act-table th, .pe-act-table td { padding: 12px 12px; }
.pe-act-table thead th { position: sticky; top: 0; z-index: 2; }
.pe-act-table thead .pe-sticky { z-index: 4; }
.pe-act-table .pe-sticky { min-width: 340px; max-width: 460px; }
.pe-act-table .pe-act-name { white-space: normal; vertical-align: middle; }
.pe-act-table .pe-text-cell { text-align: left; min-width: 130px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.pe-act-table .pe-date-cell { min-width: 88px; font-variant-numeric: tabular-nums; }
.pe-act-table .pe-status-cell { width: 64px; min-width: 64px; text-align: center; }
.pe-act-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.pe-act-main .pe-act-text { padding-top: 0; line-height: 1.35; }
.pe-act-meta { font-size: 12px; font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pe-act-table .pe-month { min-width: 46px; width: 46px; padding-left: 0; padding-right: 0; }
.pe-act-table .pe-act-name { text-transform: none; letter-spacing: 0; font-size: 12px; }
.pe-act-flex { display: flex; align-items: flex-start; gap: 6px; }
.pe-act-flex .pe-act-text { flex: 1; min-width: 0; padding-top: 3px; overflow-wrap: anywhere; }
.pe-expander { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; background: transparent; border: 1px solid transparent; color: var(--text-muted); cursor: pointer; }
.pe-expander:hover { background: var(--glass-hover); border-color: var(--glass-border); }
.pe-expander svg { width: 14px; height: 14px; }
.pe-act-text { vertical-align: middle; font-weight: 600; }
.pe-badge-cancelled { margin-left: 6px; padding: 2px 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); vertical-align: middle; }
.pe-act-row.is-cancelled th, .pe-act-row.is-cancelled td { color: var(--text-dim); }
.pe-act-row.is-cancelled .pe-act-text { text-decoration: line-through; }
.pe-status { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, var(--glass-bg)); }
.pe-status svg { width: 14px; height: 14px; flex: none; }
.pe-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12px; color: var(--text-muted); }
.pe-legend li { display: inline-flex; align-items: center; gap: 6px; }
.pe-legend b { color: var(--text-main); }
.pe-legend-sep { padding-left: 16px; border-left: 1px solid var(--glass-border); }
.pe-status-done { color: var(--accent-emerald); }
.pe-status-doing { color: var(--accent-amber); }
.pe-status-late { color: var(--accent-rose); }
.pe-status-todo, .pe-status-cancelled { color: var(--text-dim); }
.pe-act-table .pe-mark-cell { padding: 6px 3px; font-weight: 700; font-size: 11px; }
.pe-mark-box { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 36px; border-radius: 2px; }
.pe-mark { display: block; width: 100%; min-width: 40px; min-height: 36px; border-radius: 2px; padding: 0; background: transparent; border: 0; color: inherit; font: inherit; cursor: pointer; }
.pe-mark:hover { box-shadow: inset 0 0 0 2px var(--glass-border-focus); }
.pe-mark:focus-visible, .pe-menu-item:focus-visible, .pe-group-toggle:focus-visible, .pe-expander:focus-visible { outline: 2px solid var(--glass-border-focus); outline-offset: -2px; }
.pe-m-ok .pe-mark, .pe-m-ok .pe-mark-box { background: color-mix(in srgb, var(--accent-emerald) 26%, transparent); color: var(--text-main); }
.pe-m-nok .pe-mark, .pe-m-nok .pe-mark-box { background: color-mix(in srgb, var(--accent-rose) 26%, transparent); color: var(--text-main); }
.pe-m-planned .pe-mark { background: color-mix(in srgb, var(--glass-border-focus) 14%, transparent); color: var(--text-muted); }
.pe-m-extra .pe-mark, .pe-m-extra .pe-mark-box { color: var(--text-muted); font-style: italic; border: 1px dashed var(--glass-border); }
.pe-mark-cell.pe-m-none { color: var(--text-dim); }
.pe-act-row.is-cancelled .pe-mark-box { background: transparent; }
.pe-act-table .pe-actions { white-space: nowrap; text-align: right; }
.pe-actions .btn { width: 28px; height: 28px; padding: 0; margin-left: 4px; }
.pe-act-table .pe-group-row td { padding: 0; text-align: left; background: var(--bg-tertiary); }
.pe-act-table .pe-group-sub td { background: var(--bg-secondary); }
.pe-group-toggle { position: sticky; left: 0; display: flex; align-items: center; gap: 8px; min-width: 340px; padding: 12px 12px; background: transparent; border: 0; color: var(--text-main); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.pe-group-sub .pe-group-toggle { padding-left: 26px; font-weight: 600; }
.pe-group-toggle svg { width: 14px; height: 14px; flex: none; }
.pe-group-stats { font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pe-act-table .pe-detail-row td { padding: 0; text-align: left; white-space: normal; background: var(--bg-secondary); }
.pe-detail-body { position: sticky; left: 0; max-width: min(760px, calc(100vw - 96px)); padding: 10px 12px 10px 42px; }
.pe-detail-list { display: grid; gap: 8px; margin: 0; }
.pe-detail-list dt { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.pe-detail-list dd { margin: 0; font-size: 13px; color: var(--text-main); white-space: pre-wrap; overflow-wrap: anywhere; }
.pe-detail-empty { margin: 0; font-size: 12px; color: var(--text-dim); }
.pe-menu { position: fixed; z-index: 900; display: flex; flex-direction: column; min-width: 190px; padding: 2px; background: var(--bg-tertiary); border: 1px solid var(--glass-border-focus); }
.pe-menu-item { display: flex; align-items: center; min-height: 34px; padding: 6px 12px; background: transparent; border: 0; color: var(--text-main); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.pe-menu-item:hover { background: var(--glass-hover); }
.pe-menu-item::before { content: ""; display: inline-block; width: 16px; }
.pe-menu-item.is-current::before { content: "✓"; }
.pe-modal-card { max-width: 640px; }
.pe-modal-card .modal-body { max-height: 70vh; overflow-y: auto; }
.form-group label.pe-check { display: flex; align-items: center; gap: 8px; margin-bottom: 0; font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--text-main); cursor: pointer; }
.pe-hint { margin: -4px 0 12px; font-size: 12px; color: var(--text-dim); }
@media (max-width: 768px) {
  .pe-modal-card .form-row { grid-template-columns: 1fr; gap: 0; }
  .pe-filter, .pe-filter-q { flex: 1 1 100%; max-width: none; }
  .pe-act-table .pe-sticky { min-width: 150px; max-width: 170px; }
  .pe-detail-body { max-width: calc(100vw - 64px); padding-left: 12px; }
}

/* ================= TOUCH TARGETS (WCAG 2.5.8 / 44px) =================
   Só em toque ou telas estreitas; o layout denso do desktop não muda. */
@media (pointer: coarse), (max-width: 768px) {
  .btn, .btn-small, .btn-icon, .btn-icon-only, .btn-close-modal, .btn-close-small, .btn-danger-small,
  .btn-remove-member, .btn-edit-sprint, .btn-view-mode, .btn-column-add, .status-pill, .priority-pill {
    min-height: 44px;
  }
  .btn-icon, .btn-icon-only, .btn-close-modal, .btn-close-small, .btn-remove-member, .btn-edit-sprint,
  #cmdk-open-btn, #notifications-toggle-btn {
    min-width: 44px;
  }
  .btn-icon, .btn-icon-only { width: 44px; height: 44px; }
  #cmdk-open-btn, #notifications-toggle-btn { min-height: 44px; height: 44px !important; min-width: 44px !important; }
  .btn-delete-attachment, .doc-delete-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .step-card-move { min-height: 44px; }
  .pe-mark, .pe-expander, .pe-group-toggle, .pe-menu-item, .pe-filter-check { min-height: 44px; }
  .pe-expander { min-width: 44px; }
  .pe-actions .btn { width: 44px; height: 44px; }
  .back-to-projects-btn, a[id^="back-"] { display: inline-flex; align-items: center; min-height: 44px; }
  select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  .modal-footer .btn { min-height: 44px; }
  input[type="checkbox"], input[type="radio"] { position: relative; }
  input[type="checkbox"]::after, input[type="radio"]::after { content: ""; position: absolute; inset: -10px; }
  td input[type="checkbox"]::after, td input[type="radio"]::after, th input[type="checkbox"]::after { inset: -4px; }
  /* Regras mais específicas (.view-header .btn, .pf-field select, estilos inline) vencem as de cima: forçar aqui. */
  .btn, .btn-small, .btn-view-mode, .btn-column-add, .view-header .btn, .fuzzy-select-trigger, .my-steps-include-control,
  .pf-field select, .pf-field input, .status-pill, .priority-pill, #calendar-prev-month-btn, #calendar-next-month-btn { min-height: 44px !important; }
  .btn-column-add, #calendar-prev-month-btn, #calendar-next-month-btn { min-width: 44px !important; height: auto !important; }
  .fuzzy-select-trigger, .my-steps-include-control { min-width: 44px; }
  .toggle-switch { position: relative; }
  .toggle-switch::after { content: ""; position: absolute; inset: -12px -4px; }
  /* Controles que ainda ficavam < 44px: recolher nó da hierarquia, remover revisor, histórico do BSC, seletores de cor. */
  .kpi-hierarchy-collapse, .kpi-reviewer-remove, .bsc-history-toggle, input[type="color"] { min-height: 44px; min-width: 44px; }
}

/* Estados de carregamento/erro das listas (public/src/uiState.js) */
.load-state { padding: 24px; text-align: center; font-size: 13px; color: var(--text-dim); }
.load-state p { margin: 0 0 10px; }
.load-state-error { color: var(--text-main); }
.load-state:not(.load-state-error)[role="status"]::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .load-state:not(.load-state-error)[role="status"]::before { animation: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= PROPOSTAS DE PROJETO ================= */
.prop-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.prop-filter { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; max-width: 260px; min-width: 0; }
.prop-filter-q { flex: 2 1 220px; max-width: 360px; }
.prop-filter label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.prop-filter-check { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: 13px; color: var(--text-main); cursor: pointer; }
.prop-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; min-width: 0; }
.prop-board > .load-state { grid-column: 1 / -1; }
.prop-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 10px; border: 1px solid var(--glass-border); background: var(--glass-bg); }
.prop-col-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 13px; font-weight: 700; color: var(--text-main); }
.prop-count { min-width: 22px; padding: 1px 6px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--glass-border); }
.prop-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.prop-empty { margin: 0; font-size: 12px; color: var(--text-dim); }
.prop-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; padding: 10px 12px; text-align: left; font: inherit; color: var(--text-main); background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: var(--border-radius-md); cursor: pointer; }
.prop-card:hover { background: var(--glass-hover); }
.prop-card:focus-visible { outline: 2px solid var(--glass-border-focus); outline-offset: 2px; }
.prop-card.is-cancelled { opacity: 0.7; }
.prop-card-title { font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.prop-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.prop-chip { padding: 1px 6px; font-size: 11px; color: var(--text-muted); border: 1px solid var(--glass-border); }
.prop-badge { padding: 1px 6px; font-size: 11px; font-weight: 600; }
.prop-badge-cancelled { color: var(--accent-rose); border: 1px solid var(--accent-rose); }
.prop-muted { font-size: 12px; color: var(--text-dim); }
.prop-card-pm { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.prop-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.prop-avatar-initials { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--primary-ink); background: var(--primary); }
.prop-card-gate { display: flex; align-items: center; gap: 8px; width: 100%; }
.prop-gate-bar { flex: 1; height: 4px; background: var(--bg-tertiary); }
.prop-gate-bar > span { display: block; height: 100%; background: var(--accent-emerald); }
.prop-gate-text, .prop-card-days { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.prop-modal-card { width: 760px; max-width: 94%; max-height: 92vh; }
.prop-modal-card .modal-body { overflow-y: auto; }
.prop-detail-body { display: flex; flex-direction: column; gap: 16px; }
.prop-stepper { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.prop-stepper li { padding: 4px 10px; font-size: 12px; color: var(--text-dim); border: 1px solid var(--glass-border); }
.prop-stepper li.is-past { color: var(--text-muted); }
.prop-stepper li.is-current { font-weight: 700; color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.prop-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.prop-danger { color: var(--accent-rose); border-color: var(--accent-rose); }
.prop-banner { margin: 0; padding: 8px 12px; font-size: 13px; border: 1px solid var(--glass-border); }
.prop-banner-cancelled { color: var(--accent-rose); border-color: var(--accent-rose); }
.prop-project { margin: 0; font-size: 13px; }
.prop-gate { padding: 12px; border: 1px solid var(--glass-border); background: var(--glass-bg); }
.prop-gate h3, .prop-section h3 { margin: 0 0 8px; font-size: 14px; }
.prop-gate-summary { margin: 0 0 8px; font-size: 13px; }
.prop-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.prop-check { display: flex; gap: 8px; font-size: 13px; }
.prop-check.is-done { color: var(--accent-emerald); }
.prop-check.is-pending { color: var(--text-muted); }
.prop-check-icon { flex: none; width: 14px; text-align: center; }
.prop-section { margin: 0; padding: 0; border: 0; min-width: 0; }
.prop-section legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.prop-save { display: flex; justify-content: flex-end; }
.prop-doc-row { padding: 8px 0; border-top: 1px solid var(--glass-border); }
.prop-doc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.prop-upload { position: relative; cursor: pointer; }
.prop-upload:focus-within { outline: 2px solid var(--glass-border-focus); outline-offset: 2px; }
.prop-docs { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.prop-docs li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.prop-docs a { overflow-wrap: anywhere; }
.prop-timeline { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.prop-timeline li { display: flex; flex-direction: column; gap: 2px; padding-left: 10px; border-left: 2px solid var(--glass-border); }
.prop-ev-title { font-size: 13px; font-weight: 600; }
.prop-ev-meta { font-size: 11px; color: var(--text-dim); }
.prop-ev-note { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
@media (max-width: 1100px) { .prop-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
  .prop-board { grid-template-columns: minmax(0, 1fr); }
  .prop-checklist { grid-template-columns: minmax(0, 1fr); }
  .prop-modal-card .form-row { grid-template-columns: 1fr; gap: 0; }
  .prop-filter, .prop-filter-q { max-width: none; flex-basis: 100%; }
  .prop-card, .prop-upload, .prop-filter-check { min-height: 44px; }
}

/* ---------- Plano de Ações Integrado (view actions) ---------- */
.act-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--glass-border); }
.act-tab { padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-muted); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.act-tab:hover { color: var(--text-main); }
.act-tab.is-active { color: var(--text-main); border-bottom-color: var(--primary); }
.act-tab:focus-visible { outline: 2px solid var(--glass-border-focus); outline-offset: -2px; }
.act-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.act-filter { display: flex; flex-direction: column; gap: 4px; flex: 1 1 150px; max-width: 220px; min-width: 0; }
.act-filter-q { flex: 2 1 220px; max-width: 320px; }
.act-filter label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); }
.act-filter-check { display: flex; align-items: center; gap: 8px; min-height: 34px; font-size: 13px; color: var(--text-main); cursor: pointer; }
.act-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.act-toolbar .act-muted { margin: 0; }
.act-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.act-chip-btn { padding: 5px 12px; font: inherit; font-size: 13px; color: var(--text-muted); background: var(--bg-secondary); border: 1px solid var(--glass-border); cursor: pointer; }
.act-chip-btn:hover { background: var(--glass-hover); }
.act-chip-btn.is-active { font-weight: 700; color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.act-chip-btn:focus-visible, .act-link:focus-visible, .act-kpi:focus-visible, .act-meeting:focus-visible, .act-card:focus-visible { outline: 2px solid var(--glass-border-focus); outline-offset: 2px; }
.act-muted { font-size: 12px; color: var(--text-dim); }
.act-empty { margin: 0; padding: 16px 0; font-size: 13px; color: var(--text-dim); }
.act-link { padding: 0; font: inherit; font-weight: 600; text-align: left; color: var(--primary-text); background: none; border: 0; cursor: pointer; overflow-wrap: anywhere; }
.act-link:hover { text-decoration: underline; }
.act-danger { color: var(--accent-rose); border-color: var(--accent-rose); }
.act-badge { padding: 1px 6px; font-size: 11px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--glass-border); }
.act-badge-overdue { margin-left: 6px; padding: 1px 6px; font-size: 11px; font-weight: 600; color: var(--accent-rose); border: 1px solid var(--accent-rose); }
.act-chip { padding: 1px 6px; font-size: 11px; color: var(--text-muted); border: 1px solid var(--glass-border); }
.act-chip-fm { color: var(--accent-blue); border-color: var(--accent-blue); }
.act-level { display: inline-block; margin-right: 8px; padding: 1px 6px; font-size: 11px; font-weight: 700; color: var(--primary-ink); background: var(--primary); }
.act-pill { display: inline-block; padding: 1px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 1px solid var(--glass-border); color: var(--text-muted); }
.act-urgency-critica { color: var(--accent-rose); border-color: var(--accent-rose); }
.act-urgency-alta { color: var(--accent-amber); border-color: var(--accent-amber); }
.act-urgency-media { color: var(--accent-blue); border-color: var(--accent-blue); }
.act-status-concluida { color: var(--accent-emerald); border-color: var(--accent-emerald); }
.act-status-bloqueada { color: var(--accent-amber); border-color: var(--accent-amber); }
.act-status-cancelada { color: var(--text-dim); }
.act-status-em_andamento { color: var(--accent-blue); border-color: var(--accent-blue); }
.act-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
.act-avatar-initials { display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: var(--primary-ink); background: var(--primary); }
.act-person { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; min-width: 0; }
.act-due { font-size: 12px; font-variant-numeric: tabular-nums; }
.act-due.is-overdue { font-weight: 700; color: var(--accent-rose); }
.act-progress { display: inline-flex; align-items: center; gap: 6px; }
.act-progress-bar { width: 48px; height: 4px; background: var(--bg-tertiary); }
.act-progress-bar > span { display: block; height: 100%; background: var(--accent-emerald); }
.act-progress-text { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* Painel */
.act-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; }
.act-kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 12px 14px; font: inherit; text-align: left; color: var(--text-main); background: var(--bg-secondary); border: 1px solid var(--glass-border); cursor: pointer; }
.act-kpi:hover { background: var(--glass-hover); }
.act-kpi-value { font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.act-kpi-label { font-size: 12px; color: var(--text-muted); }
.act-kpi-danger .act-kpi-value { color: var(--accent-rose); }
.act-kpi-warn .act-kpi-value { color: var(--accent-amber); }
.act-bars-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.act-panel-card { padding: 12px 14px; min-width: 0; border: 1px solid var(--glass-border); background: var(--glass-bg); }
.act-panel-card h3 { margin: 0 0 10px; font-size: 14px; }
.act-bars { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.act-bar-row { display: grid; grid-template-columns: minmax(70px, 120px) 1fr 28px; align-items: center; gap: 8px; font-size: 12px; }
.act-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.act-bar-track { height: 8px; background: var(--bg-tertiary); }
.act-bar-fill { display: block; height: 100%; background: var(--primary); }
.act-fill-critica { background: var(--accent-rose); }
.act-fill-alta { background: var(--accent-amber); }
.act-fill-media { background: var(--accent-blue); }
.act-fill-baixa { background: var(--text-dim); }
.act-bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.act-fm-total { margin-left: 8px; font-size: 13px; font-weight: 700; color: var(--accent-blue); }
.act-fm-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.act-fm-row { display: grid; grid-template-columns: minmax(140px, 1.4fr) minmax(100px, 1fr) 90px 110px; align-items: baseline; gap: 8px; padding: 6px 0; border-top: 1px solid var(--glass-border); font-size: 13px; }
.act-fm-row.is-empty { color: var(--text-dim); }
.act-fm-count, .act-fm-points { text-align: right; font-variant-numeric: tabular-nums; }
.act-fm-points { font-weight: 600; }

/* Tabela, cartões e kanban */
.act-table-wrap { overflow-x: auto; border: 1px solid var(--glass-border); }
.act-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.act-table th, .act-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--glass-border); }
.act-table thead th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); white-space: nowrap; }
.act-table tbody th { font-weight: 400; min-width: 220px; }
.act-table tr.is-overdue-row { background: rgba(226, 131, 136, 0.08); }
.act-cards { display: none; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.act-board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.act-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 10px; border: 1px solid var(--glass-border); background: var(--glass-bg); }
.act-col.is-drop { outline: 2px dashed var(--primary); outline-offset: -2px; }
.act-col-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 13px; font-weight: 700; }
.act-count { min-width: 22px; padding: 1px 6px; text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--glass-border); }
.act-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.act-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; padding: 10px 12px; font: inherit; text-align: left; color: var(--text-main); background: var(--bg-secondary); border: 1px solid var(--glass-border); border-radius: var(--border-radius-md); cursor: pointer; }
.act-card:hover { background: var(--glass-hover); }
.act-card.is-overdue { border-left: 3px solid var(--accent-rose); }
.act-card[draggable="true"] { cursor: grab; }
.act-card-title { font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.act-card-meta, .act-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.act-card-foot { justify-content: space-between; width: 100%; }

/* Reuniões */
.act-meeting-group { margin-bottom: 20px; }
.act-meeting-group h3 { margin: 0 0 8px; font-size: 14px; }
.act-meetings { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.act-meeting { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 12px; font: inherit; text-align: left; color: var(--text-main); background: var(--bg-secondary); border: 1px solid var(--glass-border); cursor: pointer; }
.act-meeting:hover { background: var(--glass-hover); }
.act-meeting-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.act-meeting-meta, .act-meeting-counts { font-size: 12px; color: var(--text-muted); }
.act-meeting-actions { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.act-meeting-actions li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--glass-border); }
.act-meeting-action-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.act-notes { margin: 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.act-quick, .act-step-add { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(3, minmax(120px, 1fr)) auto; align-items: end; gap: 8px; padding: 10px; border: 1px dashed var(--glass-border); }
.act-step-add { grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(120px, 1fr) auto; margin-top: 10px; }
.act-quick .form-group, .act-step-add .form-group { margin: 0; }

/* Cadastros */
.act-tax-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.act-tax-head h3 { margin: 0; }
.act-panel-card + .act-panel-card { margin-top: 12px; }
.act-tax-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.act-tax-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--glass-border); font-size: 13px; }
.act-tax-row.is-inactive .act-tax-name { color: var(--text-dim); }
.act-tax-btns { display: flex; flex-wrap: wrap; gap: 4px; }

/* Detalhe da ação */
.act-modal-card { width: 860px; max-width: 94%; max-height: 92vh; }
.act-modal-card .modal-body { overflow-y: auto; }
.act-detail-body { display: flex; flex-direction: column; gap: 16px; }
.act-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.act-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.act-banner { margin: 0; padding: 8px 12px; font-size: 13px; border: 1px solid var(--glass-border); }
.act-banner-warn { color: var(--accent-amber); border-color: var(--accent-amber); }
.act-banner-danger { color: var(--accent-rose); border-color: var(--accent-rose); }
.act-section { margin: 0; padding: 0; border: 0; min-width: 0; }
.act-section h3, .act-section legend { margin: 0 0 8px; padding: 0; font-size: 14px; font-weight: 700; }
.act-save { display: flex; justify-content: flex-end; }
.act-steps { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.act-step { display: grid; grid-template-columns: 24px minmax(160px, 3fr) minmax(120px, 1.2fr) 140px auto; align-items: center; gap: 8px; }
.act-step.is-done .act-step-title { text-decoration: line-through; color: var(--text-dim); }
.act-step-due.is-overdue { border-color: var(--accent-rose); }
.act-step-btns { display: inline-flex; gap: 4px; }
.act-timeline { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.act-timeline li { display: flex; flex-direction: column; gap: 2px; padding-left: 10px; border-left: 2px solid var(--glass-border); }
.act-ev-title { font-size: 13px; font-weight: 600; }
.act-ev-meta { font-size: 11px; color: var(--text-dim); }
.act-ev-note { font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.act-ev-del { align-self: flex-start; }
.act-board .act-count { flex: none; }

@media (max-width: 1100px) {
  .act-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .act-bars-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .act-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .act-filter, .act-filter-q { max-width: none; flex-basis: 100%; }
  .act-table-wrap { display: none; }
  .act-cards { display: flex; }
  .act-board { grid-template-columns: repeat(5, 82vw); }
  .act-fm-row { grid-template-columns: 1fr 1fr; }
  .act-fm-count, .act-fm-points { text-align: left; }
  .act-quick, .act-step-add { grid-template-columns: minmax(0, 1fr); }
  .act-step { grid-template-columns: 24px minmax(0, 1fr); }
  .act-step > :nth-child(n+3) { grid-column: 2; }
  .act-modal-card .form-row { grid-template-columns: 1fr; gap: 0; }
  .act-card, .act-meeting, .act-kpi, .act-filter-check, .act-chip-btn, .act-tab { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .act-col.is-drop { outline-style: solid; } }
