:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #1b2a3a;
  --muted: #556377;
  --primary: #005e7a;
  --primary-hover: #0a4f64;
  --border: #cfd9e4;
  --success: #1f7a3f;
  --danger: #b42318;
  --info: #0b6fa4;
  --neutral: #718096;
}

* { box-sizing: border-box; }

html {
  font-size: 93.75%;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 0 0, #eaf1f7 0, #f6f8fb 40%, #f7fafc 100%);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  line-height: 1.25;
}

h1 { font-size: 1.35rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.94rem; }
h5 { font-size: 0.86rem; }

p {
  margin: 0 0 4px;
}

p:last-child {
  margin-bottom: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}

.app-shell > * {
  min-width: 0;
}

.sidebar {
  background: linear-gradient(180deg, #042f40, #0a485d 62%, #0c5770 100%);
  color: #fff;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.96rem;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f5b700;
  box-shadow: 0 0 0 4px rgba(245, 183, 0, 0.2);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.menu-section {
  padding: 6px 4px;
  border-radius: 10px;
  border: 1px solid rgba(229, 241, 245, 0.12);
  background: rgba(4, 36, 49, 0.3);
}

.menu-section.is-active {
  border-color: rgba(229, 241, 245, 0.24);
  background: rgba(229, 241, 245, 0.09);
}

.menu-section-title {
  margin: 0 4px 4px;
  color: rgba(229, 241, 245, 0.82);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.menu-section-title .menu-icon {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
}

.menu-section-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-item {
  padding: 7px 8px;
  border-radius: 7px;
  color: #e5f1f5;
  font-weight: 600;
}

.menu-item-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  flex: 0 0 16px;
}

.menu-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-item:hover,
.menu-item.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  text-decoration: none;
}

.menu-item-level2 {
  margin-left: 12px;
  color: #e1f0f6;
  font-size: 0.86rem;
  font-weight: 500;
}

.menu-item-level2 .menu-icon {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
  opacity: 0.92;
}

.logout-form { margin-top: auto; }

.main-content {
  padding: 16px;
  max-width: none;
  width: 100%;
  margin: 0;
  min-width: 0;
}

.topbar {
  margin-bottom: 10px;
}

.topbar-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.25;
  color: #1b2a3a;
}

.topbar-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.page-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.page-body > * {
  min-width: 0;
}

.page-body > .card > h2,
.page-body > .card > h3,
.page-body > .card > h4 {
  margin-bottom: 6px;
  color: #1f2f43;
}

.header-row h2 {
  font-size: 1.08rem;
}

.header-row h3 {
  font-size: 0.98rem;
}

.header-row h4 {
  font-size: 0.9rem;
}

.header-row .muted {
  font-size: 0.8rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  min-width: 0;
  max-width: 100%;
}

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

.grid-kpi > * {
  min-width: 0;
}

.kpi-label { color: var(--muted); margin: 0; }
.kpi-value { font-size: 1.3rem; margin: 6px 0 8px; font-weight: 700; color: #1d3348; }

.header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.header-row > * {
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.badge-neutral { background: #eef2f7; color: #465264; }
.badge-info { background: #d9effb; color: #114b72; }
.badge-success { background: #e7f7ee; color: #17643a; }
.badge-warning { background: #fff4d6; color: #8a5a00; }
.badge-danger { background: #fde7e7; color: #9f1d1d; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  height: 34px;
  padding: 0 10px;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
}

.btn-outline {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: #f5f9fc;
  text-decoration: none;
}

.btn-ghost {
  height: 30px;
  background: #eef6fb;
  border-color: #d2e6f3;
  color: #1b4d66;
}

.btn-ghost:hover {
  background: #e5f0f8;
  text-decoration: none;
}

.btn-danger {
  background: #fff2f2;
  border-color: #f3c5c5;
  color: var(--danger);
  height: 30px;
}

.btn-danger:hover {
  background: #ffe9e9;
}

.full-width { width: 100%; }

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

.w-max-120 { max-width: 120px; }
.w-max-130 { max-width: 130px; }
.w-max-160 { max-width: 160px; }
.w-max-720 { max-width: 720px; }

.sp-top-xs { margin-top: 6px; }
.sp-top-sm { margin-top: 8px; }
.sp-top-md { margin-top: 10px; }
.sp-top-lg { margin-top: 12px; }
.sp-top-xl { margin-top: 14px; }

.sp-bottom-sm { margin-bottom: 8px; }
.sp-bottom-md { margin-bottom: 10px; }
.sp-bottom-lg { margin-bottom: 12px; }

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-check-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.auth-wrapper {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
}

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

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

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #33465a;
}

input {
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 0.85rem;
}

input[type="file"] {
  height: auto;
  padding: 6px;
}

input[type="hidden"] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  height: auto;
  padding: 0;
}

select,
textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 8px;
  font-size: 0.85rem;
  background: #fff;
}

select {
  height: 34px;
}

textarea {
  min-height: 90px;
  padding: 8px;
  resize: vertical;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

input:focus {
  outline: 2px solid #9dd5ea;
  border-color: #64b8d8;
}

select:focus,
textarea:focus {
  outline: 2px solid #9dd5ea;
  border-color: #64b8d8;
}

.toast {
  margin-bottom: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
}

.toast-success {
  background: #e9f7ee;
  border-color: #cbead6;
  color: var(--success);
}

.toast-error {
  background: #feefef;
  border-color: #f6d2d2;
  color: var(--danger);
}

.muted {
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.text-muted {
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
  background: #fbfdff;
}

.filters-row {
  --filters-column-min: 190px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--filters-column-min)), 1fr));
  gap: 8px;
  margin: 10px 0;
  align-items: end;
}

.filters-row > * {
  min-width: 0;
  max-width: 100%;
}

.filters-row .btn {
  width: 100%;
}

.filters-sla-dispatch {
  --filters-column-min: 240px;
}

.filters-budget-year {
  --filters-column-min: 160px;
  margin: 0;
  max-width: 620px;
}

.sla-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 8px;
}

.reports-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 100%;
  background: #fff;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf4fa;
  border-bottom: 1px solid #d8e2ec;
}

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  font-size: 0.84rem;
  line-height: 1.3;
}

th {
  font-size: 0.8rem;
  color: #314256;
  font-weight: 700;
}

th a {
  color: inherit;
}

tbody tr:hover {
  background: #f2f7fc;
}

.table-wrap code {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

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

.actions-cell form {
  margin: 0;
}

.pagination-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.form-grid > * {
  min-width: 0;
}

.field {
  display: grid;
  gap: 4px;
}

.form-fieldset {
  margin: 0;
  padding: 8px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fcfeff;
}

.form-fieldset legend {
  padding: 0 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #425466;
}

.lookup-shell,
.destination-search-shell {
  display: grid;
  gap: 4px;
}

.lookup-suggestions,
.destination-suggestions {
  display: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  z-index: 4;
}

.lookup-suggestions.is-open,
.destination-suggestions.is-open {
  display: grid;
  gap: 2px;
}

.lookup-suggestion-btn,
.destination-suggestion-btn {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: left;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
}

.lookup-suggestion-btn:hover,
.lookup-suggestion-btn:focus,
.destination-suggestion-btn:hover,
.destination-suggestion-btn:focus {
  background: #eef6fb;
  outline: none;
}

.lookup-suggestion-empty,
.destination-suggestion-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

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

.role-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
}

.role-option input[type="checkbox"] {
  margin-top: 2px;
}

.role-description {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
}

.chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

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

.details-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.details-grid > * {
  min-width: 0;
}

.details-wide {
  grid-column: 1 / -1;
}

.summary-line {
  margin-bottom: 8px;
}

.tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.tab-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: inherit;
  border: 1px solid var(--border);
  color: #516173;
  background: #f8fbfd;
  cursor: pointer;
  line-height: 1.2;
  appearance: none;
}

.tab-chip.is-active {
  background: #e0f1fb;
  border-color: #b8daed;
  color: #184c68;
}

.tab-chip:focus-visible {
  outline: 2px solid #69a8cb;
  outline-offset: 2px;
}

.card-placeholder {
  border-style: dashed;
}

.pipeline-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.pipeline-step {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

.pipeline-step.is-done {
  background: #eaf7ef;
  border-color: #cbe8d6;
}

.pipeline-step.is-current {
  background: #e3f2fb;
  border-color: #b5d7ea;
}

.pipeline-step.is-available {
  background: #f2fbf5;
  border-color: #bee6cc;
}

.pipeline-step.is-pending {
  background: #f7fafc;
}

.pipeline-index {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #d7e2ec;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
}

.bpmn-editor-toolbar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bpmn-editor-status {
  font-size: 0.9rem;
}

.bpmn-editor-status.is-error {
  color: var(--danger);
}

.bpmn-editor-canvas {
  margin-top: 12px;
  height: 620px;
  border: 1px solid #c8dce9;
  border-radius: 12px;
  overflow: hidden;
  background: radial-gradient(circle at 0 0, #f3f9fd 0, #f9fcff 45%, #ffffff 100%);
}

.bpmn-editor-save-form {
  display: none;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-form {
  margin: 14px 0 16px;
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.timeline-context-alert {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #cfe1ee;
  border-radius: 8px;
  background: #f1f8fd;
}

.timeline-form-grid {
  margin-bottom: 10px;
}

.timeline-item {
  border-left: 3px solid #b9d7e8;
  padding: 10px 12px;
  background: #f8fcff;
  border-radius: 8px;
}

.timeline-item-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.timeline-item-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.timeline-item-description {
  margin: 8px 0;
}

.timeline-item-actions {
  margin: 8px 0 4px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 12px;
}

.checkbox-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bpmn-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timeline-stage-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
}

.timeline-attachments {
  margin: 8px 0;
}

.attachments-list {
  margin: 4px 0 0;
  padding-left: 18px;
}

.timeline-rectify-details {
  margin-top: 8px;
}

.timeline-rectify-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #1b4d66;
}

.timeline-rectify-form {
  margin-top: 8px;
  border-top: 1px dashed #c9dce8;
  padding-top: 8px;
}

.document-form {
  margin: 14px 0 16px;
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.document-context-alert {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #d7e5ef;
  border-radius: 8px;
  background: #f4f9fd;
}

.document-form-toggle {
  margin-top: 12px;
}

.document-form-toggle > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
}

.document-form-toggle > summary::-webkit-details-marker {
  display: none;
}

.document-form-toggle[open] > summary {
  margin-bottom: 8px;
}

.document-list {
  display: grid;
  gap: 10px;
}

.document-item {
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdff;
}

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

.document-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.dropzone {
  border: 1px dashed #9ec4d7;
  border-radius: 10px;
  background: #f2f9fd;
  padding: 10px;
}

.dropzone.is-dragover {
  border-color: #0b6fa4;
  background: #e7f4fb;
}

.dropzone-text {
  margin: 0 0 8px;
}

.dropzone-input {
  width: 100%;
}

.document-version-form {
  margin-top: 10px;
  border-top: 1px dashed #c9dce8;
  padding-top: 10px;
}

.document-version-history {
  margin-top: 10px;
}

.document-version-history summary {
  cursor: pointer;
  font-weight: 600;
  color: #1b4d66;
}

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

.document-version-item {
  border: 1px solid #d9e6ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.costs-kpi {
  margin: 12px 0;
}

.kpi-card {
  padding: 12px;
  box-shadow: none;
}

.dashboard-kpi-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.dashboard-flow-list {
  margin-top: 12px;
  display: grid;
  gap: 14px;
}

.dashboard-flow-group {
  position: relative;
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.dashboard-flow-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-flow-title {
  margin: 0;
  font-size: 1rem;
}

.dashboard-flow-note {
  margin: 4px 0 0;
  font-size: 0.85rem;
}

.dashboard-status-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.dashboard-status-row {
  display: grid;
  gap: 6px;
}

.dashboard-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-status-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-status-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
}

.dashboard-status-bar-btn {
  display: block;
  width: 100%;
  height: 12px;
  padding: 0;
  border: 1px solid #d4e0ea;
  background: #eef4fa;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.dashboard-status-bar-btn:hover {
  border-color: #7db3d0;
  background: #e3eff8;
}

.dashboard-status-bar-btn:focus-visible {
  outline: 2px solid #0f6fa8;
  outline-offset: 2px;
}

.dashboard-status-row.is-selected .dashboard-status-bar-btn {
  border-color: #0f6fa8;
  box-shadow: 0 0 0 2px rgba(15, 111, 168, 0.18);
  background: #dcedfa;
}

.dashboard-status-row.is-selected .dashboard-status-head strong {
  color: #0f6fa8;
}

.dashboard-status-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0a6a9b 0%, #3ea3d1 100%);
}

.dashboard-status-detail {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d7e4ef;
  border-radius: 10px;
  background: #f3f8fd;
  color: #334155;
}

.dashboard-status-detail-title {
  margin: 0;
  font-weight: 700;
}

.dashboard-status-detail-meta {
  margin: 6px 0 0;
  font-size: 0.88rem;
}

.dashboard-status-detail .actions-inline {
  margin-top: 10px;
}

.dashboard-status-tooltip {
  max-width: min(310px, calc(100% - 12px));
}

.dashboard-recent-title {
  margin: 6px 0 0;
}

.dashboard-recent-meta {
  margin: 6px 0 0;
  color: #4a5568;
  font-size: 0.88rem;
}

.dashboard-chart-wrap,
.chart-pattern-wrap {
  margin-top: 12px;
  position: relative;
  padding: 10px;
  border: 1px solid #d9e5ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #fcfeff 0%, #f6fbff 100%);
}

.dashboard-chart-legend,
.chart-pattern-legend {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-legend-item,
.chart-pattern-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #d7e4ef;
  background: #f8fbff;
  color: #4a5f73;
  font-size: 0.82rem;
  font-weight: 600;
}

.dashboard-legend-dot,
.chart-pattern-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dashboard-legend-dot.is-planned { background: #8bc8ea; }
.dashboard-legend-dot.is-real { background: #0f6fa8; }
.dashboard-legend-dot.is-limit { background: #f59e0b; }
.dashboard-legend-dot.is-active { background: #0f766e; }
.dashboard-legend-dot.is-pipeline { background: #b45309; }
.dashboard-legend-dot.is-total { background: #475569; }

.dashboard-chart-tooltip,
.chart-pattern-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 176px;
  max-width: min(280px, calc(100% - 12px));
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(191, 212, 229, 0.9);
  background: rgba(15, 23, 42, 0.93);
  color: #f8fafc;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.28);
  font-size: 0.78rem;
  line-height: 1.36;
  pointer-events: none;
}

.dashboard-chart-tooltip[hidden],
.chart-pattern-tooltip[hidden] {
  display: none;
}

.dashboard-chart-tooltip-title,
.chart-pattern-tooltip-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.dashboard-chart-tooltip-row,
.chart-pattern-tooltip-row {
  white-space: nowrap;
}

.dashboard-chart-detail,
.chart-pattern-detail {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #d7e4ef;
  border-radius: 10px;
  background: #f8fbff;
  color: #334155;
  font-size: 0.9rem;
}

.dashboard-chart-canvas,
.chart-pattern-canvas {
  display: block;
  width: 100%;
  height: clamp(250px, 34vw, 380px);
  min-height: 250px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.dashboard-chart-canvas:focus-visible,
.chart-pattern-canvas:focus-visible {
  outline: 2px solid #0f6fa8;
  outline-offset: 2px;
}

.cost-batch-form {
  margin: 14px 0 16px;
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

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

.cost-readonly-field input[readonly] {
  background: #eef4f9;
  color: #334155;
}

.cost-batch-dates {
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.cost-batch-dates p {
  margin: 0;
}

.cost-batch-table {
  min-width: 1120px;
}

.cost-col-item { width: 26%; }
.cost-col-periodicity { width: 10%; }
.cost-col-amount { width: 14%; }
.cost-col-start { width: 13%; }
.cost-col-annualized { width: 11%; }
.cost-col-year-end { width: 11%; }
.cost-col-notes { width: 15%; }
.cost-col-details { width: 10%; }

.cost-hierarchy-list {
  display: grid;
  gap: 10px;
}

.cost-hierarchy-group {
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
}

.cost-hierarchy-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.cost-hierarchy-group > summary::-webkit-details-marker {
  display: none;
}

.cost-hierarchy-group[open] > summary {
  border-bottom: 1px solid #d9e6ef;
}

.cost-batch-table th,
.cost-batch-table td {
  vertical-align: middle;
}

.cost-batch-table input[type="number"],
.cost-batch-table input[type="date"],
.cost-batch-table input[type="text"] {
  width: 100%;
  min-width: 110px;
}

.cost-batch-table input[type="text"] {
  min-width: 220px;
}

.cost-batch-table input::placeholder {
  color: #8fa1b4;
  font-size: 0.86rem;
}

.cost-batch-table tfoot td {
  background: #f3f9fe;
  border-top: 1px solid #d9e6ef;
  font-weight: 700;
}

.cost-expand-row td {
  background: #f8fbff;
}

.cost-children-table {
  min-width: 820px;
}

.cost-children-table th,
.cost-children-table td {
  vertical-align: middle;
}

.is-numeric {
  text-align: right;
  white-space: nowrap;
}

.cost-batch-table tr.is-overridden > td,
.reimbursement-batch-table tr.is-overridden > td {
  background: #fff7e6;
}

.cost-batch-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cost-batch-shortcuts {
  margin: 8px 0 0;
  font-size: 0.82rem;
}

.cost-edit-mode {
  margin-top: 12px;
}

.cost-edit-mode > summary {
  list-style: none;
}

.cost-edit-mode > summary::-webkit-details-marker {
  display: none;
}

.reimbursement-edit-mode {
  margin-top: 12px;
}

.reimbursement-edit-mode > summary {
  list-style: none;
}

.reimbursement-edit-mode > summary::-webkit-details-marker {
  display: none;
}

.reimbursement-form {
  margin: 14px 0 16px;
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.reimbursement-batch-form {
  margin: 14px 0 16px;
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.reimbursement-batch-table {
  min-width: 880px;
}

.reimbursement-batch-table th,
.reimbursement-batch-table td {
  vertical-align: middle;
}

.reimbursement-batch-table input[type="number"],
.reimbursement-batch-table input[type="text"] {
  width: 100%;
  min-width: 130px;
}

.reimbursement-batch-table tfoot td {
  background: #f3f9fe;
  border-top: 1px solid #d9e6ef;
  font-weight: 700;
}

.process-comment-form {
  margin: 14px 0 16px;
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.admin-timeline-filters,
.admin-timeline-note-form {
  margin: 14px 0 16px;
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.cost-versions {
  margin-top: 12px;
}

.cost-version-toggle {
  padding: 2px 8px;
  min-height: 28px;
}

.cost-version-detail-row td {
  background: #f8fbff;
}

.cost-version-detail {
  padding: 10px 0 2px;
}

.audit-filters {
  margin: 14px 0 16px;
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-item {
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.comment-item p {
  margin: 8px 0 0;
  line-height: 1.45;
}

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

.comment-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #4a5568;
  font-size: 0.88rem;
}

.comment-edit {
  margin-top: 10px;
}

.comment-edit summary {
  cursor: pointer;
  font-weight: 600;
  color: #1b4d66;
}

.admin-timeline-list {
  display: grid;
  gap: 10px;
}

.admin-timeline-item {
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.admin-timeline-item.is-manual {
  border-left: 3px solid #6fb2d3;
}

.admin-timeline-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.admin-timeline-item-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-timeline-item-description {
  margin: 8px 0 0;
  line-height: 1.45;
}

.admin-timeline-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #4a5568;
  font-size: 0.88rem;
}

.admin-timeline-edit {
  margin-top: 10px;
}

.admin-timeline-edit summary {
  cursor: pointer;
  font-weight: 600;
  color: #1b4d66;
}

.audit-list {
  display: grid;
  gap: 10px;
}

.audit-item {
  border: 1px solid #d9e6ef;
  border-radius: 10px;
  background: #fbfdff;
  padding: 12px;
}

.audit-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.audit-item-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.audit-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: #4a5568;
  font-size: 0.88rem;
}

.audit-details {
  margin-top: 8px;
}

.audit-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #1b4d66;
}

.audit-payload-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.audit-payload-wide {
  grid-column: 1 / -1;
}

.audit-payload-grid pre {
  margin: 6px 0 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  max-height: 220px;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.4;
}

.card pre {
  margin: 6px 0 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  overflow: auto;
  font-size: 0.84rem;
  line-height: 1.4;
}

.tabs-row,
.actions-inline,
.form-actions,
.chips-row,
.timeline-list,
.document-list,
.comment-list,
.admin-timeline-list,
.audit-list,
.dashboard-flow-list,
.dashboard-status-list {
  gap: 8px;
}

.details-grid,
.pipeline-track,
.roles-grid,
.permission-list,
.checkbox-grid {
  gap: 8px;
}

.timeline-form,
.document-form,
.cost-batch-form,
.reimbursement-form,
.process-comment-form,
.admin-timeline-filters,
.admin-timeline-note-form,
.audit-filters {
  margin: 10px 0 12px;
  padding: 10px;
  border-radius: 8px;
}

.timeline-context-alert,
.document-context-alert,
.comment-item,
.admin-timeline-item,
.audit-item,
.dashboard-flow-group,
.dashboard-status-detail,
.dashboard-chart-detail,
.chart-pattern-detail,
.cost-batch-dates {
  padding: 8px 10px;
  border-radius: 8px;
}

.timeline-item,
.document-item,
.document-version-item,
.pipeline-step,
.role-option {
  padding: 8px 10px;
  border-radius: 8px;
}

.dashboard-chart-wrap,
.chart-pattern-wrap {
  margin-top: 8px;
  padding: 8px;
  border-radius: 10px;
}

.dashboard-chart-legend,
.chart-pattern-legend {
  margin-top: 6px;
  gap: 6px;
}

.dashboard-legend-item,
.chart-pattern-legend-item {
  padding: 3px 8px;
  font-size: 0.76rem;
}

.bpmn-editor-toolbar,
.cost-batch-actions {
  margin-top: 8px;
  gap: 8px;
}

.bpmn-editor-status,
.dashboard-chart-detail,
.chart-pattern-detail {
  font-size: 0.84rem;
}

.bpmn-editor-canvas {
  margin-top: 8px;
  height: 540px;
  border-radius: 10px;
}

/* Acabamento fino por módulo */
.module-dashboard .page-body,
.module-reports .page-body,
.module-global-search .page-body,
.module-ops .page-body {
  gap: 11px;
}

.module-people .page-body,
.module-budget .page-body,
.module-lgpd .page-body,
.module-pipeline-flows .page-body,
.module-invoices .page-body,
.module-cost-mirrors .page-body,
.module-cost-items .page-body,
.module-integrity .page-body {
  gap: 8px;
}

.module-dashboard .topbar-title,
.module-reports .topbar-title,
.module-global-search .topbar-title {
  font-size: 1.18rem;
}

.module-people .topbar-title,
.module-budget .topbar-title,
.module-invoices .topbar-title,
.module-cost-mirrors .topbar-title,
.module-pipeline-flows .topbar-title,
.module-lgpd .topbar-title,
.module-integrity .topbar-title {
  font-size: 1.1rem;
}

.module-dashboard .card,
.module-reports .card,
.module-global-search .card {
  padding: 13px;
}

.module-people .card,
.module-budget .card,
.module-lgpd .card,
.module-pipeline-flows .card,
.module-invoices .card,
.module-cost-mirrors .card {
  padding: 10px 11px;
}

.module-people .table-wrap th,
.module-people .table-wrap td,
.module-budget .table-wrap th,
.module-budget .table-wrap td,
.module-pipeline-flows .table-wrap th,
.module-pipeline-flows .table-wrap td,
.module-invoices .table-wrap th,
.module-invoices .table-wrap td,
.module-cost-mirrors .table-wrap th,
.module-cost-mirrors .table-wrap td,
.module-lgpd .table-wrap th,
.module-lgpd .table-wrap td {
  padding: 7px 9px;
  font-size: 0.82rem;
}

.module-people .table-wrap th,
.module-budget .table-wrap th,
.module-pipeline-flows .table-wrap th,
.module-invoices .table-wrap th,
.module-cost-mirrors .table-wrap th,
.module-lgpd .table-wrap th {
  font-size: 0.78rem;
}

/* Ajuste fino: dashboard/index */
.page-dashboard-index .grid-kpi {
  gap: 12px;
}

.page-dashboard-index .kpi-card {
  padding: 12px 13px;
  border-color: #d4dee8;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

.page-dashboard-index .kpi-value {
  font-size: 1.38rem;
}

.page-dashboard-index .dashboard-kpi-note {
  color: #4f5f72;
  font-size: 0.8rem;
}

.page-dashboard-index .dashboard-flow-group {
  border-color: #cfdeea;
  background: linear-gradient(180deg, #fcfeff 0%, #f6fbff 100%);
}

.page-dashboard-index .dashboard-flow-title {
  font-size: 1.02rem;
}

.page-dashboard-index .dashboard-status-head strong {
  color: #1f3348;
}

.page-dashboard-index .dashboard-status-detail {
  border-color: #cedce8;
  background: #f6fbff;
}

/* Ajuste fino: budget/index */
.page-budget-index .grid-kpi {
  gap: 9px;
}

.page-budget-index .header-row {
  gap: 10px;
}

.page-budget-index .header-row .muted {
  color: #4f6074;
}

.page-budget-index .kpi-card {
  padding: 10px 11px;
}

.page-budget-index .kpi-value {
  font-size: 1.2rem;
  color: #22384d;
}

.page-budget-index .dashboard-kpi-note {
  font-size: 0.78rem;
  color: #53667b;
}

.page-budget-index .table-wrap {
  border-color: #c8d5e2;
}

.page-budget-index .table-wrap tbody tr:hover {
  background: #f0f6fb;
}

/* Ajuste fino: people/show */
.page-people-show .tabs-row {
  margin: 10px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe5ef;
}

.page-people-show .tab-chip {
  padding: 5px 9px;
  font-size: 0.78rem;
  color: #44576b;
  background: #f7fbff;
  border-color: #cfdeea;
}

.page-people-show .tab-chip.is-active {
  background: #dceef9;
  border-color: #aecdde;
  color: #123f5a;
}

.page-people-show [data-tab-panel] {
  border-color: #d1ddea;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.page-people-show [data-tab-panel] > .header-row {
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e6edf5;
}

.page-people-show [data-tab-panel] > .header-row h3 {
  font-size: 0.98rem;
}

.page-people-show .details-grid {
  gap: 7px 10px;
}

.page-people-show .details-grid > div {
  padding: 4px 6px;
  border: 1px solid #e4ebf3;
  border-radius: 7px;
  background: #fbfdff;
}

.page-people-show .table-wrap {
  border-color: #cad8e5;
}

.page-people-show .table-wrap tbody tr:hover {
  background: #eff6fc;
}

.page-people-show .comment-item,
.page-people-show .admin-timeline-item,
.page-people-show .audit-item {
  border-color: #cfdeea;
}

/* Ajuste fino: people/create */
:is(.page-people-create, .page-people-edit) .page-body {
  gap: 10px;
}

:is(.page-people-create, .page-people-edit) .people-create-hero {
  border-color: #c4d8e7;
  background: linear-gradient(135deg, #f8fcff 0%, #eef6fb 100%);
  padding: 12px;
}

:is(.page-people-create, .page-people-edit) .people-create-hero h2 {
  font-size: 1.18rem;
  color: #16354a;
}

:is(.page-people-create, .page-people-edit) .people-create-hero .muted {
  color: #3f5c72;
}

:is(.page-people-create, .page-people-edit) .people-wizard-card {
  border-color: #d3e1ec;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

:is(.page-people-create, .page-people-edit) .people-form-grid {
  gap: 12px;
}

:is(.page-people-create, .page-people-edit) .people-wizard-progress {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

:is(.page-people-create, .page-people-edit) .people-wizard-progress-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #d5e2ed;
  border-radius: 9px;
  background: #f7fbff;
  color: #486173;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

:is(.page-people-create, .page-people-edit) .people-wizard-progress-item .step-number {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #bcd3e3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a4a66;
  background: #fff;
}

:is(.page-people-create, .page-people-edit) .people-wizard-progress-item .step-label {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

:is(.page-people-create, .page-people-edit) .people-wizard-progress-item.is-active {
  border-color: #7cb3d6;
  background: #e9f4fc;
  color: #123f5a;
}

:is(.page-people-create, .page-people-edit) .people-wizard-progress-item.is-done {
  border-color: #98c6a9;
  background: #edf8f1;
  color: #1b5e36;
}

:is(.page-people-create, .page-people-edit) .people-wizard-step {
  display: grid;
  gap: 10px;
}

:is(.page-people-create, .page-people-edit) .people-wizard-step[hidden] {
  display: none !important;
}

:is(.page-people-create, .page-people-edit) .people-step-header {
  display: grid;
  gap: 2px;
}

:is(.page-people-create, .page-people-edit) .people-step-header h3 {
  font-size: 0.98rem;
  color: #183c55;
}

:is(.page-people-create, .page-people-edit) .people-step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

:is(.page-people-create, .page-people-edit) .movement-direction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

:is(.page-people-create, .page-people-edit) .movement-direction-card {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid #d1dfeb;
  border-radius: 10px;
  background: #f8fcff;
  color: #243c4f;
  cursor: pointer;
}

:is(.page-people-create, .page-people-edit) .movement-direction-card input[type="radio"] {
  margin: 0;
}

:is(.page-people-create, .page-people-edit) .movement-direction-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #173c56;
}

:is(.page-people-create, .page-people-edit) .movement-direction-description {
  font-size: 0.79rem;
  color: #4c6275;
}

:is(.page-people-create, .page-people-edit) .movement-direction-card:has(input:checked) {
  border-color: #7eb4d6;
  background: #e6f3fc;
  color: #11364f;
}

:is(.page-people-create, .page-people-edit) .lookup-shell {
  position: relative;
}

:is(.page-people-create, .page-people-edit) .lookup-shell:not(.is-enhanced) input[type="search"],
:is(.page-people-create, .page-people-edit) .lookup-shell:not(.is-enhanced) .lookup-suggestions {
  display: none;
}

:is(.page-people-create, .page-people-edit) .inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

:is(.page-people-create, .page-people-edit) .inline-field .btn {
  min-width: 74px;
}

:is(.page-people-create, .page-people-edit) .form-feedback {
  min-height: 18px;
  margin-top: 2px;
  font-size: 0.78rem;
}

:is(.page-people-create, .page-people-edit) .form-feedback.is-error {
  color: #b42318;
}

:is(.page-people-create, .page-people-edit) .form-feedback.is-success {
  color: #1f7a3f;
}

:is(.page-people-create, .page-people-edit) .form-feedback.is-info {
  color: #496177;
}

:is(.page-people-create, .page-people-edit) .people-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

:is(.page-people-create, .page-people-edit) .people-optional-details {
  border: 1px solid #d6e2ec;
  border-radius: 10px;
  padding: 8px 10px;
  background: #f9fcff;
}

:is(.page-people-create, .page-people-edit) .people-optional-details summary {
  cursor: pointer;
  font-weight: 700;
  color: #1e425a;
  font-size: 0.84rem;
}

:is(.page-people-create, .page-people-edit) .people-optional-details > summary::-webkit-details-marker {
  display: none;
}

:is(.page-people-create, .page-people-edit) .people-optional-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

:is(.page-people-create, .page-people-edit) .people-step-actions,
:is(.page-people-create, .page-people-edit) .people-form-actions {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid #dde8f1;
  justify-content: space-between;
}

/* Ajuste fino: organs/index */
.page-organs-index .organs-list-card {
  display: grid;
  gap: 10px;
}

.page-organs-index .organs-header-row {
  align-items: flex-end;
  gap: 10px;
}

.page-organs-index .organs-header-row h2 {
  margin: 0;
  font-size: 1.08rem;
  color: #1f3348;
}

.page-organs-index .organs-header-row .muted {
  margin-top: 4px;
  color: #4d6073;
}

.page-organs-index .organs-new-btn {
  gap: 7px;
}

.page-organs-index .organs-new-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
  line-height: 1;
}

.page-organs-index .organs-filters {
  display: grid;
  gap: 8px;
}

.page-organs-index .organs-search-shell {
  position: relative;
}

.page-organs-index .organs-search-shell input {
  height: 40px;
  padding-left: 34px;
  padding-right: 36px;
  font-size: 0.9rem;
}

.page-organs-index .organs-search-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #6a7d90;
  pointer-events: none;
}

.page-organs-index .organs-search-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-organs-index .organs-search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #edf3f8;
  color: #4b6176;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.page-organs-index .organs-search-clear:hover {
  background: #e2ecf4;
}

.page-organs-index .organs-search-clear.is-visible {
  display: inline-flex;
}

.page-organs-index .organs-search-clear svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.page-organs-index .organs-controls-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.page-organs-index .organs-control {
  display: grid;
  gap: 4px;
}

.page-organs-index .organs-control > span {
  font-size: 0.76rem;
  font-weight: 700;
  color: #425466;
}

.page-organs-index .organs-control-sm {
  max-width: 180px;
}

.page-organs-index .organs-table-wrap {
  margin-top: 2px;
  overflow-y: auto;
}

.page-organs-index .organs-sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.page-organs-index .organs-sort-indicator {
  min-width: 11px;
  color: #40617f;
  font-size: 0.7rem;
}

.page-organs-index .table-wrap th,
.page-organs-index .table-wrap td {
  padding: 7px 9px;
  font-size: 0.82rem;
  vertical-align: middle;
}

.page-organs-index .table-wrap th {
  font-size: 0.78rem;
}

.page-organs-index .organs-name-cell {
  max-width: 360px;
}

.page-organs-index .organs-name-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-organs-index .organs-acronym-cell {
  font-weight: 600;
}

.page-organs-index .organs-cnpj {
  display: inline-block;
  white-space: nowrap;
}

.page-organs-index .organs-type-badge {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-organs-index .organs-uf {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.page-organs-index .organs-actions-cell {
  gap: 4px;
}

.page-organs-index .organs-icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #c9dbe8;
  border-radius: 6px;
  background: #f3f8fd;
  color: #1d4c68;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.page-organs-index .organs-icon-btn:hover {
  background: #e7f1fa;
  border-color: #9fc0d8;
  text-decoration: none;
}

.page-organs-index .organs-icon-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-organs-index .organs-icon-btn:focus-visible {
  outline: 2px solid #7fb0d2;
  outline-offset: 1px;
}

.page-organs-index .organs-row-menu {
  position: relative;
}

.page-organs-index .organs-row-menu > summary {
  list-style: none;
  cursor: pointer;
}

.page-organs-index .organs-row-menu > summary::-webkit-details-marker {
  display: none;
}

.page-organs-index .organs-row-menu[open] > .organs-menu-trigger {
  background: #dcecf9;
  border-color: #84add0;
  color: #173f5a;
}

.page-organs-index .organs-row-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  min-width: 158px;
  border: 1px solid #c5d8e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.13);
  padding: 5px;
}

.page-organs-index .organs-row-menu-panel form {
  margin: 0;
}

.page-organs-index .organs-row-menu-item {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #2c465c;
  text-align: left;
  padding: 7px 8px;
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
}

.page-organs-index .organs-row-menu-item:hover {
  background: #edf4fa;
}

.page-organs-index .organs-row-menu-item:focus-visible {
  outline: 2px solid #7fb0d2;
  outline-offset: 1px;
}

.page-organs-index .organs-row-menu-item.is-danger {
  color: #9f2323;
}

.page-organs-index .organs-row-menu-item.is-danger:hover {
  background: #fdeef0;
}

.page-organs-index .organs-empty-state {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.page-organs-index .organs-pagination-row {
  margin-top: 4px;
}

.page-organs-index .organs-pagination-links .btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
  }

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

  .filters-row {
    --filters-column-min: 170px;
  }

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

  .costs-kpi {
    grid-template-columns: 1fr;
  }

  .cost-batch-meta {
    grid-template-columns: 1fr;
  }

  .cost-batch-actions {
    justify-content: flex-start;
  }

  .audit-payload-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-wrap,
  .chart-pattern-wrap {
    padding: 8px;
  }

  .dashboard-chart-canvas,
  .chart-pattern-canvas {
    height: clamp(240px, 45vw, 320px);
  }
}

@media (max-width: 640px) {
  :is(.page-people-create, .page-people-edit) .people-create-hero .header-row {
    gap: 6px;
  }

  :is(.page-people-create, .page-people-edit) .people-wizard-progress {
    grid-template-columns: 1fr;
  }

  :is(.page-people-create, .page-people-edit) .people-step-grid,
  :is(.page-people-create, .page-people-edit) .people-date-range,
  :is(.page-people-create, .page-people-edit) .people-optional-grid {
    grid-template-columns: 1fr;
  }

  :is(.page-people-create, .page-people-edit) .inline-field {
    grid-template-columns: 1fr;
  }

  :is(.page-people-create, .page-people-edit) .people-step-actions,
  :is(.page-people-create, .page-people-edit) .people-form-actions {
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-title {
    font-size: 1rem;
  }

  .module-dashboard .topbar-title,
  .module-reports .topbar-title,
  .module-global-search .topbar-title {
    font-size: 1.05rem;
  }

  .main-content {
    padding: 12px;
  }

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

  .sidebar {
    padding: 12px 8px;
  }

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

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

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

  .document-version-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .audit-item-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-timeline-item-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .pagination-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-track {
    grid-template-columns: 1fr;
  }

  .bpmn-editor-canvas {
    height: 420px;
  }

  .dashboard-chart-detail,
  .chart-pattern-detail {
    font-size: 0.86rem;
  }

  .dashboard-chart-tooltip,
  .chart-pattern-tooltip {
    min-width: 160px;
    font-size: 0.74rem;
  }

  .page-organs-index .organs-control-sm {
    max-width: none;
  }
}
