:root {
  --green: #39b54a;
  --green-dark: #2f9a3d;
  --green-soft: #e8f7ea;
  --orange: #f15a24;
  --orange-soft: #fff0ea;
  --blue: #0071bc;
  --blue-soft: #e6f3fb;
  --bg: #f2f2f2;
  --white: #ffffff;
  --ink: #4d4d4d;
  --ink-soft: #6d6e71;
  --line: #d1d3d4;
  --shadow: 0 10px 28px rgba(77, 77, 77, 0.08);
  --radius: 10px;
  --font: "Montserrat", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(57, 181, 74, 0.08), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(241, 90, 36, 0.07), transparent 36%),
    var(--bg);
}

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar-inner,
.wrap {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  padding: 10px 0;
}

.topbar-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

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

.topbar-logos {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo {
  display: block;
  object-fit: contain;
}

.logo-set {
  height: 56px;
  width: auto;
  max-width: 90px;
  background: var(--white);
}

.logo-idt {
  height: 42px;
  width: auto;
  max-width: 160px;
}

.topbar-titles {
  min-width: 0;
}

.top-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.top-progress-rings {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ring-num {
  font-size: 14px;
  font-weight: 800;
  fill: var(--green);
  font-family: var(--font);
}

.ring-num-time {
  fill: #0d9488;
}

.ring-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  fill: var(--ink-soft);
  font-family: var(--font);
}

.inaug-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid var(--line);
  padding-left: 14px;
}

.inaug-meta strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.inaug-meta span:last-child {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(0.78rem, 1.7vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7a7a7a;
}

.topbar-meta {
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
}

.link-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}

.link-action:hover {
  color: var(--green-dark);
}

.wrap {
  padding: 12px 0 20px;
  flex: 1;
}

.kpis {
  margin-bottom: 12px;
}

.kpi-groups {
  display: grid;
  gap: 14px;
}

.kpi-group-label {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.kpis-row {
  display: grid;
  gap: 10px;
}

.kpis-status {
  grid-template-columns: repeat(4, 1fr);
}

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

.kpi-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 100%;
  overflow: hidden;
}

.kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--kpi-accent, var(--green));
}

.kpi-green { --kpi-accent: var(--green); --kpi-soft: var(--green-soft); }
.kpi-blue { --kpi-accent: var(--blue); --kpi-soft: var(--blue-soft); }
.kpi-teal { --kpi-accent: #0d9488; --kpi-soft: #e6f7f5; }
.kpi-orange { --kpi-accent: var(--orange); --kpi-soft: var(--orange-soft); }
.kpi-red { --kpi-accent: #c1443c; --kpi-soft: #fdecec; }

.kpi-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--kpi-accent);
  background: var(--kpi-soft);
  flex-shrink: 0;
}

.kpi-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.kpi-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.kpi-value {
  margin: 2px 0 0;
  color: var(--kpi-accent);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.kpi-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 500;
  line-height: 1.35;
}

.kpi-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kpi-accent);
  flex-shrink: 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  box-shadow: var(--shadow);
}

.card-head {
  background: var(--green);
  color: var(--white);
  padding: 7px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}

.card-body {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-value {
  margin: 0;
  color: var(--green);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.card-value.hero {
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.card-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
}

.card-status {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 10px;
}

.panel-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
}

.panel-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ececec;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.blocks {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  box-shadow: 0 4px 14px rgba(77, 77, 77, 0.04);
}

.block:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  border-color: #c8c8c8;
}

.block.is-active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-soft) inset, var(--shadow);
}

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

.block-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.block-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--block-accent, var(--green));
  background: var(--block-soft, var(--green-soft));
  border: 1px solid color-mix(in srgb, var(--block-accent, var(--green)) 22%, transparent);
}

.block-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

.block-green {
  --block-accent: var(--green);
  --block-soft: var(--green-soft);
}

.block-blue {
  --block-accent: var(--blue);
  --block-soft: var(--blue-soft);
}

.block-titles {
  min-width: 0;
}

.block-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.block-alt {
  margin-top: 3px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
}

.block-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  padding-top: 2px;
}

.block-bar {
  position: relative;
  margin-top: 12px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.block-bar-track {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #ececec;
}

.block-seg {
  display: block;
  height: 100%;
  position: relative;
  min-width: 0;
  --tip-bg: var(--ink);
}

.block-seg[data-tip]:hover {
  filter: brightness(0.92);
  z-index: 2;
}

.block-seg[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: var(--tip-bg);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  box-shadow: var(--shadow);
  z-index: 5;
}

.block-seg[data-tip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--tip-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
}

.block-seg[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.block-seg[data-tip]:hover::before {
  opacity: 1;
}

.block-seg.is-done {
  --tip-bg: var(--green);
}

.block-seg.is-progress {
  --tip-bg: var(--blue);
}

.block-seg.is-waiting {
  --tip-bg: var(--orange);
}

.block-seg.is-rest {
  --tip-bg: #6d6e71;
}

.block-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.block-foot b,
.block-ratio {
  color: var(--ink);
  font-weight: 700;
}

.block-ratio span {
  color: inherit;
}

.block-ratio.has-progress span {
  color: var(--green);
}

.block-hint {
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.35;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.lg-green { background: var(--green); }
.lg-blue { background: var(--blue); }
.lg-orange { background: var(--orange); }
.lg-gray { background: #d8d8d8; }

.attention-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.attention-tab {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: #e4e4e4;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 9px 12px;
  cursor: pointer;
}

.attention-tab:hover {
  background: #d8d8d8;
}

.attention-tab.is-active {
  background: var(--green);
  color: var(--white);
}

.attention-tab .count {
  display: inline-flex;
  margin-left: 6px;
  min-width: 1.4em;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.68rem;
}

.attention-tab:not(.is-active) .count {
  background: rgba(77, 77, 77, 0.12);
  color: var(--ink);
}

.attention-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  max-height: min(416px, 55vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.attention-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fafafa);
}

.att-pills {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  padding-top: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pill-priority {
  background: #c1443c;
  color: #fff;
}

.pill-priority-alta {
  background: var(--orange-soft);
  color: var(--orange);
  border-color: var(--orange);
}

.pill-status-atrasado {
  background: #fdecec;
  color: #c1443c;
  border-color: #c1443c;
}

.pill-status-terceiros {
  background: var(--orange-soft);
  color: var(--orange);
  border-color: var(--orange);
}

.pill-neutral {
  background: #efefef;
  color: var(--ink-soft);
}

.days-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--ink-soft);
}

.days-badge.late {
  color: #c1443c;
}

.days-badge.soon {
  color: var(--orange);
}

.attention-item.is-open {
  background: #fff;
}

.attention-item.is-critica {
  border-left-color: #c1443c;
}

.attention-item strong {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.attention-item p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.attention-item .meta {
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
}

.attention-main {
  min-width: 0;
}

.btn-expand {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.btn-expand:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.btn-expand.is-open {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green-dark);
}

.timeline-wrap {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid var(--line);
  display: grid;
  gap: 12px;
}

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

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

.btn-del-hist {
  appearance: none;
  border: 0;
  background: transparent;
  color: #c1443c;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

.btn-del-hist:hover {
  text-decoration: underline;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -19px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px var(--green);
}

.timeline-item.is-providencia::before {
  background: var(--orange);
  box-shadow: 0 0 0 1px var(--orange);
}

.timeline-when {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.timeline-resumo {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.timeline-details {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.timeline-details li {
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.timeline-empty {
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 8px 0;
}

.item-card .timeline-wrap {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.days-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--ink-soft);
}

.days-label.late {
  color: #c1443c;
}

.days-label.soon {
  color: var(--orange);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tab {
  flex: 1 1 auto;
  min-width: 110px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: #e4e4e4;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: clamp(0.72rem, 1.6vw, 0.88rem);
  cursor: pointer;
}

.tab:hover {
  background: #d8d8d8;
}

.tab.is-active {
  background: var(--green);
  color: var(--white);
}

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

.filters label,
.dialog label {
  display: grid;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.filters select,
.filters input,
.dialog select,
.dialog input,
.dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--white);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  font-size: 0.88rem;
}

.result-count {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

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

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

.view-toggle {
  display: inline-flex;
  gap: 6px;
  background: #ececec;
  padding: 4px;
  border-radius: 8px;
}

.view-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.view-btn.is-active {
  background: var(--green);
  color: var(--white);
}

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

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

#mainTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  font-size: 0.82rem;
}

#mainTable thead th {
  position: sticky;
  top: 0;
  background: var(--ink);
  color: var(--white);
  text-align: left;
  padding: 8px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

#mainTable thead th:hover {
  background: #3a3a3a;
}

#mainTable thead th.sorted {
  color: #b8f0c0;
}

#mainTable tbody tr {
  border-top: 1px solid var(--line);
}

#mainTable tbody tr:hover {
  background: #f7f7f7;
}

#mainTable tbody tr.overdue {
  background: var(--orange-soft);
}

#mainTable td {
  padding: 7px 10px;
  vertical-align: top;
}

#mainTable td.id {
  font-weight: 700;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

#mainTable td.entrega {
  font-weight: 700;
  color: var(--ink);
  max-width: 230px;
}

#mainTable td.prazo.late {
  color: #c1443c;
  font-weight: 800;
}

#mainTable td.next {
  color: var(--ink-soft);
  max-width: 230px;
  font-size: 0.78rem;
}

.prio-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
}

.prio-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.prio-Crítica::before { background: #c1443c; }
.prio-Crítica { color: #c1443c; }
.prio-Alta::before { background: var(--orange); }
.prio-Alta { color: var(--orange); }
.prio-Média::before { background: var(--blue); }
.prio-Média { color: var(--blue); }
.prio-Baixa::before { background: var(--ink-soft); }
.prio-Baixa { color: var(--ink-soft); }

.cards-section {
  margin-bottom: 10px;
}

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

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

.cards-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pager-meta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.pager-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pager-btn {
  appearance: none;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.pager-btn:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green-dark);
}

.pager-btn.is-active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

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

.item-card .card-head {
  text-align: left;
  line-height: 1.35;
}

.item-card .card-value {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.95rem;
}

.chip {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chip-orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.chip-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.chip-neutral {
  background: #ececec;
  color: var(--ink-soft);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #e8e8e8;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #5fc86d 55%, var(--blue));
}

.item-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-run {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--green);
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(57, 181, 74, 0.28);
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
}

.btn-run:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.btn-ghost {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-ghost.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-dark);
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.78rem;
}

.footer {
  padding: 0 16px 16px;
  text-align: center;
}

.footer p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 500;
}

.btn-topo {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.footer-strip {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.7fr;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  width: min(1200px, 100%);
  margin: 0 auto;
}

.strip-green {
  background: var(--green);
}
.strip-blue {
  background: var(--blue);
}
.strip-orange {
  background: var(--orange);
}

.dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  width: min(520px, calc(100% - 24px));
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(77, 77, 77, 0.35);
}

.dialog form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.dialog header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

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

.dialog-actions-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.dialog-actions-left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-danger {
  appearance: none;
  border: 1px solid #c1443c;
  background: #fbeae8;
  color: #c1443c;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.btn-danger:hover {
  background: #c1443c;
  color: var(--white);
}

.btn-danger-solid {
  background: #c1443c;
  color: var(--white);
}

.btn-danger-solid:hover {
  background: #a33832;
}

.dialog-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.foto-field {
  display: grid;
  gap: 8px;
}

.foto-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.foto-field > label {
  margin: 0;
}

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

#btnTirarFoto {
  justify-self: start;
}

.foto-hint {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0;
}

.foto-preview-wrap {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.foto-preview {
  display: block;
  max-width: 100%;
  width: min(280px, 100%);
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7f7f7;
}

.foto-remove-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  grid-template-columns: none !important;
}

.foto-remove-label input {
  width: auto;
  margin: 0;
}

.card-foto,
.attention-foto {
  display: block;
  margin-top: 10px;
  width: min(100%, 220px);
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.table-foto {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  vertical-align: middle;
  cursor: zoom-in;
}

@media (max-width: 560px) {
  .dialog-dates {
    grid-template-columns: 1fr;
  }
}

.empty {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.gantt-root {
  margin-top: 4px;
  overflow-x: auto;
}

.gantt {
  --gantt-label: 200px;
  --gantt-cols: 6;
  min-width: 720px;
  position: relative;
}

.gantt-months {
  display: grid;
  grid-template-columns: var(--gantt-label) repeat(var(--gantt-cols), minmax(0, 1fr));
  gap: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.gantt-month {
  text-align: center;
}

.gantt-body {
  position: relative;
  display: grid;
  gap: 6px;
  padding-top: 14px;
}

.gantt-row {
  display: grid;
  grid-template-columns: var(--gantt-label) 1fr;
  gap: 10px;
  align-items: center;
  min-height: 34px;
}

.gantt-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.gantt-track {
  position: relative;
  height: 18px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.gantt-bar {
  position: absolute;
  top: 0;
  height: 18px;
  border-radius: 4px;
  min-width: 4px;
}

.gantt-bar.tone-green {
  background: var(--green);
}

.gantt-bar.tone-blue {
  background: var(--blue);
}

.gantt-bar-empty {
  left: 0;
  width: 100%;
  background: #e4e4e4;
  opacity: 0.55;
}

.gantt-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed;
  z-index: 2;
  pointer-events: none;
}

.gantt-marker span {
  position: absolute;
  top: -2px;
  left: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gantt-marker-today {
  border-left-color: #c1443c;
}

.gantt-marker-today span {
  color: #c1443c;
}

.gantt-marker-milestone {
  border-left-color: var(--blue);
  border-left-style: solid;
}

.gantt-marker-milestone span {
  color: var(--blue);
  transform: translateX(-110%);
  left: 0;
}

@media (max-width: 1100px) {
  .kpis-status {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 900px) {
  .cards,
  .filters {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .attention-item {
    grid-template-columns: 1fr;
  }

  .att-pills {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .gantt {
    --gantt-label: 140px;
  }

  .topbar-grid {
    align-items: flex-start;
  }

  .topbar-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .logo-set {
    height: 48px;
  }

  .logo-idt {
    height: 38px;
  }
}

@media (max-width: 560px) {
  .kpis-status,
  .kpis-alert,
  .cards,
  .filters,
  .blocks {
    grid-template-columns: 1fr;
  }

  .gantt {
    --gantt-label: 110px;
  }

  .topbar-inner,
  .wrap {
    width: min(100% - 20px, 1200px);
  }
}
