:root {
  --navbar-bg: #003991;
  --green-dark: #003991;
  --green: #1e5aa8;
  --green-strong: #002d6e;
  --green-light: #e8eef7;
  --green-border: #b3c9e6;
  --bg: #f4f6fa;
  --white: #ffffff;
  --text: #1a2433;
  --text-muted: #5a6578;
  --border: #dde5ef;
  --orange: #c1650f;
  --orange-bg: #fef3e8;
  --orange-text: #a34f04;
  --teal: #0d9488;
  --teal-bg: #e6f7f5;
  --teal-text: #0f6f65;
  --red: #c81e1e;
  --red-bg: #fef2f2;
  --blue: #2563eb;
  --blue-bg: #eff6ff;
  --purple: #7c3aed;
  --purple-bg: #f5f3ff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08), 0 24px 64px rgba(0, 0, 0, 0.06);
  --shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-width: 268px;
  --sidebar-collapsed-width: 76px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

button, input, textarea, select { font-family: inherit; }
button { cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

.app { display: flex; min-height: 100vh; max-width: 100vw; overflow-x: hidden; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: hidden; margin-left: var(--sidebar-width); transition: margin-left var(--transition); }

.sidebar {
  width: var(--sidebar-width);
  background: var(--navbar-bg);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 20;
  transition: width var(--transition), padding var(--transition);
  overflow: hidden;
}

.sidebar__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.sidebar__logo {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  transition: padding var(--transition);
}

.sidebar__logo img {
  max-height: 118px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: screen;
}

.sidebar__logo-mark-img {
  max-height: 64px;
  max-width: 64px;
  object-fit: contain;
  object-position: center;
  mix-blend-mode: screen;
}

.sidebar__logo-img--navbar { display: block; }

.sidebar__toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .08);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}

.sidebar__toggle:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); }

.sidebar__intro {
  overflow: hidden;
  transition: opacity var(--transition), max-height var(--transition), margin var(--transition);
  max-height: 60px;
  margin-bottom: 20px;
}

.sidebar__context { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: #b8cce6; margin-bottom: 2px; white-space: nowrap; }
.sidebar__role { font-size: 12px; color: #b8cce6; white-space: nowrap; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.sidebar__item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px;
  color: rgba(255,255,255,.86); font-size: 14px; font-weight: 600; transition: background .15s, color .15s, padding .15s;
  width: 100%; text-align: left; min-width: 0;
}
.sidebar__item:hover { background: rgba(255,255,255,.1); }
.sidebar__item--active, .sidebar__item--active:hover { background: var(--white); color: var(--green-dark); }
.sidebar__item-icon { display: flex; align-items: center; flex-shrink: 0; width: 18px; justify-content: center; }
.sidebar__item-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity var(--transition); }
.sidebar__item-chevron { opacity: .5; flex-shrink: 0; }
.sidebar__secure {
  display: flex; gap: 10px; background: rgba(0,0,0,.15); border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px; padding: 14px; margin-top: 16px; min-width: 0; overflow: hidden;
}
.sidebar__secure-icon { flex-shrink: 0; opacity: .85; margin-top: 2px; }
.sidebar__secure-body { min-width: 0; transition: opacity var(--transition); }
.sidebar__secure-title { font-size: 10px; font-weight: 800; letter-spacing: .06em; margin-bottom: 4px; white-space: nowrap; }
.sidebar__secure-text { font-size: 11px; line-height: 1.45; color: #b8cce6; }

/* Sidebar colapsada */
.sidebar--collapsed {
  width: var(--sidebar-collapsed-width);
  padding: 20px 10px;
}

.sidebar--collapsed .sidebar__top { flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 26px; }
.sidebar--collapsed .sidebar__logo { padding: 0; flex: none; width: 100%; justify-content: flex-start; }
.sidebar--collapsed .sidebar__toggle { width: 100%; }
.sidebar--collapsed .sidebar__intro { max-height: 0; opacity: 0; margin-bottom: 0; pointer-events: none; }
.sidebar--collapsed .sidebar__item { justify-content: center; padding: 11px 8px; }
.sidebar--collapsed .sidebar__item-label,
.sidebar--collapsed .sidebar__item-chevron { display: none; }
.sidebar--collapsed .sidebar__secure { justify-content: center; padding: 12px 8px; }
.sidebar--collapsed .sidebar__secure-body { display: none; }

.app--sidebar-collapsed { --sidebar-width: var(--sidebar-collapsed-width); }

.icon-btn--sidebar { display: inline-flex; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 32px 20px;
  background: var(--bg); gap: 16px; flex-wrap: wrap;
  max-width: 1680px; margin: 0 auto; width: 100%;
}
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-subtitle { margin-top: 6px; color: var(--text-muted); font-size: 14px; max-width: 820px; line-height: 1.45; }
.page-header__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.page-header__left { min-width: 0; flex: 1; }
.header-badge { flex-shrink: 0; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%; background: var(--white); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: background .15s;
}
.icon-btn:hover { background: var(--green-light); color: var(--green-dark); }
.icon-btn__badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: var(--white); font-size: 10px; font-weight: 800; line-height: 18px; text-align: center;
  border: 2px solid var(--bg);
}
.user-pill { display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--border); border-radius: 40px; padding: 6px 14px 6px 6px; }
.user-pill__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: var(--white); font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.user-pill__name { font-size: 13px; font-weight: 800; }
.user-pill__crm { font-size: 11px; color: var(--text-muted); }

.page-content { padding: 0 32px 32px; display: flex; flex-direction: column; gap: 18px; min-width: 0; max-width: 1680px; margin: 0 auto; width: 100%; }
.grid { display: grid; gap: 18px; }
.grid--kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: 1.35fr .9fr; align-items: start; }
.grid--2-even { grid-template-columns: 1fr 1fr; align-items: start; }
.grid--stretch { align-items: stretch; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card--fill { display: flex; flex-direction: column; }
.card--fill > *:last-child { flex: 1; }

.card, .kpi-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card { padding: 18px; min-width: 0; }
.card:not(.card--nested):not(.card--plain):hover { box-shadow: var(--shadow-lg); }
.card--nested { background: #f8fafc; box-shadow: none; border-color: var(--border); }
.card--overflow { overflow: hidden; padding: 0; }
.card--plain { background: transparent; border: none; box-shadow: none; padding: 0; transition: none; }
.card--plain:hover { box-shadow: none; }
.card__header--flush { padding: 18px 18px 0; margin-bottom: 0; }
.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card__header--actions-only { justify-content: flex-end; }
.card__title { font-size: 16px; font-weight: 500; color: var(--text); }
.card__description { color: var(--text-muted); font-size: 13px; line-height: 1.45; margin-top: 4px; }
.card__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi-card { padding: 14px 18px; display: flex; align-items: center; gap: 14px; min-height: 76px; }
.kpi-card__icon { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-card__icon--green { background: var(--green-light); color: var(--green-dark); }
.kpi-card__icon--orange { background: var(--orange-bg); color: var(--orange-text); }
.kpi-card__icon--red { background: var(--red-bg); color: var(--red); }
.kpi-card__icon--teal { background: var(--teal-bg); color: var(--teal); }
.kpi-card__row { display: flex; align-items: baseline; gap: 8px; }
.kpi-card__value { font-size: 25px; font-weight: 600; line-height: 1; }
.kpi-card__label { font-size: 13px; color: var(--text-muted); line-height: 1.35; }
.kpi-card__hint { margin-top: 3px; font-size: 11px; color: var(--text-muted); }

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 180px) minmax(140px, 180px);
  gap: 10px;
  align-items: center;
}
.toolbar--wide { grid-template-columns: minmax(180px, 280px) repeat(3, minmax(140px, 180px)) auto; }
.toolbar--split { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.toolbar--split .search-box { flex: 0 1 280px; min-width: 200px; width: auto; }
.toolbar__group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.toolbar__group .select--narrow { width: auto; min-width: 190px; }
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 12px; padding: 3px; background: var(--white); gap: 2px; align-self: center; }
.view-switch__btn { padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.view-switch__btn:hover { color: var(--text); }
.view-switch__btn--active { background: var(--green-light); color: var(--green-dark); font-weight: 600; }
.search-box { position: relative; min-width: 0; width: 100%; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input, .select, textarea {
  width: 100%; border: 1px solid var(--border); background: var(--white); color: var(--text); border-radius: 12px;
  padding: 11px 12px; outline: none; transition: border-color .15s, box-shadow .15s; font-size: 14px;
}
.search-box .input { padding-left: 38px; }
textarea { resize: vertical; min-height: 96px; }
.input:focus, .select:focus, textarea:focus { border-color: var(--green); outline: 2px solid var(--green-dark); outline-offset: 1px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-field small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 11px; }
.form-field--full { grid-column: 1 / -1; }
.area-rows { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.area-row { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: #f9fafb; }
.area-row .form-grid { margin-top: 0; }
.area-row__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.area-row__title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.area-row__remove { font-size: 12px; font-weight: 600; color: var(--red); background: none; border: none; padding: 0; cursor: pointer; }
.area-row__remove:hover { text-decoration: underline; }

.chip-rows { display: flex; flex-direction: column; gap: 8px; }
.chip-row { display: flex; align-items: center; gap: 8px; }
.chip-row .input { flex: 1; }
.chip-row__remove {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  color: var(--red); font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.chip-row__remove:hover { background: #fee2e2; border-color: #fca5a5; }

.icon-btn--sm { width: 32px; height: 32px; }

.btn { border-radius: 12px; padding: 10px 16px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s; border: 1px solid transparent; letter-spacing: -.01em; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--green-dark); color: var(--white); box-shadow: 0 2px 8px rgba(0, 57, 145, .25); }
.btn--primary:hover { background: var(--green-strong); box-shadow: 0 4px 12px rgba(0, 57, 145, .3); }
.btn--secondary { background: var(--white); color: var(--green-dark); border-color: var(--green-border); }
.btn--secondary:hover { background: var(--green-light); border-color: var(--green); }
.btn--danger { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.btn--danger:hover { background: #fee2e2; border-color: #fca5a5; }
.btn--ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn--ghost:hover { background: #f6f7f7; color: var(--text); }
.btn--wide { width: 100%; }
.btn--sm { padding: 8px 12px; font-size: 12px; border-radius: var(--radius-sm); }

.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
.table--nips { table-layout: fixed; min-width: 0; }
.table--nips th,
.table--nips td { overflow: hidden; }
.table--nips .table-title,
.table--nips .table-subtitle { overflow: hidden; text-overflow: ellipsis; }
.table--nips .col-beneficiary .table-title,
.table--nips .col-beneficiary .table-subtitle { white-space: nowrap; }
th { text-align: left; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #f9fafb; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: top; }
.table--compact th,
.table--compact td { padding: 10px 12px; }
.table .status-badge,
.table .pill { white-space: normal; max-width: 100%; }
.table-cell--sla { min-width: 0; }
.col-areas .table-subtitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.col-actions { width: 52px; text-align: center; }
.kebab-menu { position: relative; display: inline-block; }
.kebab-menu__trigger { width: 32px; height: 32px; }
.kebab-menu__dropdown {
  position: fixed; z-index: 200;
  background: var(--white); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 190px; display: flex; flex-direction: column; gap: 2px;
}
.kebab-menu__dropdown button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text); }
.kebab-menu__dropdown button:hover { background: var(--green-light); color: var(--green-dark); }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--green-light); }
.table-title { font-weight: 500; margin-bottom: 3px; }
.table-subtitle { color: var(--text-muted); font-size: 13px; line-height: 1.35; }

.status-badge, .pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.status--success, .pill--green { background: var(--green-light); color: var(--green-dark); border-color: var(--green-border); }
.status--warning, .pill--orange { background: var(--orange-bg); color: var(--orange-text); border-color: #fed7aa; }
.status--danger, .pill--red { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.status--info, .pill--blue { background: var(--blue-bg); color: var(--blue); border-color: #bfdbfe; }
.status--neutral, .pill--neutral { background: #f6f7f7; color: var(--text-muted); border-color: var(--border); }
.status--purple, .pill--purple { background: var(--purple-bg); color: var(--purple); border-color: #ddd6fe; }

.cell-text { font-size: 14px; color: var(--text); margin: 0; }
.cell-text + .cell-text { margin-top: 4px; }
.sla-days { font-size: 11px; color: var(--text-muted); margin: 4px 0 0; }

.status-dot {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px 5px 8px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-dot__mark { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-dot--triagem { background: rgba(190, 24, 93, .08); color: #be185d; }
.status-dot--em-tratativa { background: rgba(30, 64, 175, .08); color: #1e40af; }
.status-dot--subsidio-recebido { background: rgba(124, 58, 237, .08); color: #7c3aed; }
.status-dot--consolidada { background: rgba(37, 99, 235, .08); color: #2563eb; }
.status-dot--done { background: rgba(15, 118, 110, .08); color: #0f766e; }

.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline__item { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.timeline__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); margin-top: 4px; box-shadow: 0 0 0 5px var(--green-light); }
.timeline__date { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.timeline__text { font-size: 13px; line-height: 1.42; }

.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: #f9fafb; }
.alert-card--red { background: var(--red-bg); border-color: #fecaca; }
.alert-card--orange { background: var(--orange-bg); border-color: #fed7aa; }
.alert-card--green { background: var(--green-light); border-color: var(--green-border); }
.alert-card__icon { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--white); }
.alert-card__title { font-size: 13px; font-weight: 850; margin-bottom: 3px; }
.alert-card__text { color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.alert-card--clickable { cursor: pointer; transition: transform var(--transition), box-shadow var(--transition); }
.alert-card--clickable:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .06); }

.chart-list { display: flex; flex-direction: column; gap: 12px; }
.chart-row { display: grid; grid-template-columns: minmax(120px, .8fr) 1fr 42px; gap: 10px; align-items: center; }
.chart-row__label { font-size: 13px; font-weight: 750; }
.chart-row__bar { height: 10px; border-radius: 999px; background: #edf1f7; overflow: hidden; }
.chart-row__fill { height: 100%; border-radius: 999px; background: var(--green); }
.chart-row__value { font-size: 12px; color: var(--text-muted); text-align: right; }

.goal-kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.goal-kpi__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.goal-kpi__label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.goal-kpi__icon { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.goal-kpi__icon--green { background: var(--green-light); color: var(--green-dark); }
.goal-kpi__icon--orange { background: var(--orange-bg); color: var(--orange-text); }
.goal-kpi__icon--red { background: var(--red-bg); color: var(--red); }
.goal-kpi__icon--teal { background: var(--teal-bg); color: var(--teal); }
.goal-kpi__value { font-size: 26px; font-weight: 600; line-height: 1; }
.goal-kpi__meta { font-size: 12px; color: var(--text-muted); }
.goal-kpi__progress { margin-top: 2px; }
.goal-kpi__trend { font-size: 12px; font-weight: 700; }
.goal-kpi__trend span { font-weight: 500; color: var(--text-muted); margin-left: 2px; }
.goal-kpi__trend--good { color: var(--green-dark); }
.goal-kpi__trend--bad { color: var(--red); }

.vbar-chart { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.vbar-chart__plot-wrap { display: flex; gap: 10px; flex: 1; min-height: 0; }
.vbar-chart__axis { display: flex; flex-direction: column; justify-content: space-between; flex-shrink: 0; font-size: 11px; color: var(--text-muted); text-align: right; padding-bottom: 1px; }
.vbar-chart__plot { position: relative; display: flex; align-items: flex-end; gap: 18px; flex: 1; min-height: 160px; padding: 0 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.vbar-chart__grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.vbar-chart__gridline { border-top: 1px dashed var(--border); height: 0; }
.vbar-chart__group { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; height: 100%; justify-content: flex-end; }
.vbar-chart__bars { display: flex; align-items: flex-end; gap: 4px; height: 100%; }
.vbar-chart__bar { width: 20px; border-radius: 4px 4px 0 0; min-height: 2px; }
.vbar-chart__bar--blue { background: var(--blue); }
.vbar-chart__bar--red { background: var(--red); }
.vbar-chart__label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.vbar-chart__legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-muted); padding-left: 4px; }
.vbar-chart__legend span { display: inline-flex; align-items: center; gap: 6px; }
.vbar-chart__swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.vbar-chart__swatch--blue { background: var(--blue); }
.vbar-chart__swatch--red { background: var(--red); }

.donut-chart { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut-chart__ring { width: 210px; height: 210px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut-chart__hole { position: absolute; inset: 34px; background: var(--white); border-radius: 50%; }
.donut-chart__legend { list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 13px; flex: 1; min-width: 180px; }
.donut-chart__legend li { display: flex; align-items: center; gap: 8px; }
.donut-chart__dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.donut-chart__pct { margin-left: auto; font-weight: 700; }

.mini-bar { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: 6px; }
.mini-bar__block { width: 6px; height: 12px; border-radius: 2px; display: inline-block; }
.mini-bar__block--red { background: var(--red); }
.mini-bar__block--orange { background: var(--orange); }
.mini-bar__block--blue { background: var(--blue); }

.report-figure { font-weight: 700; }
.report-figure--red { color: var(--red); }
.report-figure--orange { color: var(--orange-text); }
.report-table-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.report-table-footer strong { color: var(--text); font-size: 14px; }
.report-card-body { display: flex; flex-direction: column; height: 100%; }
.report-card-body .table-wrap { flex: 1; }
.report-card-body--empty { align-items: center; justify-content: center; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.kanban__col { background: #f7f9fc; border: 1px solid var(--border); border-radius: 14px; padding: 12px; min-height: 360px; }
.kanban__title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 13px; font-weight: 900; line-height: 1.3; }
.kanban__title > span:first-child { min-width: 0; }
.kanban__count { color: var(--text-muted); font-size: 11px; font-weight: 800; }
.kanban-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; box-shadow: 0 1px 8px rgba(0,0,0,.03); cursor: pointer; }
.kanban-card:hover { border-color: var(--green-border); }
.kanban-card__id { font-size: 11px; color: var(--green-dark); font-weight: 900; margin-bottom: 6px; }
.kanban-card__title { font-size: 13px; font-weight: 850; margin-bottom: 6px; }
.kanban-card__meta { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.kanban-card__footer { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.detail-box { background: linear-gradient(180deg, #f8fafc 0%, #f5f7fa 100%); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.detail-box dt { font-size: 10px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.detail-box dd { font-size: 14px; font-weight: 600; margin-bottom: 14px; line-height: 1.35; }
.detail-box dd:last-child { margin-bottom: 0; }
.assignment-list { display: flex; flex-direction: column; gap: 10px; }
.assignment { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: var(--white); transition: border-color var(--transition), box-shadow var(--transition); }
.assignment:hover { border-color: var(--green-border); box-shadow: 0 2px 8px rgba(0, 0, 0, .04); }
.assignment__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.assignment__title { font-weight: 700; font-size: 14px; }
.assignment__meta { color: var(--text-muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.assignment__response { font-size: 13px; line-height: 1.5; color: var(--text); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }

.empty { text-align: center; padding: 34px 20px; color: var(--text-muted); }
.empty strong { display: block; color: var(--text); margin-bottom: 4px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 30, 58, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 40;
  animation: backdrop-in .2s ease;
}
.modal-backdrop--closing { animation: backdrop-out .15s ease forwards; }
.modal {
  width: min(980px, 100%); max-height: 88vh; overflow: auto; background: var(--white);
  border-radius: 20px; box-shadow: var(--shadow-modal); border: 1px solid rgba(255, 255, 255, .8);
  animation: modal-in .25s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.modal--closing { animation: modal-out .15s ease forwards; }
.modal--sm { width: min(480px, 100%); }
.modal--md { width: min(640px, 100%); }
.modal-backdrop.modal-backdrop--side { justify-content: flex-end; align-items: stretch; padding: 0; }
.modal.modal--side {
  width: min(780px, 100%); height: 100%; max-height: 100%; border-radius: 0;
  animation: side-panel-in .25s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.modal.modal--side.modal--closing { animation: side-panel-out .15s ease forwards; }
.modal--side .modal__header, .modal--side .modal__actions { border-radius: 0; }
.modal--side .detail-grid, .modal--side .modal__grid { grid-template-columns: 1fr; }
@keyframes side-panel-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes side-panel-out { from { transform: translateX(0); } to { transform: translateX(100%); } }
.modal__header {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  padding: 22px 24px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: linear-gradient(180deg, var(--white) 0%, #f8fafc 100%); z-index: 1;
  border-radius: 20px 20px 0 0;
}
.modal__title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.modal__subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; line-height: 1.45; }
.modal__body { padding: 20px 24px; }
.modal__actions {
  padding: 16px 24px 20px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--border); background: #f8fafc; border-radius: 0 0 20px 20px;
}
.modal__actions--split { justify-content: space-between; align-items: center; }
.modal__badge-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.modal__section { margin-top: 20px; }
.modal__section:first-child { margin-top: 0; }
.modal__description { color: var(--text); font-size: 14px; line-height: 1.55; margin-bottom: 18px; }
.modal__divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.modal__close { font-size: 22px; line-height: 1; color: var(--text-muted); }
.modal__close:hover { color: var(--text); background: var(--green-light); }
.modal__icon-wrap {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal__icon-wrap--warning { background: var(--orange-bg); color: var(--orange-text); }
.modal__icon-wrap--danger { background: var(--red-bg); color: var(--red); }
.modal__icon-wrap--info { background: var(--blue-bg); color: var(--blue); }
.modal__header-row { display: flex; gap: 14px; align-items: flex-start; }
.modal__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.modal__actions--form { padding: 18px 0 0; border: 0; background: transparent; }
.modal__footer-note { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes modal-out { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.96); } }

.notif-backdrop {
  position: fixed; inset: 0; background: rgba(10, 30, 58, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; justify-content: flex-end; z-index: 50; animation: backdrop-in .2s ease;
}
.notif-panel {
  width: min(400px, 100%); height: 100%; background: var(--white); box-shadow: var(--shadow-modal);
  display: flex; flex-direction: column; animation: notif-in .25s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.notif-panel__header {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-start;
  padding: 22px 24px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--white) 0%, #f8fafc 100%);
}
.notif-panel__title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.notif-panel__subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; line-height: 1.45; }
.notif-panel__body { padding: 16px 20px 20px; overflow-y: auto; flex: 1; }
@keyframes notif-in { from { transform: translateX(100%); } to { transform: translateX(0); } }

.toast {
  position: fixed; right: 20px; bottom: 20px; background: var(--text); color: var(--white);
  border-radius: 14px; padding: 14px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.22);
  font-size: 13px; font-weight: 600; z-index: 70; opacity: 0; transform: translateY(10px);
  transition: opacity .2s, transform .2s; max-width: min(360px, calc(100vw - 40px));
}
.toast--show { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--green-dark); }
.toast--error { background: var(--red); }

.mobile-topbar { display: none; background: var(--navbar-bg); color: var(--white); padding: 12px 16px; align-items: center; justify-content: space-between; }
.mobile-topbar img { width: auto; max-width: 200px; max-height: 68px; object-fit: contain; object-position: left center; border-radius: 0; padding: 0; mix-blend-mode: screen; }
.mobile-menu { color: var(--white); border: 1px solid rgba(255,255,255,.35); border-radius: 10px; padding: 9px 11px; }

@media (max-width: 820px) {
  .app { display: block; }
  .main { margin-left: 0; }
  .mobile-topbar { display: flex; position: sticky; top: 0; z-index: 30; }
  .sidebar { display: none; position: fixed; inset: 60px 0 auto 0; width: 100% !important; height: auto; max-height: calc(100vh - 60px); overflow: auto; z-index: 31; border-radius: 0 0 18px 18px; padding: 20px 16px; }
  .sidebar.sidebar--open { display: flex; }
  .sidebar--collapsed .sidebar__item-label,
  .sidebar--collapsed .sidebar__item-chevron { display: inline; }
  .sidebar--collapsed .sidebar__intro { max-height: 60px; opacity: 1; margin-bottom: 20px; }
  .sidebar--collapsed .sidebar__secure-body { display: block; }
  .sidebar--collapsed .sidebar__item { justify-content: flex-start; padding: 11px 12px; }
  .sidebar--collapsed .sidebar__top { flex-direction: row; }
  .sidebar--collapsed .sidebar__toggle { width: 36px; }
  .icon-btn--sidebar { display: none; }
  .page-header { padding: 20px 18px 16px; flex-direction: column; }
  .page-header__right { width: 100%; justify-content: flex-start; }
  .page-content { padding: 0 18px 24px; }
  .page-title { font-size: 22px; }
  .grid--kpis { grid-template-columns: 1fr; }
  .form-grid, .form-grid--3, .detail-grid, .modal__grid { grid-template-columns: 1fr; }
  .modal__actions--split { flex-direction: column; align-items: stretch; }
  .modal__actions--split .card__actions { justify-content: center; flex-wrap: wrap; }
  .modal { border-radius: 16px; max-height: 92vh; }
  .modal__header, .modal__actions { border-radius: 0; }
  .modal__body { padding: 16px 18px; }
  .user-pill__info { display: none; }
  .toolbar, .toolbar--wide { grid-template-columns: 1fr; }
}

.status--yellow, .pill--yellow { background: #fefce8; color: #854d0e; border-color: #fde68a; }
.alert-card--yellow { background: #fefce8; border-color: #fde68a; }
.alert-rule-row { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 12px; }
.alert-rule-row:first-of-type { margin-top: 8px; }
.alert-rule-row small { grid-column: 2; color: var(--text-muted); line-height: 1.35; }
.alert-config-note { margin-top: 14px; border: 1px solid var(--green-border); background: var(--green-light); color: var(--green-dark); border-radius: 12px; padding: 12px; font-size: 12px; line-height: 1.45; }
.attachment-list, .review-list { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; font-size: 12px; line-height: 1.45; }
.attachment-list strong, .review-list strong { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text); }
.attachment-list ul { list-style: none; padding-left: 0; color: var(--text-muted); display: flex; flex-direction: column; gap: 4px; }
.attachment-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.attachment-item__info { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-view { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--green-dark); }
.attachment-view:hover { text-decoration: underline; }
.review-box { background: var(--orange-bg); border: 1px solid #fed7aa; color: var(--orange-text); border-radius: 10px; padding: 8px; margin-top: 6px; }
.review-accordion { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.review-accordion summary { font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer; }
.review-accordion .review-list { margin-top: 8px; border-top: 0; padding-top: 0; }
.assignment__actions { margin-top: 10px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.text-body { color: var(--text); font-size: 14px; line-height: 1.55; }
.text-pre-wrap { white-space: pre-wrap; }
.mt-sm { margin-top: 14px; }
.mt-md { margin-top: 20px; }
.select--narrow { width: 100%; min-width: 0; max-width: none; }

/* Lista em cards (telas estreitas) */
.nip-list { display: none; flex-direction: column; gap: 10px; padding: 12px; }
.nip-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px;
  background: var(--white); cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition);
}
.nip-card:hover { border-color: var(--green-border); box-shadow: 0 2px 8px rgba(0, 0, 0, .04); }
.nip-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.nip-card__id { font-size: 12px; font-weight: 800; color: var(--green-dark); }
.nip-card__name { font-size: 14px; font-weight: 700; margin-top: 2px; }
.nip-card__meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.nip-card__badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }

.table--scroll { min-width: 640px; }
.table--scroll textarea { min-height: 0; height: auto; }

@media (max-width: 1400px) {
  :root { --sidebar-width: 240px; }
  .page-content { padding: 0 24px 28px; }
  .page-header { padding: 20px 24px 16px; }
  .table--nips .col-subsidios,
  .table--nips .col-areas { display: none; }
}

@media (max-width: 1180px) {
  .grid--kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2, .grid--2-even { grid-template-columns: 1fr; }
  .grid--3 { grid-template-columns: 1fr; }
  .toolbar, .toolbar--wide { grid-template-columns: 1fr 1fr; }
  .toolbar .search-box, .toolbar--wide .search-box { grid-column: 1 / -1; }
  .toolbar--split .search-box { flex-basis: 100%; }
  .toolbar__group { justify-content: flex-start; width: 100%; }
  .card__header { flex-direction: column; align-items: stretch; }
  .card__actions { justify-content: flex-start; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header__right { justify-content: flex-start; }
}

@media (max-width: 960px) {
  .table--nips { display: none; }
  .nip-list { display: flex; }
  .table-wrap:has(.table--nips) { overflow: visible; }
}
.pill--inline { margin: 2px; }

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal, .modal-backdrop--closing, .modal--closing { animation: none; }
  .notif-backdrop, .notif-panel { animation: none; }
  .toast { transition: none; }
}
